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.js
CHANGED
|
@@ -2839,6 +2839,7 @@ const DateRangePicker = (props) => {
|
|
|
2839
2839
|
};
|
|
2840
2840
|
markedDates[startDate] = {
|
|
2841
2841
|
startingDay: true,
|
|
2842
|
+
color: theme.SUCCESS,
|
|
2842
2843
|
textColor: theme.CONTENT_INVERTED,
|
|
2843
2844
|
customContainerStyle: mode === "dark" ? { backgroundColor: theme.SURFACE_INVERTED } : {
|
|
2844
2845
|
borderWidth: moderateScale(2),
|
|
@@ -4285,17 +4286,20 @@ const CustomSlideButton = React__default["default"].forwardRef(
|
|
|
4285
4286
|
}, ref) => {
|
|
4286
4287
|
const value = React.useRef(0);
|
|
4287
4288
|
const cardRef = React.useRef(null);
|
|
4288
|
-
const
|
|
4289
|
+
const [translateX] = React.useState(new reactNative.Animated.Value(0));
|
|
4289
4290
|
const slideTailCardRef = React.useRef(null);
|
|
4290
4291
|
slideTailCardRef?.current?.setNativeProps({
|
|
4291
4292
|
style: { width: 0 }
|
|
4292
4293
|
});
|
|
4293
4294
|
React__default["default"].useImperativeHandle(ref, () => ({
|
|
4294
4295
|
reset() {
|
|
4295
|
-
reactNative.Animated.spring(
|
|
4296
|
+
reactNative.Animated.spring(translateX, {
|
|
4296
4297
|
toValue: 0,
|
|
4297
4298
|
useNativeDriver: false
|
|
4298
4299
|
}).start();
|
|
4300
|
+
slideTailCardRef?.current?.setNativeProps({
|
|
4301
|
+
style: { width: 0 }
|
|
4302
|
+
});
|
|
4299
4303
|
}
|
|
4300
4304
|
}));
|
|
4301
4305
|
const handleLayout = (event) => {
|
|
@@ -4308,44 +4312,40 @@ const CustomSlideButton = React__default["default"].forwardRef(
|
|
|
4308
4312
|
value.current = width;
|
|
4309
4313
|
}
|
|
4310
4314
|
};
|
|
4311
|
-
const panResponder =
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
|
|
4315
|
-
|
|
4316
|
-
|
|
4317
|
-
|
|
4318
|
-
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
|
|
4324
|
-
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
|
|
4330
|
-
|
|
4331
|
-
|
|
4332
|
-
|
|
4333
|
-
|
|
4334
|
-
|
|
4335
|
-
|
|
4336
|
-
|
|
4337
|
-
|
|
4338
|
-
|
|
4339
|
-
|
|
4340
|
-
|
|
4341
|
-
|
|
4342
|
-
slideTailCardRef?.current?.setNativeProps({
|
|
4343
|
-
style: { width: 0 }
|
|
4344
|
-
});
|
|
4345
|
-
}
|
|
4315
|
+
const panResponder = reactNative.PanResponder.create({
|
|
4316
|
+
onMoveShouldSetPanResponder: (e, gestureState) => {
|
|
4317
|
+
return Math.abs(gestureState.dx) > Math.abs(gestureState.dy);
|
|
4318
|
+
},
|
|
4319
|
+
onPanResponderMove: (evt, gestureState) => {
|
|
4320
|
+
translateX.setValue(gestureState.dx);
|
|
4321
|
+
slideTailCardRef?.current?.setNativeProps({
|
|
4322
|
+
style: { width: gestureState.dx + BUTTON_WIDTH / 2 }
|
|
4323
|
+
});
|
|
4324
|
+
},
|
|
4325
|
+
onPanResponderRelease: (e, gestureState) => {
|
|
4326
|
+
if (gestureState.dx >= value.current * 0.7) {
|
|
4327
|
+
onComplete?.();
|
|
4328
|
+
reactNative.Animated.timing(translateX, {
|
|
4329
|
+
toValue: value.current - BUTTON_WIDTH,
|
|
4330
|
+
// Slide to the end
|
|
4331
|
+
duration: 300,
|
|
4332
|
+
useNativeDriver: false
|
|
4333
|
+
}).start();
|
|
4334
|
+
slideTailCardRef?.current?.setNativeProps({
|
|
4335
|
+
style: { width: value.current + BUTTON_WIDTH }
|
|
4336
|
+
// Change the width here
|
|
4337
|
+
});
|
|
4338
|
+
} else {
|
|
4339
|
+
reactNative.Animated.spring(translateX, {
|
|
4340
|
+
toValue: 0,
|
|
4341
|
+
useNativeDriver: false
|
|
4342
|
+
}).start();
|
|
4343
|
+
slideTailCardRef?.current?.setNativeProps({
|
|
4344
|
+
style: { width: 0 }
|
|
4345
|
+
});
|
|
4346
4346
|
}
|
|
4347
|
-
}
|
|
4348
|
-
)
|
|
4347
|
+
}
|
|
4348
|
+
});
|
|
4349
4349
|
const { theme } = useTheme();
|
|
4350
4350
|
return /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: {
|
|
4351
4351
|
...styles$3.sliderContainer,
|
|
@@ -4355,7 +4355,7 @@ const CustomSlideButton = React__default["default"].forwardRef(
|
|
|
4355
4355
|
reactNative.Animated.View,
|
|
4356
4356
|
{
|
|
4357
4357
|
ref: slideTailCardRef,
|
|
4358
|
-
style: [{ height: "100%", backgroundColor: slideButtonTailColor }]
|
|
4358
|
+
style: [{ height: "100%", width: 0, backgroundColor: slideButtonTailColor }]
|
|
4359
4359
|
}
|
|
4360
4360
|
), /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: styles$3.buttonTextContainer }, /* @__PURE__ */ React__default["default"].createElement(
|
|
4361
4361
|
CustomTypography,
|
|
@@ -4371,7 +4371,7 @@ const CustomSlideButton = React__default["default"].forwardRef(
|
|
|
4371
4371
|
)), /* @__PURE__ */ React__default["default"].createElement(
|
|
4372
4372
|
reactNative.Animated.View,
|
|
4373
4373
|
{
|
|
4374
|
-
style: [styles$3.slider, { transform: [{ translateX
|
|
4374
|
+
style: [styles$3.slider, { transform: [{ translateX }] }],
|
|
4375
4375
|
...panResponder.panHandlers
|
|
4376
4376
|
},
|
|
4377
4377
|
/* @__PURE__ */ React__default["default"].createElement(
|