From 55611a63e9e021e01fa9d13f50d1d8c52b4f0c20 Mon Sep 17 00:00:00 2001 From: pk Date: Tue, 19 Sep 2023 15:40:12 +0200 Subject: [PATCH] Fixes, dump deps. --- package.json | 8 ++++---- tp-table-item.js | 4 ++-- tp-table.js | 18 ++++++++++++------ 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index 584350c..a7f74af 100644 --- a/package.json +++ b/package.json @@ -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" } } diff --git a/tp-table-item.js b/tp-table-item.js index 8174a10..ef38440 100644 --- a/tp-table-item.js +++ b/tp-table-item.js @@ -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 } `; diff --git a/tp-table.js b/tp-table.js index 28a404a..5eb1c78 100644 --- a/tp-table.js +++ b/tp-table.js @@ -182,12 +182,7 @@ export class TpTable extends DomQuery(LitElement) { return html`
-
- ${this.selectable ? html` -
this._checkedChanged(e)}>
- ` : null} - ${columns.map(column => this.renderColumnHeader(column))} -
+ ${this.renderTableHeader(columns)}
this._selectionChanged(e)}> ${this._emptyMessage} this.renderItem(item, idx, columns, this._selItems.has(this.getItemId(item)))}> @@ -198,6 +193,17 @@ export class TpTable extends DomQuery(LitElement) { `; } + renderTableHeader(columns) { + return html` +
+ ${this.selectable ? html` +
this._checkedChanged(e)}>
+ ` : null} + ${columns.map(column => this.renderColumnHeader(column))} +
+ `; + } + renderColumnHeader(column) { if (column.visible !== true && column.required !== true) return null;