web: add TablePage

This commit is contained in:
Jens Langhammer
2020-11-30 23:49:33 +01:00
parent 8e25970c01
commit a312ad2ad1
9 changed files with 90 additions and 11 deletions

View File

@ -6,7 +6,7 @@ import { COMMON_STYLES } from "../../common/styles";
export abstract class Table<T> extends LitElement {
abstract apiEndpoint(page: number): Promise<PBResponse<T>>;
abstract columns(): Array<string>;
abstract row(item: any): Array<string>;
abstract row(item: T): Array<string>;
@property()
data?: PBResponse<T>;
@ -61,7 +61,7 @@ export abstract class Table<T> extends LitElement {
});
}
render() {
renderTable() {
if (!this.data) {
this.fetch();
}
@ -103,4 +103,8 @@ export abstract class Table<T> extends LitElement {
></pb-table-pagination>
</div>`;
}
render() {
return this.renderTable();
}
}