feat(grid): refine boolean editing and copy actions
This commit is contained in:
16 files changed
+188
-279
No files matched your search
@@ -2,7 +2,6 @@ import { ref, shallowRef, computed, nextTick, watch, getCurrentInstance, onActiv
|
||||
import * as api from "@/lib/backend/api";
|
||||
import type { CellValue } from "@/lib/dataGrid/cellValue";
|
||||
import { coerceDataGridCellValue, dataGridCellEditorText } from "@/lib/dataGrid/dataGridCellCoercion";
|
||||
import { nextBooleanCellValue } from "@/lib/dataGrid/dataGridBooleanColumn";
|
||||
import { focusDataGridEditorWithoutScrolling, preserveDataGridScrollPosition } from "@/lib/dataGrid/dataGridEditorFocus";
|
||||
import { normalizeDataGridSaveError } from "@/lib/dataGrid/dataGridSql";
|
||||
import { rowStatusFilterAfterAddingRow, type RowStatusFilter } from "@/lib/dataGrid/gridRowStatus";
|
||||
@@ -793,19 +792,6 @@ export function useDataGridEditor(options: UseDataGridEditorOptions) {
|
||||
}
|
||||
}
|
||||
|
||||
async function cycleBooleanCellValue(rowId: number, col: number, nullable: boolean) {
|
||||
if (!editable.value || !canEditColumn(col)) return;
|
||||
const item = getRowItem(rowId);
|
||||
if (!item || item.isDeleted) return;
|
||||
if (!item.isNew && !item.isDraft && !canEditExistingRows.value) return;
|
||||
if (isSavingNewRow(item)) return;
|
||||
const newVal = nextBooleanCellValue(item.data[col], nullable);
|
||||
isCancelling = false;
|
||||
suppressNextBlurCommit = false;
|
||||
editingCell.value = { rowId, col };
|
||||
await commitEditAndMaybeAutoSave({ explicitValue: newVal });
|
||||
}
|
||||
|
||||
async function commitEditFromBlur(options: CommitEditOptions = {}) {
|
||||
if (suppressNextBlurCommit) {
|
||||
suppressNextBlurCommit = false;
|
||||
@@ -1732,7 +1718,6 @@ export function useDataGridEditor(options: UseDataGridEditorOptions) {
|
||||
startEdit,
|
||||
commitEdit,
|
||||
commitEditAndMaybeAutoSave,
|
||||
cycleBooleanCellValue,
|
||||
commitEditFromBlur,
|
||||
applyCellValue,
|
||||
restoreCellValue,
|
||||
|
||||
Reference in new issue
Block a user