@jetbrains/ring-ui-built 7.0.127 → 7.0.128
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.
|
@@ -4,9 +4,9 @@ import classNames from 'classnames';
|
|
|
4
4
|
import { isArray } from '../global/typescript-utils.js';
|
|
5
5
|
import Shortcuts from '../shortcuts/shortcuts.js';
|
|
6
6
|
import getUID from '../global/get-uid.js';
|
|
7
|
-
import { toRange, HUNDRED, calculateMarks, toPercent,
|
|
7
|
+
import { toRange, HUNDRED, calculateMarks, toPercent, calculateValue, adjustValues, validateValue } from './slider.utils.js';
|
|
8
8
|
import useEventCallback from '../global/use-event-callback.js';
|
|
9
|
-
import {
|
|
9
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
10
10
|
import '../shortcuts/core.js';
|
|
11
11
|
import 'core-js/modules/es.array.includes.js';
|
|
12
12
|
import 'combokeys';
|
|
@@ -17,12 +17,12 @@ import 'util-deprecate';
|
|
|
17
17
|
var styles = {"slider":"ring-slider-slider","disabled":"ring-slider-disabled","marked":"ring-slider-marked","rail":"ring-slider-rail","rounded":"ring-slider-rounded","track":"ring-slider-track","thumb":"ring-slider-thumb ring-global-resetButton","dragged":"ring-slider-dragged","tick":"ring-slider-tick","active":"ring-slider-active","markValue":"ring-slider-markValue","tag":"ring-slider-tag"};
|
|
18
18
|
|
|
19
19
|
const Slider = t0 => {
|
|
20
|
-
const $ = c(
|
|
21
|
-
if ($[0] !== "
|
|
22
|
-
for (let $i = 0; $i <
|
|
20
|
+
const $ = c(53);
|
|
21
|
+
if ($[0] !== "646e0a4ba59e99bc170a0b0d50e8a904bc41135f208f44be7988b69caaccc2e6") {
|
|
22
|
+
for (let $i = 0; $i < 53; $i += 1) {
|
|
23
23
|
$[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
24
24
|
}
|
|
25
|
-
$[0] = "
|
|
25
|
+
$[0] = "646e0a4ba59e99bc170a0b0d50e8a904bc41135f208f44be7988b69caaccc2e6";
|
|
26
26
|
}
|
|
27
27
|
const {
|
|
28
28
|
defaultValue,
|
|
@@ -42,7 +42,7 @@ const Slider = t0 => {
|
|
|
42
42
|
const max = t2 === undefined ? HUNDRED : t2;
|
|
43
43
|
const step = t3 === undefined ? 1 : t3;
|
|
44
44
|
const ref = useRef(null);
|
|
45
|
-
const
|
|
45
|
+
const activePointer = useRef(null);
|
|
46
46
|
const [values, setValues] = useState(defaultValue !== null && defaultValue !== void 0 ? defaultValue : min);
|
|
47
47
|
const validValues = toRange(value !== null && value !== void 0 ? value : values, min, max);
|
|
48
48
|
const validStep = step < 0 ? 0 : step;
|
|
@@ -58,6 +58,7 @@ const Slider = t0 => {
|
|
|
58
58
|
const isRange = t5;
|
|
59
59
|
const [isDragging, setIsDragging] = useState(false);
|
|
60
60
|
const [draggedIndex, setDraggedIndex] = useState(-1);
|
|
61
|
+
const [focused, setFocused] = useState(false);
|
|
61
62
|
let t6;
|
|
62
63
|
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
63
64
|
t6 = getUID("ring-slider-");
|
|
@@ -115,380 +116,263 @@ const Slider = t0 => {
|
|
|
115
116
|
t9 = $[9];
|
|
116
117
|
}
|
|
117
118
|
const handleValueChange = t9;
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
nextValues_0[index]
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
const thumb = ref.current?.querySelector(`[role="slider"][data-index="${nextValues_0.indexOf(previousValue)}"]`);
|
|
127
|
-
thumb?.focus();
|
|
128
|
-
}
|
|
129
|
-
handleValueChange(nextValues_0);
|
|
130
|
-
};
|
|
131
|
-
$[10] = handleValueChange;
|
|
132
|
-
$[11] = validValues;
|
|
133
|
-
$[12] = t10;
|
|
134
|
-
} else {
|
|
135
|
-
t10 = $[12];
|
|
136
|
-
}
|
|
137
|
-
const setValueAndSwap = t10;
|
|
138
|
-
const getIndex = _temp;
|
|
139
|
-
let shortcutsMap;
|
|
140
|
-
if ($[13] !== disabled || $[14] !== max || $[15] !== min || $[16] !== setValueAndSwap || $[17] !== validStep || $[18] !== validValues) {
|
|
141
|
-
shortcutsMap = {};
|
|
142
|
-
if (!disabled) {
|
|
143
|
-
let t11;
|
|
144
|
-
if ($[20] !== min || $[21] !== setValueAndSwap || $[22] !== validStep || $[23] !== validValues) {
|
|
145
|
-
t11 = t12 => {
|
|
146
|
-
const {
|
|
147
|
-
target: target_0
|
|
148
|
-
} = t12;
|
|
149
|
-
const index_0 = getIndex(target_0);
|
|
150
|
-
setValueAndSwap(Math.max(min, validValues[index_0] - validStep), index_0);
|
|
151
|
-
};
|
|
152
|
-
$[20] = min;
|
|
153
|
-
$[21] = setValueAndSwap;
|
|
154
|
-
$[22] = validStep;
|
|
155
|
-
$[23] = validValues;
|
|
156
|
-
$[24] = t11;
|
|
157
|
-
} else {
|
|
158
|
-
t11 = $[24];
|
|
159
|
-
}
|
|
160
|
-
shortcutsMap.left = shortcutsMap.down = t11;
|
|
161
|
-
let t12;
|
|
162
|
-
if ($[25] !== max || $[26] !== setValueAndSwap || $[27] !== validStep || $[28] !== validValues) {
|
|
163
|
-
t12 = t13 => {
|
|
164
|
-
const {
|
|
165
|
-
target: target_1
|
|
166
|
-
} = t13;
|
|
167
|
-
const index_1 = getIndex(target_1);
|
|
168
|
-
setValueAndSwap(Math.min(max, validValues[index_1] + validStep), index_1);
|
|
169
|
-
};
|
|
170
|
-
$[25] = max;
|
|
171
|
-
$[26] = setValueAndSwap;
|
|
172
|
-
$[27] = validStep;
|
|
173
|
-
$[28] = validValues;
|
|
174
|
-
$[29] = t12;
|
|
175
|
-
} else {
|
|
176
|
-
t12 = $[29];
|
|
177
|
-
}
|
|
178
|
-
shortcutsMap.right = shortcutsMap.up = t12;
|
|
179
|
-
let t13;
|
|
180
|
-
if ($[30] !== min || $[31] !== setValueAndSwap) {
|
|
181
|
-
t13 = t14 => {
|
|
182
|
-
const {
|
|
183
|
-
target: target_2
|
|
184
|
-
} = t14;
|
|
185
|
-
const index_2 = getIndex(target_2);
|
|
186
|
-
setValueAndSwap(min, index_2);
|
|
187
|
-
};
|
|
188
|
-
$[30] = min;
|
|
189
|
-
$[31] = setValueAndSwap;
|
|
190
|
-
$[32] = t13;
|
|
191
|
-
} else {
|
|
192
|
-
t13 = $[32];
|
|
193
|
-
}
|
|
194
|
-
shortcutsMap.home = t13;
|
|
195
|
-
let t14;
|
|
196
|
-
if ($[33] !== max || $[34] !== setValueAndSwap) {
|
|
197
|
-
t14 = t15 => {
|
|
198
|
-
const {
|
|
199
|
-
target: target_3
|
|
200
|
-
} = t15;
|
|
201
|
-
const index_3 = getIndex(target_3);
|
|
202
|
-
setValueAndSwap(max, index_3);
|
|
203
|
-
};
|
|
204
|
-
$[33] = max;
|
|
205
|
-
$[34] = setValueAndSwap;
|
|
206
|
-
$[35] = t14;
|
|
207
|
-
} else {
|
|
208
|
-
t14 = $[35];
|
|
209
|
-
}
|
|
210
|
-
shortcutsMap.end = t14;
|
|
119
|
+
const setValueAndSwap = (nextValue, index) => {
|
|
120
|
+
const nextValues_0 = [...validValues];
|
|
121
|
+
nextValues_0[index] = nextValue;
|
|
122
|
+
if (nextValues_0[0] > nextValues_0[1]) {
|
|
123
|
+
const previousValue = nextValues_0[index];
|
|
124
|
+
nextValues_0.reverse();
|
|
125
|
+
const thumb = ref.current?.querySelector(`[role="slider"][data-index="${nextValues_0.indexOf(previousValue)}"]`);
|
|
126
|
+
thumb?.focus();
|
|
211
127
|
}
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
if ($[36] !== disabled || $[37] !== isRange || $[38] !== max || $[39] !== min || $[40] !== validStep || $[41] !== validValues) {
|
|
224
|
-
t11 = e => {
|
|
225
|
-
e.stopPropagation();
|
|
226
|
-
if (disabled) {
|
|
227
|
-
return;
|
|
228
|
-
}
|
|
229
|
-
const index_4 = e.currentTarget.getAttribute("data-index");
|
|
230
|
-
const nextValue_0 = calculateValue(ref, e.pageX, min, max, validStep);
|
|
231
|
-
if (nextValue_0 !== null && !isNaN(nextValue_0) && !index_4) {
|
|
232
|
-
const rangeIndex = Number(Math.abs(validValues[0] - nextValue_0) > Math.abs(validValues[1] - nextValue_0));
|
|
233
|
-
setDraggedIndex(isRange ? rangeIndex : 0);
|
|
234
|
-
} else {
|
|
235
|
-
setDraggedIndex(Number(index_4));
|
|
236
|
-
}
|
|
237
|
-
setIsDragging(true);
|
|
238
|
-
previouslyDragged.current = false;
|
|
128
|
+
handleValueChange(nextValues_0);
|
|
129
|
+
};
|
|
130
|
+
const getIndex = _temp;
|
|
131
|
+
const shortcutsMap = {};
|
|
132
|
+
if (!disabled) {
|
|
133
|
+
shortcutsMap.left = shortcutsMap.down = t10 => {
|
|
134
|
+
const {
|
|
135
|
+
target: target_0
|
|
136
|
+
} = t10;
|
|
137
|
+
const index_0 = getIndex(target_0);
|
|
138
|
+
setValueAndSwap(Math.max(min, validValues[index_0] - validStep), index_0);
|
|
239
139
|
};
|
|
240
|
-
|
|
241
|
-
$[37] = isRange;
|
|
242
|
-
$[38] = max;
|
|
243
|
-
$[39] = min;
|
|
244
|
-
$[40] = validStep;
|
|
245
|
-
$[41] = validValues;
|
|
246
|
-
$[42] = t11;
|
|
247
|
-
} else {
|
|
248
|
-
t11 = $[42];
|
|
249
|
-
}
|
|
250
|
-
const handleMouseDown = t11;
|
|
251
|
-
let t12;
|
|
252
|
-
if ($[43] !== draggedIndex || $[44] !== handleValueChange || $[45] !== max || $[46] !== min || $[47] !== validStep || $[48] !== validValues) {
|
|
253
|
-
t12 = t13 => {
|
|
140
|
+
shortcutsMap.right = shortcutsMap.up = t11 => {
|
|
254
141
|
const {
|
|
255
|
-
|
|
256
|
-
} =
|
|
257
|
-
const
|
|
258
|
-
|
|
259
|
-
nextValues_1.reverse();
|
|
260
|
-
}
|
|
261
|
-
handleValueChange(nextValues_1);
|
|
262
|
-
setDraggedIndex(-1);
|
|
263
|
-
setIsDragging(false);
|
|
264
|
-
previouslyDragged.current = true;
|
|
142
|
+
target: target_1
|
|
143
|
+
} = t11;
|
|
144
|
+
const index_1 = getIndex(target_1);
|
|
145
|
+
setValueAndSwap(Math.min(max, validValues[index_1] + validStep), index_1);
|
|
265
146
|
};
|
|
266
|
-
|
|
267
|
-
$[44] = handleValueChange;
|
|
268
|
-
$[45] = max;
|
|
269
|
-
$[46] = min;
|
|
270
|
-
$[47] = validStep;
|
|
271
|
-
$[48] = validValues;
|
|
272
|
-
$[49] = t12;
|
|
273
|
-
} else {
|
|
274
|
-
t12 = $[49];
|
|
275
|
-
}
|
|
276
|
-
const handleMouseUp = useEventCallback(t12);
|
|
277
|
-
let t13;
|
|
278
|
-
if ($[50] !== draggedIndex || $[51] !== handleValueChange || $[52] !== max || $[53] !== min || $[54] !== validStep || $[55] !== validValues) {
|
|
279
|
-
t13 = t14 => {
|
|
147
|
+
shortcutsMap.home = t12 => {
|
|
280
148
|
const {
|
|
281
|
-
|
|
282
|
-
} =
|
|
283
|
-
const
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
149
|
+
target: target_2
|
|
150
|
+
} = t12;
|
|
151
|
+
const index_2 = getIndex(target_2);
|
|
152
|
+
setValueAndSwap(min, index_2);
|
|
153
|
+
};
|
|
154
|
+
shortcutsMap.end = t13 => {
|
|
155
|
+
const {
|
|
156
|
+
target: target_3
|
|
157
|
+
} = t13;
|
|
158
|
+
const index_3 = getIndex(target_3);
|
|
159
|
+
setValueAndSwap(max, index_3);
|
|
289
160
|
};
|
|
290
|
-
$[50] = draggedIndex;
|
|
291
|
-
$[51] = handleValueChange;
|
|
292
|
-
$[52] = max;
|
|
293
|
-
$[53] = min;
|
|
294
|
-
$[54] = validStep;
|
|
295
|
-
$[55] = validValues;
|
|
296
|
-
$[56] = t13;
|
|
297
|
-
} else {
|
|
298
|
-
t13 = $[56];
|
|
299
161
|
}
|
|
300
|
-
const
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
162
|
+
const stopDragging = useEventCallback(() => {
|
|
163
|
+
const pointerId = activePointer.current;
|
|
164
|
+
activePointer.current = null;
|
|
165
|
+
setDraggedIndex(-1);
|
|
166
|
+
setIsDragging(false);
|
|
167
|
+
if (pointerId !== null && ref.current?.hasPointerCapture(pointerId)) {
|
|
168
|
+
ref.current.releasePointerCapture(pointerId);
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
const handlePointerDown = e => {
|
|
172
|
+
e.stopPropagation();
|
|
173
|
+
if (disabled || e.button !== 0 || !e.isPrimary || activePointer.current !== null) {
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
const index_4 = e.currentTarget.getAttribute("data-index");
|
|
177
|
+
const nextValue_0 = calculateValue(ref, e.clientX, min, max, validStep);
|
|
178
|
+
if (nextValue_0 !== null && !isNaN(nextValue_0) && !index_4) {
|
|
179
|
+
const rangeIndex = Number(Math.abs(validValues[0] - nextValue_0) > Math.abs(validValues[1] - nextValue_0));
|
|
180
|
+
setDraggedIndex(isRange ? rangeIndex : 0);
|
|
181
|
+
} else {
|
|
182
|
+
setDraggedIndex(Number(index_4));
|
|
183
|
+
}
|
|
184
|
+
activePointer.current = e.pointerId;
|
|
185
|
+
ref.current?.setPointerCapture(e.pointerId);
|
|
186
|
+
setIsDragging(true);
|
|
187
|
+
};
|
|
188
|
+
const handlePointerUp = e_0 => {
|
|
189
|
+
if (disabled || activePointer.current !== e_0.pointerId) {
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
const nextValues_1 = adjustValues(validValues, ref, draggedIndex, e_0.clientX, max, min, validStep);
|
|
193
|
+
if (nextValues_1[0] > nextValues_1[1]) {
|
|
194
|
+
nextValues_1.reverse();
|
|
195
|
+
}
|
|
196
|
+
handleValueChange(nextValues_1);
|
|
197
|
+
stopDragging();
|
|
198
|
+
};
|
|
199
|
+
const handlePointerMove = e_1 => {
|
|
200
|
+
if (disabled || activePointer.current !== e_1.pointerId) {
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
const nextValues_2 = adjustValues(validValues, ref, draggedIndex, e_1.clientX, max, min, validStep);
|
|
204
|
+
if (nextValues_2[0] > nextValues_2[1]) {
|
|
205
|
+
nextValues_2.reverse();
|
|
206
|
+
setDraggedIndex(_temp2);
|
|
207
|
+
}
|
|
208
|
+
handleValueChange(nextValues_2);
|
|
209
|
+
};
|
|
210
|
+
const handlePointerCancel = e_2 => {
|
|
211
|
+
if (activePointer.current === e_2.pointerId) {
|
|
212
|
+
stopDragging();
|
|
213
|
+
}
|
|
214
|
+
};
|
|
215
|
+
let t10;
|
|
216
|
+
let t11;
|
|
217
|
+
if ($[10] !== disabled || $[11] !== stopDragging) {
|
|
218
|
+
t10 = () => {
|
|
305
219
|
if (disabled) {
|
|
306
|
-
|
|
307
|
-
}
|
|
308
|
-
if (isDragging && !previouslyDragged.current) {
|
|
309
|
-
window.addEventListener("mousemove", handleMouseMove);
|
|
310
|
-
window.addEventListener("mouseup", handleMouseUp);
|
|
311
|
-
} else {
|
|
312
|
-
if (!isDragging && previouslyDragged.current) {
|
|
313
|
-
window.removeEventListener("mousemove", handleMouseMove);
|
|
314
|
-
window.removeEventListener("mouseup", handleMouseUp);
|
|
315
|
-
}
|
|
220
|
+
stopDragging();
|
|
316
221
|
}
|
|
317
|
-
return () => {
|
|
318
|
-
window.removeEventListener("mousemove", handleMouseMove);
|
|
319
|
-
window.removeEventListener("mouseup", handleMouseUp);
|
|
320
|
-
};
|
|
321
222
|
};
|
|
322
|
-
|
|
323
|
-
$[
|
|
324
|
-
$[
|
|
325
|
-
$[
|
|
326
|
-
$[
|
|
327
|
-
$[61] = t14;
|
|
328
|
-
$[62] = t15;
|
|
223
|
+
t11 = [disabled, stopDragging];
|
|
224
|
+
$[10] = disabled;
|
|
225
|
+
$[11] = stopDragging;
|
|
226
|
+
$[12] = t10;
|
|
227
|
+
$[13] = t11;
|
|
329
228
|
} else {
|
|
330
|
-
|
|
331
|
-
|
|
229
|
+
t10 = $[12];
|
|
230
|
+
t11 = $[13];
|
|
332
231
|
}
|
|
333
|
-
useEffect(
|
|
334
|
-
const
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
t18 = classNames(styles.slider, className, {
|
|
232
|
+
useEffect(t10, t11);
|
|
233
|
+
const t12 = !!marks || showTag;
|
|
234
|
+
let t13;
|
|
235
|
+
if ($[14] !== className || $[15] !== disabled || $[16] !== t12) {
|
|
236
|
+
t13 = classNames(styles.slider, className, {
|
|
339
237
|
[styles.disabled]: disabled,
|
|
340
|
-
[styles.marked]:
|
|
238
|
+
[styles.marked]: t12
|
|
341
239
|
});
|
|
342
|
-
$[
|
|
343
|
-
$[
|
|
344
|
-
$[
|
|
345
|
-
$[
|
|
240
|
+
$[14] = className;
|
|
241
|
+
$[15] = disabled;
|
|
242
|
+
$[16] = t12;
|
|
243
|
+
$[17] = t13;
|
|
346
244
|
} else {
|
|
347
|
-
|
|
245
|
+
t13 = $[17];
|
|
348
246
|
}
|
|
349
|
-
|
|
350
|
-
let
|
|
351
|
-
if ($[
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
$[
|
|
247
|
+
let t14;
|
|
248
|
+
let t15;
|
|
249
|
+
if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
|
|
250
|
+
t14 = () => setFocused(true);
|
|
251
|
+
t15 = e_4 => {
|
|
252
|
+
if (!(e_4.relatedTarget instanceof Node) || !e_4.currentTarget.contains(e_4.relatedTarget)) {
|
|
253
|
+
setFocused(false);
|
|
254
|
+
}
|
|
255
|
+
};
|
|
256
|
+
$[18] = t14;
|
|
257
|
+
$[19] = t15;
|
|
359
258
|
} else {
|
|
360
|
-
|
|
259
|
+
t14 = $[18];
|
|
260
|
+
t15 = $[19];
|
|
361
261
|
}
|
|
362
|
-
const
|
|
363
|
-
let
|
|
364
|
-
if ($[
|
|
365
|
-
|
|
366
|
-
[styles.rounded]:
|
|
262
|
+
const t16 = !showTicks;
|
|
263
|
+
let t17;
|
|
264
|
+
if ($[20] !== disabled || $[21] !== t16) {
|
|
265
|
+
t17 = classNames(styles.rail, {
|
|
266
|
+
[styles.rounded]: t16,
|
|
367
267
|
[styles.disabled]: disabled
|
|
368
268
|
});
|
|
369
|
-
$[
|
|
370
|
-
$[
|
|
371
|
-
$[
|
|
269
|
+
$[20] = disabled;
|
|
270
|
+
$[21] = t16;
|
|
271
|
+
$[22] = t17;
|
|
372
272
|
} else {
|
|
373
|
-
|
|
273
|
+
t17 = $[22];
|
|
374
274
|
}
|
|
375
|
-
let
|
|
376
|
-
if ($[
|
|
377
|
-
|
|
378
|
-
className:
|
|
275
|
+
let t18;
|
|
276
|
+
if ($[23] !== t17) {
|
|
277
|
+
t18 = /*#__PURE__*/jsx("div", {
|
|
278
|
+
className: t17
|
|
379
279
|
});
|
|
380
|
-
$[
|
|
381
|
-
$[
|
|
280
|
+
$[23] = t17;
|
|
281
|
+
$[24] = t18;
|
|
382
282
|
} else {
|
|
383
|
-
|
|
283
|
+
t18 = $[24];
|
|
384
284
|
}
|
|
385
|
-
const
|
|
386
|
-
const
|
|
387
|
-
let
|
|
388
|
-
if ($[
|
|
389
|
-
|
|
390
|
-
left:
|
|
391
|
-
width:
|
|
285
|
+
const t19 = `${trackStart}%`;
|
|
286
|
+
const t20 = `${trackLength}%`;
|
|
287
|
+
let t21;
|
|
288
|
+
if ($[25] !== t19 || $[26] !== t20) {
|
|
289
|
+
t21 = {
|
|
290
|
+
left: t19,
|
|
291
|
+
width: t20
|
|
392
292
|
};
|
|
393
|
-
$[
|
|
394
|
-
$[
|
|
395
|
-
$[
|
|
293
|
+
$[25] = t19;
|
|
294
|
+
$[26] = t20;
|
|
295
|
+
$[27] = t21;
|
|
396
296
|
} else {
|
|
397
|
-
|
|
297
|
+
t21 = $[27];
|
|
398
298
|
}
|
|
399
|
-
const
|
|
400
|
-
let
|
|
401
|
-
if ($[
|
|
402
|
-
|
|
403
|
-
[styles.rounded]:
|
|
299
|
+
const t22 = !showTicks;
|
|
300
|
+
let t23;
|
|
301
|
+
if ($[28] !== disabled || $[29] !== t22) {
|
|
302
|
+
t23 = classNames(styles.track, {
|
|
303
|
+
[styles.rounded]: t22,
|
|
404
304
|
[styles.disabled]: disabled
|
|
405
305
|
});
|
|
406
|
-
$[
|
|
407
|
-
$[
|
|
408
|
-
$[
|
|
306
|
+
$[28] = disabled;
|
|
307
|
+
$[29] = t22;
|
|
308
|
+
$[30] = t23;
|
|
409
309
|
} else {
|
|
410
|
-
|
|
310
|
+
t23 = $[30];
|
|
411
311
|
}
|
|
412
|
-
let
|
|
413
|
-
if ($[
|
|
414
|
-
|
|
415
|
-
style:
|
|
416
|
-
className:
|
|
312
|
+
let t24;
|
|
313
|
+
if ($[31] !== t21 || $[32] !== t23) {
|
|
314
|
+
t24 = /*#__PURE__*/jsx("div", {
|
|
315
|
+
style: t21,
|
|
316
|
+
className: t23
|
|
417
317
|
});
|
|
418
|
-
$[
|
|
419
|
-
$[
|
|
420
|
-
$[
|
|
318
|
+
$[31] = t21;
|
|
319
|
+
$[32] = t23;
|
|
320
|
+
$[33] = t24;
|
|
421
321
|
} else {
|
|
422
|
-
|
|
322
|
+
t24 = $[33];
|
|
423
323
|
}
|
|
424
|
-
let
|
|
425
|
-
if ($[
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
$[101] = showTag;
|
|
467
|
-
$[102] = t31;
|
|
468
|
-
} else {
|
|
469
|
-
t31 = $[102];
|
|
470
|
-
}
|
|
471
|
-
t30 = validValues.map(t31);
|
|
472
|
-
$[84] = disabled;
|
|
473
|
-
$[85] = draggedIndex;
|
|
474
|
-
$[86] = handleMouseDown;
|
|
475
|
-
$[87] = isDragging;
|
|
476
|
-
$[88] = max;
|
|
477
|
-
$[89] = min;
|
|
478
|
-
$[90] = renderTag;
|
|
479
|
-
$[91] = showTag;
|
|
480
|
-
$[92] = validValues;
|
|
481
|
-
$[93] = t30;
|
|
324
|
+
let t25;
|
|
325
|
+
if ($[34] !== disabled || $[35] !== draggedIndex || $[36] !== handlePointerDown || $[37] !== isDragging || $[38] !== max || $[39] !== min || $[40] !== renderTag || $[41] !== showTag) {
|
|
326
|
+
t25 = (numValue, index_5) => {
|
|
327
|
+
const percent = toPercent(numValue, min, max);
|
|
328
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
329
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
330
|
+
tabIndex: 0,
|
|
331
|
+
"aria-label": "Pick value",
|
|
332
|
+
role: "slider",
|
|
333
|
+
"aria-valuemin": min,
|
|
334
|
+
"aria-valuemax": max,
|
|
335
|
+
"aria-valuenow": numValue,
|
|
336
|
+
"data-index": index_5,
|
|
337
|
+
style: {
|
|
338
|
+
left: `${percent}%`
|
|
339
|
+
},
|
|
340
|
+
className: classNames(styles.thumb, {
|
|
341
|
+
[styles.disabled]: disabled,
|
|
342
|
+
[styles.dragged]: isDragging && draggedIndex === index_5
|
|
343
|
+
}),
|
|
344
|
+
onPointerDown: handlePointerDown
|
|
345
|
+
}), showTag && /*#__PURE__*/jsx("div", {
|
|
346
|
+
style: {
|
|
347
|
+
left: `${percent}%`
|
|
348
|
+
},
|
|
349
|
+
className: classNames(styles.tag, {
|
|
350
|
+
[styles.disabled]: disabled
|
|
351
|
+
}),
|
|
352
|
+
role: "tooltip",
|
|
353
|
+
children: renderTag ? renderTag(numValue) : numValue
|
|
354
|
+
})]
|
|
355
|
+
}, index_5);
|
|
356
|
+
};
|
|
357
|
+
$[34] = disabled;
|
|
358
|
+
$[35] = draggedIndex;
|
|
359
|
+
$[36] = handlePointerDown;
|
|
360
|
+
$[37] = isDragging;
|
|
361
|
+
$[38] = max;
|
|
362
|
+
$[39] = min;
|
|
363
|
+
$[40] = renderTag;
|
|
364
|
+
$[41] = showTag;
|
|
365
|
+
$[42] = t25;
|
|
482
366
|
} else {
|
|
483
|
-
|
|
367
|
+
t25 = $[42];
|
|
484
368
|
}
|
|
485
|
-
let
|
|
486
|
-
if ($[
|
|
487
|
-
|
|
369
|
+
let t26;
|
|
370
|
+
if ($[43] !== disabled || $[44] !== max || $[45] !== min) {
|
|
371
|
+
t26 = (t27, index_6) => {
|
|
488
372
|
const {
|
|
489
373
|
value: markValue,
|
|
490
374
|
label
|
|
491
|
-
} =
|
|
375
|
+
} = t27;
|
|
492
376
|
const percent_0 = toPercent(markValue, min, max);
|
|
493
377
|
return /*#__PURE__*/jsx("div", {
|
|
494
378
|
style: {
|
|
@@ -500,20 +384,19 @@ const Slider = t0 => {
|
|
|
500
384
|
children: label !== null && label !== void 0 ? label : markValue
|
|
501
385
|
}, index_6);
|
|
502
386
|
};
|
|
503
|
-
$[
|
|
504
|
-
$[
|
|
505
|
-
$[
|
|
506
|
-
$[
|
|
387
|
+
$[43] = disabled;
|
|
388
|
+
$[44] = max;
|
|
389
|
+
$[45] = min;
|
|
390
|
+
$[46] = t26;
|
|
507
391
|
} else {
|
|
508
|
-
|
|
392
|
+
t26 = $[46];
|
|
509
393
|
}
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
t33 = (t34, index_7) => {
|
|
394
|
+
let t27;
|
|
395
|
+
if ($[47] !== disabled || $[48] !== isRange || $[49] !== max || $[50] !== min || $[51] !== validValues) {
|
|
396
|
+
t27 = (t28, index_7) => {
|
|
514
397
|
const {
|
|
515
398
|
value: tickValue
|
|
516
|
-
} =
|
|
399
|
+
} = t28;
|
|
517
400
|
const percent_1 = toPercent(tickValue, min, max);
|
|
518
401
|
const isActive = isRange ? tickValue >= validValues[0] && tickValue <= validValues[validValues.length - 1] : tickValue <= validValues[0];
|
|
519
402
|
return /*#__PURE__*/jsx("div", {
|
|
@@ -526,39 +409,34 @@ const Slider = t0 => {
|
|
|
526
409
|
}
|
|
527
410
|
}, index_7);
|
|
528
411
|
};
|
|
529
|
-
$[
|
|
530
|
-
$[
|
|
531
|
-
$[
|
|
532
|
-
$[
|
|
533
|
-
$[
|
|
534
|
-
$[
|
|
412
|
+
$[47] = disabled;
|
|
413
|
+
$[48] = isRange;
|
|
414
|
+
$[49] = max;
|
|
415
|
+
$[50] = min;
|
|
416
|
+
$[51] = validValues;
|
|
417
|
+
$[52] = t27;
|
|
535
418
|
} else {
|
|
536
|
-
|
|
419
|
+
t27 = $[52];
|
|
537
420
|
}
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
$[121] = t35;
|
|
558
|
-
} else {
|
|
559
|
-
t35 = $[121];
|
|
560
|
-
}
|
|
561
|
-
return t35;
|
|
421
|
+
return /*#__PURE__*/jsxs("div", {
|
|
422
|
+
ref: ref,
|
|
423
|
+
role: "presentation",
|
|
424
|
+
className: t13,
|
|
425
|
+
tabIndex: -1,
|
|
426
|
+
onMouseDown: _temp3,
|
|
427
|
+
onPointerDown: handlePointerDown,
|
|
428
|
+
onPointerMove: handlePointerMove,
|
|
429
|
+
onPointerUp: handlePointerUp,
|
|
430
|
+
onPointerCancel: handlePointerCancel,
|
|
431
|
+
onLostPointerCapture: handlePointerCancel,
|
|
432
|
+
onFocus: t14,
|
|
433
|
+
onBlur: t15,
|
|
434
|
+
children: [/*#__PURE__*/jsx(Shortcuts, {
|
|
435
|
+
map: shortcutsMap,
|
|
436
|
+
scope: shortcutsScope,
|
|
437
|
+
disabled: disabled || !focused
|
|
438
|
+
}), t18, t24, validValues.map(t25), markValues.map(t26), tickMarks.map(t27)]
|
|
439
|
+
});
|
|
562
440
|
};
|
|
563
441
|
function _temp(target) {
|
|
564
442
|
return Number(target?.getAttribute("data-index"));
|
|
@@ -566,5 +444,8 @@ function _temp(target) {
|
|
|
566
444
|
function _temp2(prevState) {
|
|
567
445
|
return prevState === 0 ? 1 : 0;
|
|
568
446
|
}
|
|
447
|
+
function _temp3(e_3) {
|
|
448
|
+
return e_3.stopPropagation();
|
|
449
|
+
}
|
|
569
450
|
|
|
570
451
|
export { Slider };
|