Fixes, dump deps.

This commit is contained in:
trading_peter 2023-09-19 15:40:12 +02:00
parent 5eca76ac5e
commit 55611a63e9
3 changed files with 18 additions and 12 deletions

View File

@ -13,11 +13,11 @@
"author": "trading_peter",
"license": "Apache-2.0",
"dependencies": {
"@lit-labs/virtualizer": "^1.0.1",
"@tp/helpers": "^1.1.3",
"@tp/tp-checkbox": "^1.0.4",
"@lit-labs/virtualizer": "^2.0.7",
"@tp/helpers": "^2.1.0",
"@tp/tp-checkbox": "^1.0.7",
"@tp/tp-icon": "^1.0.1",
"@tp/tp-scroll-threshold": "^1.0.0",
"lit": "^2.2.6"
"lit": "^2.8.0"
}
}

View File

@ -80,8 +80,8 @@ class TpTableItem extends BaseElement {
` : null}
${Array.isArray(columns) ? columns.map((column, idx) => {
if (column.visible !== true && column.required !== true) return;
return this.renderColumn(column, item, idx) || null;
}) : null
return this.renderColumn(column, item, idx) || null;
}) : null
}
</div>
`;

View File

@ -182,12 +182,7 @@ export class TpTable extends DomQuery(LitElement) {
return html`
<div class="wrap">
<div id="tableHeader" part="header" class="list-headline" @track=${this._colResizeTracked}>
${this.selectable ? html`
<div class="select-col" part="chkAll"><tp-checkbox @toggled=${e => this._checkedChanged(e)}></tp-checkbox></div>
` : null}
${columns.map(column => this.renderColumnHeader(column))}
</div>
${this.renderTableHeader(columns)}
<div class="list" @row-selection-changed=${(e) => this._selectionChanged(e)}>
${this._emptyMessage}
<lit-virtualizer id="virtualList" part="list" @scroll=${this._onScroll} scroller .items=${items} .renderItem=${(item, idx) => this.renderItem(item, idx, columns, this._selItems.has(this.getItemId(item)))}></lit-virtualizer>
@ -198,6 +193,17 @@ export class TpTable extends DomQuery(LitElement) {
`;
}
renderTableHeader(columns) {
return html`
<div id="tableHeader" part="header" class="list-headline" @track=${this._colResizeTracked}>
${this.selectable ? html`
<div class="select-col" part="chkAll"><tp-checkbox @toggled=${e => this._checkedChanged(e)}></tp-checkbox></div>
` : null}
${columns.map(column => this.renderColumnHeader(column))}
</div>
`;
}
renderColumnHeader(column) {
if (column.visible !== true && column.required !== true) return null;