@zag-js/slider 0.0.0-dev-20220508172505 → 0.0.0-dev-20220509213421
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 +11 -4
- package/dist/index.js.map +2 -2
- package/dist/index.mjs +11 -4
- package/dist/index.mjs.map +2 -2
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -427,7 +427,7 @@ findByTypeahead.defaultOptions = {
|
|
|
427
427
|
|
|
428
428
|
// ../../utilities/number/dist/index.mjs
|
|
429
429
|
var __pow2 = Math.pow;
|
|
430
|
-
var nf = new Intl.NumberFormat("en-US", { style: "decimal" });
|
|
430
|
+
var nf = new Intl.NumberFormat("en-US", { style: "decimal", maximumFractionDigits: 20 });
|
|
431
431
|
function formatter(n) {
|
|
432
432
|
return parseFloat(nf.format(n));
|
|
433
433
|
}
|
|
@@ -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);
|