fix(grid): restore data grid rendering
This commit is contained in:
2 files changed
+16
-8
No files matched your search
@@ -436,6 +436,14 @@ const props = withDefaults(defineProps<DataGridProps>(), {
|
|||||||
allowDeleteRows: undefined,
|
allowDeleteRows: undefined,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const tableColumnsByResultIndex = computed(() =>
|
||||||
|
resolveDataGridColumnsByResultIndex({
|
||||||
|
resultColumns: props.result.columns,
|
||||||
|
sourceColumns: props.sourceColumns,
|
||||||
|
tableColumns: props.tableMeta?.columns ?? [],
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
|
||||||
const dataGridTraceId = uuid().slice(0, 8);
|
const dataGridTraceId = uuid().slice(0, 8);
|
||||||
const dataGridCreatedAt = performance.now();
|
const dataGridCreatedAt = performance.now();
|
||||||
const dataGridElapsed = () => `${Math.round(performance.now() - dataGridCreatedAt)}ms`;
|
const dataGridElapsed = () => `${Math.round(performance.now() - dataGridCreatedAt)}ms`;
|
||||||
@@ -3777,14 +3785,6 @@ function measureCellTextWidthCached(text: string, font: string): number {
|
|||||||
return width;
|
return width;
|
||||||
}
|
}
|
||||||
|
|
||||||
const tableColumnsByResultIndex = computed(() =>
|
|
||||||
resolveDataGridColumnsByResultIndex({
|
|
||||||
resultColumns: props.result.columns,
|
|
||||||
sourceColumns: props.sourceColumns,
|
|
||||||
tableColumns: props.tableMeta?.columns ?? [],
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
|
|
||||||
function tableColumnForGridColumn(columnIndex: number): ColumnInfo | undefined {
|
function tableColumnForGridColumn(columnIndex: number): ColumnInfo | undefined {
|
||||||
return tableColumnsByResultIndex.value[columnIndex];
|
return tableColumnsByResultIndex.value[columnIndex];
|
||||||
}
|
}
|
||||||
|
|||||||
+8
@@ -4,6 +4,14 @@ import { describe, expect, it } from "vitest";
|
|||||||
const dataGridSource = readFileSync(new URL("../DataGrid.vue", import.meta.url), "utf8");
|
const dataGridSource = readFileSync(new URL("../DataGrid.vue", import.meta.url), "utf8");
|
||||||
|
|
||||||
describe("DataGrid setup initialization order", () => {
|
describe("DataGrid setup initialization order", () => {
|
||||||
|
it("initializes table column metadata before column width measurement", () => {
|
||||||
|
const tableColumnMetadataDeclaration = dataGridSource.indexOf("const tableColumnsByResultIndex = computed");
|
||||||
|
const columnResizeInitialization = dataGridSource.indexOf("useDataGridColumnResize({");
|
||||||
|
|
||||||
|
expect(tableColumnMetadataDeclaration).toBeGreaterThanOrEqual(0);
|
||||||
|
expect(columnResizeInitialization).toBeGreaterThan(tableColumnMetadataDeclaration);
|
||||||
|
});
|
||||||
|
|
||||||
it("initializes where-search capability before the immediate filter preview watcher", () => {
|
it("initializes where-search capability before the immediate filter preview watcher", () => {
|
||||||
const canUseWhereSearchDeclaration = dataGridSource.indexOf("const canUseWhereSearch = computed");
|
const canUseWhereSearchDeclaration = dataGridSource.indexOf("const canUseWhereSearch = computed");
|
||||||
const filterPreviewDeclaration = dataGridSource.indexOf("const filterPreviewVisible = computed");
|
const filterPreviewDeclaration = dataGridSource.indexOf("const filterPreviewVisible = computed");
|
||||||
|
|||||||
Reference in new issue
Block a user