@progressive-development/pd-page 0.1.88 → 0.1.90
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/package.json +4 -4
- package/src/PdMenu.js +47 -1
- package/stories/menu.stories.js +5 -1
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Progressive development page helper, teaser, menu, footer.",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE",
|
|
5
5
|
"author": "PD Progressive Development",
|
|
6
|
-
"version": "0.1.
|
|
6
|
+
"version": "0.1.90",
|
|
7
7
|
"main": "index.js",
|
|
8
8
|
"module": "index.js",
|
|
9
9
|
"scripts": {
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@lit/localize": "^0.11.4",
|
|
23
|
-
"@progressive-development/pd-contact": "^0.1.
|
|
24
|
-
"@progressive-development/pd-dialog": "^0.1.
|
|
25
|
-
"@progressive-development/pd-forms": "^0.1.
|
|
23
|
+
"@progressive-development/pd-contact": "^0.1.47",
|
|
24
|
+
"@progressive-development/pd-dialog": "^0.1.60",
|
|
25
|
+
"@progressive-development/pd-forms": "^0.1.49",
|
|
26
26
|
"@progressive-development/pd-icon": "^0.1.16",
|
|
27
27
|
"@progressive-development/pd-shared-styles": "^0.1.1",
|
|
28
28
|
"lit": "^2.2.0",
|
package/src/PdMenu.js
CHANGED
|
@@ -129,6 +129,33 @@ export class PdMenu extends LitElement {
|
|
|
129
129
|
fill: var(--pd-menu-logo-color, #067394);
|
|
130
130
|
cursor: pointer;
|
|
131
131
|
}
|
|
132
|
+
|
|
133
|
+
.locales {
|
|
134
|
+
|
|
135
|
+
color: var(--pd-menu-font-col, var(--pd-default-bg-col));
|
|
136
|
+
font-size: var(--pd-menu-font-size, 1em);
|
|
137
|
+
|
|
138
|
+
position: absolute;
|
|
139
|
+
top: 15px;
|
|
140
|
+
right: 15px;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.selected-locale {
|
|
144
|
+
color: var(--pd-default-hover-col);
|
|
145
|
+
pointer-events: none;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.selectable-locale:hover {
|
|
149
|
+
color: var(--pd-default-hover-col);
|
|
150
|
+
cursor: pointer;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
@media (max-width: 1300px) {
|
|
155
|
+
.locales {
|
|
156
|
+
right: 25%;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
132
159
|
|
|
133
160
|
|
|
134
161
|
/**
|
|
@@ -138,7 +165,7 @@ export class PdMenu extends LitElement {
|
|
|
138
165
|
|
|
139
166
|
:host([_activeBurgerMenu]) ul {
|
|
140
167
|
visibility: visible;
|
|
141
|
-
}
|
|
168
|
+
}
|
|
142
169
|
|
|
143
170
|
.burger-menu {
|
|
144
171
|
visibility: visible;
|
|
@@ -185,6 +212,8 @@ export class PdMenu extends LitElement {
|
|
|
185
212
|
static get properties() {
|
|
186
213
|
return {
|
|
187
214
|
activeRoute: { type: String },
|
|
215
|
+
selectedLocale: { type: String },
|
|
216
|
+
locales: { type: Array },
|
|
188
217
|
menuItems: { type: Array },
|
|
189
218
|
topMenuItems: { type: Array },
|
|
190
219
|
// At the moment needed for scroll to pistion => Refactor possible?
|
|
@@ -263,6 +292,16 @@ export class PdMenu extends LitElement {
|
|
|
263
292
|
</div>
|
|
264
293
|
`}
|
|
265
294
|
|
|
295
|
+
${(this.locales && this.locales.length) > 1 ? html`
|
|
296
|
+
<div class="locales">
|
|
297
|
+
${this.locales.map((l) => html`
|
|
298
|
+
<span @click="${this._localeClicked}" data-key="${l}"
|
|
299
|
+
class="${l === this.selectedLocale ? 'selected-locale' : 'selectable-locale'}">${l}</span>
|
|
300
|
+
`)}
|
|
301
|
+
|
|
302
|
+
</div>
|
|
303
|
+
` : ''}
|
|
304
|
+
|
|
266
305
|
</div>
|
|
267
306
|
`;
|
|
268
307
|
}
|
|
@@ -295,6 +334,13 @@ export class PdMenu extends LitElement {
|
|
|
295
334
|
this._activeBurgerMenu = !this._activeBurgerMenu;
|
|
296
335
|
}
|
|
297
336
|
|
|
337
|
+
_localeClicked(e) {
|
|
338
|
+
const keyParam = e.target.dataset.key;
|
|
339
|
+
this.dispatchEvent(new CustomEvent("locale-change", {
|
|
340
|
+
detail: keyParam
|
|
341
|
+
}));
|
|
342
|
+
}
|
|
343
|
+
|
|
298
344
|
_menuItemClicked(e) {
|
|
299
345
|
|
|
300
346
|
// get menu item
|
package/stories/menu.stories.js
CHANGED
|
@@ -82,7 +82,7 @@ export default {
|
|
|
82
82
|
},
|
|
83
83
|
};
|
|
84
84
|
|
|
85
|
-
function Template({ menuItems, topMenuItems, color, logo, menuColor }) {
|
|
85
|
+
function Template({ menuItems, topMenuItems, color, logo, menuColor, locales, selectedLocale }) {
|
|
86
86
|
return html`
|
|
87
87
|
<pd-menu
|
|
88
88
|
style="--squi-menu-bg-color: ${menuColor || color};
|
|
@@ -90,6 +90,8 @@ function Template({ menuItems, topMenuItems, color, logo, menuColor }) {
|
|
|
90
90
|
.menuItems=${menuItems}
|
|
91
91
|
.topMenuItems=${topMenuItems}
|
|
92
92
|
?teaserClosed="${true}"
|
|
93
|
+
.locales="${locales}"
|
|
94
|
+
selectedLocale="${selectedLocale}"
|
|
93
95
|
@route-event="${e => {
|
|
94
96
|
console.log('Der route event ist da: ', e);
|
|
95
97
|
}}"
|
|
@@ -147,4 +149,6 @@ WithTopItems.args = {
|
|
|
147
149
|
topMenuItems: [{ name: 'Profile', icon: 'userIcon', route: 'profile' }],
|
|
148
150
|
color: '#084c61',
|
|
149
151
|
logo: ticomiLogo,
|
|
152
|
+
locales: ["de", "en"],
|
|
153
|
+
selectedLocale: "de",
|
|
150
154
|
};
|