formatted files

This commit is contained in:
Fran Jurmanović
2021-06-11 19:06:43 +02:00
parent 47f6207798
commit 130246ca88
70 changed files with 3281 additions and 21038 deletions

View File

@@ -1,2 +1,2 @@
export * from "./menu-layout/MenuLayoutElement";
export * from "./initial-layout/InitialLayoutElement";
export * from './menu-layout/MenuLayoutElement';
export * from './initial-layout/InitialLayoutElement';

View File

@@ -1,31 +1,31 @@
import { controller, target } from "@github/catalyst";
import { closest } from "core/utils";
import { html, TemplateResult } from "lit-html";
import { BaseLayoutElement } from "common/layouts";
import { AppMainElement } from "components/";
import { controller, target } from '@github/catalyst';
import { closest } from 'core/utils';
import { html, TemplateResult } from 'lit-html';
import { BaseLayoutElement } from 'common/layouts';
import { AppMainElement } from 'components/';
@controller
class InitialLayoutElement extends BaseLayoutElement {
@closest appMain: AppMainElement;
@target appPage: HTMLDivElement;
@closest appMain: AppMainElement;
@target appPage: HTMLDivElement;
constructor() {
super();
}
constructor() {
super();
}
elementConnected = (): void => {
this.update();
};
elementConnected = (): void => {
this.update();
};
elementDisconnected = (appMain: AppMainElement): void => {};
elementDisconnected = (appMain: AppMainElement): void => {};
render = (): TemplateResult => {
return html`
<div data-target="initial-layout.appPage">
<app-slot data-target="initial-layout.appSlot"></app-slot>
</div>
`;
};
render = (): TemplateResult => {
return html`
<div data-target="initial-layout.appPage">
<app-slot data-target="initial-layout.appSlot"></app-slot>
</div>
`;
};
}
export type { InitialLayoutElement };

View File

@@ -1,50 +1,50 @@
import { controller, target } from "@github/catalyst";
import { closest } from "core/utils";
import { html, TemplateResult } from "lit-html";
import { BaseLayoutElement } from "common/layouts";
import { AppMainElement } from "components/";
import { controller, target } from '@github/catalyst';
import { closest } from 'core/utils';
import { html, TemplateResult } from 'lit-html';
import { BaseLayoutElement } from 'common/layouts';
import { AppMainElement } from 'components/';
@controller
class MenuLayoutElement extends BaseLayoutElement {
@closest appMain: AppMainElement;
@target appPage: HTMLDivElement;
@closest appMain: AppMainElement;
@target appPage: HTMLDivElement;
constructor() {
super();
}
constructor() {
super();
}
elementConnected = (): void => {
this.update();
this.appMain.addEventListener("tokenchange", this.updateAuth);
this.appMain.addEventListener("routechanged", this.updateAuth);
};
elementConnected = (): void => {
this.update();
this.appMain.addEventListener('tokenchange', this.updateAuth);
this.appMain.addEventListener('routechanged', this.updateAuth);
};
elementDisconnected = (appMain: AppMainElement): void => {
appMain?.removeEventListener("tokenchange", this.updateAuth);
appMain?.removeEventListener("routechanged", this.updateAuth);
};
elementDisconnected = (appMain: AppMainElement): void => {
appMain?.removeEventListener('tokenchange', this.updateAuth);
appMain?.removeEventListener('routechanged', this.updateAuth);
};
get isAuth(): boolean {
const _is = this.appMain?.routerService?.routerState?.middleware;
if (typeof _is == "function") {
return _is();
}
return !!_is;
}
get isAuth(): boolean {
const _is = this.appMain?.routerService?.routerState?.middleware;
if (typeof _is == 'function') {
return _is();
}
return !!_is;
}
updateAuth = (): void => {
this.update();
};
updateAuth = (): void => {
this.update();
};
render = (): TemplateResult => {
const _isAuth = this.isAuth;
return html`
<div data-target="menu-layout.appPage">
${_isAuth ? html`<app-menu></app-menu>` : html``}
<app-slot data-target="menu-layout.appSlot"></app-slot>
</div>
`;
};
render = (): TemplateResult => {
const _isAuth = this.isAuth;
return html`
<div data-target="menu-layout.appPage">
${_isAuth ? html`<app-menu></app-menu>` : html``}
<app-slot data-target="menu-layout.appSlot"></app-slot>
</div>
`;
};
}
export type { MenuLayoutElement };