deno.land / x / netzo@0.5.16 / components / blocks / kanban / utils.ts

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// adapted from https://github.com/Georgegriff/react-dnd-kit-tailwind-shadcn-ui/blob/main/src/components/utils.tsimport { Active, DataRef, Over } from "../../../deps/@dnd-kit/core.ts";import type { CardDragData, GroupDragData } from "./kanban.tsx";
type DraggableData = GroupDragData | CardDragData;
export function hasDraggableData<T extends Active | Over>( entry: T | null | undefined,): entry is T & { data: DataRef<DraggableData>;} { if (!entry) return false;
const data = entry.data.current;
if (data?.type === "Group" || data?.type === "Item") return true;
return false;}
netzo

Version Info

Tagged at
a year ago