deepsea-components 5.16.0 → 5.16.1
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.
|
@@ -66,7 +66,6 @@ function getOrderMap({ prev, orders, keys }) {
|
|
|
66
66
|
});
|
|
67
67
|
orders = Array.from(orderSet);
|
|
68
68
|
newKeys.forEach((key, index)=>orderMap.set(key, orders[index]));
|
|
69
|
-
console.log(Object.fromEntries(orderMap.entries()));
|
|
70
69
|
return orderMap;
|
|
71
70
|
}
|
|
72
71
|
function getPosition({ order, columns, gapX, gapY, itemWidth, itemHeight }) {
|
|
@@ -96,12 +95,6 @@ const DraggableGridItem = ({ onDragMoveStart, onDragMove, onDragMoveEnd, ...rest
|
|
|
96
95
|
...rest
|
|
97
96
|
});
|
|
98
97
|
};
|
|
99
|
-
let DraggableGrid_cache;
|
|
100
|
-
function log(value) {
|
|
101
|
-
if ((0, external_deepsea_tools_namespaceObject.equal)(DraggableGrid_cache, value)) return;
|
|
102
|
-
DraggableGrid_cache = value;
|
|
103
|
-
console.log(value);
|
|
104
|
-
}
|
|
105
98
|
function DraggableGrid({ className, classNames, style, items = [], disabled, columns, rows, gap = 0, gapX = gap, gapY = gap, itemWidth, itemHeight, orderMap, onOrderMapChange, render, keyExtractor, isItemDisabled, isOrderDisabled, orderPriority, ...rest }) {
|
|
106
99
|
const [itemToKey, keyToItem] = (0, external_react_namespaceObject.useMemo)(()=>{
|
|
107
100
|
const itemToKey = new Map();
|
|
@@ -222,7 +215,6 @@ function DraggableGrid({ className, classNames, style, items = [], disabled, col
|
|
|
222
215
|
if (!dragging) return;
|
|
223
216
|
const { deltaX, deltaY } = event;
|
|
224
217
|
const { key, orders, keyToOrder, startX, startY, columns, gapX, gapY, itemWidth, itemHeight } = dragging;
|
|
225
|
-
log(key);
|
|
226
218
|
setDragging((prev)=>({
|
|
227
219
|
...prev,
|
|
228
220
|
deltaX,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useMemo, useRef, useState } from "react";
|
|
3
|
-
import { clsx,
|
|
3
|
+
import { clsx, getArray } from "deepsea-tools";
|
|
4
4
|
import { useDragMove } from "soda-hooks";
|
|
5
5
|
import DraggableGrid_module from "./DraggableGrid.module.js";
|
|
6
6
|
function isTheSameArray(a, b) {
|
|
@@ -28,7 +28,6 @@ function getOrderMap({ prev, orders, keys }) {
|
|
|
28
28
|
});
|
|
29
29
|
orders = Array.from(orderSet);
|
|
30
30
|
newKeys.forEach((key, index)=>orderMap.set(key, orders[index]));
|
|
31
|
-
console.log(Object.fromEntries(orderMap.entries()));
|
|
32
31
|
return orderMap;
|
|
33
32
|
}
|
|
34
33
|
function getPosition({ order, columns, gapX, gapY, itemWidth, itemHeight }) {
|
|
@@ -58,12 +57,6 @@ const DraggableGridItem = ({ onDragMoveStart, onDragMove, onDragMoveEnd, ...rest
|
|
|
58
57
|
...rest
|
|
59
58
|
});
|
|
60
59
|
};
|
|
61
|
-
let DraggableGrid_cache;
|
|
62
|
-
function log(value) {
|
|
63
|
-
if (equal(DraggableGrid_cache, value)) return;
|
|
64
|
-
DraggableGrid_cache = value;
|
|
65
|
-
console.log(value);
|
|
66
|
-
}
|
|
67
60
|
function DraggableGrid({ className, classNames, style, items = [], disabled, columns, rows, gap = 0, gapX = gap, gapY = gap, itemWidth, itemHeight, orderMap, onOrderMapChange, render, keyExtractor, isItemDisabled, isOrderDisabled, orderPriority, ...rest }) {
|
|
68
61
|
const [itemToKey, keyToItem] = useMemo(()=>{
|
|
69
62
|
const itemToKey = new Map();
|
|
@@ -184,7 +177,6 @@ function DraggableGrid({ className, classNames, style, items = [], disabled, col
|
|
|
184
177
|
if (!dragging) return;
|
|
185
178
|
const { deltaX, deltaY } = event;
|
|
186
179
|
const { key, orders, keyToOrder, startX, startY, columns, gapX, gapY, itemWidth, itemHeight } = dragging;
|
|
187
|
-
log(key);
|
|
188
180
|
setDragging((prev)=>({
|
|
189
181
|
...prev,
|
|
190
182
|
deltaX,
|
package/package.json
CHANGED
|
@@ -70,7 +70,6 @@ function getOrderMap<T>({ prev, orders, keys }: GetOrderMapParams<T>) {
|
|
|
70
70
|
})
|
|
71
71
|
orders = Array.from(orderSet)
|
|
72
72
|
newKeys.forEach((key, index) => orderMap.set(key, orders[index]))
|
|
73
|
-
console.log(Object.fromEntries(orderMap.entries()))
|
|
74
73
|
return orderMap
|
|
75
74
|
}
|
|
76
75
|
|
|
@@ -195,13 +194,6 @@ interface DraggingItem {
|
|
|
195
194
|
keyToOrder: DraggableGridKeyToOrder
|
|
196
195
|
}
|
|
197
196
|
|
|
198
|
-
let cache: any
|
|
199
|
-
function log(value: any) {
|
|
200
|
-
if (equal(cache, value)) return
|
|
201
|
-
cache = value
|
|
202
|
-
console.log(value)
|
|
203
|
-
}
|
|
204
|
-
|
|
205
197
|
export function DraggableGrid<T>({
|
|
206
198
|
className,
|
|
207
199
|
classNames,
|
|
@@ -335,7 +327,6 @@ export function DraggableGrid<T>({
|
|
|
335
327
|
|
|
336
328
|
const { deltaX, deltaY } = event
|
|
337
329
|
const { key, orders, keyToOrder, startX, startY, columns, gapX, gapY, itemWidth, itemHeight } = dragging!
|
|
338
|
-
log(key)
|
|
339
330
|
setDragging(prev => ({ ...prev!, deltaX, deltaY }))
|
|
340
331
|
const x = startX + deltaX
|
|
341
332
|
const y = startY + deltaY
|