@react-stately/slider
Advanced tools
Comparing version 3.0.0-nightly-641446f65-240905 to 3.0.0-nightly-65e3a52a3-241120
@@ -38,4 +38,4 @@ var $1NNdE$reactstatelyutils = require("@react-stately/utils"); | ||
let restrictValues = (0, $1NNdE$react.useCallback)((values)=>values === null || values === void 0 ? void 0 : values.map((val, idx)=>{ | ||
let min = idx === 0 ? minValue : val[idx - 1]; | ||
let max = idx === values.length - 1 ? maxValue : val[idx + 1]; | ||
let min = idx === 0 ? minValue : values[idx - 1]; | ||
let max = idx === values.length - 1 ? maxValue : values[idx + 1]; | ||
return (0, $1NNdE$reactstatelyutils.snapValueToStep)(val, min, max, step); | ||
@@ -42,0 +42,0 @@ }), [ |
@@ -32,4 +32,4 @@ import {snapValueToStep as $BT4Uh$snapValueToStep, useControlledState as $BT4Uh$useControlledState, clamp as $BT4Uh$clamp} from "@react-stately/utils"; | ||
let restrictValues = (0, $BT4Uh$useCallback)((values)=>values === null || values === void 0 ? void 0 : values.map((val, idx)=>{ | ||
let min = idx === 0 ? minValue : val[idx - 1]; | ||
let max = idx === values.length - 1 ? maxValue : val[idx + 1]; | ||
let min = idx === 0 ? minValue : values[idx - 1]; | ||
let max = idx === values.length - 1 ? maxValue : values[idx + 1]; | ||
return (0, $BT4Uh$snapValueToStep)(val, min, max, step); | ||
@@ -36,0 +36,0 @@ }), [ |
{ | ||
"name": "@react-stately/slider", | ||
"version": "3.0.0-nightly-641446f65-240905", | ||
"version": "3.0.0-nightly-65e3a52a3-241120", | ||
"description": "Spectrum UI components in React", | ||
@@ -25,9 +25,9 @@ "license": "Apache-2.0", | ||
"dependencies": { | ||
"@react-stately/utils": "^3.0.0-nightly-641446f65-240905", | ||
"@react-types/shared": "^3.0.0-nightly-641446f65-240905", | ||
"@react-types/slider": "^3.0.0-nightly-641446f65-240905", | ||
"@react-stately/utils": "^3.0.0-nightly-65e3a52a3-241120", | ||
"@react-types/shared": "^3.0.0-nightly-65e3a52a3-241120", | ||
"@react-types/slider": "^3.0.0-nightly-65e3a52a3-241120", | ||
"@swc/helpers": "^0.5.0" | ||
}, | ||
"peerDependencies": { | ||
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0" | ||
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1" | ||
}, | ||
@@ -37,3 +37,3 @@ "publishConfig": { | ||
}, | ||
"stableVersion": "3.5.7" | ||
"stableVersion": "3.5.8" | ||
} |
@@ -179,5 +179,5 @@ /* | ||
let restrictValues = useCallback((values: number[]) => values?.map((val, idx) => { | ||
let min = idx === 0 ? minValue : val[idx - 1]; | ||
let max = idx === values.length - 1 ? maxValue : val[idx + 1]; | ||
let restrictValues = useCallback((values: number[] | undefined) => values?.map((val, idx) => { | ||
let min = idx === 0 ? minValue : values[idx - 1]; | ||
let max = idx === values.length - 1 ? maxValue : values[idx + 1]; | ||
return snapValueToStep(val, min, max, step); | ||
@@ -187,3 +187,3 @@ }), [minValue, maxValue, step]); | ||
let value = useMemo(() => restrictValues(convertValue(props.value)), [props.value]); | ||
let defaultValue = useMemo(() => restrictValues(convertValue(props.defaultValue) ?? [minValue]), [props.defaultValue, minValue]); | ||
let defaultValue = useMemo(() => restrictValues(convertValue(props.defaultValue) ?? [minValue])!, [props.defaultValue, minValue]); | ||
let onChange = createOnChange(props.value, props.defaultValue, props.onChange); | ||
@@ -326,3 +326,3 @@ let onChangeEnd = createOnChange(props.value, props.defaultValue, props.onChangeEnd); | ||
function convertValue(value: number | number[]) { | ||
function convertValue(value?: number | number[]) { | ||
if (value == null) { | ||
@@ -329,0 +329,0 @@ return undefined; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
75953
0