blob: a9332de8b6ffe24fcf31fd08f7c1eab40147fee9 [file] [log] [blame]
Adrià Vilanova Martínezf276ac72022-10-13 22:16:22 +02001import '@material/web/fab/fab.js';
2import './components/List.js';
3import './components/AddDialog.js';
4
5import {css, html, LitElement} from 'lit';
6import {createRef, ref} from 'lit/directives/ref.js';
7
8import {SHARED_MD3_STYLES} from '../../common/styles/md3.js';
9
10export default class WFApp extends LitElement {
11 static styles = [
12 SHARED_MD3_STYLES,
13 css`
14 :host {
15 font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI',
16 Helvetica, Arial, sans-serif, 'Apple Color Emoji',
17 'Segoe UI Emoji', 'Segoe UI Symbol'!important;
18
19 display: block;
20 max-width: 1024px;
21 margin: auto;
22 position: relative;
23 }
24
25 md-fab {
26 position: fixed;
27 bottom: 2em;
28 right: 2em;
29 }
30 `,
31 ];
32
33 addFabRef = createRef();
34
35 render() {
36 return html`
37 <h1>Workflows</h1>
38 <wf-list></wf-list>
39 <md-fab ${ref(this.addFabRef)}
40 icon="add"
41 @click=${this._showAddDialog}>
42 </md-fab>
43 <wf-add-dialog></wf-add-dialog>
44 `;
45 }
46
47 _showAddDialog() {
48 this.renderRoot.querySelector('wf-add-dialog').open = true;
49 }
50}
51window.customElements.define('wf-app', WFApp);