dhre-ui-kit 0.0.209 → 0.0.211
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/index.js +41 -41
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +41 -41
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
package/lib/index.mjs
CHANGED
|
@@ -2805,6 +2805,7 @@ const DateRangePicker = (props) => {
|
|
|
2805
2805
|
};
|
|
2806
2806
|
markedDates[startDate] = {
|
|
2807
2807
|
startingDay: true,
|
|
2808
|
+
color: theme.SUCCESS,
|
|
2808
2809
|
textColor: theme.CONTENT_INVERTED,
|
|
2809
2810
|
customContainerStyle: mode === "dark" ? { backgroundColor: theme.SURFACE_INVERTED } : {
|
|
2810
2811
|
borderWidth: moderateScale(2),
|
|
@@ -4251,17 +4252,20 @@ const CustomSlideButton = React.forwardRef(
|
|
|
4251
4252
|
}, ref) => {
|
|
4252
4253
|
const value = useRef(0);
|
|
4253
4254
|
const cardRef = useRef(null);
|
|
4254
|
-
const
|
|
4255
|
+
const [translateX] = useState(new Animated.Value(0));
|
|
4255
4256
|
const slideTailCardRef = useRef(null);
|
|
4256
4257
|
slideTailCardRef?.current?.setNativeProps({
|
|
4257
4258
|
style: { width: 0 }
|
|
4258
4259
|
});
|
|
4259
4260
|
React.useImperativeHandle(ref, () => ({
|
|
4260
4261
|
reset() {
|
|
4261
|
-
Animated.spring(
|
|
4262
|
+
Animated.spring(translateX, {
|
|
4262
4263
|
toValue: 0,
|
|
4263
4264
|
useNativeDriver: false
|
|
4264
4265
|
}).start();
|
|
4266
|
+
slideTailCardRef?.current?.setNativeProps({
|
|
4267
|
+
style: { width: 0 }
|
|
4268
|
+
});
|
|
4265
4269
|
}
|
|
4266
4270
|
}));
|
|
4267
4271
|
const handleLayout = (event) => {
|
|
@@ -4274,44 +4278,40 @@ const CustomSlideButton = React.forwardRef(
|
|
|
4274
4278
|
value.current = width;
|
|
4275
4279
|
}
|
|
4276
4280
|
};
|
|
4277
|
-
const panResponder =
|
|
4278
|
-
|
|
4279
|
-
|
|
4280
|
-
|
|
4281
|
-
|
|
4282
|
-
|
|
4283
|
-
|
|
4284
|
-
|
|
4285
|
-
|
|
4286
|
-
|
|
4287
|
-
|
|
4288
|
-
|
|
4289
|
-
|
|
4290
|
-
|
|
4291
|
-
|
|
4292
|
-
|
|
4293
|
-
|
|
4294
|
-
|
|
4295
|
-
|
|
4296
|
-
|
|
4297
|
-
|
|
4298
|
-
|
|
4299
|
-
|
|
4300
|
-
|
|
4301
|
-
|
|
4302
|
-
|
|
4303
|
-
|
|
4304
|
-
|
|
4305
|
-
|
|
4306
|
-
|
|
4307
|
-
|
|
4308
|
-
slideTailCardRef?.current?.setNativeProps({
|
|
4309
|
-
style: { width: 0 }
|
|
4310
|
-
});
|
|
4311
|
-
}
|
|
4281
|
+
const panResponder = PanResponder.create({
|
|
4282
|
+
onMoveShouldSetPanResponder: (e, gestureState) => {
|
|
4283
|
+
return Math.abs(gestureState.dx) > Math.abs(gestureState.dy);
|
|
4284
|
+
},
|
|
4285
|
+
onPanResponderMove: (evt, gestureState) => {
|
|
4286
|
+
translateX.setValue(gestureState.dx);
|
|
4287
|
+
slideTailCardRef?.current?.setNativeProps({
|
|
4288
|
+
style: { width: gestureState.dx + BUTTON_WIDTH / 2 }
|
|
4289
|
+
});
|
|
4290
|
+
},
|
|
4291
|
+
onPanResponderRelease: (e, gestureState) => {
|
|
4292
|
+
if (gestureState.dx >= value.current * 0.7) {
|
|
4293
|
+
onComplete?.();
|
|
4294
|
+
Animated.timing(translateX, {
|
|
4295
|
+
toValue: value.current - BUTTON_WIDTH,
|
|
4296
|
+
// Slide to the end
|
|
4297
|
+
duration: 300,
|
|
4298
|
+
useNativeDriver: false
|
|
4299
|
+
}).start();
|
|
4300
|
+
slideTailCardRef?.current?.setNativeProps({
|
|
4301
|
+
style: { width: value.current + BUTTON_WIDTH }
|
|
4302
|
+
// Change the width here
|
|
4303
|
+
});
|
|
4304
|
+
} else {
|
|
4305
|
+
Animated.spring(translateX, {
|
|
4306
|
+
toValue: 0,
|
|
4307
|
+
useNativeDriver: false
|
|
4308
|
+
}).start();
|
|
4309
|
+
slideTailCardRef?.current?.setNativeProps({
|
|
4310
|
+
style: { width: 0 }
|
|
4311
|
+
});
|
|
4312
4312
|
}
|
|
4313
|
-
}
|
|
4314
|
-
)
|
|
4313
|
+
}
|
|
4314
|
+
});
|
|
4315
4315
|
const { theme } = useTheme();
|
|
4316
4316
|
return /* @__PURE__ */ React.createElement(View, { style: {
|
|
4317
4317
|
...styles$3.sliderContainer,
|
|
@@ -4321,7 +4321,7 @@ const CustomSlideButton = React.forwardRef(
|
|
|
4321
4321
|
Animated.View,
|
|
4322
4322
|
{
|
|
4323
4323
|
ref: slideTailCardRef,
|
|
4324
|
-
style: [{ height: "100%", backgroundColor: slideButtonTailColor }]
|
|
4324
|
+
style: [{ height: "100%", width: 0, backgroundColor: slideButtonTailColor }]
|
|
4325
4325
|
}
|
|
4326
4326
|
), /* @__PURE__ */ React.createElement(View, { style: styles$3.buttonTextContainer }, /* @__PURE__ */ React.createElement(
|
|
4327
4327
|
CustomTypography,
|
|
@@ -4337,7 +4337,7 @@ const CustomSlideButton = React.forwardRef(
|
|
|
4337
4337
|
)), /* @__PURE__ */ React.createElement(
|
|
4338
4338
|
Animated.View,
|
|
4339
4339
|
{
|
|
4340
|
-
style: [styles$3.slider, { transform: [{ translateX
|
|
4340
|
+
style: [styles$3.slider, { transform: [{ translateX }] }],
|
|
4341
4341
|
...panResponder.panHandlers
|
|
4342
4342
|
},
|
|
4343
4343
|
/* @__PURE__ */ React.createElement(
|