@zag-js/slider 0.0.0-dev-20220508172505 → 0.0.0-dev-20220508184419
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/index.js +10 -3
- package/dist/index.js.map +2 -2
- package/dist/index.mjs +10 -3
- package/dist/index.mjs.map +2 -2
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -442,9 +442,16 @@ var percentToValue = (v, r) => r.min + (r.max - r.min) * valueOf(v);
|
|
|
442
442
|
function clamp(v, o) {
|
|
443
443
|
return Math.min(Math.max(valueOf(v), o.min), o.max);
|
|
444
444
|
}
|
|
445
|
-
function countDecimals(
|
|
446
|
-
|
|
447
|
-
|
|
445
|
+
function countDecimals(value) {
|
|
446
|
+
if (!Number.isFinite(value))
|
|
447
|
+
return 0;
|
|
448
|
+
let e = 1;
|
|
449
|
+
let p = 0;
|
|
450
|
+
while (Math.round(value * e) / e !== value) {
|
|
451
|
+
e *= 10;
|
|
452
|
+
p += 1;
|
|
453
|
+
}
|
|
454
|
+
return p;
|
|
448
455
|
}
|
|
449
456
|
var increment = (v, s) => formatter(valueOf(v) + s);
|
|
450
457
|
var decrement = (v, s) => formatter(valueOf(v) - s);
|