Add column resizing and reordering
All checks were successful
build / build (push) Successful in 1m26s

This commit is contained in:
2025-04-24 20:16:19 +09:30
parent 53f27e4b22
commit 5d8bd10e92
2 changed files with 7 additions and 5 deletions

View File

@@ -12,10 +12,8 @@ export interface RowsResponse {
totalRows: bigint;
}
const whitespaceRegex = /\s*/g;
const sanitisedFileName = (file: File) =>
file.name.toLowerCase().replaceAll("'", '').replaceAll(whitespaceRegex, '');
file.name.toLowerCase().replaceAll("'", '').replaceAll(/\s*/g, '');
//https://www.npmjs.com/package/@duckdb/duckdb-wasm
@Injectable({

View File

@@ -21,8 +21,12 @@ import { Column, DuckdbService } from '../duckdb.service';
template: `
@if (file() && columns().length > 0) {
<p-table
[reorderableColumns]="true"
[resizableColumns]="true"
columnResizeMode="expand"
[columns]="columns()"
[value]="currentValue()"
showGridlines
[scrollable]="true"
scrollHeight="400px"
[rows]="100"
@@ -34,7 +38,7 @@ import { Column, DuckdbService } from '../duckdb.service';
<ng-template #header let-columns>
<tr>
@for (col of columns; track $index) {
<th style="width: 20%">
<th style="width: 20%" pReorderableColumn pResizableColumn>
{{ col.name }}
</th>
}
@@ -43,7 +47,7 @@ import { Column, DuckdbService } from '../duckdb.service';
<ng-template #body let-rowData let-columns="columns">
<tr style="height: 46px">
@for (col of columns; track $index) {
<td>
<td pReorderableRowHandle>
{{ rowData[col.name] }}
</td>
}