2023-09-09 11:34:46 +00:00
|
|
|
import { demoFunc } from './dees-simple-appdash.demo.js';
|
|
|
|
import {
|
|
|
|
customElement,
|
|
|
|
html,
|
|
|
|
DeesElement,
|
|
|
|
property,
|
|
|
|
type TemplateResult,
|
|
|
|
cssManager,
|
|
|
|
css,
|
|
|
|
unsafeCSS,
|
|
|
|
type CSSResult,
|
|
|
|
state,
|
|
|
|
} from '@design.estate/dees-element';
|
|
|
|
|
|
|
|
declare global {
|
|
|
|
interface HTMLElementTagNameMap {
|
|
|
|
'dees-simple-appdash': DeesSimpleAppDash;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@customElement('dees-simple-appdash')
|
|
|
|
export class DeesSimpleAppDash extends DeesElement {
|
|
|
|
// STATIC
|
|
|
|
public static demo = demoFunc;
|
|
|
|
// INSTANCE
|
|
|
|
|
|
|
|
@property()
|
2023-09-12 23:37:02 +00:00
|
|
|
public name = 'Dees Simple Login';
|
2023-09-09 11:34:46 +00:00
|
|
|
|
2024-01-22 00:26:13 +00:00
|
|
|
@property()
|
|
|
|
public views: Array<{ name: string; icon: string; viewFunction: () => Promise<TemplateResult> }> = [];
|
|
|
|
|
2023-09-09 11:34:46 +00:00
|
|
|
public static styles = [
|
|
|
|
cssManager.defaultStyles,
|
|
|
|
css`
|
|
|
|
:host {
|
2024-01-22 00:26:13 +00:00
|
|
|
color: ${cssManager.bdTheme('#333', '#ccc')};
|
2023-09-09 11:34:46 +00:00
|
|
|
user-select: none;
|
|
|
|
}
|
|
|
|
.appbar {
|
2024-01-21 23:59:25 +00:00
|
|
|
position: fixed;
|
2023-09-09 11:34:46 +00:00
|
|
|
top: 0;
|
|
|
|
height: 40px;
|
|
|
|
width: 100%;
|
2024-01-22 00:26:13 +00:00
|
|
|
background: ${cssManager.bdTheme('#eeeeeb', '#222')};
|
|
|
|
border-bottom: 1px solid ${cssManager.bdTheme('#ccc', '#ffffff10')};
|
2023-09-09 11:34:46 +00:00
|
|
|
font-size: 14px;
|
|
|
|
line-height: 40px;
|
2023-10-05 12:36:59 +00:00
|
|
|
font-family: 'Roboto', 'Inter', sans-serif;
|
2023-09-09 11:34:46 +00:00
|
|
|
padding: 0px 16px;
|
2024-01-22 00:11:28 +00:00
|
|
|
z-index: 2;
|
2024-01-22 00:29:27 +00:00
|
|
|
box-shadow: 0px 4px 10px 0px rgba(0, 0, 0, 0.8);
|
2024-01-22 00:11:28 +00:00
|
|
|
display: grid;
|
2024-01-22 00:26:13 +00:00
|
|
|
grid-template-columns: min-content 1fr auto;
|
|
|
|
}
|
|
|
|
|
|
|
|
.appName {
|
|
|
|
white-space: nowrap;
|
2023-09-09 11:34:46 +00:00
|
|
|
}
|
2024-01-22 00:11:28 +00:00
|
|
|
|
|
|
|
.appActions {
|
|
|
|
display: flex;
|
|
|
|
}
|
|
|
|
|
2024-01-22 00:26:13 +00:00
|
|
|
.appActions .action {}
|
|
|
|
.appActions .action:hover {
|
|
|
|
color: ${cssManager.bdTheme('#000', '#fff')};
|
|
|
|
}
|
|
|
|
|
2023-09-09 11:34:46 +00:00
|
|
|
.appcontent {
|
2024-01-22 00:11:28 +00:00
|
|
|
z-index: 1;
|
2024-01-21 23:59:25 +00:00
|
|
|
position: fixed;
|
2023-09-09 11:34:46 +00:00
|
|
|
top: 40px;
|
2024-01-22 00:11:28 +00:00
|
|
|
height: calc(100vh - 40px);
|
2024-01-21 23:59:25 +00:00
|
|
|
bottom: 0px;
|
2023-09-09 11:34:46 +00:00
|
|
|
width: 100%;
|
2024-01-21 23:59:25 +00:00
|
|
|
overflow: auto;
|
2023-09-09 11:34:46 +00:00
|
|
|
background: ${cssManager.bdTheme('#eeeeeb', '#000')};
|
|
|
|
}
|
|
|
|
`,
|
|
|
|
];
|
|
|
|
|
|
|
|
public render(): TemplateResult {
|
|
|
|
return html`
|
|
|
|
<div class="appbar">
|
2024-01-22 00:11:28 +00:00
|
|
|
<div class="appName">${this.name}</div>
|
2024-01-22 00:26:13 +00:00
|
|
|
<div class="viewTabs"></div>
|
2024-01-22 00:11:28 +00:00
|
|
|
<div class="appActions">
|
|
|
|
<div class="action">
|
|
|
|
Logout
|
|
|
|
</div>
|
|
|
|
</div>
|
2023-09-09 11:34:46 +00:00
|
|
|
</div>
|
|
|
|
<div class="appcontent">
|
|
|
|
<slot></slot>
|
|
|
|
</div>
|
|
|
|
`;
|
|
|
|
}
|
|
|
|
|
|
|
|
public async firstUpdated(_changedProperties): Promise<void> {
|
|
|
|
const domtools = await this.domtoolsPromise;
|
|
|
|
super.firstUpdated(_changedProperties);
|
|
|
|
}
|
|
|
|
}
|