comand-component-library 4.0.15 → 4.0.16
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/comand-component-library.js +362 -300
- package/dist/comand-component-library.umd.cjs +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/ComponentLibrary.vue +73 -99
- package/src/assets/data/listOfComponents.json +39 -0
- package/src/componentSettingsDataAndControls.vue +5 -0
- package/src/components/CmdBox.vue +2 -3
- package/src/components/CmdCompanyLogo.vue +6 -3
- package/src/components/CmdFormElement.vue +1 -1
- package/src/components/CmdImage.vue +4 -1
- package/src/components/CmdSiteHeader.vue +89 -1
- package/src/components/ComponentSettings.vue +0 -1
- package/src/App.vue +0 -2117
package/src/ComponentLibrary.vue
CHANGED
@@ -19,10 +19,11 @@
|
|
19
19
|
:useGap="false"
|
20
20
|
>
|
21
21
|
<template v-slot="slotProps">
|
22
|
+
<!-- begin box template selection -->
|
22
23
|
<CmdBox
|
23
24
|
:use-slots="['body']"
|
24
25
|
:collapsible="true"
|
25
|
-
:cmdHeadline="{headlineText: 'Template
|
26
|
+
:cmdHeadline="{headlineText: 'Template Selection', headlineLevel: 4, headlineIcon: {iconClass: 'icon-settings-template'}}"
|
26
27
|
:openCollapsedBox="slotProps.boxIsOpen(0)"
|
27
28
|
@toggleCollapse="slotProps.boxToggled(0, $event)"
|
28
29
|
>
|
@@ -39,6 +40,9 @@
|
|
39
40
|
</label>
|
40
41
|
</template>
|
41
42
|
</CmdBox>
|
43
|
+
<!-- end box template selection -->
|
44
|
+
|
45
|
+
<!-- begin box list of components-->
|
42
46
|
<CmdBox
|
43
47
|
:use-slots="['body']"
|
44
48
|
:collapsible="true"
|
@@ -48,92 +52,21 @@
|
|
48
52
|
>
|
49
53
|
<template v-slot:body>
|
50
54
|
<ul>
|
51
|
-
<li :class="'active'
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
</li>
|
60
|
-
<li><a href="#section-breadcrumbs"
|
61
|
-
@click="updateSettingsSidebar('CmdBreadcrumbs')">Breadcrumbs</a></li>
|
62
|
-
<li><a href="#section-cookie-disclaimer" @click="hideSettingsSidebar">Cookie-Disclaimer</a>
|
63
|
-
</li>
|
64
|
-
<li><a href="#section-fancybox" @click="hideSettingsSidebar">Fancybox</a></li>
|
65
|
-
<li><a href="#section-forms" @click="hideSettingsSidebar">Forms</a></li>
|
66
|
-
<li><a href="#section-google-maps" @click="hideSettingsSidebar">Google-Maps™</a>
|
67
|
-
</li>
|
68
|
-
<li><a href="#section-headlines" @click="updateSettingsSidebar('CmdHeadline')">Headlines</a>
|
69
|
-
</li>
|
70
|
-
<li><a href="#section-icons" @click="hideSettingsSidebar">Icons</a></li>
|
71
|
-
<li><a href="#section-input-group"
|
72
|
-
@click="updateSettingsSidebar('CmdInputGroup')">Input-Group</a></li>
|
73
|
-
<li><a href="#section-image" @click="hideSettingsSidebar">Image</a></li>
|
74
|
-
<li><a href="#section-image-gallery" @click="hideSettingsSidebar">Image
|
75
|
-
Gallery</a></li>
|
76
|
-
<li><a href="#section-image-zoom" @click="hideSettingsSidebar">Image-Zoom</a>
|
77
|
-
</li>
|
78
|
-
<li><a href="#section-list-of-links"
|
79
|
-
@click="updateSettingsSidebar('CmdLinkOfLists')">List Of Links</a></li>
|
80
|
-
<li><a href="#section-login-form"
|
81
|
-
@click="updateSettingsSidebar('CmdLoginForm')">Login Form</a></li>
|
82
|
-
<li><a href="#section-main-navigation"
|
83
|
-
@click="updateSettingsSidebar('CmdMainNavigation')">Main-Navigation</a>
|
84
|
-
</li>
|
85
|
-
<li><a href="#section-multistep-form-progress-bar"
|
86
|
-
@click="updateSettingsSidebar('CmdMultistepFormProgressBar')">Multistepform-Progressbar</a>
|
87
|
-
</li>
|
88
|
-
<li><a href="#section-newsletter-subscription"
|
89
|
-
@click="updateSettingsSidebar('CmdNewsletterSubscription')">Newsletter
|
90
|
-
Subscription</a></li>
|
91
|
-
<li><a href="#section-opening-hours"
|
92
|
-
@click="updateSettingsSidebar('CmdOpeningHours')">Opening Hours</a></li>
|
93
|
-
<li><a href="#section-page-footer"
|
94
|
-
@click="updateSettingsSidebar('CmdPageFooter')">Page Footer</a></li>
|
95
|
-
<li><a href="#section-page-header"
|
96
|
-
@click="updateSettingsSidebar('CmdPageHeader')">Page Header</a></li>
|
97
|
-
<li><a href="#section-pagination"
|
98
|
-
@click="updateSettingsSidebar('CmdPagination')">Pagination</a></li>
|
99
|
-
<li><a href="#section-site-footer" @click="hideSettingsSidebar">Site Footer</a>
|
100
|
-
</li>
|
101
|
-
<li><a href="#section-site-header"
|
102
|
-
@click="updateSettingsSidebar('CmdSiteHeader')">Site Header</a></li>
|
103
|
-
<li><a href="#section-site-search"
|
104
|
-
@click="updateSettingsSidebar('CmdSiteSearch')">Site Search</a></li>
|
105
|
-
<li><a href="#section-slideshow" @click="updateSettingsSidebar('CmdSlideshow')">Slideshow</a>
|
106
|
-
</li>
|
107
|
-
<li><a href="#section-social-networks"
|
108
|
-
@click="updateSettingsSidebar('CmdSocialNetworks')">Social Networks</a>
|
109
|
-
</li>
|
110
|
-
<li><a href="#section-switch-language" @click="hideSettingsSidebar">Switch Language</a>
|
111
|
-
</li>
|
112
|
-
<li><a href="#section-system-message"
|
113
|
-
@click="updateSettingsSidebar('CmdSystemMessage')">System-Message</a>
|
114
|
-
</li>
|
115
|
-
<li><a href="#section-tables"
|
116
|
-
@click="updateSettingsSidebar('CmdSystemMeCmdTablesssage')">Tables</a>
|
117
|
-
</li>
|
118
|
-
<li><a href="#section-tabs" @click="updateSettingsSidebar('CmdTabs')">Tabs</a>
|
119
|
-
</li>
|
120
|
-
<li><a href="#section-text-image-block"
|
121
|
-
@click="updateSettingsSidebar('CmdTextImageBlock')">Text Image Block</a>
|
122
|
-
</li>
|
123
|
-
<li><a href="#section-thumbnail-scroller"
|
124
|
-
@click="updateSettingsSidebar('CmdThumbnailScroller')">Thumbnail-Scroller</a>
|
125
|
-
</li>
|
126
|
-
<li><a href="#section-toggle-darkmode"
|
127
|
-
@click="updateSettingsSidebar('CmdToggleDarkMode')">ToggleDarkMode</a>
|
128
|
-
</li>
|
129
|
-
<li><a href="#section-tooltip" @click="updateSettingsSidebar('CmdTooltip')">Tooltip</a>
|
130
|
-
</li>
|
131
|
-
<li><a href="#section-upload-form"
|
132
|
-
@click="updateSettingsSidebar('CmdUploadForm')">Upload-Form</a>
|
55
|
+
<li v-for="(componentName, index) in listOfComponents" :key="index" :class="{'active' : activeEntry === 'Cmd' + componentName}">
|
56
|
+
<a
|
57
|
+
:href="sectionName(componentName)"
|
58
|
+
@click="updateSettingsSidebar(componentNameWithPrefix(componentName))"
|
59
|
+
title="Go to component"
|
60
|
+
>
|
61
|
+
{{ readableComponentName(componentName)}}
|
62
|
+
</a>
|
133
63
|
</li>
|
134
64
|
</ul>
|
135
65
|
</template>
|
136
66
|
</CmdBox>
|
67
|
+
<!-- end box list of components-->
|
68
|
+
|
69
|
+
<!-- begin box page-templates -->
|
137
70
|
<CmdBox
|
138
71
|
:use-slots="['body']"
|
139
72
|
:collapsible="true"
|
@@ -186,18 +119,22 @@
|
|
186
119
|
</ul>
|
187
120
|
</template>
|
188
121
|
</CmdBox>
|
122
|
+
<!-- end box page-templates -->
|
189
123
|
</template>
|
190
124
|
</CmdBoxWrapper>
|
125
|
+
|
126
|
+
<!-- begin list comand-versions -->
|
191
127
|
<dl class="box-footer comand-versions">
|
192
128
|
<dt>Frontend-Framework Version:</dt>
|
193
129
|
<dd>{{ packageJson.dependencies['comand-frontend-framework'].replace("^", "") }}</dd>
|
194
130
|
<dt>Component-Library Version:</dt>
|
195
131
|
<dd>{{ packageJson.version }}</dd>
|
196
132
|
</dl>
|
133
|
+
<!-- end list comand-versions -->
|
197
134
|
</template>
|
198
135
|
<template #closed>
|
199
136
|
<div class="closed-sidebar">
|
200
|
-
<a href="#" class="button primary" title="Open Template
|
137
|
+
<a href="#" class="button primary" title="Open Template Selection" @click.prevent="openBox(0)">
|
201
138
|
<span class="icon-settings-template"></span>
|
202
139
|
</a>
|
203
140
|
<a href="#" class="button primary" title="Open Components Overview" @click.prevent="openBox(1)">
|
@@ -226,10 +163,7 @@
|
|
226
163
|
<template v-slot:logo>
|
227
164
|
<!-- begin company-logo --------------------------------------------------------------------------------------------------------------------------------------------------->
|
228
165
|
<CmdCompanyLogo
|
229
|
-
|
230
|
-
altText="CoManD Logo"
|
231
|
-
:pathDefaultLogo="companyLogoData.pathDefaultLogo"
|
232
|
-
:pathDarkmodeLogo="companyLogoData.pathDarkmodeLogo"
|
166
|
+
v-bind="companyLogoData"
|
233
167
|
/>
|
234
168
|
<!-- end company-logo --------------------------------------------------------------------------------------------------------------------------------------------------->
|
235
169
|
</template>
|
@@ -1236,13 +1170,30 @@
|
|
1236
1170
|
<a href="#" class="icon-cog" title="Open Component Settings"
|
1237
1171
|
@click.prevent="openSettingsSidebar('CmdBreadcrumbs')"></a>
|
1238
1172
|
</h2>
|
1239
|
-
<CmdBreadcrumbs
|
1240
|
-
|
1241
|
-
|
1242
|
-
|
1173
|
+
<CmdBreadcrumbs
|
1174
|
+
ref="CmdBreadcrumbs"
|
1175
|
+
:breadcrumbLabel="breadcrumbsData.breadcrumbLabel"
|
1176
|
+
:breadcrumbLinks="breadcrumbsData.breadcrumbLinks"
|
1177
|
+
v-bind="cmdBreadcrumbsSettingsData"
|
1178
|
+
/>
|
1243
1179
|
</CmdWidthLimitationWrapper>
|
1244
1180
|
<!-- end breadcrumbs ------------------------------------------------------------------------------------------------------------------------------------------------------->
|
1245
1181
|
|
1182
|
+
<!-- begin company-logo ------------------------------------------------------------------------------------------------------------------------------------------------------->
|
1183
|
+
<CmdWidthLimitationWrapper>
|
1184
|
+
<h2 class="headline-demopage" id="section-company-logo">
|
1185
|
+
<span>Company Logo</span>
|
1186
|
+
<a href="#" class="icon-cog" title="Open Component Settings"
|
1187
|
+
@click.prevent="openSettingsSidebar('CmdCompanyLogo')"></a>
|
1188
|
+
</h2>
|
1189
|
+
<CmdCompanyLogo
|
1190
|
+
ref="CmdCompanyLogo"
|
1191
|
+
:link="companyLogoData.link"
|
1192
|
+
v-bind="cmdCompanyLogoSettingsData"
|
1193
|
+
/>
|
1194
|
+
</CmdWidthLimitationWrapper>
|
1195
|
+
<!-- end company-logo ------------------------------------------------------------------------------------------------------------------------------------------------------->
|
1196
|
+
|
1246
1197
|
<!-- begin cookie-disclaimer ------------------------------------------------------------------------------------------------------------------------------------------------------->
|
1247
1198
|
<CmdWidthLimitationWrapper>
|
1248
1199
|
<h2 class="headline-demopage" id="section-cookie-disclaimer">Cookie Disclaimer</h2>
|
@@ -1815,7 +1766,7 @@
|
|
1815
1766
|
<CmdThumbnailScroller
|
1816
1767
|
ref="CmdThumbnailScroller"
|
1817
1768
|
v-bind="cmdThumbnailScrollerSettingsData"
|
1818
|
-
:
|
1769
|
+
:thumbnailScrollerItems="thumbnailScrollerData"
|
1819
1770
|
/>
|
1820
1771
|
</div>
|
1821
1772
|
</CmdWidthLimitationWrapper>
|
@@ -1871,16 +1822,19 @@
|
|
1871
1822
|
<!-- end upload-form ------------------------------------------------------------------------------------------------------------------------------------------------------->
|
1872
1823
|
</main>
|
1873
1824
|
|
1825
|
+
<!-- begin page view -->
|
1874
1826
|
<main v-else id="content">
|
1875
1827
|
<CmdWidthLimitationWrapper>
|
1876
1828
|
<h1 class="headline-demopage">Page Overview</h1>
|
1877
1829
|
</CmdWidthLimitationWrapper>
|
1878
1830
|
|
1879
|
-
<!--
|
1831
|
+
<!-- begin page-overview -->
|
1880
1832
|
<PageOverview />
|
1881
1833
|
<!-- end page-overview -->
|
1882
1834
|
</main>
|
1835
|
+
<!-- end page view -->
|
1883
1836
|
|
1837
|
+
<!-- begin cmd-site-footer -->
|
1884
1838
|
<CmdSiteFooter>
|
1885
1839
|
<!-- begin slot-content -->
|
1886
1840
|
Slot-Content for Site-Footer
|
@@ -1978,6 +1932,8 @@ import thumbnailScrollerTextData from '@/assets/data/thumbnail-scroller-text.jso
|
|
1978
1932
|
|
1979
1933
|
import packageJson from '../package.json'
|
1980
1934
|
|
1935
|
+
import listOfComponents from "@/assets/data/listOfComponents.json"
|
1936
|
+
|
1981
1937
|
import PageOverview from "@/pages/PageOverview.vue"
|
1982
1938
|
|
1983
1939
|
// import external functions
|
@@ -1996,6 +1952,7 @@ export default {
|
|
1996
1952
|
},
|
1997
1953
|
data() {
|
1998
1954
|
return {
|
1955
|
+
listOfComponents,
|
1999
1956
|
activeEntry: "CmdAddressData",
|
2000
1957
|
componentControls: {},
|
2001
1958
|
componentView: true,
|
@@ -2159,17 +2116,27 @@ export default {
|
|
2159
2116
|
}
|
2160
2117
|
},
|
2161
2118
|
methods: {
|
2162
|
-
|
2163
|
-
|
2119
|
+
sectionName(componentName) {
|
2120
|
+
let componentNameWithHyphens = componentName.replace(/([A-Z])/g, '-$1');
|
2121
|
+
return "#section" + componentNameWithHyphens.toLowerCase();
|
2122
|
+
},
|
2123
|
+
readableComponentName(componentName) {
|
2124
|
+
return componentName.replace(/(?!^)([A-Z])/g, ' $1');
|
2164
2125
|
},
|
2165
|
-
|
2166
|
-
|
2126
|
+
componentNameWithPrefix(componentName) {
|
2127
|
+
return "Cmd" + componentName
|
2128
|
+
},
|
2129
|
+
setActiveEntry(componentName) {
|
2130
|
+
this.activeEntry = componentName
|
2131
|
+
},
|
2132
|
+
updateSettingsSidebar(componentName, type) {
|
2133
|
+
this.setActiveEntry(componentName)
|
2167
2134
|
|
2168
2135
|
if(type !== 'page') {
|
2169
2136
|
this.componentView = true
|
2170
2137
|
|
2171
2138
|
if (this.openRightSidebar) {
|
2172
|
-
this.openSettingsSidebar(
|
2139
|
+
this.openSettingsSidebar(componentName)
|
2173
2140
|
}
|
2174
2141
|
} else {
|
2175
2142
|
this.componentView = false
|
@@ -2187,6 +2154,8 @@ export default {
|
|
2187
2154
|
this.componentSettings = this[lowerCaseComponentName + "SettingsData"]
|
2188
2155
|
|
2189
2156
|
const controlsName = lowerCaseComponentName + "SettingsControls"
|
2157
|
+
console.log("controlsName", controlsName)
|
2158
|
+
console.log("this[controlsName]", this[controlsName])
|
2190
2159
|
if (this[controlsName]) {
|
2191
2160
|
this.componentControls = this[controlsName]
|
2192
2161
|
}
|
@@ -2387,6 +2356,11 @@ export default {
|
|
2387
2356
|
&:not(:last-child) {
|
2388
2357
|
border-bottom: 0;
|
2389
2358
|
}
|
2359
|
+
|
2360
|
+
li.active a {
|
2361
|
+
padding: 0.1rem 0.3rem;
|
2362
|
+
text-decoration: none;
|
2363
|
+
}
|
2390
2364
|
}
|
2391
2365
|
|
2392
2366
|
.open-slot-wrapper {
|
@@ -0,0 +1,39 @@
|
|
1
|
+
[
|
2
|
+
"AddressData",
|
3
|
+
"AdvancedFormElements",
|
4
|
+
"BankAccountData",
|
5
|
+
"Boxes",
|
6
|
+
"Breadcrumbs",
|
7
|
+
"CompanyLogo",
|
8
|
+
"CookieDisclaimer",
|
9
|
+
"Forms",
|
10
|
+
"Fancybox",
|
11
|
+
"GoogleMaps",
|
12
|
+
"Headlines",
|
13
|
+
"Icons",
|
14
|
+
"Image",
|
15
|
+
"ImageGallery",
|
16
|
+
"ImageZoom",
|
17
|
+
"ListOfLinks",
|
18
|
+
"LoginForm",
|
19
|
+
"MainNavigation",
|
20
|
+
"MultistepFormProgressBar",
|
21
|
+
"NewsletterSubscription",
|
22
|
+
"OpeningHours",
|
23
|
+
"PageFooter",
|
24
|
+
"PageHeader",
|
25
|
+
"Pagination",
|
26
|
+
"SiteFooter",
|
27
|
+
"SiteHeader",
|
28
|
+
"SiteSearch",
|
29
|
+
"Slideshow",
|
30
|
+
"SocialNetworks",
|
31
|
+
"SwitchLanguage",
|
32
|
+
"SystemMessage",
|
33
|
+
"Tables",
|
34
|
+
"Tabs",
|
35
|
+
"TextImageBlock",
|
36
|
+
"ThumbnailScroller",
|
37
|
+
"Tooltip",
|
38
|
+
"UploadForm"
|
39
|
+
]
|
@@ -92,6 +92,11 @@ data() {
|
|
92
92
|
}
|
93
93
|
]
|
94
94
|
},
|
95
|
+
cmdCompanyLogoSettingsData: {
|
96
|
+
pathDefaultLogo: "/media/images/logos/logo.svg",
|
97
|
+
pathDarkmodeLogo: "/media/images/logos/logo-darkmode.svg",
|
98
|
+
altText: "Company Logo"
|
99
|
+
},
|
95
100
|
cmdFakeSelectSettingsData: {
|
96
101
|
showSelectAllOptions: true,
|
97
102
|
status: "",
|
@@ -257,11 +257,11 @@ export default {
|
|
257
257
|
default: false
|
258
258
|
},
|
259
259
|
/**
|
260
|
-
* set max-height for body (should only be used
|
260
|
+
* set max-height for body (should only be used if allowContentToScroll-property is active)
|
261
261
|
*/
|
262
262
|
maxBoxBodyHeight: {
|
263
263
|
type: String,
|
264
|
-
default: "
|
264
|
+
default: "20rem"
|
265
265
|
},
|
266
266
|
/**
|
267
267
|
* activate if box should be collapsible
|
@@ -440,7 +440,6 @@ export default {
|
|
440
440
|
},
|
441
441
|
/*
|
442
442
|
mounted() {
|
443
|
-
|
444
443
|
if (this.allowContentToScroll && this.$refs.boxBody) {
|
445
444
|
const topPosition = this.$refs.boxBody.getBoundingClientRect().top
|
446
445
|
this.calculatedBodyHeight = (document.documentElement.clientHeight - topPosition) + "px"
|
@@ -2,16 +2,16 @@
|
|
2
2
|
<div class="cmd-company-logo company-logo">
|
3
3
|
<router-link v-if="link?.type === 'router'" :to="link?.path" :title="link?.tooltip">
|
4
4
|
<!-- begin CmdImage -->
|
5
|
-
<CmdImage :image="image"/>
|
5
|
+
<CmdImage :image="image" @image-loaded="onImageLoaded" />
|
6
6
|
<!-- end CmdImage -->
|
7
7
|
</router-link>
|
8
8
|
<a v-else-if="link?.type === 'href'" :href="link?.path" :title="link?.tooltip">
|
9
9
|
<!-- begin CmdImage -->
|
10
|
-
<CmdImage :image="image"/>
|
10
|
+
<CmdImage :image="image" @image-loaded="onImageLoaded" />
|
11
11
|
<!-- end CmdImage -->
|
12
12
|
</a>
|
13
13
|
<!-- begin CmdImage -->
|
14
|
-
<CmdImage v-else :image="image"/>
|
14
|
+
<CmdImage v-else :image="image" @image-loaded="onImageLoaded" />
|
15
15
|
<!-- end CmdImage -->
|
16
16
|
</div>
|
17
17
|
</template>
|
@@ -88,6 +88,9 @@ export default {
|
|
88
88
|
this.$_observer.disconnect()
|
89
89
|
},
|
90
90
|
methods: {
|
91
|
+
onImageLoaded(event) {
|
92
|
+
this.$emit("image-loaded", event)
|
93
|
+
},
|
91
94
|
onColorSchemeChange(event) {
|
92
95
|
this.prefersColorScheme = event.matches ? "light" : "dark"
|
93
96
|
},
|
@@ -28,7 +28,7 @@
|
|
28
28
|
<!-- end slot 'labeltext' -->
|
29
29
|
|
30
30
|
<!-- begin required asterisk -->
|
31
|
-
<sup v-if="$attrs.required !==
|
31
|
+
<sup v-if="$attrs.required != null && $attrs.required !== false" aria-hidden="true">*</sup>
|
32
32
|
<!-- end required asterisk -->
|
33
33
|
</span>
|
34
34
|
|
@@ -92,7 +92,7 @@
|
|
92
92
|
<!-- begin default-view -->
|
93
93
|
<figure v-else :class="['cmd-image', textAlign]">
|
94
94
|
<figcaption v-if="figcaption?.show && figcaption?.position === 'top'">{{ figcaption?.text }}</figcaption>
|
95
|
-
<img :src="imageSource" :alt="image?.alt" :title="image?.tooltip"/>
|
95
|
+
<img :src="imageSource" :alt="image?.alt" :title="image?.tooltip" @load="onImageLoaded" />
|
96
96
|
<figcaption v-if="figcaption?.show && figcaption?.position !== 'top'">{{ figcaption?.text }}</figcaption>
|
97
97
|
</figure>
|
98
98
|
<!-- end default-view -->
|
@@ -248,6 +248,9 @@ export default {
|
|
248
248
|
}
|
249
249
|
},
|
250
250
|
methods: {
|
251
|
+
onImageLoaded(event) {
|
252
|
+
this.$emit("image-loaded", event)
|
253
|
+
},
|
251
254
|
itemProvider() {
|
252
255
|
const editModeConfig = this.editModeConfig?.itemProviderOverwrite?.()
|
253
256
|
return {
|
@@ -1,6 +1,14 @@
|
|
1
1
|
<template>
|
2
2
|
<div
|
3
|
-
|
3
|
+
ref="site-header"
|
4
|
+
:class="[
|
5
|
+
'cmd-site-header site-header',
|
6
|
+
{
|
7
|
+
sticky: sticky,
|
8
|
+
'navigation-inline': navigationInline,
|
9
|
+
'off-canvas-right': cmdMainNavigation?.offcanvasPosition === 'right'
|
10
|
+
}
|
11
|
+
]"
|
4
12
|
role="banner">
|
5
13
|
<!-- begin slot for elements above header -->
|
6
14
|
<div v-if="$slots.topheader" class="top-header">
|
@@ -8,6 +16,7 @@
|
|
8
16
|
</div>
|
9
17
|
<!-- end slot for elements above header -->
|
10
18
|
|
19
|
+
<!-- begin (inner) header -->
|
11
20
|
<header
|
12
21
|
:class="[
|
13
22
|
useGrid ? 'grid-container-create-columns': 'flex-container',
|
@@ -27,6 +36,7 @@
|
|
27
36
|
<CmdCompanyLogo
|
28
37
|
v-if="cmdCompanyLogo"
|
29
38
|
v-bind="cmdCompanyLogo"
|
39
|
+
@image-loaded="onImageLoaded"
|
30
40
|
/>
|
31
41
|
<!-- end CmdCompanyLogo -->
|
32
42
|
|
@@ -43,6 +53,7 @@
|
|
43
53
|
</template>
|
44
54
|
<!-- end content given by data -->
|
45
55
|
</header>
|
56
|
+
<!-- end (inner) header -->
|
46
57
|
|
47
58
|
<!-- begin CmdMainNavigation -->
|
48
59
|
<CmdMainNavigation
|
@@ -61,6 +72,11 @@
|
|
61
72
|
export default {
|
62
73
|
name: "CmdSiteHeader",
|
63
74
|
emits: ["offcanvas"],
|
75
|
+
data() {
|
76
|
+
return {
|
77
|
+
defaultLogoHeight: ""
|
78
|
+
}
|
79
|
+
},
|
64
80
|
props: {
|
65
81
|
/**
|
66
82
|
* use only if default-button of inner navigation-component should not be used
|
@@ -85,6 +101,24 @@ export default {
|
|
85
101
|
type: Boolean,
|
86
102
|
default: false
|
87
103
|
},
|
104
|
+
/**
|
105
|
+
* set if header (incl. logo) should be resized if user scrolls page
|
106
|
+
*
|
107
|
+
* scrollContainerToResizeHeader-property must be defined
|
108
|
+
*/
|
109
|
+
resizeHeaderOnScroll: {
|
110
|
+
type: Boolean,
|
111
|
+
default: true
|
112
|
+
},
|
113
|
+
/**
|
114
|
+
* set selector the user scrolls to resize header
|
115
|
+
*
|
116
|
+
* resizeHeaderOnScroll-property must be activated
|
117
|
+
*/
|
118
|
+
scrollContainerToResizeHeader: {
|
119
|
+
type: String,
|
120
|
+
default: "#page-wrapper"
|
121
|
+
},
|
88
122
|
/**
|
89
123
|
* use a grid for positioning of inner-elements (else a flex-container will be used)
|
90
124
|
*
|
@@ -109,10 +143,34 @@ export default {
|
|
109
143
|
required: false
|
110
144
|
}
|
111
145
|
},
|
146
|
+
mounted() {
|
147
|
+
if (this.resizeHeaderOnScroll) {
|
148
|
+
const scrollContainer = document.querySelector(this.scrollContainerToResizeHeader);
|
149
|
+
|
150
|
+
scrollContainer.addEventListener("scroll", function () {
|
151
|
+
const header = document.querySelector(".cmd-site-header > header");
|
152
|
+
|
153
|
+
if (scrollContainer.scrollTop > 0) {
|
154
|
+
header.classList.add("resize-on-scroll");
|
155
|
+
} else {
|
156
|
+
header.classList.remove("resize-on-scroll");
|
157
|
+
}
|
158
|
+
});
|
159
|
+
}
|
160
|
+
},
|
112
161
|
methods: {
|
162
|
+
onImageLoaded(event) {
|
163
|
+
this.defaultLogoHeight = (event.target.height / 10) + "rem"
|
164
|
+
},
|
113
165
|
emitOffcanvasStatus(event) {
|
114
166
|
this.$emit("offcanvas", event)
|
115
167
|
}
|
168
|
+
},
|
169
|
+
watch: {
|
170
|
+
defaultLogoHeight() {
|
171
|
+
const logo = this.$refs["site-header"].querySelector(".cmd-company-logo img")
|
172
|
+
logo.style.height = this.defaultLogoHeight
|
173
|
+
}
|
116
174
|
}
|
117
175
|
}
|
118
176
|
</script>
|
@@ -130,6 +188,36 @@ export default {
|
|
130
188
|
&.sticky {
|
131
189
|
position: sticky;
|
132
190
|
z-index: 300;
|
191
|
+
|
192
|
+
header {
|
193
|
+
--header-scroll-animation: var(--default-transition);
|
194
|
+
transition: var(--header-scroll-animation);
|
195
|
+
|
196
|
+
.cmd-company-logo {
|
197
|
+
figure {
|
198
|
+
img {
|
199
|
+
transform-origin: top left;
|
200
|
+
transition: var(--header-scroll-animation);
|
201
|
+
margin: 0;
|
202
|
+
}
|
203
|
+
}
|
204
|
+
}
|
205
|
+
|
206
|
+
&.resize-on-scroll {
|
207
|
+
padding-top: var(--default-padding);
|
208
|
+
padding-bottom: var(--default-padding);
|
209
|
+
transition: var(--header-scroll-animation);
|
210
|
+
|
211
|
+
.cmd-company-logo {
|
212
|
+
figure {
|
213
|
+
img {
|
214
|
+
transition: var(--header-scroll-animation);
|
215
|
+
height: 5rem;
|
216
|
+
}
|
217
|
+
}
|
218
|
+
}
|
219
|
+
}
|
220
|
+
}
|
133
221
|
}
|
134
222
|
|
135
223
|
header, .cmd-main-navigation nav, .cmd-list-of-links {
|
@@ -4,7 +4,6 @@
|
|
4
4
|
:collapsible="true"
|
5
5
|
:cmdHeadline="{headlineText: readableName(componentName), headlineLevel: 4, headlineIcon: {iconClass: 'icon-settings-template'}}"
|
6
6
|
:openCollapsedBox="true"
|
7
|
-
:allowContentToScroll="true"
|
8
7
|
boxBodyClass="settings-body"
|
9
8
|
>
|
10
9
|
<template v-slot:body>
|