@jetbrains/ring-ui-built 7.0.127 → 7.0.129

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