Skip to content

Commit 2e01436

Browse files
committed
fix lint
1 parent 213c278 commit 2e01436

File tree

3 files changed

+16
-25
lines changed

3 files changed

+16
-25
lines changed

packages/core/src/data-editor/data-editor.tsx

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1433,11 +1433,7 @@ const DataEditorImpl: React.ForwardRefRenderFunction<DataEditorRef, DataEditorPr
14331433
);
14341434

14351435
const reselect = React.useCallback(
1436-
(
1437-
bounds: Rectangle,
1438-
activation: CellActivatedEventArgs,
1439-
initialValue?: string
1440-
) => {
1436+
(bounds: Rectangle, activation: CellActivatedEventArgs, initialValue?: string) => {
14411437
if (gridSelection.current === undefined) return;
14421438

14431439
const [col, row] = gridSelection.current.cell;
@@ -1474,11 +1470,7 @@ const DataEditorImpl: React.ForwardRefRenderFunction<DataEditorRef, DataEditorPr
14741470
forceEditMode: initialValue !== undefined,
14751471
activation,
14761472
});
1477-
} else if (
1478-
c.kind === GridCellKind.Boolean &&
1479-
activation.inputType === "keyboard" &&
1480-
c.readonly !== true
1481-
) {
1473+
} else if (c.kind === GridCellKind.Boolean && activation.inputType === "keyboard" && c.readonly !== true) {
14821474
mangledOnCellsEdited([
14831475
{
14841476
location: gridSelection.current.cell,
@@ -2070,6 +2062,7 @@ const DataEditorImpl: React.ForwardRefRenderFunction<DataEditorRef, DataEditorPr
20702062
mapper,
20712063
lastRowSticky,
20722064
setCurrent,
2065+
headerRowMarkerDisabled,
20732066
setSelectedColumns,
20742067
setGridSelection,
20752068
onSelectionCleared,
@@ -2399,14 +2392,16 @@ const DataEditorImpl: React.ForwardRefRenderFunction<DataEditorRef, DataEditorPr
23992392
}
24002393
}
24012394
if (shouldActivate) {
2402-
const act = a.isDoubleClick ? "double-click" : (c.activationBehaviorOverride ?? cellActivationBehavior);
2403-
const activationEvent: CellActivatedEventArgs = {
2404-
inputType: "pointer",
2405-
pointerActivation: act,
2406-
pointerType: a.isTouch ? "touch" : "mouse",
2407-
};
2408-
onCellActivated?.([col - rowMarkerOffset, row], activationEvent);
2409-
reselect(a.bounds, activationEvent);
2395+
const act = a.isDoubleClick === true
2396+
? "double-click"
2397+
: (c.activationBehaviorOverride ?? cellActivationBehavior);
2398+
const activationEvent: CellActivatedEventArgs = {
2399+
inputType: "pointer",
2400+
pointerActivation: act,
2401+
pointerType: a.isTouch ? "touch" : "mouse",
2402+
};
2403+
onCellActivated?.([col - rowMarkerOffset, row], activationEvent);
2404+
reselect(a.bounds, activationEvent);
24102405
return true;
24112406
}
24122407
}
@@ -3569,7 +3564,7 @@ const DataEditorImpl: React.ForwardRefRenderFunction<DataEditorRef, DataEditorPr
35693564
formatted?: string | string[]
35703565
): EditListItem | undefined {
35713566
const stringifiedRawValue =
3572-
typeof rawValue === "object" ? rawValue?.join("\n") ?? "" : rawValue?.toString() ?? "";
3567+
typeof rawValue === "object" ? (rawValue?.join("\n") ?? "") : (rawValue?.toString() ?? "");
35733568

35743569
if (!isInnerOnlyCell(inner) && isReadWriteCell(inner) && inner.readonly !== true) {
35753570
const coerced = coercePasteValue?.(stringifiedRawValue, inner);

packages/core/src/internal/data-grid/data-grid.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1718,7 +1718,7 @@ const DataGrid: React.ForwardRefRenderFunction<DataGridRef, DataGridProps> = (p,
17181718
return getMouseArgsForPosition(canvasRef.current, posX, posY, ev);
17191719
}
17201720
}),
1721-
[canvasRef, damage, getBoundsForItem]
1721+
[canvasRef, damage, getBoundsForItem, getMouseArgsForPosition]
17221722
);
17231723

17241724
const lastFocusedSubdomNode = React.useRef<Item>();

packages/core/src/internal/data-grid/event-args.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,22 +101,18 @@ export interface HeaderClickedEventArgs extends GridMouseHeaderEventArgs, Preven
101101
/** @category Types */
102102
export interface GroupHeaderClickedEventArgs extends GridMouseGroupHeaderEventArgs, PreventableEvent {}
103103

104-
/** Shared fields (if any) go here */
105104
export interface BaseCellActivatedEvent {}
106105

107106
/** Keyboard-initiated activation */
108107
export interface KeyboardCellActivatedEvent extends BaseCellActivatedEvent {
109108
readonly inputType: "keyboard";
110-
/** Physical key the user pressed – always present in this variant */
111109
readonly key: string;
112110
}
113111

114-
/** Pointer-initiated activation (mouse, touch, pen…) */
112+
/** Pointer-initiated activation */
115113
export interface PointerCellActivatedEvent extends BaseCellActivatedEvent {
116114
readonly inputType: "pointer";
117-
/** Activation reason: double-click, second-click, single-click, etc. */
118115
readonly pointerActivation: CellActiviationBehavior;
119-
/** Optional – distinguishes mouse vs touch vs pen if you like */
120116
readonly pointerType?: "mouse" | "touch" | "pen";
121117
}
122118

0 commit comments

Comments
 (0)