@tamagui/slider 1.1.8 → 1.1.9
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/cjs/Slider.js +214 -181
- package/dist/cjs/Slider.js.map +1 -1
- package/dist/cjs/SliderImpl.js +50 -43
- package/dist/cjs/SliderImpl.js.map +1 -1
- package/dist/cjs/helpers.js.map +1 -1
- package/dist/esm/Slider.js +210 -181
- package/dist/esm/Slider.js.map +1 -1
- package/dist/esm/SliderImpl.js +46 -43
- package/dist/esm/SliderImpl.js.map +1 -1
- package/dist/esm/helpers.js.map +1 -1
- package/dist/jsx/Slider.js +182 -91
- package/dist/jsx/Slider.js.map +1 -1
- package/dist/jsx/SliderImpl.js +43 -28
- package/dist/jsx/SliderImpl.js.map +1 -1
- package/dist/jsx/helpers.js.map +1 -1
- package/package.json +9 -9
package/dist/cjs/Slider.js
CHANGED
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -61,47 +65,53 @@ const SliderHorizontal = React.forwardRef(
|
|
|
61
65
|
const value = (0, import_helpers2.linearScale)(input, output);
|
|
62
66
|
return value(pointerPosition);
|
|
63
67
|
}
|
|
64
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
68
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
69
|
+
import_constants.SliderOrientationProvider,
|
|
70
|
+
{
|
|
71
|
+
scope: props.__scopeSlider,
|
|
72
|
+
startEdge: isDirectionLTR ? "left" : "right",
|
|
73
|
+
endEdge: isDirectionLTR ? "right" : "left",
|
|
74
|
+
direction: isDirectionLTR ? 1 : -1,
|
|
75
|
+
sizeProp: "width",
|
|
76
|
+
size: state.size,
|
|
77
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
78
|
+
import_SliderImpl.SliderImpl,
|
|
79
|
+
{
|
|
80
|
+
ref: (0, import_compose_refs.composeRefs)(forwardedRef, sliderRef),
|
|
81
|
+
dir: direction,
|
|
82
|
+
...sliderProps,
|
|
83
|
+
orientation: "horizontal",
|
|
84
|
+
onLayout: () => {
|
|
85
|
+
var _a;
|
|
86
|
+
(_a = sliderRef.current) == null ? void 0 : _a.measure((_x, _y, width, _height, pageX, _pageY) => {
|
|
87
|
+
setState({
|
|
88
|
+
size: width,
|
|
89
|
+
offset: pageX
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
},
|
|
93
|
+
onSlideStart: (event, target) => {
|
|
94
|
+
const value = getValueFromPointer(event.nativeEvent.locationX);
|
|
95
|
+
if (value) {
|
|
96
|
+
onSlideStart == null ? void 0 : onSlideStart(value, target);
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
onSlideMove: (event) => {
|
|
100
|
+
const value = getValueFromPointer(event.nativeEvent.pageX - state.offset);
|
|
101
|
+
if (value) {
|
|
102
|
+
onSlideMove == null ? void 0 : onSlideMove(value);
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
onSlideEnd: () => {
|
|
106
|
+
},
|
|
107
|
+
onStepKeyDown: (event) => {
|
|
108
|
+
const isBackKey = import_constants.BACK_KEYS[direction].includes(event.key);
|
|
109
|
+
onStepKeyDown == null ? void 0 : onStepKeyDown({ event, direction: isBackKey ? -1 : 1 });
|
|
110
|
+
}
|
|
95
111
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
onStepKeyDown: (event) => {
|
|
100
|
-
const isBackKey = import_constants.BACK_KEYS[direction].includes(event.key);
|
|
101
|
-
onStepKeyDown == null ? void 0 : onStepKeyDown({ event, direction: isBackKey ? -1 : 1 });
|
|
102
|
-
}
|
|
103
|
-
})
|
|
104
|
-
});
|
|
112
|
+
)
|
|
113
|
+
}
|
|
114
|
+
);
|
|
105
115
|
}
|
|
106
116
|
);
|
|
107
117
|
const SliderVertical = React.forwardRef(
|
|
@@ -115,46 +125,52 @@ const SliderVertical = React.forwardRef(
|
|
|
115
125
|
const value = (0, import_helpers2.linearScale)(input, output);
|
|
116
126
|
return value(pointerPosition);
|
|
117
127
|
}
|
|
118
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
128
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
129
|
+
import_constants.SliderOrientationProvider,
|
|
130
|
+
{
|
|
131
|
+
scope: props.__scopeSlider,
|
|
132
|
+
startEdge: "bottom",
|
|
133
|
+
endEdge: "top",
|
|
134
|
+
sizeProp: "height",
|
|
135
|
+
size: state.size,
|
|
136
|
+
direction: 1,
|
|
137
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
138
|
+
import_SliderImpl.SliderImpl,
|
|
139
|
+
{
|
|
140
|
+
ref: (0, import_compose_refs.composeRefs)(forwardedRef, sliderRef),
|
|
141
|
+
...sliderProps,
|
|
142
|
+
orientation: "vertical",
|
|
143
|
+
onLayout: ({ nativeEvent: { layout } }) => {
|
|
144
|
+
var _a;
|
|
145
|
+
(_a = sliderRef.current) == null ? void 0 : _a.measure((_x, _y, _width, height, _pageX, pageY) => {
|
|
146
|
+
setState({
|
|
147
|
+
size: height,
|
|
148
|
+
offset: pageY
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
},
|
|
152
|
+
onSlideStart: (event, target) => {
|
|
153
|
+
const value = getValueFromPointer(event.nativeEvent.locationY);
|
|
154
|
+
if (value) {
|
|
155
|
+
onSlideStart == null ? void 0 : onSlideStart(value, target);
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
onSlideMove: (event) => {
|
|
159
|
+
const value = getValueFromPointer(event.nativeEvent.pageY - state.offset);
|
|
160
|
+
if (value) {
|
|
161
|
+
onSlideMove == null ? void 0 : onSlideMove(value);
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
onSlideEnd: () => {
|
|
165
|
+
},
|
|
166
|
+
onStepKeyDown: (event) => {
|
|
167
|
+
const isBackKey = import_constants.BACK_KEYS.ltr.includes(event.key);
|
|
168
|
+
onStepKeyDown == null ? void 0 : onStepKeyDown({ event, direction: isBackKey ? -1 : 1 });
|
|
169
|
+
}
|
|
142
170
|
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
if (value) {
|
|
147
|
-
onSlideMove == null ? void 0 : onSlideMove(value);
|
|
148
|
-
}
|
|
149
|
-
},
|
|
150
|
-
onSlideEnd: () => {
|
|
151
|
-
},
|
|
152
|
-
onStepKeyDown: (event) => {
|
|
153
|
-
const isBackKey = import_constants.BACK_KEYS.ltr.includes(event.key);
|
|
154
|
-
onStepKeyDown == null ? void 0 : onStepKeyDown({ event, direction: isBackKey ? -1 : 1 });
|
|
155
|
-
}
|
|
156
|
-
})
|
|
157
|
-
});
|
|
171
|
+
)
|
|
172
|
+
}
|
|
173
|
+
);
|
|
158
174
|
}
|
|
159
175
|
);
|
|
160
176
|
const TRACK_NAME = "SliderTrack";
|
|
@@ -171,14 +187,17 @@ const SliderTrack = React.forwardRef(
|
|
|
171
187
|
(props, forwardedRef) => {
|
|
172
188
|
const { __scopeSlider, ...trackProps } = props;
|
|
173
189
|
const context = (0, import_constants.useSliderContext)(TRACK_NAME, __scopeSlider);
|
|
174
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
190
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
191
|
+
SliderTrackFrame,
|
|
192
|
+
{
|
|
193
|
+
"data-disabled": context.disabled ? "" : void 0,
|
|
194
|
+
"data-orientation": context.orientation,
|
|
195
|
+
orientation: context.orientation,
|
|
196
|
+
size: context.size,
|
|
197
|
+
...trackProps,
|
|
198
|
+
ref: forwardedRef
|
|
199
|
+
}
|
|
200
|
+
);
|
|
182
201
|
}
|
|
183
202
|
);
|
|
184
203
|
SliderTrack.displayName = TRACK_NAME;
|
|
@@ -201,24 +220,27 @@ const SliderTrackActive = React.forwardRef(
|
|
|
201
220
|
);
|
|
202
221
|
const offsetStart = valuesCount > 1 ? Math.min(...percentages) : 0;
|
|
203
222
|
const offsetEnd = 100 - Math.max(...percentages);
|
|
204
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
223
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
224
|
+
SliderTrackActiveFrame,
|
|
225
|
+
{
|
|
226
|
+
orientation: context.orientation,
|
|
227
|
+
"data-orientation": context.orientation,
|
|
228
|
+
"data-disabled": context.disabled ? "" : void 0,
|
|
229
|
+
size: context.size,
|
|
230
|
+
...rangeProps,
|
|
231
|
+
ref: composedRefs,
|
|
232
|
+
...{
|
|
233
|
+
[orientation.startEdge]: `${offsetStart}%`,
|
|
234
|
+
[orientation.endEdge]: `${offsetEnd}%`
|
|
235
|
+
},
|
|
236
|
+
...orientation.sizeProp === "width" ? {
|
|
237
|
+
height: "100%"
|
|
238
|
+
} : {
|
|
239
|
+
left: 0,
|
|
240
|
+
right: 0
|
|
241
|
+
}
|
|
220
242
|
}
|
|
221
|
-
|
|
243
|
+
);
|
|
222
244
|
}
|
|
223
245
|
);
|
|
224
246
|
SliderTrackActive.displayName = RANGE_NAME;
|
|
@@ -235,7 +257,9 @@ const getThumbSize = (val) => {
|
|
|
235
257
|
const SliderThumbFrame = (0, import_core.styled)(import_stacks.ThemeableStack, {
|
|
236
258
|
name: "SliderThumb",
|
|
237
259
|
position: "absolute",
|
|
260
|
+
// TODO not taking up 2
|
|
238
261
|
bordered: 2,
|
|
262
|
+
// OR THIS
|
|
239
263
|
borderWidth: 2,
|
|
240
264
|
backgrounded: true,
|
|
241
265
|
pressTheme: import_core.isWeb,
|
|
@@ -271,47 +295,50 @@ const SliderThumb = React.forwardRef(
|
|
|
271
295
|
};
|
|
272
296
|
}
|
|
273
297
|
}, [thumb, context.thumbs]);
|
|
274
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
top: "
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
left: "
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
298
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
299
|
+
SliderThumbFrame,
|
|
300
|
+
{
|
|
301
|
+
ref: composedRefs,
|
|
302
|
+
role: "slider",
|
|
303
|
+
"aria-label": props["aria-label"] || label,
|
|
304
|
+
"aria-valuemin": context.min,
|
|
305
|
+
"aria-valuenow": value,
|
|
306
|
+
"aria-valuemax": context.max,
|
|
307
|
+
"aria-orientation": context.orientation,
|
|
308
|
+
"data-orientation": context.orientation,
|
|
309
|
+
"data-disabled": context.disabled ? "" : void 0,
|
|
310
|
+
tabIndex: context.disabled ? void 0 : 0,
|
|
311
|
+
animateOnly: ["transform", "left", "right", "top", "bottom"],
|
|
312
|
+
...thumbProps,
|
|
313
|
+
...context.orientation === "horizontal" ? {
|
|
314
|
+
x: thumbInBoundsOffset - size / 2,
|
|
315
|
+
y: -size / 2,
|
|
316
|
+
top: "50%",
|
|
317
|
+
...size === 0 && {
|
|
318
|
+
top: "auto",
|
|
319
|
+
bottom: "auto"
|
|
320
|
+
}
|
|
321
|
+
} : {
|
|
322
|
+
x: -size / 2,
|
|
323
|
+
y: size / 2,
|
|
324
|
+
left: "50%",
|
|
325
|
+
...size === 0 && {
|
|
326
|
+
left: "auto",
|
|
327
|
+
right: "auto"
|
|
328
|
+
}
|
|
329
|
+
},
|
|
330
|
+
...{
|
|
331
|
+
[orientation.startEdge]: `${percent}%`
|
|
332
|
+
},
|
|
333
|
+
size: sizeIn,
|
|
334
|
+
onLayout: (e) => {
|
|
335
|
+
setSize(e.nativeEvent.layout[orientation.sizeProp]);
|
|
336
|
+
},
|
|
337
|
+
onFocus: (0, import_helpers.composeEventHandlers)(props.onFocus, () => {
|
|
338
|
+
context.valueIndexToChangeRef.current = index;
|
|
339
|
+
})
|
|
340
|
+
}
|
|
341
|
+
);
|
|
315
342
|
}
|
|
316
343
|
);
|
|
317
344
|
SliderThumb.displayName = THUMB_NAME;
|
|
@@ -385,45 +412,51 @@ const Slider = (0, import_core.withStaticProperties)(
|
|
|
385
412
|
});
|
|
386
413
|
}
|
|
387
414
|
const SliderOriented = isHorizontal ? SliderHorizontal : SliderVertical;
|
|
388
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
valueIndexToChangeRef,
|
|
394
|
-
thumbs: thumbRefs.current,
|
|
395
|
-
values,
|
|
396
|
-
orientation,
|
|
397
|
-
size: sizeProp,
|
|
398
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SliderOriented, {
|
|
399
|
-
"aria-disabled": disabled,
|
|
400
|
-
"data-disabled": disabled ? "" : void 0,
|
|
401
|
-
...sliderProps,
|
|
402
|
-
ref: composedRefs,
|
|
415
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
416
|
+
import_constants.SliderProvider,
|
|
417
|
+
{
|
|
418
|
+
scope: props.__scopeSlider,
|
|
419
|
+
disabled,
|
|
403
420
|
min,
|
|
404
421
|
max,
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
422
|
+
valueIndexToChangeRef,
|
|
423
|
+
thumbs: thumbRefs.current,
|
|
424
|
+
values,
|
|
425
|
+
orientation,
|
|
426
|
+
size: sizeProp,
|
|
427
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
428
|
+
SliderOriented,
|
|
429
|
+
{
|
|
430
|
+
"aria-disabled": disabled,
|
|
431
|
+
"data-disabled": disabled ? "" : void 0,
|
|
432
|
+
...sliderProps,
|
|
433
|
+
ref: composedRefs,
|
|
434
|
+
min,
|
|
435
|
+
max,
|
|
436
|
+
onSlideStart: disabled ? void 0 : (value2, target) => {
|
|
437
|
+
if (target !== "thumb") {
|
|
438
|
+
const closestIndex = (0, import_helpers2.getClosestValueIndex)(values, value2);
|
|
439
|
+
updateValues(value2, closestIndex);
|
|
440
|
+
}
|
|
441
|
+
},
|
|
442
|
+
onSlideMove: disabled ? void 0 : handleSlideMove,
|
|
443
|
+
onHomeKeyDown: () => !disabled && updateValues(min, 0),
|
|
444
|
+
onEndKeyDown: () => !disabled && updateValues(max, values.length - 1),
|
|
445
|
+
onStepKeyDown: ({ event, direction: stepDirection }) => {
|
|
446
|
+
if (!disabled) {
|
|
447
|
+
const isPageKey = import_constants.PAGE_KEYS.includes(event.key);
|
|
448
|
+
const isSkipKey = isPageKey || event.shiftKey && import_constants.ARROW_KEYS.includes(event.key);
|
|
449
|
+
const multiplier = isSkipKey ? 10 : 1;
|
|
450
|
+
const atIndex = valueIndexToChangeRef.current;
|
|
451
|
+
const value2 = values[atIndex];
|
|
452
|
+
const stepInDirection = step * multiplier * stepDirection;
|
|
453
|
+
updateValues(value2 + stepInDirection, atIndex);
|
|
454
|
+
}
|
|
455
|
+
}
|
|
409
456
|
}
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
onEndKeyDown: () => !disabled && updateValues(max, values.length - 1),
|
|
414
|
-
onStepKeyDown: ({ event, direction: stepDirection }) => {
|
|
415
|
-
if (!disabled) {
|
|
416
|
-
const isPageKey = import_constants.PAGE_KEYS.includes(event.key);
|
|
417
|
-
const isSkipKey = isPageKey || event.shiftKey && import_constants.ARROW_KEYS.includes(event.key);
|
|
418
|
-
const multiplier = isSkipKey ? 10 : 1;
|
|
419
|
-
const atIndex = valueIndexToChangeRef.current;
|
|
420
|
-
const value2 = values[atIndex];
|
|
421
|
-
const stepInDirection = step * multiplier * stepDirection;
|
|
422
|
-
updateValues(value2 + stepInDirection, atIndex);
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
})
|
|
426
|
-
});
|
|
457
|
+
)
|
|
458
|
+
}
|
|
459
|
+
);
|
|
427
460
|
}),
|
|
428
461
|
{
|
|
429
462
|
Track: SliderTrack,
|
package/dist/cjs/Slider.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Slider.tsx"],
|
|
4
4
|
"sourcesContent": ["// forked from radix-ui\n\nimport { composeRefs, useComposedRefs } from '@tamagui/compose-refs'\nimport {\n GetProps,\n SizeTokens,\n getVariableValue,\n isWeb,\n styled,\n withStaticProperties,\n} from '@tamagui/core'\nimport { getSize } from '@tamagui/get-size'\nimport { clamp, composeEventHandlers } from '@tamagui/helpers'\nimport { SizableStackProps, ThemeableStack } from '@tamagui/stacks'\nimport { useControllableState } from '@tamagui/use-controllable-state'\nimport { useDirection } from '@tamagui/use-direction'\nimport * as React from 'react'\nimport { View } from 'react-native'\n\nimport {\n ARROW_KEYS,\n BACK_KEYS,\n PAGE_KEYS,\n SLIDER_NAME,\n SliderOrientationProvider,\n SliderProvider,\n useSliderContext,\n useSliderOrientationContext,\n} from './constants'\nimport {\n convertValueToPercentage,\n getClosestValueIndex,\n getDecimalCount,\n getLabel,\n getNextSortedValues,\n getThumbInBoundsOffset,\n hasMinStepsBetweenValues,\n linearScale,\n roundValue,\n} from './helpers'\nimport { SliderFrame, SliderImpl } from './SliderImpl'\nimport {\n ScopedProps,\n SliderContextValue,\n SliderHorizontalProps,\n SliderProps,\n SliderTrackProps,\n SliderVerticalProps,\n} from './types'\n\n/* -------------------------------------------------------------------------------------------------\n * SliderHorizontal\n * -----------------------------------------------------------------------------------------------*/\n\nconst SliderHorizontal = React.forwardRef<View, SliderHorizontalProps>(\n (props: ScopedProps<SliderHorizontalProps>, forwardedRef) => {\n const { min, max, dir, onSlideStart, onSlideMove, onStepKeyDown, ...sliderProps } =\n props\n const direction = useDirection(dir)\n const isDirectionLTR = direction === 'ltr'\n const sliderRef = React.useRef<View>(null)\n const [state, setState] = React.useState(() => ({ size: 0, offset: 0 }))\n\n function getValueFromPointer(pointerPosition: number) {\n const input: [number, number] = [0, state.size]\n const output: [number, number] = isDirectionLTR ? [min, max] : [max, min]\n const value = linearScale(input, output)\n return value(pointerPosition)\n }\n\n return (\n <SliderOrientationProvider\n scope={props.__scopeSlider}\n startEdge={isDirectionLTR ? 'left' : 'right'}\n endEdge={isDirectionLTR ? 'right' : 'left'}\n direction={isDirectionLTR ? 1 : -1}\n sizeProp=\"width\"\n size={state.size}\n >\n <SliderImpl\n ref={composeRefs(forwardedRef, sliderRef)}\n dir={direction}\n {...sliderProps}\n orientation=\"horizontal\"\n onLayout={() => {\n sliderRef.current?.measure((_x, _y, width, _height, pageX, _pageY) => {\n setState({\n size: width,\n offset: pageX,\n })\n })\n }}\n onSlideStart={(event, target) => {\n const value = getValueFromPointer(event.nativeEvent.locationX)\n if (value) {\n onSlideStart?.(value, target)\n }\n }}\n onSlideMove={(event) => {\n const value = getValueFromPointer(event.nativeEvent.pageX - state.offset)\n if (value) {\n onSlideMove?.(value)\n }\n }}\n onSlideEnd={() => {}}\n onStepKeyDown={(event) => {\n const isBackKey = BACK_KEYS[direction].includes(event.key)\n onStepKeyDown?.({ event, direction: isBackKey ? -1 : 1 })\n }}\n />\n </SliderOrientationProvider>\n )\n }\n)\n\n/* -------------------------------------------------------------------------------------------------\n * SliderVertical\n * -----------------------------------------------------------------------------------------------*/\n\nconst SliderVertical = React.forwardRef<View, SliderVerticalProps>(\n (props: ScopedProps<SliderVerticalProps>, forwardedRef) => {\n const { min, max, onSlideStart, onSlideMove, onStepKeyDown, ...sliderProps } = props\n const [state, setState] = React.useState(() => ({ size: 0, offset: 0 }))\n const sliderRef = React.useRef<View>(null)\n\n function getValueFromPointer(pointerPosition: number) {\n const input: [number, number] = [0, state.size]\n const output: [number, number] = [max, min]\n const value = linearScale(input, output)\n return value(pointerPosition)\n }\n\n return (\n <SliderOrientationProvider\n scope={props.__scopeSlider}\n startEdge=\"bottom\"\n endEdge=\"top\"\n sizeProp=\"height\"\n size={state.size}\n direction={1}\n >\n <SliderImpl\n ref={composeRefs(forwardedRef, sliderRef)}\n {...sliderProps}\n orientation=\"vertical\"\n onLayout={({ nativeEvent: { layout } }) => {\n sliderRef.current?.measure((_x, _y, _width, height, _pageX, pageY) => {\n setState({\n size: height,\n offset: pageY,\n })\n })\n }}\n onSlideStart={(event, target) => {\n const value = getValueFromPointer(event.nativeEvent.locationY)\n if (value) {\n onSlideStart?.(value, target)\n }\n }}\n onSlideMove={(event) => {\n const value = getValueFromPointer(event.nativeEvent.pageY - state.offset)\n if (value) {\n onSlideMove?.(value)\n }\n }}\n onSlideEnd={() => {}}\n onStepKeyDown={(event) => {\n const isBackKey = BACK_KEYS.ltr.includes(event.key)\n onStepKeyDown?.({ event, direction: isBackKey ? -1 : 1 })\n }}\n />\n </SliderOrientationProvider>\n )\n }\n)\n\n/* -------------------------------------------------------------------------------------------------\n * SliderTrack\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRACK_NAME = 'SliderTrack'\n\ntype SliderTrackElement = HTMLElement | View\n\nexport const SliderTrackFrame = styled(SliderFrame, {\n name: 'SliderTrack',\n height: '100%',\n width: '100%',\n backgroundColor: '$background',\n position: 'relative',\n borderRadius: 100_000,\n overflow: 'hidden',\n})\n\nconst SliderTrack = React.forwardRef<SliderTrackElement, SliderTrackProps>(\n (props: ScopedProps<SliderTrackProps>, forwardedRef) => {\n const { __scopeSlider, ...trackProps } = props\n const context = useSliderContext(TRACK_NAME, __scopeSlider)\n return (\n <SliderTrackFrame\n data-disabled={context.disabled ? '' : undefined}\n data-orientation={context.orientation}\n orientation={context.orientation}\n size={context.size}\n {...trackProps}\n ref={forwardedRef}\n />\n )\n }\n)\n\nSliderTrack.displayName = TRACK_NAME\n\n/* -------------------------------------------------------------------------------------------------\n * SliderTrackActive\n * -----------------------------------------------------------------------------------------------*/\n\nconst RANGE_NAME = 'SliderTrackActive'\n\nexport const SliderTrackActiveFrame = styled(SliderFrame, {\n name: 'SliderTrackActive',\n backgroundColor: '$background',\n position: 'absolute',\n})\n\ntype SliderTrackActiveProps = GetProps<typeof SliderTrackActiveFrame>\n\nconst SliderTrackActive = React.forwardRef<View, SliderTrackActiveProps>(\n (props: ScopedProps<SliderTrackActiveProps>, forwardedRef) => {\n const { __scopeSlider, ...rangeProps } = props\n const context = useSliderContext(RANGE_NAME, __scopeSlider)\n const orientation = useSliderOrientationContext(RANGE_NAME, __scopeSlider)\n const ref = React.useRef<View>(null)\n const composedRefs = useComposedRefs(forwardedRef, ref)\n const valuesCount = context.values.length\n const percentages = context.values.map((value) =>\n convertValueToPercentage(value, context.min, context.max)\n )\n const offsetStart = valuesCount > 1 ? Math.min(...percentages) : 0\n const offsetEnd = 100 - Math.max(...percentages)\n\n return (\n <SliderTrackActiveFrame\n orientation={context.orientation}\n data-orientation={context.orientation}\n data-disabled={context.disabled ? '' : undefined}\n size={context.size}\n {...rangeProps}\n ref={composedRefs}\n {...{\n [orientation.startEdge]: `${offsetStart}%`,\n [orientation.endEdge]: `${offsetEnd}%`,\n }}\n {...(orientation.sizeProp === 'width'\n ? {\n height: '100%',\n }\n : {\n left: 0,\n right: 0,\n })}\n />\n )\n }\n)\n\nSliderTrackActive.displayName = RANGE_NAME\n\n/* -------------------------------------------------------------------------------------------------\n * SliderThumb\n * -----------------------------------------------------------------------------------------------*/\n\nconst THUMB_NAME = 'SliderThumb'\n\n// TODO make this customizable through tamagui\n// so we can accurately use it for estimatedSize below\nconst getThumbSize = (val?: SizeTokens | number) => {\n const size = typeof val === 'number' ? val : getSize(val, -1)\n return {\n width: size,\n height: size,\n minWidth: size,\n minHeight: size,\n }\n}\n\nexport const SliderThumbFrame = styled(ThemeableStack, {\n name: 'SliderThumb',\n position: 'absolute',\n // TODO not taking up 2\n bordered: 2,\n // OR THIS\n borderWidth: 2,\n backgrounded: true,\n pressTheme: isWeb,\n focusTheme: isWeb,\n hoverTheme: isWeb,\n\n variants: {\n size: {\n '...size': getThumbSize,\n },\n } as const,\n})\n\ninterface SliderThumbProps extends SizableStackProps {\n index: number\n}\n\nconst SliderThumb = React.forwardRef<View, SliderThumbProps>(\n (props: ScopedProps<SliderThumbProps>, forwardedRef) => {\n const { __scopeSlider, index, size: sizeProp, ...thumbProps } = props\n const context = useSliderContext(THUMB_NAME, __scopeSlider)\n const orientation = useSliderOrientationContext(THUMB_NAME, __scopeSlider)\n const [thumb, setThumb] = React.useState<View | HTMLElement | null>(null)\n const composedRefs = useComposedRefs(forwardedRef, (node) => setThumb(node))\n\n // We cast because index could be `-1` which would return undefined\n const value = context.values[index] as number | undefined\n const percent =\n value === undefined ? 0 : convertValueToPercentage(value, context.min, context.max)\n const label = getLabel(index, context.values.length)\n const sizeIn = sizeProp ?? context.size ?? '$true'\n const [size, setSize] = React.useState(() => {\n // for SSR\n const estimatedSize = getVariableValue(getThumbSize(sizeIn).width)\n return estimatedSize\n })\n\n const thumbInBoundsOffset = size\n ? getThumbInBoundsOffset(size, percent, orientation.direction)\n : 0\n\n React.useEffect(() => {\n if (thumb) {\n context.thumbs.add(thumb)\n return () => {\n context.thumbs.delete(thumb)\n }\n }\n }, [thumb, context.thumbs])\n\n return (\n <SliderThumbFrame\n ref={composedRefs}\n // TODO\n // @ts-ignore\n role=\"slider\"\n aria-label={props['aria-label'] || label}\n aria-valuemin={context.min}\n aria-valuenow={value}\n aria-valuemax={context.max}\n aria-orientation={context.orientation}\n data-orientation={context.orientation}\n data-disabled={context.disabled ? '' : undefined}\n tabIndex={context.disabled ? undefined : 0}\n animateOnly={['transform', 'left', 'right', 'top', 'bottom']}\n {...thumbProps}\n {...(context.orientation === 'horizontal'\n ? {\n x: thumbInBoundsOffset - size / 2,\n y: -size / 2,\n top: '50%',\n ...(size === 0 && {\n top: 'auto',\n bottom: 'auto',\n }),\n }\n : {\n x: -size / 2,\n y: size / 2,\n left: '50%',\n ...(size === 0 && {\n left: 'auto',\n right: 'auto',\n }),\n })}\n {...{\n [orientation.startEdge]: `${percent}%`,\n }}\n size={sizeIn}\n onLayout={(e) => {\n setSize(e.nativeEvent.layout[orientation.sizeProp])\n }}\n /**\n * There will be no value on initial render while we work out the index so we hide thumbs\n * without a value, otherwise SSR will render them in the wrong position before they\n * snap into the correct position during hydration which would be visually jarring for\n * slower connections.\n */\n // style={value === undefined ? { display: 'none' } : props.style}\n onFocus={composeEventHandlers(props.onFocus, () => {\n context.valueIndexToChangeRef.current = index\n })}\n />\n )\n }\n)\n\nSliderThumb.displayName = THUMB_NAME\n\n/* -------------------------------------------------------------------------------------------------\n * Slider\n * -----------------------------------------------------------------------------------------------*/\n\nconst Slider = withStaticProperties(\n React.forwardRef<View, SliderProps>((props: ScopedProps<SliderProps>, forwardedRef) => {\n const {\n name,\n min = 0,\n max = 100,\n step = 1,\n orientation = 'horizontal',\n disabled = false,\n minStepsBetweenThumbs = 0,\n defaultValue = [min],\n value,\n onValueChange = () => {},\n size: sizeProp,\n ...sliderProps\n } = props\n const sliderRef = React.useRef<View>(null)\n const composedRefs = useComposedRefs(sliderRef, forwardedRef)\n const thumbRefs = React.useRef<SliderContextValue['thumbs']>(new Set())\n const valueIndexToChangeRef = React.useRef<number>(0)\n const isHorizontal = orientation === 'horizontal'\n // We set this to true by default so that events bubble to forms without JS (SSR)\n // const isFormControl =\n // sliderRef.current instanceof HTMLElement ? Boolean(sliderRef.current.closest('form')) : true\n\n const [values = [], setValues] = useControllableState({\n prop: value,\n defaultProp: defaultValue,\n transition: true,\n onChange: (value) => {\n if (isWeb) {\n const thumbs = [...thumbRefs.current]\n thumbs[valueIndexToChangeRef.current]?.focus()\n }\n onValueChange(value)\n },\n })\n\n if (isWeb) {\n React.useEffect(() => {\n // @ts-ignore\n const node = sliderRef.current as HTMLElement\n if (!node) return\n const preventDefault = (e) => {\n e.preventDefault()\n }\n node.addEventListener('touchstart', preventDefault)\n return () => {\n node.removeEventListener('touchstart', preventDefault)\n }\n }, [])\n }\n\n function handleSlideMove(value: number) {\n updateValues(value, valueIndexToChangeRef.current)\n }\n\n function updateValues(value: number, atIndex: number) {\n const decimalCount = getDecimalCount(step)\n const snapToStep = roundValue(\n Math.round((value - min) / step) * step + min,\n decimalCount\n )\n const nextValue = clamp(snapToStep, [min, max])\n setValues((prevValues = []) => {\n const nextValues = getNextSortedValues(prevValues, nextValue, atIndex)\n if (hasMinStepsBetweenValues(nextValues, minStepsBetweenThumbs * step)) {\n valueIndexToChangeRef.current = nextValues.indexOf(nextValue)\n return String(nextValues) === String(prevValues) ? prevValues : nextValues\n } else {\n return prevValues\n }\n })\n }\n\n const SliderOriented = isHorizontal ? SliderHorizontal : SliderVertical\n\n return (\n <SliderProvider\n scope={props.__scopeSlider}\n disabled={disabled}\n min={min}\n max={max}\n valueIndexToChangeRef={valueIndexToChangeRef}\n thumbs={thumbRefs.current}\n values={values}\n orientation={orientation}\n size={sizeProp}\n >\n <SliderOriented\n aria-disabled={disabled}\n data-disabled={disabled ? '' : undefined}\n {...sliderProps}\n ref={composedRefs}\n min={min}\n max={max}\n onSlideStart={\n disabled\n ? undefined\n : (value: number, target) => {\n // when starting on the track, move it right away\n // when starting on thumb, dont jump until movemenet as it feels weird\n if (target !== 'thumb') {\n const closestIndex = getClosestValueIndex(values, value)\n updateValues(value, closestIndex)\n }\n }\n }\n onSlideMove={disabled ? undefined : handleSlideMove}\n onHomeKeyDown={() => !disabled && updateValues(min, 0)}\n onEndKeyDown={() => !disabled && updateValues(max, values.length - 1)}\n onStepKeyDown={({ event, direction: stepDirection }) => {\n if (!disabled) {\n const isPageKey = PAGE_KEYS.includes(event.key)\n const isSkipKey =\n isPageKey || (event.shiftKey && ARROW_KEYS.includes(event.key))\n const multiplier = isSkipKey ? 10 : 1\n const atIndex = valueIndexToChangeRef.current\n const value = values[atIndex]\n const stepInDirection = step * multiplier * stepDirection\n updateValues(value + stepInDirection, atIndex)\n }\n }}\n />\n {/* {isFormControl &&\n values.map((value, index) => (\n <BubbleInput\n key={index}\n name={name ? name + (values.length > 1 ? '[]' : '') : undefined}\n value={value}\n />\n ))} */}\n </SliderProvider>\n )\n }),\n {\n Track: SliderTrack,\n TrackActive: SliderTrackActive,\n Thumb: SliderThumb,\n }\n)\n\nSlider.displayName = SLIDER_NAME\n\n/* -----------------------------------------------------------------------------------------------*/\n\n// // TODO\n// const BubbleInput = (props: any) => {\n// const { value, ...inputProps } = props\n// const ref = React.useRef<HTMLInputElement>(null)\n// const prevValue = usePrevious(value)\n\n// // Bubble value change to parents (e.g form change event)\n// React.useEffect(() => {\n// const input = ref.current!\n// const inputProto = window.HTMLInputElement.prototype\n// const descriptor = Object.getOwnPropertyDescriptor(inputProto, 'value') as PropertyDescriptor\n// const setValue = descriptor.set\n// if (prevValue !== value && setValue) {\n// const event = new Event('input', { bubbles: true })\n// setValue.call(input, value)\n// input.dispatchEvent(event)\n// }\n// }, [prevValue, value])\n\n// /**\n// * We purposefully do not use `type=\"hidden\"` here otherwise forms that\n// * wrap it will not be able to access its value via the FormData API.\n// *\n// * We purposefully do not add the `value` attribute here to allow the value\n// * to be set programatically and bubble to any parent form `onChange` event.\n// * Adding the `value` will cause React to consider the programatic\n// * dispatch a duplicate and it will get swallowed.\n// */\n// return <input style={{ display: 'none' }} {...inputProps} ref={ref} defaultValue={value} />\n// }\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst Track = SliderTrack\nconst Range = SliderTrackActive\nconst Thumb = SliderThumb\n\nexport {\n Slider,\n SliderTrack,\n SliderTrackActive,\n SliderThumb,\n //\n Track,\n Range,\n Thumb,\n}\n\nexport type { SliderProps, SliderTrackProps, SliderTrackActiveProps, SliderThumbProps }\n"],
|
|
5
|
-
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