fix(core): update
This commit is contained in:
parent
369437ceba
commit
7941628d1d
@ -73,7 +73,7 @@ export class DeesTable<T> extends DeesElement {
|
|||||||
public heading2: string;
|
public heading2: string;
|
||||||
|
|
||||||
@property({
|
@property({
|
||||||
type: Array
|
type: Array,
|
||||||
})
|
})
|
||||||
public data: T[] = [];
|
public data: T[] = [];
|
||||||
|
|
||||||
@ -142,6 +142,9 @@ export class DeesTable<T> extends DeesElement {
|
|||||||
tr:first-child:hover .innerCellContainer {
|
tr:first-child:hover .innerCellContainer {
|
||||||
background: none;
|
background: none;
|
||||||
}
|
}
|
||||||
|
tr.selected .innerCellContainer {
|
||||||
|
background: #ffffff20
|
||||||
|
}
|
||||||
th {
|
th {
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
}
|
}
|
||||||
@ -192,28 +195,39 @@ export class DeesTable<T> extends DeesElement {
|
|||||||
return html`
|
return html`
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
${headings.map(headingArg => html`
|
${headings.map(
|
||||||
|
(headingArg) => html`
|
||||||
<th>
|
<th>
|
||||||
<div class="innerCellContainer">${headingArg}</div>
|
<div class="innerCellContainer">${headingArg}</div>
|
||||||
</th>
|
</th>
|
||||||
`)}
|
`
|
||||||
|
)}
|
||||||
</tr>
|
</tr>
|
||||||
${this.data.map(itemArg => html`
|
${this.data.map(
|
||||||
<tr>
|
(itemArg) => html`
|
||||||
${headings.map(headingArg => html`
|
<tr
|
||||||
|
@click=${() => {
|
||||||
|
this.selectedDataRow = itemArg;
|
||||||
|
}}
|
||||||
|
class="${itemArg === this.selectedDataRow ? 'selected' : ''}"
|
||||||
|
>
|
||||||
|
${headings.map(
|
||||||
|
(headingArg) => html`
|
||||||
<td>
|
<td>
|
||||||
<div class="innerCellContainer">${itemArg[headingArg]}</div>
|
<div class="innerCellContainer">${itemArg[headingArg]}</div>
|
||||||
</td>
|
</td>
|
||||||
`)}
|
`
|
||||||
|
)}
|
||||||
</tr>
|
</tr>
|
||||||
`)}
|
`
|
||||||
|
)}
|
||||||
</table>
|
</table>
|
||||||
`;
|
`;
|
||||||
})()
|
})()
|
||||||
: html` <div class="noDataSet">No data set!</div> `}
|
: html` <div class="noDataSet">No data set!</div> `}
|
||||||
<div class="tableStatistics">
|
<div class="tableStatistics">
|
||||||
${this.data.length} data rows (total) |
|
${this.data.length} data rows (total) |
|
||||||
${this.selectedDataRow ? html`` : html`No row selected`}
|
${this.selectedDataRow ? html`Row ${this.data.indexOf(this.selectedDataRow) + 1} selected` : html`No row selected`}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
Loading…
Reference in New Issue
Block a user