@react-stately/slider
Advanced tools
Comparing version 3.0.0-nightly.2492 to 3.0.0-nightly.2497
@@ -11,3 +11,4 @@ var { | ||
var { | ||
clamp | ||
clamp, | ||
snapValueToStep | ||
} = require("@react-aria/utils"); | ||
@@ -69,3 +70,3 @@ | ||
value = clamp(getRoundedValue(value), thisMin, thisMax); | ||
value = snapValueToStep(value, thisMin, thisMax, step); | ||
valuesRef.current = $bc3294032743285adead374b6f67$var$replaceIndex(valuesRef.current, index, value); | ||
@@ -72,0 +73,0 @@ setValues(valuesRef.current); |
import { useRef, useState } from "react"; | ||
import { useControlledState } from "@react-stately/utils"; | ||
import { clamp } from "@react-aria/utils"; | ||
import { clamp, snapValueToStep } from "@react-aria/utils"; | ||
export const DEFAULT_MIN_VALUE = 0; | ||
@@ -54,3 +54,3 @@ export const DEFAULT_MAX_VALUE = 100; | ||
value = clamp(getRoundedValue(value), thisMin, thisMax); | ||
value = snapValueToStep(value, thisMin, thisMax, step); | ||
valuesRef.current = $dcc38d2f5fc04b76254f325fa36d$var$replaceIndex(valuesRef.current, index, value); | ||
@@ -57,0 +57,0 @@ setValues(valuesRef.current); |
{ | ||
"name": "@react-stately/slider", | ||
"version": "3.0.0-nightly.2492+1feff7d9", | ||
"version": "3.0.0-nightly.2497+e91d2ed3", | ||
"description": "Spectrum UI components in React", | ||
@@ -21,6 +21,6 @@ "license": "Apache-2.0", | ||
"@babel/runtime": "^7.6.2", | ||
"@react-aria/i18n": "3.0.0-nightly.814+1feff7d9", | ||
"@react-aria/utils": "3.0.0-nightly.814+1feff7d9", | ||
"@react-stately/utils": "3.0.0-nightly.814+1feff7d9", | ||
"@react-types/slider": "3.0.0-nightly.2492+1feff7d9" | ||
"@react-aria/i18n": "3.0.0-nightly.819+e91d2ed3", | ||
"@react-aria/utils": "3.0.0-nightly.819+e91d2ed3", | ||
"@react-stately/utils": "3.0.0-nightly.819+e91d2ed3", | ||
"@react-types/slider": "3.0.0-nightly.2497+e91d2ed3" | ||
}, | ||
@@ -33,3 +33,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "1feff7d919642630f293ff9c4a21b7e8a2746722" | ||
"gitHead": "e91d2ed382218e2edafb82ded03f9f69f5ece77c" | ||
} |
@@ -13,3 +13,3 @@ /* | ||
import {clamp} from '@react-aria/utils'; | ||
import {clamp, snapValueToStep} from '@react-aria/utils'; | ||
import {SliderProps} from '@react-types/slider'; | ||
@@ -114,3 +114,3 @@ import {useControlledState} from '@react-stately/utils'; | ||
// Round value to multiple of step, clamp value between min and max | ||
value = clamp(getRoundedValue(value), thisMin, thisMax); | ||
value = snapValueToStep(value, thisMin, thisMax, step); | ||
valuesRef.current = replaceIndex(valuesRef.current, index, value); | ||
@@ -117,0 +117,0 @@ setValues(valuesRef.current); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
52305
398