Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@react-aria/slider

Package Overview
Dependencies
Maintainers
2
Versions
862
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@react-aria/slider - npm Package Compare versions

Comparing version 3.0.0-nightly-4baa1b08e-241029 to 3.0.0-nightly-4dd0993da-241224

3

dist/useSlider.main.js

@@ -54,5 +54,6 @@ var $28db8d634be2fa58$exports = require("./utils.main.js");

onMove ({ deltaX: deltaX, deltaY: deltaY }) {
if (!trackRef.current) return;
let { height: height, width: width } = trackRef.current.getBoundingClientRect();
let size = isVertical ? height : width;
if (currentPosition.current == null) currentPosition.current = state.getThumbPercent(realTimeTrackDraggingIndex.current) * size;
if (currentPosition.current == null && realTimeTrackDraggingIndex.current != null) currentPosition.current = state.getThumbPercent(realTimeTrackDraggingIndex.current) * size;
let delta = isVertical ? deltaY : deltaX;

@@ -59,0 +60,0 @@ if (isVertical || reverseX) delta = -delta;

@@ -48,5 +48,6 @@ import {getSliderThumbId as $aa519ee6cf463259$export$68e648cbec363a18, sliderData as $aa519ee6cf463259$export$d6c8d9636a3dc49c} from "./utils.module.js";

onMove ({ deltaX: deltaX, deltaY: deltaY }) {
if (!trackRef.current) return;
let { height: height, width: width } = trackRef.current.getBoundingClientRect();
let size = isVertical ? height : width;
if (currentPosition.current == null) currentPosition.current = state.getThumbPercent(realTimeTrackDraggingIndex.current) * size;
if (currentPosition.current == null && realTimeTrackDraggingIndex.current != null) currentPosition.current = state.getThumbPercent(realTimeTrackDraggingIndex.current) * size;
let delta = isVertical ? deltaY : deltaX;

@@ -53,0 +54,0 @@ if (isVertical || reverseX) delta = -delta;

@@ -86,2 +86,3 @@ var $28db8d634be2fa58$exports = require("./utils.main.js");

const { getThumbPercent: getThumbPercent, setThumbPercent: setThumbPercent, decrementThumb: decrementThumb, incrementThumb: incrementThumb, step: step, pageSize: pageSize } = state;
if (!trackRef.current) return;
let { width: width, height: height } = trackRef.current.getBoundingClientRect();

@@ -88,0 +89,0 @@ let size = isVertical ? height : width;

@@ -80,2 +80,3 @@ import {getSliderThumbId as $aa519ee6cf463259$export$68e648cbec363a18, sliderData as $aa519ee6cf463259$export$d6c8d9636a3dc49c} from "./utils.module.js";

const { getThumbPercent: getThumbPercent, setThumbPercent: setThumbPercent, decrementThumb: decrementThumb, incrementThumb: incrementThumb, step: step, pageSize: pageSize } = state;
if (!trackRef.current) return;
let { width: width, height: height } = trackRef.current.getBoundingClientRect();

@@ -82,0 +83,0 @@ let size = isVertical ? height : width;

{
"name": "@react-aria/slider",
"version": "3.0.0-nightly-4baa1b08e-241029",
"version": "3.0.0-nightly-4dd0993da-241224",
"description": "Slider",

@@ -25,19 +25,18 @@ "license": "Apache-2.0",

"dependencies": {
"@react-aria/focus": "^3.0.0-nightly-4baa1b08e-241029",
"@react-aria/i18n": "^3.0.0-nightly-4baa1b08e-241029",
"@react-aria/interactions": "^3.0.0-nightly-4baa1b08e-241029",
"@react-aria/label": "^3.0.0-nightly-4baa1b08e-241029",
"@react-aria/utils": "^3.0.0-nightly-4baa1b08e-241029",
"@react-stately/slider": "^3.0.0-nightly-4baa1b08e-241029",
"@react-types/shared": "^3.0.0-nightly-4baa1b08e-241029",
"@react-types/slider": "^3.0.0-nightly-4baa1b08e-241029",
"@react-aria/focus": "3.0.0-nightly-4dd0993da-241224",
"@react-aria/i18n": "3.0.0-nightly-4dd0993da-241224",
"@react-aria/interactions": "3.0.0-nightly-4dd0993da-241224",
"@react-aria/label": "3.0.0-nightly-4dd0993da-241224",
"@react-aria/utils": "3.0.0-nightly-4dd0993da-241224",
"@react-stately/slider": "3.0.0-nightly-4dd0993da-241224",
"@react-types/shared": "3.0.0-nightly-4dd0993da-241224",
"@react-types/slider": "3.0.0-nightly-4dd0993da-241224",
"@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.7.13"
}
}

@@ -58,3 +58,3 @@ /*

sliderData.set(state, {
id: labelProps.id ?? fieldProps.id,
id: (labelProps.id ?? fieldProps.id)!,
'aria-describedby': props['aria-describedby'],

@@ -75,3 +75,3 @@ 'aria-details': props['aria-details']

const reverseX = direction === 'rtl';
const currentPosition = useRef<number>(null);
const currentPosition = useRef<number | null>(null);
const {moveProps} = useMove({

@@ -82,6 +82,9 @@ onMoveStart() {

onMove({deltaX, deltaY}) {
if (!trackRef.current) {
return;
}
let {height, width} = trackRef.current.getBoundingClientRect();
let size = isVertical ? height : width;
if (currentPosition.current == null) {
if (currentPosition.current == null && realTimeTrackDraggingIndex.current != null) {
currentPosition.current = state.getThumbPercent(realTimeTrackDraggingIndex.current) * size;

@@ -95,6 +98,6 @@ }

currentPosition.current += delta;
currentPosition.current! += delta;
if (realTimeTrackDraggingIndex.current != null && trackRef.current) {
const percent = clamp(currentPosition.current / size, 0, 1);
const percent = clamp(currentPosition.current! / size, 0, 1);
state.setThumbPercent(realTimeTrackDraggingIndex.current, percent);

@@ -112,3 +115,3 @@ }

let currentPointer = useRef<number | null | undefined>(undefined);
let onDownTrack = (e: React.UIEvent, id: number, clientX: number, clientY: number) => {
let onDownTrack = (e: React.UIEvent, id: number | undefined, clientX: number, clientY: number) => {
// We only trigger track-dragging if the user clicks on the track itself and nothing is currently being dragged.

@@ -155,3 +158,3 @@ if (trackRef.current && !props.isDisabled && state.values.every((_, i) => !state.isThumbDragging(i))) {

state.setThumbDragging(realTimeTrackDraggingIndex.current, true);
state.setThumbDragging(realTimeTrackDraggingIndex.current!, true);
state.setThumbValue(closestThumb, value);

@@ -158,0 +161,0 @@

@@ -64,3 +64,3 @@ import {AriaSliderThumbProps} from '@react-types/slider';

let data = sliderData.get(state);
let data = sliderData.get(state)!;
const {labelProps, fieldProps} = useLabel({

@@ -143,2 +143,5 @@ ...opts,

} = state;
if (!trackRef.current) {
return;
}
let {width, height} = trackRef.current.getBoundingClientRect();

@@ -145,0 +148,0 @@ let size = isVertical ? height : width;

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

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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc