@react-stately/slider 3.0.4-nightly.3085 → 3.0.4-nightly.3086

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/main.js CHANGED
@@ -1,6 +1,6 @@
1
- var $lMkdD$reactariautils = require("@react-aria/utils");
2
- var $lMkdD$reactstatelyutils = require("@react-stately/utils");
3
- var $lMkdD$react = require("react");
1
+ var $ewMrq$reactariautils = require("@react-aria/utils");
2
+ var $ewMrq$reactstatelyutils = require("@react-stately/utils");
3
+ var $ewMrq$react = require("react");
4
4
 
5
5
  function $parcel$exportWildcard(dest, source) {
6
6
  Object.keys(source).forEach(function(key) {
@@ -21,26 +21,26 @@ function $parcel$exportWildcard(dest, source) {
21
21
  function $parcel$export(e, n, v, s) {
22
22
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
23
23
  }
24
- var $ec80cfa9a3830ae5$exports = {};
24
+ var $16a7c389e53c069a$exports = {};
25
25
 
26
- $parcel$export($ec80cfa9a3830ae5$exports, "useSliderState", () => $ec80cfa9a3830ae5$export$e5fda3247f5d67f9);
26
+ $parcel$export($16a7c389e53c069a$exports, "useSliderState", () => $16a7c389e53c069a$export$e5fda3247f5d67f9);
27
27
 
28
28
 
29
29
 
30
- const $ec80cfa9a3830ae5$var$DEFAULT_MIN_VALUE = 0;
31
- const $ec80cfa9a3830ae5$var$DEFAULT_MAX_VALUE = 100;
32
- const $ec80cfa9a3830ae5$var$DEFAULT_STEP_VALUE = 1;
33
- function $ec80cfa9a3830ae5$export$e5fda3247f5d67f9(props) {
34
- const { isDisabled: isDisabled , minValue: minValue = $ec80cfa9a3830ae5$var$DEFAULT_MIN_VALUE , maxValue: maxValue = $ec80cfa9a3830ae5$var$DEFAULT_MAX_VALUE , numberFormatter: formatter , step: step = $ec80cfa9a3830ae5$var$DEFAULT_STEP_VALUE } = props;
35
- const [values, setValues] = $lMkdD$reactstatelyutils.useControlledState(props.value, props.defaultValue ?? [
30
+ const $16a7c389e53c069a$var$DEFAULT_MIN_VALUE = 0;
31
+ const $16a7c389e53c069a$var$DEFAULT_MAX_VALUE = 100;
32
+ const $16a7c389e53c069a$var$DEFAULT_STEP_VALUE = 1;
33
+ function $16a7c389e53c069a$export$e5fda3247f5d67f9(props) {
34
+ const { isDisabled: isDisabled , minValue: minValue = $16a7c389e53c069a$var$DEFAULT_MIN_VALUE , maxValue: maxValue = $16a7c389e53c069a$var$DEFAULT_MAX_VALUE , numberFormatter: formatter , step: step = $16a7c389e53c069a$var$DEFAULT_STEP_VALUE } = props;
35
+ const [values, setValues] = $ewMrq$reactstatelyutils.useControlledState(props.value, props.defaultValue ?? [
36
36
  minValue
37
37
  ], props.onChange);
38
- const [isDraggings, setDraggings] = $lMkdD$react.useState(new Array(values.length).fill(false));
39
- const isEditablesRef = $lMkdD$react.useRef(new Array(values.length).fill(true));
40
- const [focusedIndex, setFocusedIndex] = $lMkdD$react.useState(undefined);
41
- const valuesRef = $lMkdD$react.useRef(null);
38
+ const [isDraggings, setDraggings] = $ewMrq$react.useState(new Array(values.length).fill(false));
39
+ const isEditablesRef = $ewMrq$react.useRef(new Array(values.length).fill(true));
40
+ const [focusedIndex, setFocusedIndex] = $ewMrq$react.useState(undefined);
41
+ const valuesRef = $ewMrq$react.useRef(null);
42
42
  valuesRef.current = values;
43
- const isDraggingsRef = $lMkdD$react.useRef(null);
43
+ const isDraggingsRef = $ewMrq$react.useRef(null);
44
44
  isDraggingsRef.current = isDraggings;
45
45
  function getValuePercent(value) {
46
46
  return (value - minValue) / (maxValue - minValue);
@@ -62,14 +62,14 @@ function $ec80cfa9a3830ae5$export$e5fda3247f5d67f9(props) {
62
62
  const thisMin = getThumbMinValue(index);
63
63
  const thisMax = getThumbMaxValue(index);
64
64
  // Round value to multiple of step, clamp value between min and max
65
- value = $lMkdD$reactariautils.snapValueToStep(value, thisMin, thisMax, step);
66
- valuesRef.current = $ec80cfa9a3830ae5$var$replaceIndex(valuesRef.current, index, value);
65
+ value = $ewMrq$reactariautils.snapValueToStep(value, thisMin, thisMax, step);
66
+ valuesRef.current = $16a7c389e53c069a$var$replaceIndex(valuesRef.current, index, value);
67
67
  setValues(valuesRef.current);
68
68
  }
69
69
  function updateDragging(index, dragging) {
70
70
  if (isDisabled || !isThumbEditable(index)) return;
71
71
  const wasDragging = isDraggingsRef.current[index];
72
- isDraggingsRef.current = $ec80cfa9a3830ae5$var$replaceIndex(isDraggingsRef.current, index, dragging);
72
+ isDraggingsRef.current = $16a7c389e53c069a$var$replaceIndex(isDraggingsRef.current, index, dragging);
73
73
  setDraggings(isDraggingsRef.current);
74
74
  // Call onChangeEnd if no handles are dragging.
75
75
  if (props.onChangeEnd && wasDragging && !isDraggingsRef.current.some(Boolean)) props.onChangeEnd(valuesRef.current);
@@ -85,7 +85,7 @@ function $ec80cfa9a3830ae5$export$e5fda3247f5d67f9(props) {
85
85
  }
86
86
  function getPercentValue(percent) {
87
87
  const val = percent * (maxValue - minValue) + minValue;
88
- return $lMkdD$reactariautils.clamp(getRoundedValue(val), minValue, maxValue);
88
+ return $ewMrq$reactariautils.clamp(getRoundedValue(val), minValue, maxValue);
89
89
  }
90
90
  return {
91
91
  values: values,
@@ -112,7 +112,7 @@ function $ec80cfa9a3830ae5$export$e5fda3247f5d67f9(props) {
112
112
  step: step
113
113
  };
114
114
  }
115
- function $ec80cfa9a3830ae5$var$replaceIndex(array, index, value) {
115
+ function $16a7c389e53c069a$var$replaceIndex(array, index, value) {
116
116
  if (array[index] === value) return array;
117
117
  return [
118
118
  ...array.slice(0, index),
@@ -122,7 +122,7 @@ function $ec80cfa9a3830ae5$var$replaceIndex(array, index, value) {
122
122
  }
123
123
 
124
124
 
125
- $parcel$exportWildcard(module.exports, $ec80cfa9a3830ae5$exports);
125
+ $parcel$exportWildcard(module.exports, $16a7c389e53c069a$exports);
126
126
 
127
127
 
128
128
  //# sourceMappingURL=main.js.map
package/dist/module.js CHANGED
@@ -1,30 +1,30 @@
1
- import {snapValueToStep as $9LrbI$snapValueToStep, clamp as $9LrbI$clamp} from "@react-aria/utils";
2
- import {useControlledState as $9LrbI$useControlledState} from "@react-stately/utils";
3
- import {useState as $9LrbI$useState, useRef as $9LrbI$useRef} from "react";
1
+ import {snapValueToStep as $35Cqk$snapValueToStep, clamp as $35Cqk$clamp} from "@react-aria/utils";
2
+ import {useControlledState as $35Cqk$useControlledState} from "@react-stately/utils";
3
+ import {useState as $35Cqk$useState, useRef as $35Cqk$useRef} from "react";
4
4
 
5
5
  function $parcel$export(e, n, v, s) {
6
6
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
7
7
  }
8
- var $bc616ccd4b00f45f$exports = {};
8
+ var $41e91674a959b70c$exports = {};
9
9
 
10
- $parcel$export($bc616ccd4b00f45f$exports, "useSliderState", () => $bc616ccd4b00f45f$export$e5fda3247f5d67f9);
10
+ $parcel$export($41e91674a959b70c$exports, "useSliderState", () => $41e91674a959b70c$export$e5fda3247f5d67f9);
11
11
 
12
12
 
13
13
 
14
- const $bc616ccd4b00f45f$var$DEFAULT_MIN_VALUE = 0;
15
- const $bc616ccd4b00f45f$var$DEFAULT_MAX_VALUE = 100;
16
- const $bc616ccd4b00f45f$var$DEFAULT_STEP_VALUE = 1;
17
- function $bc616ccd4b00f45f$export$e5fda3247f5d67f9(props) {
18
- const { isDisabled: isDisabled , minValue: minValue = $bc616ccd4b00f45f$var$DEFAULT_MIN_VALUE , maxValue: maxValue = $bc616ccd4b00f45f$var$DEFAULT_MAX_VALUE , numberFormatter: formatter , step: step = $bc616ccd4b00f45f$var$DEFAULT_STEP_VALUE } = props;
19
- const [values, setValues] = $9LrbI$useControlledState(props.value, props.defaultValue ?? [
14
+ const $41e91674a959b70c$var$DEFAULT_MIN_VALUE = 0;
15
+ const $41e91674a959b70c$var$DEFAULT_MAX_VALUE = 100;
16
+ const $41e91674a959b70c$var$DEFAULT_STEP_VALUE = 1;
17
+ function $41e91674a959b70c$export$e5fda3247f5d67f9(props) {
18
+ const { isDisabled: isDisabled , minValue: minValue = $41e91674a959b70c$var$DEFAULT_MIN_VALUE , maxValue: maxValue = $41e91674a959b70c$var$DEFAULT_MAX_VALUE , numberFormatter: formatter , step: step = $41e91674a959b70c$var$DEFAULT_STEP_VALUE } = props;
19
+ const [values, setValues] = $35Cqk$useControlledState(props.value, props.defaultValue ?? [
20
20
  minValue
21
21
  ], props.onChange);
22
- const [isDraggings, setDraggings] = $9LrbI$useState(new Array(values.length).fill(false));
23
- const isEditablesRef = $9LrbI$useRef(new Array(values.length).fill(true));
24
- const [focusedIndex, setFocusedIndex] = $9LrbI$useState(undefined);
25
- const valuesRef = $9LrbI$useRef(null);
22
+ const [isDraggings, setDraggings] = $35Cqk$useState(new Array(values.length).fill(false));
23
+ const isEditablesRef = $35Cqk$useRef(new Array(values.length).fill(true));
24
+ const [focusedIndex, setFocusedIndex] = $35Cqk$useState(undefined);
25
+ const valuesRef = $35Cqk$useRef(null);
26
26
  valuesRef.current = values;
27
- const isDraggingsRef = $9LrbI$useRef(null);
27
+ const isDraggingsRef = $35Cqk$useRef(null);
28
28
  isDraggingsRef.current = isDraggings;
29
29
  function getValuePercent(value) {
30
30
  return (value - minValue) / (maxValue - minValue);
@@ -46,14 +46,14 @@ function $bc616ccd4b00f45f$export$e5fda3247f5d67f9(props) {
46
46
  const thisMin = getThumbMinValue(index);
47
47
  const thisMax = getThumbMaxValue(index);
48
48
  // Round value to multiple of step, clamp value between min and max
49
- value = $9LrbI$snapValueToStep(value, thisMin, thisMax, step);
50
- valuesRef.current = $bc616ccd4b00f45f$var$replaceIndex(valuesRef.current, index, value);
49
+ value = $35Cqk$snapValueToStep(value, thisMin, thisMax, step);
50
+ valuesRef.current = $41e91674a959b70c$var$replaceIndex(valuesRef.current, index, value);
51
51
  setValues(valuesRef.current);
52
52
  }
53
53
  function updateDragging(index, dragging) {
54
54
  if (isDisabled || !isThumbEditable(index)) return;
55
55
  const wasDragging = isDraggingsRef.current[index];
56
- isDraggingsRef.current = $bc616ccd4b00f45f$var$replaceIndex(isDraggingsRef.current, index, dragging);
56
+ isDraggingsRef.current = $41e91674a959b70c$var$replaceIndex(isDraggingsRef.current, index, dragging);
57
57
  setDraggings(isDraggingsRef.current);
58
58
  // Call onChangeEnd if no handles are dragging.
59
59
  if (props.onChangeEnd && wasDragging && !isDraggingsRef.current.some(Boolean)) props.onChangeEnd(valuesRef.current);
@@ -69,7 +69,7 @@ function $bc616ccd4b00f45f$export$e5fda3247f5d67f9(props) {
69
69
  }
70
70
  function getPercentValue(percent) {
71
71
  const val = percent * (maxValue - minValue) + minValue;
72
- return $9LrbI$clamp(getRoundedValue(val), minValue, maxValue);
72
+ return $35Cqk$clamp(getRoundedValue(val), minValue, maxValue);
73
73
  }
74
74
  return {
75
75
  values: values,
@@ -96,7 +96,7 @@ function $bc616ccd4b00f45f$export$e5fda3247f5d67f9(props) {
96
96
  step: step
97
97
  };
98
98
  }
99
- function $bc616ccd4b00f45f$var$replaceIndex(array, index, value) {
99
+ function $41e91674a959b70c$var$replaceIndex(array, index, value) {
100
100
  if (array[index] === value) return array;
101
101
  return [
102
102
  ...array.slice(0, index),
@@ -108,5 +108,5 @@ function $bc616ccd4b00f45f$var$replaceIndex(array, index, value) {
108
108
 
109
109
 
110
110
 
111
- export {$bc616ccd4b00f45f$export$e5fda3247f5d67f9 as useSliderState};
111
+ export {$41e91674a959b70c$export$e5fda3247f5d67f9 as useSliderState};
112
112
  //# sourceMappingURL=module.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-stately/slider",
3
- "version": "3.0.4-nightly.3085+dfe72ee07",
3
+ "version": "3.0.4-nightly.3086+b2abc5d94",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -18,10 +18,10 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "@babel/runtime": "^7.6.2",
21
- "@react-aria/i18n": "3.0.0-nightly.1394+dfe72ee07",
22
- "@react-aria/utils": "3.0.0-nightly.1394+dfe72ee07",
23
- "@react-stately/utils": "3.0.0-nightly.1394+dfe72ee07",
24
- "@react-types/slider": "3.0.3-nightly.3085+dfe72ee07"
21
+ "@react-aria/i18n": "3.0.0-nightly.1395+b2abc5d94",
22
+ "@react-aria/utils": "3.0.0-nightly.1395+b2abc5d94",
23
+ "@react-stately/utils": "3.0.0-nightly.1395+b2abc5d94",
24
+ "@react-types/slider": "3.0.3-nightly.3086+b2abc5d94"
25
25
  },
26
26
  "peerDependencies": {
27
27
  "react": "^16.8.0 || ^17.0.0-rc.1"
@@ -29,5 +29,5 @@
29
29
  "publishConfig": {
30
30
  "access": "public"
31
31
  },
32
- "gitHead": "dfe72ee076f7ca27728d0b6b4c1ef86e11191ece"
32
+ "gitHead": "b2abc5d94162a7bd614fffcdf11e3d3754dc7d9f"
33
33
  }