'use strict'
/*
Open Rowing Monitor, https://github.com/laberning/openrowingmonitor
Component that renders the action buttons of the dashboard
*/
import { AppElement, html, css } from './AppElement.js'
import { customElement, property, queryAll } from 'lit/decorators.js'
import { icon_settings } from '../lib/icons.js'
import './AppDialog.js'
@customElement('settings-dialog')
export class DashboardActions extends AppElement {
static styles = css`
.metric-selector-feedback{
font-size: 0.4em;
padding-top: 8px;
}
.metric-selector-feedback>div {
display: grid;
grid-template-columns: repeat(4,1fr);
grid-template-rows: repeat(2, max-content);
gap: 8px;
}
.settings-dialog>div.metric-selector{
display: grid;
grid-template-columns: repeat(4,max-content);
grid-template-rows: repeat(3, max-content);
gap: 8px;
}
.settings-dialog>div>label{
font-size: 0.6em;
}
input[type="checkbox"]{
cursor: pointer;
align-self: center;
width: 1.5em;
height: 1.5em;
}
.icon {
height: 1.6em;
}
legend{
text-align: center;
}
table {
min-height: 70px;
margin-top: 8px;
width: 100%;
}
table, th, td {
font-size: 0.8em;
border: 1px solid white;
border-collapse: collapse;
}
tr {
height: 50%;
}
th, td {
padding: 8px;
text-align: center;
background-color: var(--theme-widget-color);
}
`
@property({ type: Object })
config
@queryAll('input')
inputs
static get properties () {
return {
selectedMetrics: { type: Array },
sumSelectedSlots: { type: Number },
isValid: { type: Boolean }
}
}
constructor () {
super()
this.selectedMetrics = []
this.sumSelectedSlots = 0
this.isValid = false
}
@property({ type: Object })
icon
render () {
return html`
Select metrics to be shown:
${this.renderSelectedMetrics()}