related-ui-components 3.2.9 → 3.3.1
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/lib/module/components/Card/templates/SelaDealCard.js +0 -10
- package/lib/module/components/Card/templates/SelaDealCard.js.map +1 -1
- package/lib/module/components/RangeSlider/RangeSlider.js +260 -26
- package/lib/module/components/RangeSlider/RangeSlider.js.map +1 -1
- package/lib/module/components/RangeSlider/SliderLabel.js +93 -30
- package/lib/module/components/RangeSlider/SliderLabel.js.map +1 -1
- package/lib/typescript/src/components/Card/templates/SelaDealCard.d.ts.map +1 -1
- package/lib/typescript/src/components/RangeSlider/RangeSlider.d.ts +13 -0
- package/lib/typescript/src/components/RangeSlider/RangeSlider.d.ts.map +1 -1
- package/lib/typescript/src/components/RangeSlider/SliderLabel.d.ts.map +1 -1
- package/package.json +81 -81
- package/src/components/Card/templates/SelaDealCard.tsx +0 -11
- package/src/components/RangeSlider/RangeSlider.tsx +349 -50
- package/src/components/RangeSlider/SliderLabel.tsx +122 -38
|
@@ -5,7 +5,6 @@ import { View, StyleSheet, Image } from "react-native";
|
|
|
5
5
|
import Card from "../Card.js";
|
|
6
6
|
import { useTheme } from "../../../theme/ThemeContext.js";
|
|
7
7
|
import { LockOverlay } from "../../LockOverlay/index.js";
|
|
8
|
-
import { BlurView } from "expo-blur";
|
|
9
8
|
import { ThemedText as Text } from "../../ui/index.js";
|
|
10
9
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
10
|
const SelaDealCard = ({
|
|
@@ -141,15 +140,6 @@ const SelaDealCard = ({
|
|
|
141
140
|
style: descriptionTextStyle,
|
|
142
141
|
children: description
|
|
143
142
|
})]
|
|
144
|
-
}), price && priceContainerBlur && /*#__PURE__*/_jsx(BlurView, {
|
|
145
|
-
experimentalBlurMethod: "dimezisBlurView",
|
|
146
|
-
intensity: priceContainerBlur,
|
|
147
|
-
tint: "dark",
|
|
148
|
-
style: finalPriceContainerStyle,
|
|
149
|
-
children: /*#__PURE__*/_jsx(Text, {
|
|
150
|
-
style: finalPriceStyle,
|
|
151
|
-
children: price
|
|
152
|
-
})
|
|
153
143
|
}), price && !priceContainerBlur && /*#__PURE__*/_jsx(View, {
|
|
154
144
|
style: [{
|
|
155
145
|
backgroundColor: theme.primary
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useEffect","useState","View","StyleSheet","Image","Card","useTheme","LockOverlay","
|
|
1
|
+
{"version":3,"names":["React","useEffect","useState","View","StyleSheet","Image","Card","useTheme","LockOverlay","ThemedText","Text","jsx","_jsx","jsxs","_jsxs","SelaDealCard","variant","backgroundImage","label","labelStyle","labelContainerStyle","providerName","providerNameStyle","description","descriptionStyle","price","priceStyle","priceContainerStyle","itemId","onPress","style","width","height","isRTL","propIsRTL","borderRadius","darkOverlayEnabled","darkOverlayColor","lockOverlay","lockIcon","priceContainerBlur","showGrayscale","gestureHandler","theme","themeIsRTL","undefined","styles","getStyles","dynamicHeight","setDynamicHeight","uri","getSize","imgWidth","imgHeight","aspectRatio","finalLabelContainerStyle","labelContainerBase","finalLabelStyle","labelTextBase","finalPriceContainerStyle","priceContainerBase","priceContainerHorizontal","priceContainerVertical","finalPriceStyle","priceTextBase","providerTextStyle","providerNameBase","color","onSurface","descriptionTextStyle","descriptionBase","cardBase","greyscale","source","resizeMode","id","children","absoluteFill","backgroundColor","visible","contentPosition","icon","text","overlayOpacity","overlayContainer","topSection","bottomContentHorizontal","textBlockHorizontal","bottomContentVertical","textBlockVertical","primary","create","overflow","position","flex","padding","justifyContent","flexDirection","paddingVertical","paddingHorizontal","background","fontWeight","fontSize","onBackground","marginBottom","secondary","helper","onPrimary","alignItems","marginRight","alignSelf"],"sourceRoot":"..\\..\\..\\..\\..\\src","sources":["components/Card/templates/SelaDealCard.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAClD,SAIEC,IAAI,EAGJC,U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AE;IACrBS,aAAa,EAAE;EACjB,CAAC;EACDR,iBAAiB,EAAE;IACjBe,YAAY,EAAE,EAAE;IAChBI,UAAU,EAAC;EACb,CAAC;EACD9C,sBAAsB,EAAE;IACtBgD,SAAS,EAAE,SAAS;IACpBF,UAAU,EAAE;EACd;AACF,CAAC,CAAC;AAEJ,eAAe7F,YAAY","ignoreList":[]}
|
|
@@ -1,15 +1,56 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import React, { useCallback, useState } from "react";
|
|
3
|
+
import React, { useCallback, useMemo, useState } from "react";
|
|
4
4
|
import { I18nManager, StyleSheet, View } from "react-native";
|
|
5
5
|
import { Gesture, GestureDetector } from "react-native-gesture-handler";
|
|
6
6
|
import Animated, { runOnJS, useAnimatedStyle, useSharedValue } from "react-native-reanimated";
|
|
7
|
-
import { SliderLabels } from "./SliderLabel.js";
|
|
8
7
|
import { useTheme } from "../../theme/index.js";
|
|
8
|
+
import { SliderLabels } from "./SliderLabel.js";
|
|
9
|
+
import { Input } from "../Input/index.js";
|
|
9
10
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
11
|
const THUMB_SIZE = 28;
|
|
12
|
+
const THUMB_RADIUS = THUMB_SIZE / 2;
|
|
11
13
|
const RAIL_HEIGHT = 6;
|
|
12
14
|
const LABEL_HEIGHT = 26;
|
|
15
|
+
/**
|
|
16
|
+
* Creates percentile breakpoints from data
|
|
17
|
+
* Returns sorted unique values that represent the distribution
|
|
18
|
+
*/
|
|
19
|
+
function createPercentileBreakpoints(data) {
|
|
20
|
+
const sorted = [...new Set(data)].sort((a, b) => a - b);
|
|
21
|
+
if (sorted.length <= 100) {
|
|
22
|
+
return sorted;
|
|
23
|
+
}
|
|
24
|
+
const breakpoints = [];
|
|
25
|
+
const numBreakpoints = 100;
|
|
26
|
+
for (let i = 0; i <= numBreakpoints; i++) {
|
|
27
|
+
const index = Math.floor(i / numBreakpoints * (sorted.length - 1));
|
|
28
|
+
const value = sorted[index];
|
|
29
|
+
if (breakpoints[breakpoints.length - 1] !== value) {
|
|
30
|
+
breakpoints.push(value);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return breakpoints;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Binary search to find position in breakpoints
|
|
38
|
+
*/
|
|
39
|
+
function findBreakpointIndex(breakpoints, value) {
|
|
40
|
+
"worklet";
|
|
41
|
+
|
|
42
|
+
let left = 0;
|
|
43
|
+
let right = breakpoints.length - 1;
|
|
44
|
+
while (left < right) {
|
|
45
|
+
const mid = Math.floor((left + right) / 2);
|
|
46
|
+
if (breakpoints[mid] < value) {
|
|
47
|
+
left = mid + 1;
|
|
48
|
+
} else {
|
|
49
|
+
right = mid;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return left;
|
|
53
|
+
}
|
|
13
54
|
const RangeSlider = ({
|
|
14
55
|
min,
|
|
15
56
|
max,
|
|
@@ -18,7 +59,13 @@ const RangeSlider = ({
|
|
|
18
59
|
initialMinValue,
|
|
19
60
|
initialMaxValue,
|
|
20
61
|
onValueChange,
|
|
21
|
-
theme
|
|
62
|
+
theme,
|
|
63
|
+
scale = "linear",
|
|
64
|
+
dataPoints,
|
|
65
|
+
showCustomInputs = false,
|
|
66
|
+
inputPlaceholders,
|
|
67
|
+
inputLabels,
|
|
68
|
+
isBottomSheet = false
|
|
22
69
|
}) => {
|
|
23
70
|
const {
|
|
24
71
|
theme: defaultTheme
|
|
@@ -26,25 +73,82 @@ const RangeSlider = ({
|
|
|
26
73
|
const currTheme = theme || defaultTheme;
|
|
27
74
|
const styles = getStyles(currTheme);
|
|
28
75
|
const isRTL = I18nManager.isRTL;
|
|
29
|
-
|
|
30
|
-
// State for label text values, passed down to the SliderLabels component
|
|
31
76
|
const [leftLabel, setLeftLabel] = useState(initialMinValue.toLocaleString());
|
|
32
77
|
const [rightLabel, setRightLabel] = useState(initialMaxValue.toLocaleString());
|
|
78
|
+
|
|
79
|
+
// State for custom input fields
|
|
80
|
+
const [minInputValue, setMinInputValue] = useState(initialMinValue.toString());
|
|
81
|
+
const [maxInputValue, setMaxInputValue] = useState(initialMaxValue.toString());
|
|
82
|
+
|
|
83
|
+
// The effective track width (where thumb CENTER can travel)
|
|
84
|
+
const effectiveWidth = sliderWidth - THUMB_SIZE;
|
|
85
|
+
|
|
86
|
+
// Pre-compute breakpoints for percentile scale
|
|
87
|
+
const breakpoints = useMemo(() => {
|
|
88
|
+
if (scale === "percentile" && dataPoints?.length) {
|
|
89
|
+
return createPercentileBreakpoints(dataPoints);
|
|
90
|
+
}
|
|
91
|
+
return [];
|
|
92
|
+
}, [scale, dataPoints]);
|
|
93
|
+
const safeMin = scale === "logarithmic" ? Math.max(min, 0.001) : min;
|
|
33
94
|
const valueToPosition = useCallback(value => {
|
|
34
95
|
"worklet";
|
|
35
96
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
97
|
+
let percentage;
|
|
98
|
+
if (scale === "percentile" && breakpoints.length > 1) {
|
|
99
|
+
const index = findBreakpointIndex(breakpoints, value);
|
|
100
|
+
if (index === 0) {
|
|
101
|
+
percentage = 0;
|
|
102
|
+
} else if (index >= breakpoints.length - 1) {
|
|
103
|
+
percentage = 1;
|
|
104
|
+
} else {
|
|
105
|
+
const lowerVal = breakpoints[index - 1];
|
|
106
|
+
const upperVal = breakpoints[index];
|
|
107
|
+
const lowerPct = (index - 1) / (breakpoints.length - 1);
|
|
108
|
+
const upperPct = index / (breakpoints.length - 1);
|
|
109
|
+
if (upperVal === lowerVal) {
|
|
110
|
+
percentage = lowerPct;
|
|
111
|
+
} else {
|
|
112
|
+
const ratio = (value - lowerVal) / (upperVal - lowerVal);
|
|
113
|
+
percentage = lowerPct + ratio * (upperPct - lowerPct);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
} else if (scale === "logarithmic") {
|
|
117
|
+
const logMin = Math.log(safeMin);
|
|
118
|
+
const logMax = Math.log(max);
|
|
119
|
+
const logValue = Math.log(Math.max(value, safeMin));
|
|
120
|
+
percentage = (logValue - logMin) / (logMax - logMin);
|
|
121
|
+
} else {
|
|
122
|
+
percentage = (value - min) / (max - min);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// Map to effective width, offset by thumb radius
|
|
126
|
+
const position = percentage * effectiveWidth + THUMB_RADIUS;
|
|
127
|
+
return isRTL ? sliderWidth - position : position;
|
|
128
|
+
}, [min, max, safeMin, sliderWidth, effectiveWidth, isRTL, scale, breakpoints]);
|
|
40
129
|
const positionToValue = useCallback(position => {
|
|
41
130
|
"worklet";
|
|
42
131
|
|
|
43
|
-
//
|
|
44
|
-
const
|
|
45
|
-
const
|
|
132
|
+
// Convert position to percentage using effective width
|
|
133
|
+
const adjustedPosition = isRTL ? sliderWidth - position : position;
|
|
134
|
+
const percentage = (adjustedPosition - THUMB_RADIUS) / effectiveWidth;
|
|
135
|
+
const clampedPercentage = Math.max(0, Math.min(1, percentage));
|
|
136
|
+
let rawValue;
|
|
137
|
+
if (scale === "percentile" && breakpoints.length > 1) {
|
|
138
|
+
const exactIndex = clampedPercentage * (breakpoints.length - 1);
|
|
139
|
+
const lowerIndex = Math.floor(exactIndex);
|
|
140
|
+
const upperIndex = Math.min(lowerIndex + 1, breakpoints.length - 1);
|
|
141
|
+
const ratio = exactIndex - lowerIndex;
|
|
142
|
+
rawValue = breakpoints[lowerIndex] + ratio * (breakpoints[upperIndex] - breakpoints[lowerIndex]);
|
|
143
|
+
} else if (scale === "logarithmic") {
|
|
144
|
+
const logMin = Math.log(safeMin);
|
|
145
|
+
const logMax = Math.log(max);
|
|
146
|
+
rawValue = Math.exp(logMin + clampedPercentage * (logMax - logMin));
|
|
147
|
+
} else {
|
|
148
|
+
rawValue = clampedPercentage * (max - min) + min;
|
|
149
|
+
}
|
|
46
150
|
return Math.round(rawValue / step) * step;
|
|
47
|
-
}, [min, max, step, sliderWidth, isRTL]);
|
|
151
|
+
}, [min, max, safeMin, step, sliderWidth, effectiveWidth, isRTL, scale, breakpoints]);
|
|
48
152
|
const leftPosition = useSharedValue(valueToPosition(initialMinValue));
|
|
49
153
|
const rightPosition = useSharedValue(valueToPosition(initialMaxValue));
|
|
50
154
|
const context = useSharedValue({
|
|
@@ -68,20 +172,22 @@ const RangeSlider = ({
|
|
|
68
172
|
}).onUpdate(e => {
|
|
69
173
|
if (activeThumb.value === null) return;
|
|
70
174
|
const newPos = context.value.x + e.translationX;
|
|
71
|
-
|
|
72
|
-
// 5. Adjust clamping logic for RTL
|
|
73
175
|
if (activeThumb.value === "left") {
|
|
74
|
-
const lowerBound = isRTL ? rightPosition.value + THUMB_SIZE :
|
|
75
|
-
const upperBound = isRTL ? sliderWidth : rightPosition.value - THUMB_SIZE;
|
|
176
|
+
const lowerBound = isRTL ? rightPosition.value + THUMB_SIZE : THUMB_RADIUS;
|
|
177
|
+
const upperBound = isRTL ? sliderWidth - THUMB_RADIUS : rightPosition.value - THUMB_SIZE;
|
|
76
178
|
const clampedPos = Math.max(Math.min(newPos, upperBound), lowerBound);
|
|
77
179
|
leftPosition.value = clampedPos;
|
|
78
|
-
|
|
180
|
+
const newValue = positionToValue(clampedPos);
|
|
181
|
+
runOnJS(setLeftLabel)(newValue.toLocaleString());
|
|
182
|
+
runOnJS(setMinInputValue)(newValue.toString());
|
|
79
183
|
} else {
|
|
80
|
-
const lowerBound = isRTL ?
|
|
81
|
-
const upperBound = isRTL ? leftPosition.value - THUMB_SIZE : sliderWidth;
|
|
184
|
+
const lowerBound = isRTL ? THUMB_RADIUS : leftPosition.value + THUMB_SIZE;
|
|
185
|
+
const upperBound = isRTL ? leftPosition.value - THUMB_SIZE : sliderWidth - THUMB_RADIUS;
|
|
82
186
|
const clampedPos = Math.max(Math.min(newPos, upperBound), lowerBound);
|
|
83
187
|
rightPosition.value = clampedPos;
|
|
84
|
-
|
|
188
|
+
const newValue = positionToValue(clampedPos);
|
|
189
|
+
runOnJS(setRightLabel)(newValue.toLocaleString());
|
|
190
|
+
runOnJS(setMaxInputValue)(newValue.toString());
|
|
85
191
|
}
|
|
86
192
|
}).onEnd(() => {
|
|
87
193
|
if (activeThumb.value === null) return;
|
|
@@ -93,18 +199,84 @@ const RangeSlider = ({
|
|
|
93
199
|
});
|
|
94
200
|
activeThumb.value = null;
|
|
95
201
|
});
|
|
202
|
+
|
|
203
|
+
// Handlers for custom input fields
|
|
204
|
+
const handleMinInputChange = useCallback(text => {
|
|
205
|
+
// Allow only numeric input (with optional decimal)
|
|
206
|
+
const sanitized = text.replace(/[^0-9.]/g, "");
|
|
207
|
+
setMinInputValue(sanitized);
|
|
208
|
+
}, []);
|
|
209
|
+
const handleMaxInputChange = useCallback(text => {
|
|
210
|
+
const sanitized = text.replace(/[^0-9.]/g, "");
|
|
211
|
+
setMaxInputValue(sanitized);
|
|
212
|
+
}, []);
|
|
213
|
+
const handleMinInputSubmit = useCallback(() => {
|
|
214
|
+
const parsed = parseFloat(minInputValue);
|
|
215
|
+
if (isNaN(parsed)) {
|
|
216
|
+
// Reset to current slider value
|
|
217
|
+
const currentValue = positionToValue(leftPosition.value);
|
|
218
|
+
setMinInputValue(currentValue.toString());
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
// Clamp value: must be >= min and <= current max value
|
|
223
|
+
const currentMaxValue = positionToValue(rightPosition.value);
|
|
224
|
+
const clampedValue = Math.max(min, Math.min(parsed, currentMaxValue - step));
|
|
225
|
+
const steppedValue = Math.round(clampedValue / step) * step;
|
|
226
|
+
|
|
227
|
+
// Update input display
|
|
228
|
+
setMinInputValue(steppedValue.toString());
|
|
229
|
+
setLeftLabel(steppedValue.toLocaleString());
|
|
230
|
+
|
|
231
|
+
// Update slider position
|
|
232
|
+
leftPosition.value = valueToPosition(steppedValue);
|
|
233
|
+
|
|
234
|
+
// Trigger callback
|
|
235
|
+
onValueChange({
|
|
236
|
+
min: steppedValue,
|
|
237
|
+
max: currentMaxValue
|
|
238
|
+
});
|
|
239
|
+
}, [minInputValue, min, step, leftPosition, rightPosition, positionToValue, valueToPosition, onValueChange]);
|
|
240
|
+
const handleMaxInputSubmit = useCallback(() => {
|
|
241
|
+
const parsed = parseFloat(maxInputValue);
|
|
242
|
+
if (isNaN(parsed)) {
|
|
243
|
+
// Reset to current slider value
|
|
244
|
+
const currentValue = positionToValue(rightPosition.value);
|
|
245
|
+
setMaxInputValue(currentValue.toString());
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
// Clamp value: must be <= max and >= current min value
|
|
250
|
+
const currentMinValue = positionToValue(leftPosition.value);
|
|
251
|
+
const clampedValue = Math.min(max, Math.max(parsed, currentMinValue + step));
|
|
252
|
+
const steppedValue = Math.round(clampedValue / step) * step;
|
|
253
|
+
|
|
254
|
+
// Update input display
|
|
255
|
+
setMaxInputValue(steppedValue.toString());
|
|
256
|
+
setRightLabel(steppedValue.toLocaleString());
|
|
257
|
+
|
|
258
|
+
// Update slider position
|
|
259
|
+
rightPosition.value = valueToPosition(steppedValue);
|
|
260
|
+
|
|
261
|
+
// Trigger callback
|
|
262
|
+
onValueChange({
|
|
263
|
+
min: currentMinValue,
|
|
264
|
+
max: steppedValue
|
|
265
|
+
});
|
|
266
|
+
}, [maxInputValue, max, step, leftPosition, rightPosition, positionToValue, valueToPosition, onValueChange]);
|
|
267
|
+
|
|
268
|
+
// Thumb position = center of thumb, so offset by radius to get left edge
|
|
96
269
|
const animatedLeftThumbStyle = useAnimatedStyle(() => ({
|
|
97
270
|
transform: [{
|
|
98
|
-
translateX: leftPosition.value -
|
|
271
|
+
translateX: leftPosition.value - THUMB_RADIUS
|
|
99
272
|
}]
|
|
100
273
|
}));
|
|
101
274
|
const animatedRightThumbStyle = useAnimatedStyle(() => ({
|
|
102
275
|
transform: [{
|
|
103
|
-
translateX: rightPosition.value -
|
|
276
|
+
translateX: rightPosition.value - THUMB_RADIUS
|
|
104
277
|
}]
|
|
105
278
|
}));
|
|
106
279
|
const animatedActiveRailStyle = useAnimatedStyle(() => {
|
|
107
|
-
// 6. Use Math.min and Math.max to correctly draw the active rail in both LTR and RTL
|
|
108
280
|
const start = Math.min(leftPosition.value, rightPosition.value);
|
|
109
281
|
const end = Math.max(leftPosition.value, rightPosition.value);
|
|
110
282
|
return {
|
|
@@ -113,10 +285,41 @@ const RangeSlider = ({
|
|
|
113
285
|
};
|
|
114
286
|
});
|
|
115
287
|
return /*#__PURE__*/_jsxs(View, {
|
|
116
|
-
style: [styles.container, {
|
|
288
|
+
style: [showCustomInputs ? styles.containerWithInputs : styles.container, {
|
|
117
289
|
width: sliderWidth
|
|
118
290
|
}],
|
|
119
|
-
children: [/*#__PURE__*/
|
|
291
|
+
children: [showCustomInputs ? /*#__PURE__*/_jsxs(View, {
|
|
292
|
+
style: styles.inputsContainer,
|
|
293
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
294
|
+
style: styles.inputWrapper,
|
|
295
|
+
children: /*#__PURE__*/_jsx(Input, {
|
|
296
|
+
label: inputLabels?.min ?? "Min",
|
|
297
|
+
value: minInputValue,
|
|
298
|
+
onChangeText: handleMinInputChange,
|
|
299
|
+
onBlur: handleMinInputSubmit,
|
|
300
|
+
onSubmitEditing: handleMinInputSubmit,
|
|
301
|
+
keyboardType: "numeric",
|
|
302
|
+
placeholder: inputPlaceholders?.min,
|
|
303
|
+
placeholderTextColor: currTheme.surfaceVariant,
|
|
304
|
+
returnKeyType: "done",
|
|
305
|
+
isBottomSheet: isBottomSheet
|
|
306
|
+
})
|
|
307
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
308
|
+
style: styles.inputWrapper,
|
|
309
|
+
children: /*#__PURE__*/_jsx(Input, {
|
|
310
|
+
label: inputLabels?.max ?? "Max",
|
|
311
|
+
value: maxInputValue,
|
|
312
|
+
onChangeText: handleMaxInputChange,
|
|
313
|
+
onBlur: handleMaxInputSubmit,
|
|
314
|
+
onSubmitEditing: handleMaxInputSubmit,
|
|
315
|
+
keyboardType: "numeric",
|
|
316
|
+
placeholder: inputPlaceholders?.max,
|
|
317
|
+
placeholderTextColor: currTheme.surfaceVariant,
|
|
318
|
+
returnKeyType: "done",
|
|
319
|
+
isBottomSheet: isBottomSheet
|
|
320
|
+
})
|
|
321
|
+
})]
|
|
322
|
+
}) : /*#__PURE__*/_jsx(SliderLabels, {
|
|
120
323
|
leftValue: leftLabel,
|
|
121
324
|
rightValue: rightLabel,
|
|
122
325
|
leftPosition: leftPosition,
|
|
@@ -153,6 +356,9 @@ const getStyles = theme => StyleSheet.create({
|
|
|
153
356
|
marginTop: LABEL_HEIGHT,
|
|
154
357
|
direction: "ltr"
|
|
155
358
|
},
|
|
359
|
+
containerWithInputs: {
|
|
360
|
+
direction: "ltr"
|
|
361
|
+
},
|
|
156
362
|
railContainer: {
|
|
157
363
|
justifyContent: "center",
|
|
158
364
|
height: THUMB_SIZE
|
|
@@ -181,6 +387,34 @@ const getStyles = theme => StyleSheet.create({
|
|
|
181
387
|
backgroundColor: theme.background,
|
|
182
388
|
borderColor: theme.primary,
|
|
183
389
|
borderWidth: 5
|
|
390
|
+
},
|
|
391
|
+
inputsContainer: {
|
|
392
|
+
flexDirection: "row",
|
|
393
|
+
justifyContent: "space-between",
|
|
394
|
+
gap: 16,
|
|
395
|
+
marginBottom: 12,
|
|
396
|
+
direction: I18nManager.isRTL ? "rtl" : "ltr"
|
|
397
|
+
},
|
|
398
|
+
inputWrapper: {
|
|
399
|
+
flex: 1
|
|
400
|
+
},
|
|
401
|
+
inputLabel: {
|
|
402
|
+
color: theme.onSurface,
|
|
403
|
+
fontSize: 13,
|
|
404
|
+
fontFamily: "DinMedium",
|
|
405
|
+
marginBottom: 6
|
|
406
|
+
},
|
|
407
|
+
input: {
|
|
408
|
+
backgroundColor: theme.background,
|
|
409
|
+
paddingHorizontal: 16,
|
|
410
|
+
paddingVertical: 10,
|
|
411
|
+
borderRadius: 8,
|
|
412
|
+
borderWidth: 1,
|
|
413
|
+
borderColor: theme.surfaceVariant,
|
|
414
|
+
color: theme.onSurface,
|
|
415
|
+
fontSize: 15,
|
|
416
|
+
fontFamily: "DinBold",
|
|
417
|
+
textAlign: "center"
|
|
184
418
|
}
|
|
185
419
|
});
|
|
186
420
|
export default RangeSlider;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useCallback","useState","I18nManager","StyleSheet","View","Gesture","GestureDetector","Animated","runOnJS","useAnimatedStyle","useSharedValue","SliderLabels","useTheme","jsx","_jsx","jsxs","_jsxs","THUMB_SIZE","RAIL_HEIGHT","LABEL_HEIGHT","RangeSlider","min","max","step","sliderWidth","initialMinValue","initialMaxValue","onValueChange","theme","defaultTheme","currTheme","styles","getStyles","isRTL","leftLabel","setLeftLabel","toLocaleString","rightLabel","setRightLabel","valueToPosition","value","percentage","positionToValue","position","rawValue","Math","round","leftPosition","rightPosition","context","x","activeThumb","panGesture","Pan","onBegin","e","distToLeft","abs","distToRight","onUpdate","newPos","translationX","lowerBound","upperBound","clampedPos","onEnd","finalLeftValue","finalRightValue","animatedLeftThumbStyle","transform","translateX","animatedRightThumbStyle","animatedActiveRailStyle","start","end","left","right","style","container","width","children","leftValue","rightValue","thumbSize","gesture","railContainer","rail","activeRail","thumbContainer","thumb","create","height","justifyContent","marginTop","direction","borderRadius","backgroundColor","surface","primary","alignItems","background","borderColor","borderWidth"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/RangeSlider/RangeSlider.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,QAAQ,QAAQ,OAAO;AACpD,SAASC,WAAW,EAAEC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAC5D,SAASC,OAAO,EAAEC,eAAe,QAAQ,8BAA8B;AACvE,OAAOC,QAAQ,IACbC,OAAO,EACPC,gBAAgB,EAChBC,cAAc,QACT,yBAAyB;AAChC,SAASC,YAAY,QAAQ,kBAAe;AAC5C,SAAoBC,QAAQ,QAAQ,sBAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAA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qE,IAAI,EAAE;IACJK,MAAM,EAAEzE,WAAW;IACnB6E,YAAY,EAAE7E,WAAW,GAAG,CAAC;IAC7B8E,eAAe,EAAEpE,KAAK,CAACqE;EACzB,CAAC;EACDV,UAAU,EAAE;IACVI,MAAM,EAAEzE,WAAW;IACnB8E,eAAe,EAAEpE,KAAK,CAACsE,OAAO;IAC9BvD,QAAQ,EAAE;EACZ,CAAC;EACD6C,cAAc,EAAE;IACd7C,QAAQ,EAAE,UAAU;IACpBoC,KAAK,EAAE9D,UAAU;IACjB0E,MAAM,EAAE1E,UAAU;IAClB2E,cAAc,EAAE,QAAQ;IACxBO,UAAU,EAAE;EACd,CAAC;EACDV,KAAK,EAAE;IACLV,KAAK,EAAE9D,UAAU;IACjB0E,MAAM,EAAE1E,UAAU;IAClB8E,YAAY,EAAE9E,UAAU,GAAG,CAAC;IAC5B+E,eAAe,EAAEpE,KAAK,CAACwE,UAAU;IACjCC,WAAW,EAAEzE,KAAK,CAACsE,OAAO;IAC1BI,WAAW,EAAE;EACf;AACF,CAAC,CAAC;AAEJ,eAAelF,WAAW","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","useCallback","useMemo","useState","I18nManager","StyleSheet","View","Gesture","GestureDetector","Animated","runOnJS","useAnimatedStyle","useSharedValue","useTheme","SliderLabels","Input","jsx","_jsx","jsxs","_jsxs","THUMB_SIZE","THUMB_RADIUS","RAIL_HEIGHT","LABEL_HEIGHT","createPercentileBreakpoints","data","sorted","Set","sort","a","b","length","breakpoints","numBreakpoints","i","index","Math","floor","value","push","findBreakpointIndex","left","right","mid","RangeSlider","min","max","step","sliderWidth","initialMinValue","initialMaxValue","onValueChange","theme","scale","dataPoints","showCustomInputs","inputPlaceholders","inputLabels","isBottomSheet","defaultTheme","currTheme","styles","getStyles","isRTL","leftLabel","setLeftLabel","toLocaleString","rightLabel","setRightLabel","minInputValue","setMinInputValue","toString","maxInputValue","setMaxInputValue","effectiveWidth","safeMin","valueToPosition","percentage","lowerVal","upperVal","lowerPct","upperPct","ratio","logMin","log","logMax","logValue","position","positionToValue","adjustedPosition","clampedPercentage","rawValue","exactIndex","lowerIndex","upperIndex","exp","round","leftPosition","rightPosition","context","x","activeThumb","panGesture","Pan","onBegin","e","distToLeft","abs","distToRight","onUpdate","newPos","translationX","lowerBound","upperBound","clampedPos","newValue","onEnd","finalLeftValue","finalRightValue","handleMinInputChange","text","sanitized","replace","handleMaxInputChange","handleMinInputSubmit","parsed","parseFloat","isNaN","currentValue","currentMaxValue","clampedValue","steppedValue","handleMaxInputSubmit","currentMinValue","animatedLeftThumbStyle","transform","translateX","animatedRightThumbStyle","animatedActiveRailStyle","start","end","style","containerWithInputs","container","width","children","inputsContainer","inputWrapper","label","onChangeText","onBlur","onSubmitEditing","keyboardType","placeholder","placeholderTextColor","surfaceVariant","returnKeyType","leftValue","rightValue","thumbSize","gesture","railContainer","rail","activeRail","thumbContainer","thumb","create","height","justifyContent","marginTop","direction","borderRadius","backgroundColor","surface","primary","alignItems","background","borderColor","borderWidth","flexDirection","gap","marginBottom","flex","inputLabel","color","onSurface","fontSize","fontFamily","input","paddingHorizontal","paddingVertical","textAlign"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/RangeSlider/RangeSlider.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AAC7D,SAASC,WAAW,EAAEC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAC5D,SAASC,OAAO,EAAEC,eAAe,QAAQ,8BAA8B;AACvE,OAAOC,QAAQ,IACbC,OAAO,EACPC,gBAAgB,EAChBC,cAAc,QACT,yBAAyB;AAChC,SAAoBC,QAAQ,QAAQ,sBAAa;AACjD,SAASC,YAAY,QAAQ,kBAAe;AAC5C,SAASC,KAAK,QAAQ,mBAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEjC,MAAMC,UAAU,GAAG,EAAE;AACrB,M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IACd7E,QAAQ,EAAE,UAAU;IACpByD,KAAK,EAAE5H,UAAU;IACjBmJ,MAAM,EAAEnJ,UAAU;IAClBoJ,cAAc,EAAE,QAAQ;IACxBO,UAAU,EAAE;EACd,CAAC;EACDV,KAAK,EAAE;IACLrB,KAAK,EAAE5H,UAAU;IACjBmJ,MAAM,EAAEnJ,UAAU;IAClBuJ,YAAY,EAAEvJ,UAAU,GAAG,CAAC;IAC5BwJ,eAAe,EAAExH,KAAK,CAAC4H,UAAU;IACjCC,WAAW,EAAE7H,KAAK,CAAC0H,OAAO;IAC1BI,WAAW,EAAE;EACf,CAAC;EACDhC,eAAe,EAAE;IACfiC,aAAa,EAAE,KAAK;IACpBX,cAAc,EAAE,eAAe;IAC/BY,GAAG,EAAE,EAAE;IACPC,YAAY,EAAE,EAAE;IAChBX,SAAS,EAAEtK,WAAW,CAAC2D,KAAK,GAAG,KAAK,GAAG;EACzC,CAAC;EACDoF,YAAY,EAAE;IACZmC,IAAI,EAAE;EACR,CAAC;EACDC,UAAU,EAAE;IACVC,KAAK,EAAEpI,KAAK,CAACqI,SAAS;IACtBC,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,WAAW;IACvBN,YAAY,EAAE;EAChB,CAAC;EACDO,KAAK,EAAE;IACLhB,eAAe,EAAExH,KAAK,CAAC4H,UAAU;IACjCa,iBAAiB,EAAE,EAAE;IACrBC,eAAe,EAAE,EAAE;IACnBnB,YAAY,EAAE,CAAC;IACfO,WAAW,EAAE,CAAC;IACdD,WAAW,EAAE7H,KAAK,CAACuG,cAAc;IACjC6B,KAAK,EAAEpI,KAAK,CAACqI,SAAS;IACtBC,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,SAAS;IACrBI,SAAS,EAAE;EACb;AACF,CAAC,CAAC;AAEJ,eAAenJ,WAAW","ignoreList":[]}
|
|
@@ -6,35 +6,71 @@ import Animated, { useAnimatedStyle, useDerivedValue, useSharedValue } from "rea
|
|
|
6
6
|
import { useTheme } from "../../theme/index.js";
|
|
7
7
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
8
|
const LABEL_HEIGHT = 26;
|
|
9
|
-
const
|
|
9
|
+
const LABEL_PADDING = 8;
|
|
10
|
+
const MIN_GAP = 4;
|
|
11
|
+
const SingleLabel = ({
|
|
10
12
|
value,
|
|
11
13
|
position,
|
|
12
14
|
sliderWidth,
|
|
13
|
-
|
|
15
|
+
onWidthChange,
|
|
16
|
+
isVisible,
|
|
14
17
|
theme
|
|
15
18
|
}) => {
|
|
19
|
+
const styles = getStyles(theme);
|
|
20
|
+
const localWidth = useSharedValue(0);
|
|
21
|
+
const animatedStyle = useAnimatedStyle(() => {
|
|
22
|
+
const halfLabel = localWidth.value / 2;
|
|
23
|
+
const rawCenter = position.value;
|
|
24
|
+
const shifted = rawCenter - halfLabel;
|
|
25
|
+
const left = Math.min(Math.max(shifted, 0), sliderWidth - localWidth.value);
|
|
26
|
+
return {
|
|
27
|
+
left,
|
|
28
|
+
opacity: isVisible.value ? 1 : 0
|
|
29
|
+
};
|
|
30
|
+
});
|
|
31
|
+
return /*#__PURE__*/_jsx(Animated.View, {
|
|
32
|
+
style: [styles.labelContainer, animatedStyle],
|
|
33
|
+
onLayout: e => {
|
|
34
|
+
const width = e.nativeEvent.layout.width;
|
|
35
|
+
localWidth.value = width;
|
|
36
|
+
onWidthChange(width);
|
|
37
|
+
},
|
|
38
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
39
|
+
style: styles.labelText,
|
|
40
|
+
children: value
|
|
41
|
+
})
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
const MergedLabel = ({
|
|
45
|
+
leftValue,
|
|
46
|
+
rightValue,
|
|
47
|
+
leftPosition,
|
|
48
|
+
rightPosition,
|
|
49
|
+
sliderWidth,
|
|
50
|
+
isVisible,
|
|
51
|
+
theme
|
|
52
|
+
}) => {
|
|
53
|
+
const styles = getStyles(theme);
|
|
16
54
|
const labelWidth = useSharedValue(0);
|
|
17
|
-
const {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const styles = getStyles(currTheme);
|
|
22
|
-
const animatedLabelStyle = useAnimatedStyle(() => {
|
|
23
|
-
const rawCenter = position.value + thumbSize / 2;
|
|
24
|
-
const shifted = rawCenter - labelWidth.value / 2;
|
|
55
|
+
const animatedStyle = useAnimatedStyle(() => {
|
|
56
|
+
const centerPosition = (leftPosition.value + rightPosition.value) / 2;
|
|
57
|
+
const halfLabel = labelWidth.value / 2;
|
|
58
|
+
const shifted = centerPosition - halfLabel;
|
|
25
59
|
const left = Math.min(Math.max(shifted, 0), sliderWidth - labelWidth.value);
|
|
26
60
|
return {
|
|
27
|
-
left
|
|
61
|
+
left,
|
|
62
|
+
opacity: isVisible.value ? 1 : 0
|
|
28
63
|
};
|
|
29
64
|
});
|
|
65
|
+
const displayText = leftValue === rightValue ? leftValue : `${leftValue} - ${rightValue}`;
|
|
30
66
|
return /*#__PURE__*/_jsx(Animated.View, {
|
|
31
|
-
style: [styles.labelContainer,
|
|
67
|
+
style: [styles.labelContainer, animatedStyle],
|
|
32
68
|
onLayout: e => {
|
|
33
69
|
labelWidth.value = e.nativeEvent.layout.width;
|
|
34
70
|
},
|
|
35
71
|
children: /*#__PURE__*/_jsx(Text, {
|
|
36
72
|
style: styles.labelText,
|
|
37
|
-
children:
|
|
73
|
+
children: displayText
|
|
38
74
|
})
|
|
39
75
|
});
|
|
40
76
|
};
|
|
@@ -51,27 +87,54 @@ export const SliderLabels = ({
|
|
|
51
87
|
theme: defaultTheme
|
|
52
88
|
} = useTheme();
|
|
53
89
|
const currTheme = theme || defaultTheme;
|
|
54
|
-
const styles = getStyles(currTheme);
|
|
55
|
-
const rightThumbLeftPosition = useDerivedValue(() => {
|
|
56
|
-
return rightPosition.value - thumbSize;
|
|
57
|
-
});
|
|
58
|
-
const leftThumbLeftPosition = useDerivedValue(() => {
|
|
59
|
-
return leftPosition.value - thumbSize;
|
|
60
|
-
});
|
|
61
90
|
const isRTL = I18nManager.isRTL;
|
|
91
|
+
|
|
92
|
+
// Track label widths in parent for overlap calculation
|
|
93
|
+
const leftLabelWidth = useSharedValue(0);
|
|
94
|
+
const rightLabelWidth = useSharedValue(0);
|
|
95
|
+
const shouldMerge = useDerivedValue(() => {
|
|
96
|
+
const leftCenter = leftPosition.value;
|
|
97
|
+
const rightCenter = rightPosition.value;
|
|
98
|
+
const leftEnd = leftCenter + leftLabelWidth.value / 2;
|
|
99
|
+
const rightStart = rightCenter - rightLabelWidth.value / 2;
|
|
100
|
+
if (isRTL) {
|
|
101
|
+
const rtlLeftEnd = rightCenter + rightLabelWidth.value / 2;
|
|
102
|
+
const rtlRightStart = leftCenter - leftLabelWidth.value / 2;
|
|
103
|
+
return rtlRightStart - rtlLeftEnd < MIN_GAP;
|
|
104
|
+
}
|
|
105
|
+
return rightStart - leftEnd < MIN_GAP;
|
|
106
|
+
});
|
|
107
|
+
const showSeparate = useDerivedValue(() => !shouldMerge.value);
|
|
108
|
+
const showMerged = useDerivedValue(() => shouldMerge.value);
|
|
62
109
|
return /*#__PURE__*/_jsxs(View, {
|
|
63
|
-
style:
|
|
110
|
+
style: getStyles(currTheme).wrapper,
|
|
64
111
|
pointerEvents: "none",
|
|
65
|
-
children: [/*#__PURE__*/_jsx(
|
|
112
|
+
children: [/*#__PURE__*/_jsx(SingleLabel, {
|
|
66
113
|
value: leftValue,
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
114
|
+
position: leftPosition,
|
|
115
|
+
sliderWidth: sliderWidth,
|
|
116
|
+
onWidthChange: width => {
|
|
117
|
+
leftLabelWidth.value = width;
|
|
118
|
+
},
|
|
119
|
+
isVisible: showSeparate,
|
|
120
|
+
theme: currTheme
|
|
121
|
+
}), /*#__PURE__*/_jsx(SingleLabel, {
|
|
71
122
|
value: rightValue,
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
123
|
+
position: rightPosition,
|
|
124
|
+
sliderWidth: sliderWidth,
|
|
125
|
+
onWidthChange: width => {
|
|
126
|
+
rightLabelWidth.value = width;
|
|
127
|
+
},
|
|
128
|
+
isVisible: showSeparate,
|
|
129
|
+
theme: currTheme
|
|
130
|
+
}), /*#__PURE__*/_jsx(MergedLabel, {
|
|
131
|
+
leftValue: leftValue,
|
|
132
|
+
rightValue: rightValue,
|
|
133
|
+
leftPosition: leftPosition,
|
|
134
|
+
rightPosition: rightPosition,
|
|
135
|
+
sliderWidth: sliderWidth,
|
|
136
|
+
isVisible: showMerged,
|
|
137
|
+
theme: currTheme
|
|
75
138
|
})]
|
|
76
139
|
});
|
|
77
140
|
};
|
|
@@ -88,7 +151,7 @@ const getStyles = theme => StyleSheet.create({
|
|
|
88
151
|
},
|
|
89
152
|
labelText: {
|
|
90
153
|
backgroundColor: theme.surface,
|
|
91
|
-
paddingHorizontal:
|
|
154
|
+
paddingHorizontal: LABEL_PADDING,
|
|
92
155
|
paddingVertical: 4,
|
|
93
156
|
borderRadius: 4,
|
|
94
157
|
color: theme.onSurface,
|