diff --git a/package-lock.json b/package-lock.json index e70f151..38fe0b5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,7 @@ "license": "MIT", "dependencies": { "@jalik/observer": "github:jalik/js-observer", + "@thisbeyond/solid-dnd": "^0.7.4", "babel-preset-solid": "^1.7.7", "solid-js": "^1.7.11" }, @@ -1309,6 +1310,14 @@ "@svgr/core": "^6.0.0" } }, + "node_modules/@thisbeyond/solid-dnd": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/@thisbeyond/solid-dnd/-/solid-dnd-0.7.4.tgz", + "integrity": "sha512-jgV9EtR3gAtVsILG8p1OAGrhHIgnK4W04YxpyLgJRCDKEFYQWuDrMdUe8F5Kc6pcVXlC4IMXr4cB8fS2Ut3/Ow==", + "peerDependencies": { + "solid-js": "^1.5" + } + }, "node_modules/@types/codemirror": { "version": "5.60.8", "resolved": "https://registry.npmjs.org/@types/codemirror/-/codemirror-5.60.8.tgz", diff --git a/package.json b/package.json index 71e570a..d1cf5c1 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ }, "dependencies": { "@jalik/observer": "github:jalik/js-observer", + "@thisbeyond/solid-dnd": "^0.7.4", "babel-preset-solid": "^1.7.7", "solid-js": "^1.7.11" } diff --git a/src/Globals.d.ts b/src/Globals.d.ts index d92ca48..21f6e92 100644 --- a/src/Globals.d.ts +++ b/src/Globals.d.ts @@ -9,6 +9,9 @@ declare module "solid-js" { interface Directives { // use:clickOutside clickOutside: ()=>void; + + draggable: boolean; + sortable: boolean; } } } diff --git a/src/Views/components/GridView.tsx b/src/Views/components/GridView.tsx index d3f757f..f9e6d7a 100644 --- a/src/Views/components/GridView.tsx +++ b/src/Views/components/GridView.tsx @@ -5,6 +5,8 @@ import { ObjectData } from "src/Data/ObjectData"; import { Cell } from "./Cell"; import { Header } from "./Header"; import { useGrid } from "./GridProvider"; +import { DragDropProvider, DragDropSensors } from "@thisbeyond/solid-dnd"; +import HeaderRow from "./HeaderRow"; // TODO: use https://github.com/minht11/solid-virtual-container @@ -29,14 +31,9 @@ const GridView: Component<{ data: ObjectData[], attributes: AttributeDefinition[ return