Skip to content

Commit fba291a

Browse files
committed
refactor: fix lint errors
1 parent 243f29b commit fba291a

File tree

2 files changed

+32
-5
lines changed

2 files changed

+32
-5
lines changed

packages/modules/data-widgets/src/themesource/datawidgets/web/_datagrid.scss

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,24 @@ $root: ".widget-datagrid";
131131
align-self: center;
132132
}
133133

134+
/* Drag handle */
135+
.drag-handle {
136+
cursor: grab;
137+
pointer-events: auto;
138+
position: relative;
139+
width: 14px;
140+
padding: 0;
141+
flex-grow: 0;
142+
display: flex;
143+
justify-content: center;
144+
z-index: 1;
145+
146+
&:hover {
147+
background-color: var(--brand-primary-50, $brand-light);
148+
color: var(--brand-primary, $brand-primary);
149+
}
150+
}
151+
134152
&:focus:not(:focus-visible) {
135153
outline: none;
136154
}

packages/pluggableWidgets/datagrid-web/src/components/ColumnContainer.tsx

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
import classNames from "classnames";
2-
import { DragEventHandler, HTMLAttributes, KeyboardEvent, ReactElement, ReactNode, useMemo } from "react";
2+
import {
3+
DragEvent,
4+
DragEventHandler,
5+
HTMLAttributes,
6+
KeyboardEvent,
7+
MouseEvent,
8+
ReactElement,
9+
ReactNode,
10+
useMemo
11+
} from "react";
312
import { FaArrowsAltV } from "./icons/FaArrowsAltV";
413
import { FaLongArrowAltDown } from "./icons/FaLongArrowAltDown";
514
import { FaLongArrowAltUp } from "./icons/FaLongArrowAltUp";
@@ -94,25 +103,25 @@ export const ColumnContainer = observer(function ColumnContainer(props: ColumnCo
94103
});
95104

96105
function DragHandle({ draggable, onDragStart, onDragEnd }: DragHandleProps): ReactElement {
97-
const handleMouseDown = (e: React.MouseEvent) => {
106+
const handleMouseDown = (e: MouseEvent<HTMLSpanElement>): void => {
98107
// Only stop propagation, don't prevent default - we need default for drag to work
99108
e.stopPropagation();
100109
};
101110

102-
const handleClick = (e: React.MouseEvent) => {
111+
const handleClick = (e: MouseEvent<HTMLSpanElement>): void => {
103112
// Stop click events from bubbling to prevent sorting
104113
e.stopPropagation();
105114
e.preventDefault();
106115
};
107116

108-
const handleDragStart = (e: React.DragEvent<HTMLSpanElement>) => {
117+
const handleDragStart = (e: DragEvent<HTMLSpanElement>): void => {
109118
// Don't stop propagation here - let the drag start properly
110119
if (onDragStart) {
111120
onDragStart(e);
112121
}
113122
};
114123

115-
const handleDragEnd = (e: React.DragEvent<HTMLSpanElement>) => {
124+
const handleDragEnd = (e: DragEvent<HTMLSpanElement>): void => {
116125
if (onDragEnd) {
117126
onDragEnd(e);
118127
}

0 commit comments

Comments
 (0)