import React from "react"; import { CaretDownCircleFillIcon, CaretUpCircleFillIcon, DragVerticalIcon, } from "@navikt/aksel-icons"; import { Floating } from "../../../utils/components/floating/Floating"; export interface DataDragAndDropDragHandlerProps { /** * Whether the drag handler is disabled */ // disabled?: boolean; /** * Wether dragging is done by keyboard. Used to conditionally render drag indicators. */ keyboardDragging?: boolean; /** * Handle ref is forwarded to the button element serving as drag handle. */ handleRef: React.Ref; // Just for testing purposes, to render an alternative drag handler alt?: boolean; } /** * DataDragAndDropDragHandler * * A button component that serves as a drag handle for drag and drop operations. * Can be used to initiate dragging of elements in a data table or list. */ export const DataDragAndDropDragHandler = React.forwardRef< HTMLButtonElement, DataDragAndDropDragHandlerProps >(({ keyboardDragging, handleRef, alt }) => { if (alt) { return (
{keyboardDragging && ( )}
{keyboardDragging && ( )}
); } return ( {keyboardDragging && ( )}
{keyboardDragging && ( )}
); });