@vuer-ai/vuer-uikit 0.0.22 → 0.0.23
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.
- package/dist/{chunk-G5KMD72J.mjs → chunk-7JAADHQO.mjs} +49 -41
- package/dist/{chunk-6ESGGXBG.js → chunk-C7VFXWS6.js} +1 -1
- package/dist/{chunk-FORVP7XH.js → chunk-FUQCOZWA.js} +49 -41
- package/dist/{chunk-YW3YL6GR.mjs → chunk-QZVQRU25.mjs} +1 -1
- package/dist/index.js +4 -4
- package/dist/index.mjs +2 -2
- package/dist/ui/index.js +4 -4
- package/dist/ui/index.mjs +2 -2
- package/dist/ui/input-numbers.js +2 -2
- package/dist/ui/input-numbers.mjs +1 -1
- package/dist/ui/version-badge.js +2 -2
- package/dist/ui/version-badge.mjs +1 -1
- package/package.json +1 -1
- package/src/ui/input-numbers.tsx +65 -54
|
@@ -37,50 +37,58 @@ var InputNumbers = forwardRef(function InputNumbers2({ size, value, onValuesChan
|
|
|
37
37
|
};
|
|
38
38
|
document.addEventListener("click", stopClick2, true);
|
|
39
39
|
}, []);
|
|
40
|
-
const bind = useGesture(
|
|
41
|
-
|
|
42
|
-
event
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
40
|
+
const bind = useGesture(
|
|
41
|
+
{
|
|
42
|
+
onDrag: ({ delta: [dx], event, initial, distance: [, oy], xy, memo = 0 }) => {
|
|
43
|
+
if (typeof document === "undefined") return memo || 0;
|
|
44
|
+
event.stopPropagation();
|
|
45
|
+
event.preventDefault();
|
|
46
|
+
if (selectRange.current[0] === null) {
|
|
47
|
+
selectRange.current[0] = getHoverElementAndIndex(
|
|
48
|
+
document.elementFromPoint(...initial),
|
|
49
|
+
inputs.current
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
let newMX = memo + dx / 2;
|
|
53
|
+
if (Math.abs(newMX) >= (inputChange.current ? 1 : 5)) {
|
|
54
|
+
const multiplyStep = event.shiftKey ? 5 : event.altKey ? 1 / 5 : 1;
|
|
55
|
+
const newValue = value.map((v, i) => {
|
|
56
|
+
const [first, last] = selectRange.current;
|
|
57
|
+
if (first === null || last === null) {
|
|
58
|
+
return v;
|
|
59
|
+
} else if (i <= Math.max(first, last) && i >= Math.min(first, last)) {
|
|
60
|
+
return Number(((v || 0) + Math.floor(newMX) * step * multiplyStep).toPrecision(6));
|
|
61
|
+
} else {
|
|
62
|
+
return v;
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
onValuesChange == null ? void 0 : onValuesChange(newValue);
|
|
66
|
+
newMX = 0;
|
|
67
|
+
inputChange.current = true;
|
|
68
|
+
changeElementsHoverState(inputs.current, selectRange.current, "x");
|
|
69
|
+
stopClick();
|
|
70
|
+
}
|
|
71
|
+
if (!inputChange.current) {
|
|
72
|
+
const currentElement = document.elementFromPoint(...xy);
|
|
73
|
+
const currentIndex = getHoverElementAndIndex(currentElement, inputs.current);
|
|
74
|
+
selectRange.current[1] = currentIndex ?? selectRange.current[1];
|
|
75
|
+
changeElementsHoverState(inputs.current, selectRange.current, oy !== 0 ? "y" : "none");
|
|
76
|
+
stopClick();
|
|
77
|
+
}
|
|
78
|
+
return newMX;
|
|
79
|
+
},
|
|
80
|
+
onDragEnd: () => {
|
|
81
|
+
if (typeof document === "undefined") return;
|
|
82
|
+
selectRange.current = [null, null];
|
|
83
|
+
inputChange.current = false;
|
|
84
|
+
changeElementsHoverState(inputs.current, selectRange.current, "none");
|
|
75
85
|
}
|
|
76
|
-
return newMX;
|
|
77
86
|
},
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
changeElementsHoverState(inputs.current, selectRange.current, "none");
|
|
87
|
+
{
|
|
88
|
+
// Pass config options to make gesture library SSR-safe
|
|
89
|
+
enabled: typeof document !== "undefined"
|
|
82
90
|
}
|
|
83
|
-
|
|
91
|
+
);
|
|
84
92
|
const valueChangeHandler = useCallback(
|
|
85
93
|
(index) => {
|
|
86
94
|
return (e) => {
|
|
@@ -39,50 +39,58 @@ var InputNumbers = react.forwardRef(function InputNumbers2({ size, value, onValu
|
|
|
39
39
|
};
|
|
40
40
|
document.addEventListener("click", stopClick2, true);
|
|
41
41
|
}, []);
|
|
42
|
-
const bind = react$1.useGesture(
|
|
43
|
-
|
|
44
|
-
event
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
42
|
+
const bind = react$1.useGesture(
|
|
43
|
+
{
|
|
44
|
+
onDrag: ({ delta: [dx], event, initial, distance: [, oy], xy, memo = 0 }) => {
|
|
45
|
+
if (typeof document === "undefined") return memo || 0;
|
|
46
|
+
event.stopPropagation();
|
|
47
|
+
event.preventDefault();
|
|
48
|
+
if (selectRange.current[0] === null) {
|
|
49
|
+
selectRange.current[0] = getHoverElementAndIndex(
|
|
50
|
+
document.elementFromPoint(...initial),
|
|
51
|
+
inputs.current
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
let newMX = memo + dx / 2;
|
|
55
|
+
if (Math.abs(newMX) >= (inputChange.current ? 1 : 5)) {
|
|
56
|
+
const multiplyStep = event.shiftKey ? 5 : event.altKey ? 1 / 5 : 1;
|
|
57
|
+
const newValue = value.map((v, i) => {
|
|
58
|
+
const [first, last] = selectRange.current;
|
|
59
|
+
if (first === null || last === null) {
|
|
60
|
+
return v;
|
|
61
|
+
} else if (i <= Math.max(first, last) && i >= Math.min(first, last)) {
|
|
62
|
+
return Number(((v || 0) + Math.floor(newMX) * step * multiplyStep).toPrecision(6));
|
|
63
|
+
} else {
|
|
64
|
+
return v;
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
onValuesChange == null ? void 0 : onValuesChange(newValue);
|
|
68
|
+
newMX = 0;
|
|
69
|
+
inputChange.current = true;
|
|
70
|
+
changeElementsHoverState(inputs.current, selectRange.current, "x");
|
|
71
|
+
stopClick();
|
|
72
|
+
}
|
|
73
|
+
if (!inputChange.current) {
|
|
74
|
+
const currentElement = document.elementFromPoint(...xy);
|
|
75
|
+
const currentIndex = getHoverElementAndIndex(currentElement, inputs.current);
|
|
76
|
+
selectRange.current[1] = currentIndex ?? selectRange.current[1];
|
|
77
|
+
changeElementsHoverState(inputs.current, selectRange.current, oy !== 0 ? "y" : "none");
|
|
78
|
+
stopClick();
|
|
79
|
+
}
|
|
80
|
+
return newMX;
|
|
81
|
+
},
|
|
82
|
+
onDragEnd: () => {
|
|
83
|
+
if (typeof document === "undefined") return;
|
|
84
|
+
selectRange.current = [null, null];
|
|
85
|
+
inputChange.current = false;
|
|
86
|
+
changeElementsHoverState(inputs.current, selectRange.current, "none");
|
|
77
87
|
}
|
|
78
|
-
return newMX;
|
|
79
88
|
},
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
changeElementsHoverState(inputs.current, selectRange.current, "none");
|
|
89
|
+
{
|
|
90
|
+
// Pass config options to make gesture library SSR-safe
|
|
91
|
+
enabled: typeof document !== "undefined"
|
|
84
92
|
}
|
|
85
|
-
|
|
93
|
+
);
|
|
86
94
|
const valueChangeHandler = react.useCallback(
|
|
87
95
|
(index) => {
|
|
88
96
|
return (e) => {
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
require('./chunk-N7CINZS2.js');
|
|
4
4
|
var chunk2YCL2ET2_js = require('./chunk-2YCL2ET2.js');
|
|
5
|
-
var
|
|
5
|
+
var chunkC7VFXWS6_js = require('./chunk-C7VFXWS6.js');
|
|
6
6
|
var chunkH5P4IX7R_js = require('./chunk-H5P4IX7R.js');
|
|
7
7
|
var chunkPVRQNCSJ_js = require('./chunk-PVRQNCSJ.js');
|
|
8
8
|
var chunkAOUGWGQR_js = require('./chunk-AOUGWGQR.js');
|
|
@@ -22,7 +22,7 @@ var chunkX55EAYE2_js = require('./chunk-X55EAYE2.js');
|
|
|
22
22
|
var chunk5TVG5JK5_js = require('./chunk-5TVG5JK5.js');
|
|
23
23
|
var chunk2JCULHBM_js = require('./chunk-2JCULHBM.js');
|
|
24
24
|
var chunkFP26SRGL_js = require('./chunk-FP26SRGL.js');
|
|
25
|
-
var
|
|
25
|
+
var chunkFUQCOZWA_js = require('./chunk-FUQCOZWA.js');
|
|
26
26
|
var chunk6N5422RT_js = require('./chunk-6N5422RT.js');
|
|
27
27
|
require('./chunk-KJ42IGH6.js');
|
|
28
28
|
var chunkQEY7BWIR_js = require('./chunk-QEY7BWIR.js');
|
|
@@ -47,7 +47,7 @@ Object.defineProperty(exports, "TreeView", {
|
|
|
47
47
|
});
|
|
48
48
|
Object.defineProperty(exports, "VersionBadge", {
|
|
49
49
|
enumerable: true,
|
|
50
|
-
get: function () { return
|
|
50
|
+
get: function () { return chunkC7VFXWS6_js.VersionBadge; }
|
|
51
51
|
});
|
|
52
52
|
Object.defineProperty(exports, "Switch", {
|
|
53
53
|
enumerable: true,
|
|
@@ -327,7 +327,7 @@ Object.defineProperty(exports, "DropdownMenuTrigger", {
|
|
|
327
327
|
});
|
|
328
328
|
Object.defineProperty(exports, "InputNumbers", {
|
|
329
329
|
enumerable: true,
|
|
330
|
-
get: function () { return
|
|
330
|
+
get: function () { return chunkFUQCOZWA_js.InputNumbers; }
|
|
331
331
|
});
|
|
332
332
|
Object.defineProperty(exports, "Avatar", {
|
|
333
333
|
enumerable: true,
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './chunk-F56ZKT7B.mjs';
|
|
2
2
|
export { TreeView } from './chunk-UKFVRXAR.mjs';
|
|
3
|
-
export { VersionBadge } from './chunk-
|
|
3
|
+
export { VersionBadge } from './chunk-QZVQRU25.mjs';
|
|
4
4
|
export { Switch } from './chunk-JAMJUXBY.mjs';
|
|
5
5
|
export { ThemeProvider, useTheme } from './chunk-LEPXSM36.mjs';
|
|
6
6
|
export { Timeline } from './chunk-ZVG2UKKC.mjs';
|
|
@@ -20,7 +20,7 @@ export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader,
|
|
|
20
20
|
export { Checkbox } from './chunk-G6PRZVSE.mjs';
|
|
21
21
|
export { Collapsible, CollapsibleContent, CollapsibleTrigger } from './chunk-FRT225GK.mjs';
|
|
22
22
|
export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from './chunk-EUY74AXP.mjs';
|
|
23
|
-
export { InputNumbers } from './chunk-
|
|
23
|
+
export { InputNumbers } from './chunk-7JAADHQO.mjs';
|
|
24
24
|
export { Avatar, AvatarFallback, AvatarGroup, AvatarImage } from './chunk-F776EMXP.mjs';
|
|
25
25
|
import './chunk-VGCVIHBR.mjs';
|
|
26
26
|
export { CursorProvider } from './chunk-OOI3SJDU.mjs';
|
package/dist/ui/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
require('../chunk-N7CINZS2.js');
|
|
4
4
|
var chunk2YCL2ET2_js = require('../chunk-2YCL2ET2.js');
|
|
5
|
-
var
|
|
5
|
+
var chunkC7VFXWS6_js = require('../chunk-C7VFXWS6.js');
|
|
6
6
|
var chunkH5P4IX7R_js = require('../chunk-H5P4IX7R.js');
|
|
7
7
|
var chunkPVRQNCSJ_js = require('../chunk-PVRQNCSJ.js');
|
|
8
8
|
var chunkAOUGWGQR_js = require('../chunk-AOUGWGQR.js');
|
|
@@ -22,7 +22,7 @@ var chunkX55EAYE2_js = require('../chunk-X55EAYE2.js');
|
|
|
22
22
|
var chunk5TVG5JK5_js = require('../chunk-5TVG5JK5.js');
|
|
23
23
|
var chunk2JCULHBM_js = require('../chunk-2JCULHBM.js');
|
|
24
24
|
var chunkFP26SRGL_js = require('../chunk-FP26SRGL.js');
|
|
25
|
-
var
|
|
25
|
+
var chunkFUQCOZWA_js = require('../chunk-FUQCOZWA.js');
|
|
26
26
|
var chunk6N5422RT_js = require('../chunk-6N5422RT.js');
|
|
27
27
|
var chunkIXHMIR5P_js = require('../chunk-IXHMIR5P.js');
|
|
28
28
|
var chunk5OUTEHVX_js = require('../chunk-5OUTEHVX.js');
|
|
@@ -42,7 +42,7 @@ Object.defineProperty(exports, "TreeView", {
|
|
|
42
42
|
});
|
|
43
43
|
Object.defineProperty(exports, "VersionBadge", {
|
|
44
44
|
enumerable: true,
|
|
45
|
-
get: function () { return
|
|
45
|
+
get: function () { return chunkC7VFXWS6_js.VersionBadge; }
|
|
46
46
|
});
|
|
47
47
|
Object.defineProperty(exports, "Switch", {
|
|
48
48
|
enumerable: true,
|
|
@@ -322,7 +322,7 @@ Object.defineProperty(exports, "DropdownMenuTrigger", {
|
|
|
322
322
|
});
|
|
323
323
|
Object.defineProperty(exports, "InputNumbers", {
|
|
324
324
|
enumerable: true,
|
|
325
|
-
get: function () { return
|
|
325
|
+
get: function () { return chunkFUQCOZWA_js.InputNumbers; }
|
|
326
326
|
});
|
|
327
327
|
Object.defineProperty(exports, "Avatar", {
|
|
328
328
|
enumerable: true,
|
package/dist/ui/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '../chunk-F56ZKT7B.mjs';
|
|
2
2
|
export { TreeView } from '../chunk-UKFVRXAR.mjs';
|
|
3
|
-
export { VersionBadge } from '../chunk-
|
|
3
|
+
export { VersionBadge } from '../chunk-QZVQRU25.mjs';
|
|
4
4
|
export { Switch } from '../chunk-JAMJUXBY.mjs';
|
|
5
5
|
export { ThemeProvider, useTheme } from '../chunk-LEPXSM36.mjs';
|
|
6
6
|
export { Timeline } from '../chunk-ZVG2UKKC.mjs';
|
|
@@ -20,7 +20,7 @@ export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader,
|
|
|
20
20
|
export { Checkbox } from '../chunk-G6PRZVSE.mjs';
|
|
21
21
|
export { Collapsible, CollapsibleContent, CollapsibleTrigger } from '../chunk-FRT225GK.mjs';
|
|
22
22
|
export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from '../chunk-EUY74AXP.mjs';
|
|
23
|
-
export { InputNumbers } from '../chunk-
|
|
23
|
+
export { InputNumbers } from '../chunk-7JAADHQO.mjs';
|
|
24
24
|
export { Avatar, AvatarFallback, AvatarGroup, AvatarImage } from '../chunk-F776EMXP.mjs';
|
|
25
25
|
export { Tabs, TabsContent, TabsList, TabsTrigger } from '../chunk-MRVMXKZO.mjs';
|
|
26
26
|
export { Textarea } from '../chunk-DDOX4EEM.mjs';
|
package/dist/ui/input-numbers.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkFUQCOZWA_js = require('../chunk-FUQCOZWA.js');
|
|
4
4
|
require('../chunk-SKO72K64.js');
|
|
5
5
|
require('../chunk-XWS4SIB5.js');
|
|
6
6
|
require('../chunk-EOFYA6CS.js');
|
|
@@ -10,5 +10,5 @@ require('../chunk-XXWQ4RVP.js');
|
|
|
10
10
|
|
|
11
11
|
Object.defineProperty(exports, "InputNumbers", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunkFUQCOZWA_js.InputNumbers; }
|
|
14
14
|
});
|
package/dist/ui/version-badge.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkC7VFXWS6_js = require('../chunk-C7VFXWS6.js');
|
|
4
4
|
require('../chunk-EFIRD3FN.js');
|
|
5
5
|
require('../chunk-XWS4SIB5.js');
|
|
6
6
|
require('../chunk-EOFYA6CS.js');
|
|
@@ -10,5 +10,5 @@ require('../chunk-XXWQ4RVP.js');
|
|
|
10
10
|
|
|
11
11
|
Object.defineProperty(exports, "VersionBadge", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunkC7VFXWS6_js.VersionBadge; }
|
|
14
14
|
});
|
package/package.json
CHANGED
package/src/ui/input-numbers.tsx
CHANGED
|
@@ -63,62 +63,73 @@ const InputNumbers = forwardRef<HTMLDivElement, InputNumbersProps>(function Inpu
|
|
|
63
63
|
document.addEventListener("click", stopClick, true);
|
|
64
64
|
}, []);
|
|
65
65
|
|
|
66
|
-
const bind = useGesture(
|
|
67
|
-
|
|
68
|
-
event
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
)
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
66
|
+
const bind = useGesture(
|
|
67
|
+
{
|
|
68
|
+
onDrag: ({ delta: [dx], event, initial, distance: [, oy], xy, memo = 0 }) => {
|
|
69
|
+
// SSR guard - if no document, return early
|
|
70
|
+
if (typeof document === "undefined") return memo || 0;
|
|
71
|
+
|
|
72
|
+
event.stopPropagation();
|
|
73
|
+
event.preventDefault();
|
|
74
|
+
|
|
75
|
+
if (selectRange.current[0] === null) {
|
|
76
|
+
selectRange.current[0] = getHoverElementAndIndex(
|
|
77
|
+
document.elementFromPoint(...initial),
|
|
78
|
+
inputs.current,
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
let newMX: number = memo + dx / 2;
|
|
83
|
+
|
|
84
|
+
if (Math.abs(newMX) >= (inputChange.current ? 1 : 5)) {
|
|
85
|
+
const multiplyStep = event.shiftKey ? 5 : event.altKey ? 1 / 5 : 1;
|
|
86
|
+
|
|
87
|
+
const newValue = value.map((v, i) => {
|
|
88
|
+
const [first, last] = selectRange.current;
|
|
89
|
+
if (first === null || last === null) {
|
|
90
|
+
return v;
|
|
91
|
+
} else if (i <= Math.max(first, last) && i >= Math.min(first, last)) {
|
|
92
|
+
return Number(((v || 0) + Math.floor(newMX) * step * multiplyStep).toPrecision(6));
|
|
93
|
+
} else {
|
|
94
|
+
return v;
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
onValuesChange?.(newValue);
|
|
98
|
+
newMX = 0;
|
|
99
|
+
inputChange.current = true;
|
|
100
|
+
|
|
101
|
+
changeElementsHoverState(inputs.current, selectRange.current, "x");
|
|
102
|
+
|
|
103
|
+
stopClick();
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
if (!inputChange.current) {
|
|
107
|
+
const currentElement = document.elementFromPoint(...xy);
|
|
108
|
+
|
|
109
|
+
const currentIndex = getHoverElementAndIndex(currentElement, inputs.current);
|
|
110
|
+
selectRange.current[1] = currentIndex ?? selectRange.current[1];
|
|
111
|
+
|
|
112
|
+
changeElementsHoverState(inputs.current, selectRange.current, oy !== 0 ? "y" : "none");
|
|
113
|
+
|
|
114
|
+
stopClick();
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
return newMX;
|
|
118
|
+
},
|
|
119
|
+
onDragEnd: () => {
|
|
120
|
+
// SSR guard
|
|
121
|
+
if (typeof document === "undefined") return;
|
|
122
|
+
|
|
123
|
+
selectRange.current = [null, null];
|
|
124
|
+
inputChange.current = false;
|
|
125
|
+
changeElementsHoverState(inputs.current, selectRange.current, "none");
|
|
126
|
+
},
|
|
115
127
|
},
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
changeElementsHoverState(inputs.current, selectRange.current, "none");
|
|
128
|
+
{
|
|
129
|
+
// Pass config options to make gesture library SSR-safe
|
|
130
|
+
enabled: typeof document !== "undefined",
|
|
120
131
|
},
|
|
121
|
-
|
|
132
|
+
);
|
|
122
133
|
|
|
123
134
|
const valueChangeHandler = useCallback(
|
|
124
135
|
(index: number) => {
|