@react-stately/slider
Advanced tools
Comparing version 3.0.0-nightly-e60fb427c-240930 to 3.0.0-nightly-e7053dd8f-250108
@@ -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-e60fb427c-240930", | ||
"version": "3.0.0-nightly-e7053dd8f-250108", | ||
"description": "Spectrum UI components in React", | ||
@@ -25,14 +25,13 @@ "license": "Apache-2.0", | ||
"dependencies": { | ||
"@react-stately/utils": "^3.0.0-nightly-e60fb427c-240930", | ||
"@react-types/shared": "^3.0.0-nightly-e60fb427c-240930", | ||
"@react-types/slider": "^3.0.0-nightly-e60fb427c-240930", | ||
"@react-stately/utils": "3.0.0-nightly-e7053dd8f-250108", | ||
"@react-types/shared": "3.0.0-nightly-e7053dd8f-250108", | ||
"@react-types/slider": "3.0.0-nightly-e7053dd8f-250108", | ||
"@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" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"stableVersion": "3.5.7" | ||
} | ||
} |
@@ -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
75922
+ Added@react-stately/utils@3.0.0-nightly-e7053dd8f-250108(transitive)
+ Added@react-types/shared@3.0.0-nightly-e7053dd8f-250108(transitive)
+ Added@react-types/slider@3.0.0-nightly-e7053dd8f-250108(transitive)
- Removed@react-stately/utils@3.10.5(transitive)
- Removed@react-types/shared@3.27.0(transitive)
- Removed@react-types/slider@3.7.8(transitive)