feat(book/table): set up sample grid

This commit is contained in:
Elian Doran
2025-06-25 10:49:33 +03:00
parent 1b5dd4638d
commit 894a26cc67
2 changed files with 33 additions and 1 deletions

View File

@@ -1,3 +1,4 @@
import renderTable from "./table_view/renderer";
import ViewMode, { ViewModeArgs } from "./view_mode";
const TPL = /*html*/`
@@ -10,20 +11,28 @@ const TPL = /*html*/`
user-select: none;
padding: 10px;
}
.table-view-container {
height: 100%;
}
</style>
<p>Table view goes here.</p>
<div class="table-view-container">
<p>Table view goes here.</p>
</div>
</div>
`;
export default class TableView extends ViewMode {
private $root: JQuery<HTMLElement>;
private $container: JQuery<HTMLElement>;
constructor(args: ViewModeArgs) {
super(args);
this.$root = $(TPL);
this.$container = this.$root.find(".table-view-container");
args.$parent.append(this.$root);
}
@@ -32,6 +41,8 @@ export default class TableView extends ViewMode {
}
async renderList() {
this.$container.empty();
renderTable(this.$container[0]);
return this.$root;
}