fix(core): update

This commit is contained in:
Philipp Kunz 2022-08-18 02:11:35 +02:00
parent b69b1179a1
commit 9a6db7d882
2 changed files with 52 additions and 6 deletions

View File

@ -3,6 +3,6 @@
*/ */
export const commitinfo = { export const commitinfo = {
name: '@designestate/dees-catalog', name: '@designestate/dees-catalog',
version: '1.0.98', version: '1.0.99',
description: 'website for lossless.com' description: 'website for lossless.com'
} }

View File

@ -12,6 +12,26 @@ import { DeesWindowLayer } from './dees-windowlayer.js';
@customElement('dees-mobilenavigation') @customElement('dees-mobilenavigation')
export class DeesMobilenavigation extends DeesElement { export class DeesMobilenavigation extends DeesElement {
// STATIC
public static demo = () => html`
<dees-mobilenavigation
.menuItems="${[
{
name: 'hello1',
action: async () => {},
},
{
name: 'hello2',
action: async () => {},
},
{
name: 'hello3',
action: async () => {},
},
]}"
></dees-mobilenavigation>
`;
private static singletonRef: DeesMobilenavigation; private static singletonRef: DeesMobilenavigation;
public static async createAndInit(menuItemsArg: plugins.tsclass.website.IMenuItem[]) { public static async createAndInit(menuItemsArg: plugins.tsclass.website.IMenuItem[]) {
if (!this.singletonRef) { if (!this.singletonRef) {
@ -27,12 +47,24 @@ export class DeesMobilenavigation extends DeesElement {
// INSTANCE // INSTANCE
@property({ @property({
type: Object, type: Array,
})
public heading: string = `MENU`;
@property({
type: Array,
}) })
public menuItems: plugins.tsclass.website.IMenuItem[] = []; public menuItems: plugins.tsclass.website.IMenuItem[] = [];
readyDeferred = domtools.plugins.smartpromise.defer(); readyDeferred = domtools.plugins.smartpromise.defer();
constructor() {
super();
this.init().then(() => {
this.show();
});
}
/** /**
* inits the mobile navigation * inits the mobile navigation
*/ */
@ -52,12 +84,12 @@ export class DeesMobilenavigation extends DeesElement {
will-change: transform; will-change: transform;
position: fixed; position: fixed;
height: 100vh; height: 100vh;
min-width: 370px; min-width: 280px;
transform: translateX(200px); transform: translateX(200px);
color: #fff; color: #fff;
z-index: 250; z-index: 250;
opacity: 0; opacity: 0;
padding: 16px; padding: 16px 32px;
right: 0px; right: 0px;
top: 0px; top: 0px;
bottom: 0px; bottom: 0px;
@ -73,20 +105,34 @@ export class DeesMobilenavigation extends DeesElement {
} }
.menuItem { .menuItem {
text-align: center; text-align: left;
padding: 8px; padding: 8px;
margin-left: -8px;
margin-right: -8px;
cursor: pointer; cursor: pointer;
border-radius: 3px; border-radius: 3px;
} }
.menuItem:hover { .menuItem:hover {
background: #333; background: #333;
} }
.heading {
text-align: left;
font-size: 24px;
padding: 8px 0px;
font-family: 'Roboto';
font-weight: 300;
border-bottom: 1px dashed #444;
margin-top: 16px;
margin-bottom: 16px;
}
`, `,
]; ];
public render() { public render() {
return html` return html`
<div class="main"> <div class="main">
<div class="heading">${this.heading}</div>
${this.menuItems.map((menuItem) => { ${this.menuItems.map((menuItem) => {
return html` return html`
<div <div
@ -136,7 +182,7 @@ export class DeesMobilenavigation extends DeesElement {
this.windowLayer.hide(); this.windowLayer.hide();
} }
async disconnectedCallback () { async disconnectedCallback() {
document.body.removeChild(this.windowLayer); document.body.removeChild(this.windowLayer);
} }
} }