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