@react-spectrum/slider 3.4.1-nightly.3598 → 3.4.1-nightly.3600
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.css +1 -1
- package/dist/main.js +149 -101
- package/dist/main.js.map +1 -1
- package/dist/module.mjs +149 -101
- package/dist/module.mjs.map +1 -1
- package/package.json +14 -14
package/dist/module.mjs
CHANGED
|
@@ -16,10 +16,41 @@ function $parcel$interopDefault(a) {
|
|
|
16
16
|
function $parcel$export(e, n, v, s) {
|
|
17
17
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
18
18
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
/*
|
|
20
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
21
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
22
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
23
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
24
|
+
*
|
|
25
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
26
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
27
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
28
|
+
* governing permissions and limitations under the License.
|
|
29
|
+
*/ /// <reference types="css-module-types" />
|
|
30
|
+
/*
|
|
31
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
32
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
33
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
34
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
35
|
+
*
|
|
36
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
37
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
38
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
39
|
+
* governing permissions and limitations under the License.
|
|
40
|
+
*/
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
/*
|
|
44
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
45
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
46
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
47
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
48
|
+
*
|
|
49
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
50
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
51
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
52
|
+
* governing permissions and limitations under the License.
|
|
53
|
+
*/
|
|
23
54
|
|
|
24
55
|
|
|
25
56
|
var $bfbf422e6c44be4b$exports = {};
|
|
@@ -144,37 +175,37 @@ $bfbf422e6c44be4b$export$fc5a803c4caf36a = "spectrum-Slider--label-side_e4b6ba";
|
|
|
144
175
|
|
|
145
176
|
|
|
146
177
|
function $39572711324a3b8e$var$SliderBase(props, ref) {
|
|
147
|
-
props = $9lJNF$useProviderProps(props);
|
|
148
|
-
let { isDisabled: isDisabled , children: children , classes: classes , style: style , labelPosition: labelPosition =
|
|
149
|
-
let { styleProps: styleProps } = $9lJNF$useStyleProps(otherProps);
|
|
178
|
+
props = (0, $9lJNF$useProviderProps)(props);
|
|
179
|
+
let { isDisabled: isDisabled , children: children , classes: classes , style: style , labelPosition: labelPosition = "top" , getValueLabel: getValueLabel , showValueLabel: showValueLabel = !!props.label , formatOptions: formatOptions , minValue: minValue = 0 , maxValue: maxValue = 100 , ...otherProps } = props;
|
|
180
|
+
let { styleProps: styleProps } = (0, $9lJNF$useStyleProps)(otherProps);
|
|
150
181
|
// `Math.abs(Math.sign(a) - Math.sign(b)) === 2` is true if the values have a different sign.
|
|
151
182
|
let alwaysDisplaySign = Math.abs(Math.sign(minValue) - Math.sign(maxValue)) === 2;
|
|
152
183
|
if (alwaysDisplaySign) {
|
|
153
184
|
if (formatOptions != null) {
|
|
154
|
-
if (!(
|
|
185
|
+
if (!("signDisplay" in formatOptions)) formatOptions = {
|
|
155
186
|
...formatOptions,
|
|
156
187
|
// @ts-ignore
|
|
157
|
-
signDisplay:
|
|
188
|
+
signDisplay: "exceptZero"
|
|
158
189
|
};
|
|
159
190
|
} else // @ts-ignore
|
|
160
191
|
formatOptions = {
|
|
161
|
-
signDisplay:
|
|
192
|
+
signDisplay: "exceptZero"
|
|
162
193
|
};
|
|
163
194
|
}
|
|
164
|
-
const formatter = $9lJNF$useNumberFormatter(formatOptions);
|
|
165
|
-
const state = $9lJNF$useSliderState({
|
|
195
|
+
const formatter = (0, $9lJNF$useNumberFormatter)(formatOptions);
|
|
196
|
+
const state = (0, $9lJNF$useSliderState)({
|
|
166
197
|
...props,
|
|
167
198
|
numberFormatter: formatter,
|
|
168
199
|
minValue: minValue,
|
|
169
200
|
maxValue: maxValue
|
|
170
201
|
});
|
|
171
|
-
let trackRef = $9lJNF$useRef();
|
|
172
|
-
let { groupProps: groupProps , trackProps: trackProps , labelProps: labelProps , outputProps: outputProps } = $9lJNF$useSlider(props, state, trackRef);
|
|
173
|
-
let inputRef = $9lJNF$useRef();
|
|
174
|
-
let domRef = $9lJNF$useFocusableRef(ref, inputRef);
|
|
175
|
-
let displayValue =
|
|
202
|
+
let trackRef = (0, $9lJNF$useRef)();
|
|
203
|
+
let { groupProps: groupProps , trackProps: trackProps , labelProps: labelProps , outputProps: outputProps } = (0, $9lJNF$useSlider)(props, state, trackRef);
|
|
204
|
+
let inputRef = (0, $9lJNF$useRef)();
|
|
205
|
+
let domRef = (0, $9lJNF$useFocusableRef)(ref, inputRef);
|
|
206
|
+
let displayValue = "";
|
|
176
207
|
let maxLabelLength = undefined;
|
|
177
|
-
if (typeof getValueLabel ===
|
|
208
|
+
if (typeof getValueLabel === "function") {
|
|
178
209
|
displayValue = getValueLabel(state.values);
|
|
179
210
|
switch(state.values.length){
|
|
180
211
|
case 1:
|
|
@@ -201,7 +232,7 @@ function $39572711324a3b8e$var$SliderBase(props, ref) {
|
|
|
201
232
|
]).length);
|
|
202
233
|
break;
|
|
203
234
|
default:
|
|
204
|
-
throw new Error(
|
|
235
|
+
throw new Error("Only sliders with 1 or 2 handles are supported!");
|
|
205
236
|
}
|
|
206
237
|
} else {
|
|
207
238
|
maxLabelLength = Math.max([
|
|
@@ -225,44 +256,44 @@ function $39572711324a3b8e$var$SliderBase(props, ref) {
|
|
|
225
256
|
].length);
|
|
226
257
|
break;
|
|
227
258
|
default:
|
|
228
|
-
throw new Error(
|
|
259
|
+
throw new Error("Only sliders with 1 or 2 handles are supported!");
|
|
229
260
|
}
|
|
230
261
|
}
|
|
231
|
-
let labelNode = /*#__PURE__*/ $9lJNF$react.createElement("label", {
|
|
232
|
-
className: $9lJNF$classNames((/*@__PURE__*/$parcel$interopDefault($bfbf422e6c44be4b$exports)),
|
|
262
|
+
let labelNode = /*#__PURE__*/ (0, $9lJNF$react).createElement("label", {
|
|
263
|
+
className: (0, $9lJNF$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($bfbf422e6c44be4b$exports))), "spectrum-Slider-label"),
|
|
233
264
|
...labelProps
|
|
234
265
|
}, props.label);
|
|
235
|
-
let valueNode = /*#__PURE__*/ $9lJNF$react.createElement("output", {
|
|
266
|
+
let valueNode = /*#__PURE__*/ (0, $9lJNF$react).createElement("output", {
|
|
236
267
|
...outputProps,
|
|
237
|
-
className: $9lJNF$classNames((/*@__PURE__*/$parcel$interopDefault($bfbf422e6c44be4b$exports)),
|
|
268
|
+
className: (0, $9lJNF$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($bfbf422e6c44be4b$exports))), "spectrum-Slider-value"),
|
|
238
269
|
style: maxLabelLength && {
|
|
239
270
|
width: `${maxLabelLength}ch`,
|
|
240
271
|
minWidth: `${maxLabelLength}ch`
|
|
241
272
|
}
|
|
242
273
|
}, displayValue);
|
|
243
|
-
return
|
|
274
|
+
return /*#__PURE__*/ (0, $9lJNF$react).createElement("div", {
|
|
244
275
|
ref: domRef,
|
|
245
|
-
className: $9lJNF$classNames((/*@__PURE__*/$parcel$interopDefault($bfbf422e6c44be4b$exports)),
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
276
|
+
className: (0, $9lJNF$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($bfbf422e6c44be4b$exports))), "spectrum-Slider", {
|
|
277
|
+
"spectrum-Slider--positionTop": labelPosition === "top",
|
|
278
|
+
"spectrum-Slider--positionSide": labelPosition === "side",
|
|
279
|
+
"is-disabled": isDisabled
|
|
249
280
|
}, classes, styleProps.className),
|
|
250
281
|
style: {
|
|
251
282
|
...style,
|
|
252
283
|
...styleProps.style
|
|
253
284
|
},
|
|
254
285
|
...groupProps
|
|
255
|
-
}, props.label && /*#__PURE__*/ $9lJNF$react.createElement("div", {
|
|
256
|
-
className: $9lJNF$classNames((/*@__PURE__*/$parcel$interopDefault($bfbf422e6c44be4b$exports)),
|
|
286
|
+
}, props.label && /*#__PURE__*/ (0, $9lJNF$react).createElement("div", {
|
|
287
|
+
className: (0, $9lJNF$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($bfbf422e6c44be4b$exports))), "spectrum-Slider-labelContainer"),
|
|
257
288
|
role: "presentation"
|
|
258
|
-
}, props.label && labelNode, props.contextualHelp && /*#__PURE__*/ $9lJNF$react.createElement($9lJNF$SlotProvider, {
|
|
289
|
+
}, props.label && labelNode, props.contextualHelp && /*#__PURE__*/ (0, $9lJNF$react).createElement((0, $9lJNF$SlotProvider), {
|
|
259
290
|
slots: {
|
|
260
291
|
actionButton: {
|
|
261
|
-
UNSAFE_className: $9lJNF$classNames((/*@__PURE__*/$parcel$interopDefault($bfbf422e6c44be4b$exports)),
|
|
292
|
+
UNSAFE_className: (0, $9lJNF$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($bfbf422e6c44be4b$exports))), "spectrum-Slider-contextualHelp")
|
|
262
293
|
}
|
|
263
294
|
}
|
|
264
|
-
}, props.contextualHelp), labelPosition ===
|
|
265
|
-
className: $9lJNF$classNames((/*@__PURE__*/$parcel$interopDefault($bfbf422e6c44be4b$exports)),
|
|
295
|
+
}, props.contextualHelp), labelPosition === "top" && showValueLabel && valueNode), /*#__PURE__*/ (0, $9lJNF$react).createElement("div", {
|
|
296
|
+
className: (0, $9lJNF$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($bfbf422e6c44be4b$exports))), "spectrum-Slider-controls"),
|
|
266
297
|
ref: trackRef,
|
|
267
298
|
...trackProps,
|
|
268
299
|
role: "presentation"
|
|
@@ -270,15 +301,25 @@ function $39572711324a3b8e$var$SliderBase(props, ref) {
|
|
|
270
301
|
trackRef: trackRef,
|
|
271
302
|
inputRef: inputRef,
|
|
272
303
|
state: state
|
|
273
|
-
})), labelPosition ===
|
|
274
|
-
className: $9lJNF$classNames((/*@__PURE__*/$parcel$interopDefault($bfbf422e6c44be4b$exports)),
|
|
304
|
+
})), labelPosition === "side" && /*#__PURE__*/ (0, $9lJNF$react).createElement("div", {
|
|
305
|
+
className: (0, $9lJNF$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($bfbf422e6c44be4b$exports))), "spectrum-Slider-valueLabelContainer"),
|
|
275
306
|
role: "presentation"
|
|
276
|
-
}, showValueLabel && valueNode))
|
|
307
|
+
}, showValueLabel && valueNode));
|
|
277
308
|
}
|
|
278
|
-
const $39572711324a3b8e$export$9418495bb635ebde = /*#__PURE__*/ $9lJNF$react.forwardRef($39572711324a3b8e$var$SliderBase);
|
|
279
|
-
|
|
309
|
+
const $39572711324a3b8e$export$9418495bb635ebde = /*#__PURE__*/ (0, $9lJNF$react).forwardRef($39572711324a3b8e$var$SliderBase);
|
|
280
310
|
|
|
281
311
|
|
|
312
|
+
/*
|
|
313
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
314
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
315
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
316
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
317
|
+
*
|
|
318
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
319
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
320
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
321
|
+
* governing permissions and limitations under the License.
|
|
322
|
+
*/
|
|
282
323
|
|
|
283
324
|
|
|
284
325
|
|
|
@@ -288,30 +329,29 @@ const $39572711324a3b8e$export$9418495bb635ebde = /*#__PURE__*/ $9lJNF$react.for
|
|
|
288
329
|
|
|
289
330
|
function $9058ca69d66a724f$export$2c1b491743890dec(props) {
|
|
290
331
|
let { inputRef: inputRef , state: state } = props;
|
|
291
|
-
let backupRef = $9lJNF$useRef();
|
|
332
|
+
let backupRef = (0, $9lJNF$useRef)();
|
|
292
333
|
inputRef = inputRef || backupRef;
|
|
293
|
-
let { thumbProps: thumbProps , inputProps: inputProps , isDragging: isDragging , isFocused: isFocused } = $9lJNF$useSliderThumb({
|
|
334
|
+
let { thumbProps: thumbProps , inputProps: inputProps , isDragging: isDragging , isFocused: isFocused } = (0, $9lJNF$useSliderThumb)({
|
|
294
335
|
...props,
|
|
295
336
|
inputRef: inputRef
|
|
296
337
|
}, state);
|
|
297
|
-
let { hoverProps: hoverProps , isHovered: isHovered } = $9lJNF$useHover({
|
|
298
|
-
|
|
299
|
-
return(/*#__PURE__*/ $9lJNF$react.createElement($9lJNF$FocusRing, {
|
|
338
|
+
let { hoverProps: hoverProps , isHovered: isHovered } = (0, $9lJNF$useHover)({});
|
|
339
|
+
return /*#__PURE__*/ (0, $9lJNF$react).createElement((0, $9lJNF$FocusRing), {
|
|
300
340
|
within: true,
|
|
301
|
-
focusRingClass: $9lJNF$classNames((/*@__PURE__*/$parcel$interopDefault($bfbf422e6c44be4b$exports)),
|
|
302
|
-
}, /*#__PURE__*/ $9lJNF$react.createElement("div", {
|
|
303
|
-
className: $9lJNF$classNames((/*@__PURE__*/$parcel$interopDefault($bfbf422e6c44be4b$exports)),
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
341
|
+
focusRingClass: (0, $9lJNF$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($bfbf422e6c44be4b$exports))), "is-focused")
|
|
342
|
+
}, /*#__PURE__*/ (0, $9lJNF$react).createElement("div", {
|
|
343
|
+
className: (0, $9lJNF$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($bfbf422e6c44be4b$exports))), "spectrum-Slider-handle", {
|
|
344
|
+
"is-hovered": isHovered,
|
|
345
|
+
"is-dragged": isDragging,
|
|
346
|
+
"is-tophandle": isFocused
|
|
307
347
|
}),
|
|
308
|
-
|
|
348
|
+
...(0, $9lJNF$mergeProps)(thumbProps, hoverProps),
|
|
309
349
|
role: "presentation"
|
|
310
|
-
}, /*#__PURE__*/ $9lJNF$react.createElement($9lJNF$VisuallyHidden, null, /*#__PURE__*/ $9lJNF$react.createElement("input", {
|
|
311
|
-
className: $9lJNF$classNames((/*@__PURE__*/$parcel$interopDefault($bfbf422e6c44be4b$exports)),
|
|
350
|
+
}, /*#__PURE__*/ (0, $9lJNF$react).createElement((0, $9lJNF$VisuallyHidden), null, /*#__PURE__*/ (0, $9lJNF$react).createElement("input", {
|
|
351
|
+
className: (0, $9lJNF$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($bfbf422e6c44be4b$exports))), "spectrum-Slider-input"),
|
|
312
352
|
ref: inputRef,
|
|
313
353
|
...inputProps
|
|
314
|
-
}))))
|
|
354
|
+
}))));
|
|
315
355
|
}
|
|
316
356
|
|
|
317
357
|
|
|
@@ -334,25 +374,24 @@ function $a1251704aa53e1a5$var$Slider(props, ref) {
|
|
|
334
374
|
onChangeEnd: (v)=>{
|
|
335
375
|
onChangeEnd === null || onChangeEnd === void 0 ? void 0 : onChangeEnd(v[0]);
|
|
336
376
|
},
|
|
337
|
-
getValueLabel: getValueLabel ? ([v])=>getValueLabel(v)
|
|
338
|
-
: undefined
|
|
377
|
+
getValueLabel: getValueLabel ? ([v])=>getValueLabel(v) : undefined
|
|
339
378
|
};
|
|
340
|
-
let { direction: direction } = $9lJNF$useLocale();
|
|
341
|
-
return
|
|
379
|
+
let { direction: direction } = (0, $9lJNF$useLocale)();
|
|
380
|
+
return /*#__PURE__*/ (0, $9lJNF$react).createElement((0, $39572711324a3b8e$export$9418495bb635ebde), {
|
|
342
381
|
...baseProps,
|
|
343
382
|
ref: ref,
|
|
344
383
|
classes: {
|
|
345
|
-
|
|
384
|
+
"spectrum-Slider--filled": isFilled && fillOffset == null
|
|
346
385
|
},
|
|
347
386
|
style: // @ts-ignore
|
|
348
387
|
{
|
|
349
|
-
|
|
388
|
+
"--spectrum-slider-track-gradient": trackGradient && `linear-gradient(to ${direction === "ltr" ? "right" : "left"}, ${trackGradient.join(", ")})`
|
|
350
389
|
}
|
|
351
390
|
}, ({ trackRef: trackRef , inputRef: inputRef , state: state })=>{
|
|
352
|
-
fillOffset = fillOffset != null ? $9lJNF$clamp(fillOffset, state.getThumbMinValue(0), state.getThumbMaxValue(0)) : fillOffset;
|
|
353
|
-
let cssDirection = direction ===
|
|
354
|
-
let lowerTrack = /*#__PURE__*/ $9lJNF$react.createElement("div", {
|
|
355
|
-
className: $9lJNF$classNames((/*@__PURE__*/$parcel$interopDefault($bfbf422e6c44be4b$exports)),
|
|
391
|
+
fillOffset = fillOffset != null ? (0, $9lJNF$clamp)(fillOffset, state.getThumbMinValue(0), state.getThumbMaxValue(0)) : fillOffset;
|
|
392
|
+
let cssDirection = direction === "rtl" ? "right" : "left";
|
|
393
|
+
let lowerTrack = /*#__PURE__*/ (0, $9lJNF$react).createElement("div", {
|
|
394
|
+
className: (0, $9lJNF$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($bfbf422e6c44be4b$exports))), "spectrum-Slider-track"),
|
|
356
395
|
style: {
|
|
357
396
|
width: `${state.getThumbPercent(0) * 100}%`,
|
|
358
397
|
// TODO not sure if it has advantages, but this could also be implemented as CSS calc():
|
|
@@ -361,17 +400,17 @@ function $a1251704aa53e1a5$var$Slider(props, ref) {
|
|
|
361
400
|
// width: calc(var(--width) * 1%)M
|
|
362
401
|
// }
|
|
363
402
|
// @ts-ignore
|
|
364
|
-
|
|
365
|
-
|
|
403
|
+
"--spectrum-track-background-size": `${1 / state.getThumbPercent(0) * 100}%`,
|
|
404
|
+
"--spectrum-track-background-position": direction === "ltr" ? "0" : "100%"
|
|
366
405
|
}
|
|
367
406
|
});
|
|
368
|
-
let upperTrack = /*#__PURE__*/ $9lJNF$react.createElement("div", {
|
|
369
|
-
className: $9lJNF$classNames((/*@__PURE__*/$parcel$interopDefault($bfbf422e6c44be4b$exports)),
|
|
407
|
+
let upperTrack = /*#__PURE__*/ (0, $9lJNF$react).createElement("div", {
|
|
408
|
+
className: (0, $9lJNF$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($bfbf422e6c44be4b$exports))), "spectrum-Slider-track"),
|
|
370
409
|
style: {
|
|
371
410
|
width: `${(1 - state.getThumbPercent(0)) * 100}%`,
|
|
372
411
|
// @ts-ignore
|
|
373
|
-
|
|
374
|
-
|
|
412
|
+
"--spectrum-track-background-size": `${1 / (1 - state.getThumbPercent(0)) * 100}%`,
|
|
413
|
+
"--spectrum-track-background-position": direction === "ltr" ? "100%" : "0"
|
|
375
414
|
}
|
|
376
415
|
});
|
|
377
416
|
let filledTrack = null;
|
|
@@ -379,9 +418,9 @@ function $a1251704aa53e1a5$var$Slider(props, ref) {
|
|
|
379
418
|
let width = state.getThumbPercent(0) - state.getValuePercent(fillOffset);
|
|
380
419
|
let isRightOfOffset = width > 0;
|
|
381
420
|
let offset = isRightOfOffset ? state.getValuePercent(fillOffset) : state.getThumbPercent(0);
|
|
382
|
-
filledTrack = /*#__PURE__*/ $9lJNF$react.createElement("div", {
|
|
383
|
-
className: $9lJNF$classNames((/*@__PURE__*/$parcel$interopDefault($bfbf422e6c44be4b$exports)),
|
|
384
|
-
|
|
421
|
+
filledTrack = /*#__PURE__*/ (0, $9lJNF$react).createElement("div", {
|
|
422
|
+
className: (0, $9lJNF$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($bfbf422e6c44be4b$exports))), "spectrum-Slider-fill", {
|
|
423
|
+
"spectrum-Slider-fill--right": isRightOfOffset
|
|
385
424
|
}),
|
|
386
425
|
style: {
|
|
387
426
|
[cssDirection]: `${offset * 100}%`,
|
|
@@ -389,21 +428,31 @@ function $a1251704aa53e1a5$var$Slider(props, ref) {
|
|
|
389
428
|
}
|
|
390
429
|
});
|
|
391
430
|
}
|
|
392
|
-
return
|
|
431
|
+
return /*#__PURE__*/ (0, $9lJNF$react).createElement((0, $9lJNF$react).Fragment, null, lowerTrack, /*#__PURE__*/ (0, $9lJNF$react).createElement((0, $9058ca69d66a724f$export$2c1b491743890dec), {
|
|
393
432
|
index: 0,
|
|
394
433
|
isDisabled: props.isDisabled,
|
|
395
434
|
trackRef: trackRef,
|
|
396
435
|
inputRef: inputRef,
|
|
397
436
|
state: state
|
|
398
|
-
}), filledTrack, upperTrack)
|
|
399
|
-
})
|
|
437
|
+
}), filledTrack, upperTrack);
|
|
438
|
+
});
|
|
400
439
|
}
|
|
401
440
|
/**
|
|
402
441
|
* Sliders allow users to quickly select a value within a range. They should be used when the upper and lower bounds to the range are invariable.
|
|
403
|
-
*/ const $a1251704aa53e1a5$export$472062a354075cee = /*#__PURE__*/ $9lJNF$react.forwardRef($a1251704aa53e1a5$var$Slider);
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
442
|
+
*/ const $a1251704aa53e1a5$export$472062a354075cee = /*#__PURE__*/ (0, $9lJNF$react).forwardRef($a1251704aa53e1a5$var$Slider);
|
|
443
|
+
|
|
444
|
+
|
|
445
|
+
/*
|
|
446
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
447
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
448
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
449
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
450
|
+
*
|
|
451
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
452
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
453
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
454
|
+
* governing permissions and limitations under the License.
|
|
455
|
+
*/
|
|
407
456
|
var $28d0e3950780ae05$exports = {};
|
|
408
457
|
var $e8390eb96e247aac$exports = {};
|
|
409
458
|
$e8390eb96e247aac$exports = {
|
|
@@ -717,52 +766,51 @@ function $d42a197b273dc031$var$RangeSlider(props, ref) {
|
|
|
717
766
|
getValueLabel: getValueLabel ? ([start, end])=>getValueLabel({
|
|
718
767
|
start: start,
|
|
719
768
|
end: end
|
|
720
|
-
})
|
|
721
|
-
: undefined
|
|
769
|
+
}) : undefined
|
|
722
770
|
};
|
|
723
|
-
let stringFormatter = $9lJNF$useLocalizedStringFormatter((/*@__PURE__*/$parcel$interopDefault($28d0e3950780ae05$exports)));
|
|
724
|
-
let { direction: direction } = $9lJNF$useLocale();
|
|
725
|
-
return
|
|
771
|
+
let stringFormatter = (0, $9lJNF$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($28d0e3950780ae05$exports))));
|
|
772
|
+
let { direction: direction } = (0, $9lJNF$useLocale)();
|
|
773
|
+
return /*#__PURE__*/ (0, $9lJNF$react).createElement((0, $39572711324a3b8e$export$9418495bb635ebde), {
|
|
726
774
|
...baseProps,
|
|
727
|
-
classes:
|
|
775
|
+
classes: "spectrum-Slider--range",
|
|
728
776
|
ref: ref
|
|
729
777
|
}, ({ trackRef: trackRef , inputRef: inputRef , state: state })=>{
|
|
730
|
-
let cssDirection = direction ===
|
|
731
|
-
return
|
|
732
|
-
className: $9lJNF$classNames((/*@__PURE__*/$parcel$interopDefault($bfbf422e6c44be4b$exports)),
|
|
778
|
+
let cssDirection = direction === "rtl" ? "right" : "left";
|
|
779
|
+
return /*#__PURE__*/ (0, $9lJNF$react).createElement((0, $9lJNF$react).Fragment, null, /*#__PURE__*/ (0, $9lJNF$react).createElement("div", {
|
|
780
|
+
className: (0, $9lJNF$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($bfbf422e6c44be4b$exports))), "spectrum-Slider-track"),
|
|
733
781
|
style: {
|
|
734
782
|
width: `${state.getThumbPercent(0) * 100}%`
|
|
735
783
|
}
|
|
736
|
-
}), /*#__PURE__*/ $9lJNF$react.createElement($9058ca69d66a724f$export$2c1b491743890dec, {
|
|
784
|
+
}), /*#__PURE__*/ (0, $9lJNF$react).createElement((0, $9058ca69d66a724f$export$2c1b491743890dec), {
|
|
737
785
|
index: 0,
|
|
738
|
-
"aria-label": stringFormatter.format(
|
|
786
|
+
"aria-label": stringFormatter.format("minimum"),
|
|
739
787
|
isDisabled: props.isDisabled,
|
|
740
788
|
trackRef: trackRef,
|
|
741
789
|
inputRef: inputRef,
|
|
742
790
|
state: state
|
|
743
|
-
}), /*#__PURE__*/ $9lJNF$react.createElement("div", {
|
|
744
|
-
className: $9lJNF$classNames((/*@__PURE__*/$parcel$interopDefault($bfbf422e6c44be4b$exports)),
|
|
791
|
+
}), /*#__PURE__*/ (0, $9lJNF$react).createElement("div", {
|
|
792
|
+
className: (0, $9lJNF$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($bfbf422e6c44be4b$exports))), "spectrum-Slider-track"),
|
|
745
793
|
style: {
|
|
746
794
|
[cssDirection]: `${state.getThumbPercent(0) * 100}%`,
|
|
747
795
|
width: `${Math.abs(state.getThumbPercent(0) - state.getThumbPercent(1)) * 100}%`
|
|
748
796
|
}
|
|
749
|
-
}), /*#__PURE__*/ $9lJNF$react.createElement($9058ca69d66a724f$export$2c1b491743890dec, {
|
|
797
|
+
}), /*#__PURE__*/ (0, $9lJNF$react).createElement((0, $9058ca69d66a724f$export$2c1b491743890dec), {
|
|
750
798
|
index: 1,
|
|
751
|
-
"aria-label": stringFormatter.format(
|
|
799
|
+
"aria-label": stringFormatter.format("maximum"),
|
|
752
800
|
isDisabled: props.isDisabled,
|
|
753
801
|
trackRef: trackRef,
|
|
754
802
|
state: state
|
|
755
|
-
}), /*#__PURE__*/ $9lJNF$react.createElement("div", {
|
|
756
|
-
className: $9lJNF$classNames((/*@__PURE__*/$parcel$interopDefault($bfbf422e6c44be4b$exports)),
|
|
803
|
+
}), /*#__PURE__*/ (0, $9lJNF$react).createElement("div", {
|
|
804
|
+
className: (0, $9lJNF$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($bfbf422e6c44be4b$exports))), "spectrum-Slider-track"),
|
|
757
805
|
style: {
|
|
758
806
|
width: `${(1 - state.getThumbPercent(1)) * 100}%`
|
|
759
807
|
}
|
|
760
|
-
}))
|
|
761
|
-
})
|
|
808
|
+
}));
|
|
809
|
+
});
|
|
762
810
|
}
|
|
763
811
|
/**
|
|
764
812
|
* RangeSliders allow users to quickly select a subset range. They should be used when the upper and lower bounds to the range are invariable.
|
|
765
|
-
*/ const $d42a197b273dc031$export$826424dabc3dd705 = /*#__PURE__*/ $9lJNF$react.forwardRef($d42a197b273dc031$var$RangeSlider);
|
|
813
|
+
*/ const $d42a197b273dc031$export$826424dabc3dd705 = /*#__PURE__*/ (0, $9lJNF$react).forwardRef($d42a197b273dc031$var$RangeSlider);
|
|
766
814
|
|
|
767
815
|
|
|
768
816
|
|