@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, 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] !== "646e0a4ba59e99bc170a0b0d50e8a904bc41135f208f44be7988b69caaccc2e6") {
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] = "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 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,263 @@ 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);
239
139
  };
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 => {
140
+ shortcutsMap.right = shortcutsMap.up = t11 => {
254
141
  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;
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
- $[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 => {
147
+ shortcutsMap.home = t12 => {
280
148
  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);
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 handleMouseMove = useEventCallback(t13);
301
- let t14;
302
- let t15;
303
- if ($[57] !== disabled || $[58] !== handleMouseMove || $[59] !== handleMouseUp || $[60] !== isDragging) {
304
- t14 = () => {
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
- 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
- }
220
+ stopDragging();
316
221
  }
317
- return () => {
318
- window.removeEventListener("mousemove", handleMouseMove);
319
- window.removeEventListener("mouseup", handleMouseUp);
320
- };
321
222
  };
322
- t15 = [isDragging, disabled, handleMouseMove, handleMouseUp];
323
- $[57] = disabled;
324
- $[58] = handleMouseMove;
325
- $[59] = handleMouseUp;
326
- $[60] = isDragging;
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
- t14 = $[61];
331
- t15 = $[62];
229
+ t10 = $[12];
230
+ t11 = $[13];
332
231
  }
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, {
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]: t17
238
+ [styles.marked]: t12
341
239
  });
342
- $[63] = className;
343
- $[64] = disabled;
344
- $[65] = t17;
345
- $[66] = t18;
240
+ $[14] = className;
241
+ $[15] = disabled;
242
+ $[16] = t12;
243
+ $[17] = t13;
346
244
  } else {
347
- t18 = $[66];
245
+ t13 = $[17];
348
246
  }
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;
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
- t20 = $[69];
259
+ t14 = $[18];
260
+ t15 = $[19];
361
261
  }
362
- const t21 = !showTicks;
363
- let t22;
364
- if ($[70] !== disabled || $[71] !== t21) {
365
- t22 = classNames(styles.rail, {
366
- [styles.rounded]: t21,
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
- $[70] = disabled;
370
- $[71] = t21;
371
- $[72] = t22;
269
+ $[20] = disabled;
270
+ $[21] = t16;
271
+ $[22] = t17;
372
272
  } else {
373
- t22 = $[72];
273
+ t17 = $[22];
374
274
  }
375
- let t23;
376
- if ($[73] !== t22) {
377
- t23 = /*#__PURE__*/jsx("div", {
378
- className: t22
275
+ let t18;
276
+ if ($[23] !== t17) {
277
+ t18 = /*#__PURE__*/jsx("div", {
278
+ className: t17
379
279
  });
380
- $[73] = t22;
381
- $[74] = t23;
280
+ $[23] = t17;
281
+ $[24] = t18;
382
282
  } else {
383
- t23 = $[74];
283
+ t18 = $[24];
384
284
  }
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
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
- $[75] = t24;
394
- $[76] = t25;
395
- $[77] = t26;
293
+ $[25] = t19;
294
+ $[26] = t20;
295
+ $[27] = t21;
396
296
  } else {
397
- t26 = $[77];
297
+ t21 = $[27];
398
298
  }
399
- const t27 = !showTicks;
400
- let t28;
401
- if ($[78] !== disabled || $[79] !== t27) {
402
- t28 = classNames(styles.track, {
403
- [styles.rounded]: t27,
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
- $[78] = disabled;
407
- $[79] = t27;
408
- $[80] = t28;
306
+ $[28] = disabled;
307
+ $[29] = t22;
308
+ $[30] = t23;
409
309
  } else {
410
- t28 = $[80];
310
+ t23 = $[30];
411
311
  }
412
- let t29;
413
- if ($[81] !== t26 || $[82] !== t28) {
414
- t29 = /*#__PURE__*/jsx("div", {
415
- style: t26,
416
- className: t28
312
+ let t24;
313
+ if ($[31] !== t21 || $[32] !== t23) {
314
+ t24 = /*#__PURE__*/jsx("div", {
315
+ style: t21,
316
+ className: t23
417
317
  });
418
- $[81] = t26;
419
- $[82] = t28;
420
- $[83] = t29;
318
+ $[31] = t21;
319
+ $[32] = t23;
320
+ $[33] = t24;
421
321
  } else {
422
- t29 = $[83];
322
+ t24 = $[33];
423
323
  }
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;
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
- t30 = $[93];
367
+ t25 = $[42];
484
368
  }
485
- let t31;
486
- if ($[103] !== disabled || $[104] !== max || $[105] !== min) {
487
- t31 = (t32, index_6) => {
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
- } = t32;
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
- $[103] = disabled;
504
- $[104] = max;
505
- $[105] = min;
506
- $[106] = t31;
387
+ $[43] = disabled;
388
+ $[44] = max;
389
+ $[45] = min;
390
+ $[46] = t26;
507
391
  } else {
508
- t31 = $[106];
392
+ t26 = $[46];
509
393
  }
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) => {
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
- } = t34;
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
- $[107] = disabled;
530
- $[108] = isRange;
531
- $[109] = max;
532
- $[110] = min;
533
- $[111] = validValues;
534
- $[112] = t33;
412
+ $[47] = disabled;
413
+ $[48] = isRange;
414
+ $[49] = max;
415
+ $[50] = min;
416
+ $[51] = validValues;
417
+ $[52] = t27;
535
418
  } else {
536
- t33 = $[112];
419
+ t27 = $[52];
537
420
  }
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;
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 };