refactor(data-grid): drop unused gridRef/scrollbarGutter options from useDataGridColumnResize
This commit is contained in:
1 parent
6e7f0578b6
commit
e67e7730d1
3 files changed
+2
-8
No files matched your search
@@ -2650,8 +2650,6 @@ const { initColumnWidths, onResizeStart, autoFitColumn, renderedColumnWidths, to
|
|||||||
columns: visibleColumns,
|
columns: visibleColumns,
|
||||||
sourceRows: computed(() => props.result.rows),
|
sourceRows: computed(() => props.result.rows),
|
||||||
columnIndexes: visibleColumnIndexes,
|
columnIndexes: visibleColumnIndexes,
|
||||||
gridRef,
|
|
||||||
scrollbarGutter: gridScrollbarGutter,
|
|
||||||
});
|
});
|
||||||
const gridStyle = computed(() => ({
|
const gridStyle = computed(() => ({
|
||||||
...columnVars.value,
|
...columnVars.value,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { computed, ref } from "vue";
|
import { computed } from "vue";
|
||||||
import { describe, expect, it } from "vitest";
|
import { describe, expect, it } from "vitest";
|
||||||
import { DATA_GRID_COL_AUTO_FIT_MAX_WIDTH, DATA_GRID_COL_MAX_WIDTH, DATA_GRID_COL_MIN_WIDTH } from "@/lib/dataGrid/dataGridColumnWidth";
|
import { DATA_GRID_COL_AUTO_FIT_MAX_WIDTH, DATA_GRID_COL_MAX_WIDTH, DATA_GRID_COL_MIN_WIDTH } from "@/lib/dataGrid/dataGridColumnWidth";
|
||||||
import { DATA_GRID_ROW_NUM_WIDTH, resizeDataGridColumnWidth, useDataGridColumnResize } from "@/composables/useDataGridColumnResize";
|
import { DATA_GRID_ROW_NUM_WIDTH, resizeDataGridColumnWidth, useDataGridColumnResize } from "@/composables/useDataGridColumnResize";
|
||||||
@@ -8,8 +8,6 @@ function createResizeState(options: { columns: string[]; rows: Array<Array<strin
|
|||||||
columns: computed(() => options.columns),
|
columns: computed(() => options.columns),
|
||||||
sourceRows: computed(() => options.rows),
|
sourceRows: computed(() => options.rows),
|
||||||
columnIndexes: computed(() => options.columnIndexes ?? options.columns.map((_, index) => index)),
|
columnIndexes: computed(() => options.columnIndexes ?? options.columns.map((_, index) => index)),
|
||||||
gridRef: ref<HTMLDivElement>(),
|
|
||||||
scrollbarGutter: ref(0),
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { ref, computed, watch, type ComputedRef, type Ref } from "vue";
|
import { ref, computed, watch, type ComputedRef } from "vue";
|
||||||
import { calculateDataGridColumnWidth, DATA_GRID_AUTO_FIT_VALUE_TEXT_LIMIT, DATA_GRID_COL_AUTO_FIT_MAX_WIDTH, DATA_GRID_COL_MIN_WIDTH, DATA_GRID_SAMPLE_ROWS } from "@/lib/dataGrid/dataGridColumnWidth";
|
import { calculateDataGridColumnWidth, DATA_GRID_AUTO_FIT_VALUE_TEXT_LIMIT, DATA_GRID_COL_AUTO_FIT_MAX_WIDTH, DATA_GRID_COL_MIN_WIDTH, DATA_GRID_SAMPLE_ROWS } from "@/lib/dataGrid/dataGridColumnWidth";
|
||||||
|
|
||||||
type CellValue = string | number | boolean | null;
|
type CellValue = string | number | boolean | null;
|
||||||
@@ -13,8 +13,6 @@ export interface UseDataGridColumnResizeOptions {
|
|||||||
columns: ComputedRef<string[]>;
|
columns: ComputedRef<string[]>;
|
||||||
sourceRows: ComputedRef<CellValue[][]>;
|
sourceRows: ComputedRef<CellValue[][]>;
|
||||||
columnIndexes: ComputedRef<number[]>;
|
columnIndexes: ComputedRef<number[]>;
|
||||||
gridRef: Ref<HTMLDivElement | undefined>;
|
|
||||||
scrollbarGutter?: Ref<number>;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function useDataGridColumnResize(options: UseDataGridColumnResizeOptions) {
|
export function useDataGridColumnResize(options: UseDataGridColumnResizeOptions) {
|
||||||
|
|||||||
Reference in new issue
Block a user