@progressive-development/pd-page 0.5.9 → 0.6.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/generated/locale-codes.d.ts +14 -0
- package/dist/generated/locale-codes.d.ts.map +1 -0
- package/dist/generated/locales/be.d.ts +11 -0
- package/dist/generated/locales/be.d.ts.map +1 -0
- package/dist/generated/locales/de.d.ts +11 -0
- package/dist/generated/locales/de.d.ts.map +1 -0
- package/dist/generated/locales/en.d.ts +11 -0
- package/dist/generated/locales/en.d.ts.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -7
- package/dist/locales/be.d.ts +2 -0
- package/dist/locales/be.js +2 -1
- package/dist/locales/de.d.ts +2 -0
- package/dist/locales/de.js +2 -1
- package/dist/locales/en.d.ts +2 -0
- package/dist/locales/en.js +2 -1
- package/dist/pd-contact-us.d.ts +18 -0
- package/dist/pd-contact-us.d.ts.map +1 -0
- package/dist/pd-contact-us.js +218 -4
- package/dist/pd-footer.d.ts +31 -0
- package/dist/pd-footer.d.ts.map +1 -0
- package/dist/pd-footer.js +165 -4
- package/dist/pd-menu.d.ts +67 -0
- package/dist/pd-menu.d.ts.map +1 -0
- package/dist/pd-menu.js +483 -4
- package/dist/stories/01_index.stories.d.ts +5 -0
- package/dist/stories/01_index.stories.d.ts.map +1 -0
- package/dist/stories/pd-contact-us.stories.d.ts +6 -0
- package/dist/stories/pd-contact-us.stories.d.ts.map +1 -0
- package/dist/stories/pd-footer.stories.d.ts +8 -0
- package/dist/stories/pd-footer.stories.d.ts.map +1 -0
- package/dist/stories/pd-menu.stories.d.ts +20 -0
- package/dist/stories/pd-menu.stories.d.ts.map +1 -0
- package/dist/types.d.ts +25 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +31 -48
- package/dist/pd-teaser.js +0 -8
- package/dist/src/PdContactUs.js +0 -204
- package/dist/src/PdFooter.js +0 -140
- package/dist/src/PdMenu.js +0 -449
- package/dist/src/PdTeaser.js +0 -247
- package/dist/src/PdTeaserContent.js +0 -211
package/dist/src/PdMenu.js
DELETED
|
@@ -1,449 +0,0 @@
|
|
|
1
|
-
import { LitElement, css, html } from "lit";
|
|
2
|
-
import { updateWhenLocaleChanges } from "@lit/localize";
|
|
3
|
-
import { installMediaQueryWatcher } from "pwa-helpers/media-query.js";
|
|
4
|
-
import { ICON_TOOGLE_ARROW, ICON_BURGER_MENU } from "@progressive-development/pd-icon";
|
|
5
|
-
import "@progressive-development/pd-icon/pd-icon";
|
|
6
|
-
import { PDColorStyles, PDFontStyles } from "@progressive-development/pd-shared-styles";
|
|
7
|
-
/**
|
|
8
|
-
* @license
|
|
9
|
-
* Copyright (c) 2021 PD Progressive Development UG. All rights reserved.
|
|
10
|
-
*/
|
|
11
|
-
class PdMenu extends LitElement {
|
|
12
|
-
/**
|
|
13
|
-
* Fired when route menu item clicked
|
|
14
|
-
* @event route-event
|
|
15
|
-
*/
|
|
16
|
-
static get styles() {
|
|
17
|
-
return [
|
|
18
|
-
PDColorStyles,
|
|
19
|
-
PDFontStyles,
|
|
20
|
-
css`
|
|
21
|
-
|
|
22
|
-
:host {
|
|
23
|
-
display: block;
|
|
24
|
-
position: relative;
|
|
25
|
-
height: var(--pd-menu-height, 100px);
|
|
26
|
-
background-color: var(--pd-menu-bg-col, var(--pd-default-col));
|
|
27
|
-
box-shadow: var(--pd-menu-shadow, 3px 3px 5px grey);
|
|
28
|
-
|
|
29
|
-
/*
|
|
30
|
-
Add into component, before styled from outside by using element
|
|
31
|
-
removed fixed again => not fit for the teaser, custom properties possible, but now handle this in SPAHelper header element
|
|
32
|
-
width: 100%;
|
|
33
|
-
position: fixed;
|
|
34
|
-
top: 0;
|
|
35
|
-
*/
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.menu-container {
|
|
39
|
-
height: 100%;
|
|
40
|
-
padding-left: 10px;
|
|
41
|
-
padding-right: 10px;
|
|
42
|
-
display: flex;
|
|
43
|
-
justify-content: space-between;
|
|
44
|
-
align-items: center;
|
|
45
|
-
white-space: nowrap;
|
|
46
|
-
max-width: var(--pd-menu-wax-width, 1170px);
|
|
47
|
-
margin: 0 auto;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.menu-ul {
|
|
51
|
-
display: flex;
|
|
52
|
-
align-items: center;
|
|
53
|
-
list-style: none;
|
|
54
|
-
margin: 0;
|
|
55
|
-
padding: 0;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.burger-ul {
|
|
59
|
-
visibility: hidden;
|
|
60
|
-
overflow: hidden;
|
|
61
|
-
z-index: -1;
|
|
62
|
-
position: absolute;
|
|
63
|
-
flex-direction: column;
|
|
64
|
-
top: calc(var(--pd-menu-height, 100px) * -1);
|
|
65
|
-
right: 0px;
|
|
66
|
-
background-color: var(--pd-menu-burger-bg-col, var(--pd-default-light-col));
|
|
67
|
-
|
|
68
|
-
box-shadow: var(--pd-menu-shadow, 3px 3px 5px grey);
|
|
69
|
-
border-bottom: var(--pd-menu-burger-bottomborder);
|
|
70
|
-
padding: var(--pd-menu-burger-padding, 0);
|
|
71
|
-
width:100%;
|
|
72
|
-
-moz-border-radius: var(--pd-border-radius);
|
|
73
|
-
border-radius: var(--pd-border-radius);
|
|
74
|
-
|
|
75
|
-
transition: 0.5s;
|
|
76
|
-
transition-timing-function: ease-out;
|
|
77
|
-
|
|
78
|
-
transform: translateY(0);
|
|
79
|
-
opacity: 0;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.locale-ul {
|
|
83
|
-
visibility: hidden;
|
|
84
|
-
position: absolute;
|
|
85
|
-
flex-direction: column;
|
|
86
|
-
top: 10px;
|
|
87
|
-
right: 15px;
|
|
88
|
-
z-index: 100;
|
|
89
|
-
background-color: var(--pd-menu-burger-bg-col, var(--pd-default-light-col));
|
|
90
|
-
|
|
91
|
-
box-shadow: var(--pd-menu-shadow, 3px 3px 5px grey);
|
|
92
|
-
border-bottom: var(--pd-menu-burger-bottomborder);
|
|
93
|
-
padding: var(--pd-menu-burger-padding, 0);
|
|
94
|
-
-moz-border-radius: var(--pd-border-radius);
|
|
95
|
-
border-radius: var(--pd-border-radius);
|
|
96
|
-
|
|
97
|
-
transition: 0.5s;
|
|
98
|
-
transition-timing-function: ease-out;
|
|
99
|
-
|
|
100
|
-
transform: translateY(0);
|
|
101
|
-
opacity: 0;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
:host([_activeBurgerMenu]) .burger-ul {
|
|
105
|
-
visibility: visible;
|
|
106
|
-
opacity: 1;
|
|
107
|
-
top: var(--pd-menu-burger-top, var(--pd-menu-height, 100px));
|
|
108
|
-
transition-timing-function: ease-in;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
:host([_activeLocaleMenu]) .locale-ul {
|
|
113
|
-
visibility: visible;
|
|
114
|
-
opacity: 1;
|
|
115
|
-
top: 40px;
|
|
116
|
-
transition-timing-function: ease-in;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
.menu-li {
|
|
120
|
-
display: flex;
|
|
121
|
-
align-items: center;
|
|
122
|
-
cursor: pointer;
|
|
123
|
-
border-radius: var(--pd-border-radius);
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
.burger-li {
|
|
127
|
-
border-radius: var(--pd-border-radius);
|
|
128
|
-
align-self: justify;
|
|
129
|
-
width:80%;
|
|
130
|
-
font-size:90% !important;
|
|
131
|
-
height:1rem;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
.locale-li {
|
|
135
|
-
position: relative;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
.burger-li:hover {
|
|
139
|
-
background-color: var(--pd-default-dark-col);
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
.item {
|
|
143
|
-
color: var(--pd-menu-font-col, var(--pd-default-bg-col));
|
|
144
|
-
font-family: var(--pd-menu-font-family, var(--pd-default-font-title-family));
|
|
145
|
-
font-size: var(--pd-menu-font-size, 1.2em);
|
|
146
|
-
font-weight: var(--pd-menu-font-weight, bold);
|
|
147
|
-
padding: var(--pd-menu-item-padding, 0.6em);
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
.burger-item {
|
|
151
|
-
color: var(--pd-menu-burger-font-col, var(--pd-default-dark-col));
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
.locale-item {
|
|
155
|
-
padding-left: 1.5em;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
.item.active,
|
|
159
|
-
.item:hover {
|
|
160
|
-
color: var(--pd-default-hover-col);
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
.item:hover {
|
|
164
|
-
background-color: var(--pd-menu-item-bg-hover-col);
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
.item:hover .topItemLogo {
|
|
168
|
-
--pd-icon-stroke-col: var(--pd-default-hover-col);
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
.topMenu {
|
|
172
|
-
width: 100%;
|
|
173
|
-
justify-content: end;
|
|
174
|
-
padding-left: 10px;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
.topItemLogo {
|
|
178
|
-
--pd-icon-size: 1.4rem;
|
|
179
|
-
--pd-icon-bg-col: transparent;
|
|
180
|
-
--pd-icon-stroke-col: var(--pd-menu-font-col, var(--pd-default-bg-col));
|
|
181
|
-
--pd-icon-col: var(--pd-menu-font-col, var(--pd-default-bg-col));
|
|
182
|
-
pointer-events: none;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
.burgerLogo {
|
|
186
|
-
--pd-icon-size: 2rem;
|
|
187
|
-
--pd-icon-bg-col: transparent;
|
|
188
|
-
pointer-events: none;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
.menu-wrapper {
|
|
192
|
-
width: 100%;
|
|
193
|
-
display: flex;
|
|
194
|
-
align-items: center;
|
|
195
|
-
justify-content: end;
|
|
196
|
-
padding-right: 0.5rem;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
.burger-menu {
|
|
200
|
-
display: flex;
|
|
201
|
-
gap: 0.3rem;
|
|
202
|
-
align-items: center;
|
|
203
|
-
cursor: pointer;
|
|
204
|
-
|
|
205
|
-
--pd-icon-stroke-col: var(--pd-menu-font-col, var(--pd-default-bg-col));
|
|
206
|
-
--pd-icon-col: var(--pd-default-hover-col);
|
|
207
|
-
|
|
208
|
-
--pd-icon-stroke-col-active: var(--pd-menu-font-col, var(--pd-default-bg-col));
|
|
209
|
-
--pd-icon-col-active: lightgrey;
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
.burger-menu:hover {
|
|
213
|
-
--pd-icon-col: var(--pd-default-hover-col);
|
|
214
|
-
--pd-icon-col-active: var(--pd-default-hover-col);
|
|
215
|
-
--pd-icon-stroke-col: var(--pd-menu-font-col, var(--pd-default-bg-col));
|
|
216
|
-
--pd-icon-stroke-col-active: var(--pd-menu-font-col, var(--pd-default-bg-col));
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
.burger-menu .item{
|
|
220
|
-
padding: 0;
|
|
221
|
-
font-size: 1.5em;
|
|
222
|
-
transition: color ease 0.5s;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
.burger-menu:hover .item {
|
|
226
|
-
color: var(--pd-default-hover-col);
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
/* Doppelt zum logo-container, pd-logo sonst nicht mehr funktional
|
|
231
|
-
*/
|
|
232
|
-
::slotted(.logo) {
|
|
233
|
-
width: 100%;
|
|
234
|
-
max-width: var(--pd-menu-logo-maxwidth, 8rem);
|
|
235
|
-
padding: var(--pd-menu-logo-padding, 2em);
|
|
236
|
-
width: 100%;
|
|
237
|
-
fill: var(--pd-menu-logo-color, #067394);
|
|
238
|
-
cursor: pointer;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
.locale-selection-logo {
|
|
243
|
-
--pd-icon-size: 0.8rem;
|
|
244
|
-
--pd-icon-bg-col: transparent;
|
|
245
|
-
--pd-icon-stroke-col: var(--pd-menu-font-col, var(--pd-default-bg-col));
|
|
246
|
-
--pd-icon-col: var(--pd-default-hover-col);
|
|
247
|
-
--pd-icon-stroke-col-active: var(--pd-menu-font-col, var(--pd-default-bg-col));
|
|
248
|
-
--pd-icon-col-active: var(--pd-menu-font-col, var(--pd-default-bg-col));
|
|
249
|
-
margin-top: 2px;
|
|
250
|
-
pointer-events: none;
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
`
|
|
254
|
-
];
|
|
255
|
-
}
|
|
256
|
-
static get properties() {
|
|
257
|
-
return {
|
|
258
|
-
activeRoute: { type: String },
|
|
259
|
-
selectedLocale: { type: String },
|
|
260
|
-
locales: { type: Array },
|
|
261
|
-
menuItems: { type: Array },
|
|
262
|
-
topMenuItems: { type: Array },
|
|
263
|
-
noBurgerMenu: { type: Boolean },
|
|
264
|
-
// At the moment needed for scroll to pistion => Refactor possible?
|
|
265
|
-
headerSize: { type: Number },
|
|
266
|
-
_activeSecIndex: { type: Number },
|
|
267
|
-
_smallScreen: { type: Boolean, state: true },
|
|
268
|
-
_activeBurgerMenu: { type: Boolean, reflect: true },
|
|
269
|
-
_activeLocaleMenu: { type: Boolean, reflect: true }
|
|
270
|
-
};
|
|
271
|
-
}
|
|
272
|
-
constructor() {
|
|
273
|
-
super();
|
|
274
|
-
this.menuItems = [];
|
|
275
|
-
this.topMenuItems = [];
|
|
276
|
-
this.noBurgerMenu = false;
|
|
277
|
-
this._activeSecIndex = 0;
|
|
278
|
-
this._activeBurgerMenu = false;
|
|
279
|
-
this.headerSize = 0;
|
|
280
|
-
updateWhenLocaleChanges(this);
|
|
281
|
-
}
|
|
282
|
-
firstUpdated() {
|
|
283
|
-
const doSomething = (scrollPos) => {
|
|
284
|
-
let activeSecIndex = -1;
|
|
285
|
-
let distance = scrollPos > 300 ? 5e3 : 300;
|
|
286
|
-
this.menuItems.forEach((item, index) => {
|
|
287
|
-
if (item.ref) {
|
|
288
|
-
let distTmp = item.ref.getBoundingClientRect().top;
|
|
289
|
-
distTmp = Math.abs(distTmp);
|
|
290
|
-
if (item.ref && distTmp < distance) {
|
|
291
|
-
activeSecIndex = index;
|
|
292
|
-
distance = distTmp;
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
});
|
|
296
|
-
this._activeSecIndex = activeSecIndex >= 0 ? activeSecIndex + 1 : 0;
|
|
297
|
-
};
|
|
298
|
-
let ticking = false;
|
|
299
|
-
document.addEventListener("scroll", () => {
|
|
300
|
-
const lastKnownScrollPosition = window.scrollY;
|
|
301
|
-
if (!ticking) {
|
|
302
|
-
window.requestAnimationFrame(() => {
|
|
303
|
-
doSomething(lastKnownScrollPosition);
|
|
304
|
-
ticking = false;
|
|
305
|
-
});
|
|
306
|
-
ticking = true;
|
|
307
|
-
}
|
|
308
|
-
});
|
|
309
|
-
installMediaQueryWatcher(`(max-width: 700px)`, (matches) => {
|
|
310
|
-
if (matches) {
|
|
311
|
-
this._smallScreen = !this.noBurgerMenu;
|
|
312
|
-
} else {
|
|
313
|
-
this._smallScreen = false;
|
|
314
|
-
}
|
|
315
|
-
});
|
|
316
|
-
}
|
|
317
|
-
render() {
|
|
318
|
-
return html`
|
|
319
|
-
<div class="menu-container">
|
|
320
|
-
|
|
321
|
-
<slot @click="${this._logoClicked}" name="slotLogo"></slot>
|
|
322
|
-
|
|
323
|
-
<ul class="menu-ul ${this._smallScreen ? "burger-ul" : ""}">
|
|
324
|
-
${this._renderItems(this._smallScreen ? [...this.menuItems, ...this.topMenuItems] : this.menuItems, true, this._smallScreen)}
|
|
325
|
-
</ul>
|
|
326
|
-
|
|
327
|
-
${!this._smallScreen ? html`
|
|
328
|
-
<ul class="menu-ul topMenu">
|
|
329
|
-
${this._renderItems(this.topMenuItems, false)}
|
|
330
|
-
|
|
331
|
-
${(this.locales && this.locales.length) > 1 ? html`
|
|
332
|
-
<li class="item menu-li locale-li" @click="${this._toggleLocaleSelection}">
|
|
333
|
-
${this.selectedLocale}
|
|
334
|
-
<pd-icon class="locale-selection-logo" icon="${ICON_TOOGLE_ARROW}" ?activeIcon="${!this._activeLocaleMenu}"></pd-icon>
|
|
335
|
-
<ul class="menu-ul locale-ul">
|
|
336
|
-
${this.locales.filter((l) => l !== this.selectedLocale).map((locale) => html`
|
|
337
|
-
<li class="item menu-li burger-li burger-item locale-item"
|
|
338
|
-
data-key="${locale}"
|
|
339
|
-
@click="${this._localeClicked}"
|
|
340
|
-
>
|
|
341
|
-
${locale}
|
|
342
|
-
</li>
|
|
343
|
-
`)}
|
|
344
|
-
</ul>
|
|
345
|
-
</li>
|
|
346
|
-
` : ""}
|
|
347
|
-
</ul>
|
|
348
|
-
` : html`
|
|
349
|
-
<div class="menu-wrapper">
|
|
350
|
-
<div class="burger-menu" @click="${this._toggleBurgerMenu}">
|
|
351
|
-
<pd-icon class="burgerLogo" icon="${ICON_BURGER_MENU}" ?activeIcon="${!this._activeBurgerMenu}"></pd-icon>
|
|
352
|
-
<span class="item ${this._activeBurgerMenu ? "active" : ""}">Menu</span>
|
|
353
|
-
</div>
|
|
354
|
-
</div>
|
|
355
|
-
`}
|
|
356
|
-
|
|
357
|
-
</div>
|
|
358
|
-
`;
|
|
359
|
-
}
|
|
360
|
-
_renderItems(items, checkActiveClass, disableIcons) {
|
|
361
|
-
return html`
|
|
362
|
-
${items.map(
|
|
363
|
-
(item, index) => html`
|
|
364
|
-
<li
|
|
365
|
-
class="item menu-li ${this._smallScreen ? "burger-li burger-item" : ""}
|
|
366
|
-
${checkActiveClass && this._activeSecIndex === index + 1 || item.route && item.route === this.activeRoute ? "active" : ""}"
|
|
367
|
-
data-key="${item.key}"
|
|
368
|
-
@click="${this._menuItemClicked}"
|
|
369
|
-
>
|
|
370
|
-
${item.icon && !disableIcons ? html`<pd-icon
|
|
371
|
-
class="topItemLogo"
|
|
372
|
-
icon="${item.icon}"
|
|
373
|
-
></pd-icon>` : ""}
|
|
374
|
-
${item.name}
|
|
375
|
-
</li>
|
|
376
|
-
`
|
|
377
|
-
)}
|
|
378
|
-
`;
|
|
379
|
-
}
|
|
380
|
-
_toggleBurgerMenu() {
|
|
381
|
-
this._activeBurgerMenu = !this._activeBurgerMenu;
|
|
382
|
-
}
|
|
383
|
-
_toggleLocaleSelection() {
|
|
384
|
-
this._activeLocaleMenu = !this._activeLocaleMenu;
|
|
385
|
-
}
|
|
386
|
-
_localeClicked(e) {
|
|
387
|
-
const keyParam = e.target.dataset.key;
|
|
388
|
-
this.dispatchEvent(new CustomEvent("locale-change", {
|
|
389
|
-
detail: keyParam
|
|
390
|
-
}));
|
|
391
|
-
}
|
|
392
|
-
_menuItemClicked(e) {
|
|
393
|
-
const keyParam = e.target.dataset.key;
|
|
394
|
-
const menuItem = this.menuItems.filter((mi) => mi.key === keyParam)[0] || this.topMenuItems.filter((mi) => mi.key === keyParam)[0];
|
|
395
|
-
if (menuItem.sec && menuItem.sec !== "") {
|
|
396
|
-
this._scrollToContent(menuItem.sec);
|
|
397
|
-
} else if (menuItem.route && menuItem.route !== "") {
|
|
398
|
-
this.dispatchEvent(
|
|
399
|
-
new CustomEvent("route-event", {
|
|
400
|
-
detail: {
|
|
401
|
-
route: menuItem.route === "back" ? "" : menuItem.route
|
|
402
|
-
},
|
|
403
|
-
composed: true,
|
|
404
|
-
bubbles: true
|
|
405
|
-
})
|
|
406
|
-
);
|
|
407
|
-
} else if (menuItem.action) {
|
|
408
|
-
menuItem.action();
|
|
409
|
-
}
|
|
410
|
-
if (this._activeBurgerMenu) {
|
|
411
|
-
this._activeBurgerMenu = !this._activeBurgerMenu;
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
|
-
static _scrollToTop() {
|
|
415
|
-
window.scrollTo({
|
|
416
|
-
top: 0,
|
|
417
|
-
left: 0,
|
|
418
|
-
behavior: "smooth"
|
|
419
|
-
});
|
|
420
|
-
}
|
|
421
|
-
_scrollToContent(section) {
|
|
422
|
-
const selMenuItem = this.menuItems.filter((item) => item.sec === section)[0] || {};
|
|
423
|
-
const el = selMenuItem.ref;
|
|
424
|
-
if (el) {
|
|
425
|
-
const rect = el.getBoundingClientRect();
|
|
426
|
-
window.scrollBy({
|
|
427
|
-
top: rect.top - this.headerSize,
|
|
428
|
-
left: 0,
|
|
429
|
-
behavior: "smooth"
|
|
430
|
-
});
|
|
431
|
-
}
|
|
432
|
-
}
|
|
433
|
-
// eslint-disable-next-line class-methods-use-this
|
|
434
|
-
_logoClicked() {
|
|
435
|
-
PdMenu._scrollToTop();
|
|
436
|
-
this.dispatchEvent(
|
|
437
|
-
new CustomEvent("route-event", {
|
|
438
|
-
detail: {
|
|
439
|
-
route: ""
|
|
440
|
-
},
|
|
441
|
-
composed: true,
|
|
442
|
-
bubbles: true
|
|
443
|
-
})
|
|
444
|
-
);
|
|
445
|
-
}
|
|
446
|
-
}
|
|
447
|
-
export {
|
|
448
|
-
PdMenu
|
|
449
|
-
};
|
package/dist/src/PdTeaser.js
DELETED
|
@@ -1,247 +0,0 @@
|
|
|
1
|
-
import { LitElement, css, html } from "lit";
|
|
2
|
-
import "@progressive-development/pd-icon/pd-icon";
|
|
3
|
-
import { PDColorStyles } from "@progressive-development/pd-shared-styles";
|
|
4
|
-
/**
|
|
5
|
-
* @license
|
|
6
|
-
* Copyright (c) 2021 PD Progressive Development UG. All rights reserved.
|
|
7
|
-
*/
|
|
8
|
-
class PdTeaser extends LitElement {
|
|
9
|
-
/**
|
|
10
|
-
* Fired when free date clicked => At the moment only for freeDates
|
|
11
|
-
* @event close-teaser
|
|
12
|
-
*/
|
|
13
|
-
static get styles() {
|
|
14
|
-
return [
|
|
15
|
-
PDColorStyles,
|
|
16
|
-
css`
|
|
17
|
-
:host {
|
|
18
|
-
|
|
19
|
-
--my-height: var(--pd-teaser-height, 420px);
|
|
20
|
-
|
|
21
|
-
display: block;
|
|
22
|
-
background-color: var(--pd-teaser-bg-col, var(--pd-default-col));
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.teaser {
|
|
26
|
-
display: grid;
|
|
27
|
-
grid-template-columns: minmax(10px, 200px) auto;
|
|
28
|
-
grid-template-rows: var(--my-height);
|
|
29
|
-
grid-template-areas:
|
|
30
|
-
". content"
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.teaser-flex {
|
|
34
|
-
display: flex;
|
|
35
|
-
justify-content: left;
|
|
36
|
-
height: var(--my-height);
|
|
37
|
-
}
|
|
38
|
-
.in-active {
|
|
39
|
-
/* ToDo Ausblenden */
|
|
40
|
-
display: none;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.active {
|
|
44
|
-
/* ToDo Einblenden */
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.previous {
|
|
48
|
-
position: absolute;
|
|
49
|
-
top: calc(var(--my-height) / 2);
|
|
50
|
-
left: 10px;
|
|
51
|
-
z-index: 1;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.next {
|
|
55
|
-
position: absolute;
|
|
56
|
-
top: calc(var(--my-height) / 2);
|
|
57
|
-
right: 10px;
|
|
58
|
-
z-index: 1;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
pd-icon {
|
|
62
|
-
--pd-icon-stroke-col: var(--pd-default-bg-col);
|
|
63
|
-
--pd-icon-col: var(--pd-default-dark-col);
|
|
64
|
-
--pd-icon-stroke-col-hover: var(--pd-default-hover-col);
|
|
65
|
-
--pd-icon-col-hover: var(--pd-default-dark-col);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.content {
|
|
69
|
-
/*grid-area: content; */
|
|
70
|
-
flex-grow: 4;
|
|
71
|
-
overflow: hidden;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.slide-rigth {
|
|
75
|
-
animation-duration:1s;
|
|
76
|
-
animation-name: slideFromLeft;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.slide-left {
|
|
80
|
-
animation-duration:1s;
|
|
81
|
-
animation-name: slideFromRigth;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
@keyframes slideFromRigth {
|
|
85
|
-
from {
|
|
86
|
-
margin-right: 100%;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
to {
|
|
90
|
-
margin-right: 0%;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
@keyframes slideFromLeft {
|
|
95
|
-
from {
|
|
96
|
-
margin-left: 100%;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
to {
|
|
100
|
-
margin-left: 0%;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
.not-visible {
|
|
105
|
-
display: none;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
::slotted(*) {
|
|
109
|
-
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
/* Size Elements for small width */
|
|
113
|
-
@media (max-width: 1400px) {
|
|
114
|
-
:host {
|
|
115
|
-
--my-height: 350px;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
/* Size Elements for small width */
|
|
120
|
-
@media (max-width: 900px) {
|
|
121
|
-
:host {
|
|
122
|
-
--my-height: 300px;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
/* Size Elements for small width */
|
|
127
|
-
@media (max-width: 600px) {
|
|
128
|
-
:host {
|
|
129
|
-
--my-height: 270px;
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
/* Size Elements for small width */
|
|
135
|
-
@media (max-width: 350px) {
|
|
136
|
-
:host {
|
|
137
|
-
--my-height: 220px;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
/* Size Elements for small width */
|
|
142
|
-
@media (max-width: 320px) {
|
|
143
|
-
:host {
|
|
144
|
-
--my-height: 250px;
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
`
|
|
149
|
-
];
|
|
150
|
-
}
|
|
151
|
-
static get properties() {
|
|
152
|
-
return {
|
|
153
|
-
teaserObjects: { type: Array },
|
|
154
|
-
resizeWidth: { type: String },
|
|
155
|
-
_hideContent: { type: Boolean },
|
|
156
|
-
_currentNumber: { type: Number },
|
|
157
|
-
_slideDirection: { type: String },
|
|
158
|
-
_visible: { type: Boolean }
|
|
159
|
-
};
|
|
160
|
-
}
|
|
161
|
-
constructor() {
|
|
162
|
-
super();
|
|
163
|
-
this.teaserObjects = [];
|
|
164
|
-
this.resizeWidth = "1232px";
|
|
165
|
-
this._hideContent = false;
|
|
166
|
-
this._currentNumber = 0;
|
|
167
|
-
this._slideDirection = "slide-rigth";
|
|
168
|
-
this._visible = true;
|
|
169
|
-
}
|
|
170
|
-
firstUpdated() {
|
|
171
|
-
const doSomething = (scrollPos) => {
|
|
172
|
-
if (scrollPos <= 50) {
|
|
173
|
-
this._visible = true;
|
|
174
|
-
} else {
|
|
175
|
-
this._visible = false;
|
|
176
|
-
}
|
|
177
|
-
};
|
|
178
|
-
let ticking = false;
|
|
179
|
-
document.addEventListener("scroll", () => {
|
|
180
|
-
const lastKnownScrollPosition = window.scrollY;
|
|
181
|
-
if (!ticking) {
|
|
182
|
-
window.requestAnimationFrame(() => {
|
|
183
|
-
doSomething(lastKnownScrollPosition);
|
|
184
|
-
ticking = false;
|
|
185
|
-
});
|
|
186
|
-
ticking = true;
|
|
187
|
-
}
|
|
188
|
-
});
|
|
189
|
-
}
|
|
190
|
-
updated(changedProps) {
|
|
191
|
-
if (changedProps.has("_visible")) {
|
|
192
|
-
if (changedProps.get("_visible") === true && this._visible === false || changedProps.get("_visible") === false && this._visible === true)
|
|
193
|
-
this.dispatchEvent(
|
|
194
|
-
new CustomEvent("close-teaser", {
|
|
195
|
-
detail: {
|
|
196
|
-
value: this._visible
|
|
197
|
-
}
|
|
198
|
-
})
|
|
199
|
-
);
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
render() {
|
|
203
|
-
return html`
|
|
204
|
-
<div class="teaser-flex ${this._visible ? "" : "in-active"}">
|
|
205
|
-
<pd-icon
|
|
206
|
-
icon="previousArrow"
|
|
207
|
-
class="previous"
|
|
208
|
-
@click="${this._prevContent}"
|
|
209
|
-
></pd-icon>
|
|
210
|
-
<pd-icon
|
|
211
|
-
icon="nextArrow"
|
|
212
|
-
class="next"
|
|
213
|
-
@click="${this._nextContent}"
|
|
214
|
-
></pd-icon>
|
|
215
|
-
|
|
216
|
-
${this.teaserObjects.map(
|
|
217
|
-
(teaserObj, index) => html`
|
|
218
|
-
<div
|
|
219
|
-
class="content ${this._currentNumber === index ? this._slideDirection : "not-visible"}"
|
|
220
|
-
>
|
|
221
|
-
<slot name="${teaserObj.name}"></slot>
|
|
222
|
-
</div>
|
|
223
|
-
`
|
|
224
|
-
)}
|
|
225
|
-
</div>
|
|
226
|
-
`;
|
|
227
|
-
}
|
|
228
|
-
_prevContent() {
|
|
229
|
-
this._slideDirection = "slide-left";
|
|
230
|
-
if (this._currentNumber === 0) {
|
|
231
|
-
this._currentNumber = this.teaserObjects.length - 1;
|
|
232
|
-
} else {
|
|
233
|
-
this._currentNumber -= 1;
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
_nextContent() {
|
|
237
|
-
this._slideDirection = "slide-rigth";
|
|
238
|
-
if (this._currentNumber === this.teaserObjects.length - 1) {
|
|
239
|
-
this._currentNumber = 0;
|
|
240
|
-
} else {
|
|
241
|
-
this._currentNumber += 1;
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
export {
|
|
246
|
-
PdTeaser
|
|
247
|
-
};
|