@topconsultnpm/sdkui-react 6.22.0-dev3.11 → 6.22.0-dev3.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,12 @@ import { useEffect } from "react";
2
2
  const usePreventFileDrop = (allowedDropZones) => {
3
3
  useEffect(() => {
4
4
  const isOverAllowedZone = (event) => allowedDropZones.some((ref) => ref.current?.contains(event.target));
5
+ // Il blocco vale solo per i file trascinati da fuori: i drag interni all'applicazione
6
+ // (riordino di metadati, colonne, tab, ...) devono restare liberi di completarsi
7
+ const isFileDrag = (event) => event.dataTransfer?.types?.includes("Files") === true;
5
8
  const handleDragOver = (event) => {
9
+ if (!isFileDrag(event))
10
+ return;
6
11
  if (isOverAllowedZone(event)) {
7
12
  // Riafferma "copy" ad ogni dragover: altrimenti un "none"
8
13
  // impostato mentre si era fuori zona resta e mostra "not-allowed"
@@ -17,6 +22,8 @@ const usePreventFileDrop = (allowedDropZones) => {
17
22
  }
18
23
  };
19
24
  const handleDragEnter = (event) => {
25
+ if (!isFileDrag(event))
26
+ return;
20
27
  if (isOverAllowedZone(event)) {
21
28
  document.body.style.cursor = "default";
22
29
  }
@@ -28,6 +35,8 @@ const usePreventFileDrop = (allowedDropZones) => {
28
35
  document.body.style.cursor = "default";
29
36
  };
30
37
  const handleDrop = (event) => {
38
+ if (!isFileDrag(event))
39
+ return;
31
40
  if (!isOverAllowedZone(event)) {
32
41
  event.preventDefault();
33
42
  document.body.style.cursor = "default";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topconsultnpm/sdkui-react",
3
- "version": "6.22.0-dev3.11",
3
+ "version": "6.22.0-dev3.12",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",