@hkdigital/lib-sveltekit 0.1.88 → 0.1.89
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.
@@ -306,25 +306,31 @@
|
|
306
306
|
const dropzoneRect = dropzoneElement.getBoundingClientRect();
|
307
307
|
|
308
308
|
// Calculate position with both dragData.offsetX/Y adjustment and border adjustment
|
309
|
-
const
|
309
|
+
const dropOffsetX =
|
310
310
|
event.clientX -
|
311
311
|
dropzoneRect.left -
|
312
|
-
borderLeftWidth
|
313
|
-
(dragData.offsetX ?? 0);
|
312
|
+
borderLeftWidth;
|
314
313
|
|
315
|
-
const
|
314
|
+
const dropOffsetY =
|
316
315
|
event.clientY -
|
317
316
|
dropzoneRect.top -
|
318
|
-
borderTopWidth
|
319
|
-
|
317
|
+
borderTopWidth;
|
318
|
+
|
319
|
+
const x = dropOffsetX - (dragData.offsetX ?? 0);
|
320
|
+
const y = dropOffsetY - (dragData.offsetY ?? 0);
|
320
321
|
|
321
322
|
const dropResult = onDrop?.({
|
322
|
-
event,
|
323
|
-
offsetX,
|
324
|
-
offsetY,
|
325
323
|
zone,
|
324
|
+
source: dragData.source,
|
326
325
|
item: dragData.item,
|
327
|
-
|
326
|
+
x,
|
327
|
+
y,
|
328
|
+
drag: dragData,
|
329
|
+
drop: {
|
330
|
+
offsetX: dropOffsetX,
|
331
|
+
offsetY: dropOffsetY,
|
332
|
+
event
|
333
|
+
}
|
328
334
|
});
|
329
335
|
|
330
336
|
// Handle async or sync results
|
package/dist/typedef/drop.d.ts
CHANGED
@@ -1,11 +1,15 @@
|
|
1
1
|
declare const _default: {};
|
2
2
|
export default _default;
|
3
3
|
export type DropData = {
|
4
|
-
|
5
|
-
|
6
|
-
offsetY: number;
|
4
|
+
x: number;
|
5
|
+
y: number;
|
7
6
|
zone: string;
|
8
|
-
item: any;
|
9
7
|
source: string;
|
10
|
-
|
8
|
+
item: any;
|
9
|
+
drag: import("./drag").DragData;
|
10
|
+
drop: {
|
11
|
+
offsetX: number;
|
12
|
+
offsetY: number;
|
13
|
+
event: DragEvent;
|
14
|
+
};
|
11
15
|
};
|
package/dist/typedef/drop.js
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
/**
|
2
2
|
* @typedef {Object} DropData
|
3
|
-
* @property {
|
4
|
-
* @property {number}
|
5
|
-
* @property {number} offsetY
|
3
|
+
* @property {number} x
|
4
|
+
* @property {number} y
|
6
5
|
* @property {string} zone
|
7
|
-
* @property {any} item
|
8
6
|
* @property {string} source
|
9
|
-
* @property {any}
|
7
|
+
* @property {any} item
|
8
|
+
* @property {import('./drag').DragData} drag
|
9
|
+
* @property {{offsetX: number, offsetY: number, event: DragEvent}} drop
|
10
10
|
*/
|
11
11
|
|
12
12
|
export default {};
|