@draftbit/core 48.2.2-110284.2 → 48.2.2-f405d7.2
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/src/components/DeckSwiper/DeckSwiper.d.ts +3 -1
- package/lib/src/components/DeckSwiper/DeckSwiper.js +6 -2
- package/lib/src/components/DeckSwiper/DeckSwiper.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/components/DeckSwiper/DeckSwiper.js +6 -2
- package/src/components/DeckSwiper/DeckSwiper.js.map +1 -1
- package/src/components/DeckSwiper/DeckSwiper.tsx +8 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draftbit/core",
|
|
3
|
-
"version": "48.2.2-
|
|
3
|
+
"version": "48.2.2-f405d7.2+f405d7f",
|
|
4
4
|
"description": "Core (non-native) Components",
|
|
5
5
|
"main": "lib/src/index.js",
|
|
6
6
|
"types": "lib/src/index.d.ts",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@date-io/date-fns": "^1.3.13",
|
|
43
43
|
"@draftbit/react-theme-provider": "^2.1.1",
|
|
44
|
-
"@draftbit/types": "^48.2.2-
|
|
44
|
+
"@draftbit/types": "^48.2.2-f405d7.2+f405d7f",
|
|
45
45
|
"@expo/vector-icons": "^13.0.0",
|
|
46
46
|
"@material-ui/core": "^4.11.0",
|
|
47
47
|
"@material-ui/pickers": "^3.2.10",
|
|
@@ -97,5 +97,5 @@
|
|
|
97
97
|
],
|
|
98
98
|
"testEnvironment": "node"
|
|
99
99
|
},
|
|
100
|
-
"gitHead": "
|
|
100
|
+
"gitHead": "f405d7f50ee45c6c57a66de9b2303017d2aa3896"
|
|
101
101
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { StyleSheet, View } from "react-native";
|
|
3
3
|
import DeckSwiperComponent from "react-native-deck-swiper";
|
|
4
|
-
const DeckSwiper = ({ onSwipe, onSwipedLeft, onSwipedRight, onSwipedUp, onSwipedDown, onIndexChanged, onEndReached, startCardIndex = 0, infiniteSwiping = false, verticalEnabled = true, horizontalEnabled = true, visibleCardCount = 1, data, keyExtractor, renderItem, style, children, }) => {
|
|
4
|
+
const DeckSwiper = ({ onStartSwipe, onEndSwipe, onSwipe, onSwipedLeft, onSwipedRight, onSwipedUp, onSwipedDown, onIndexChanged, onEndReached, startCardIndex = 0, infiniteSwiping = false, verticalEnabled = true, horizontalEnabled = true, visibleCardCount = 1, data, keyExtractor, renderItem, style, children, }) => {
|
|
5
5
|
//Both 'renderItem' and 'data' are optional to allow direct children. But if one is included, both need to be included
|
|
6
6
|
if ((data && !renderItem) || (renderItem && !data)) {
|
|
7
7
|
throw new Error("'renderItem' and 'data' need to both be provided to lazily render. Either remove them entirley or include both");
|
|
@@ -67,7 +67,11 @@ const DeckSwiper = ({ onSwipe, onSwipedLeft, onSwipedRight, onSwipedUp, onSwiped
|
|
|
67
67
|
}, onSwipedBottom: (index) => {
|
|
68
68
|
onSwipedDown === null || onSwipedDown === void 0 ? void 0 : onSwipedDown(index);
|
|
69
69
|
onSwipe === null || onSwipe === void 0 ? void 0 : onSwipe(index);
|
|
70
|
-
}
|
|
70
|
+
},
|
|
71
|
+
//@ts-ignore Not typed, but is implemented and works
|
|
72
|
+
dragStart: onStartSwipe,
|
|
73
|
+
//@ts-ignore
|
|
74
|
+
dragEnd: onEndSwipe })));
|
|
71
75
|
};
|
|
72
76
|
const styles = StyleSheet.create({
|
|
73
77
|
cardsContainer: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeckSwiper.js","sourceRoot":"","sources":["DeckSwiper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAwB,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACtE,OAAO,mBAAm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c,EAAE;QACd,QAAQ,EAAE,UAAU;KACrB;IACD,IAAI,EAAE;QACJ,IAAI,EAAE,CAAC;QACP,KAAK,EAAE,CAAC;QACR,KAAK,EAAE,MAAM;QACb,MAAM,EAAE,MAAM;KACf;IACD,qBAAqB,EAAE;QACrB,OAAO,EAAE,GAAG;KACb;CACF,CAAC,CAAC;AAEH,eAAe,UAAU,CAAC"}
|
|
@@ -3,6 +3,8 @@ import { StyleProp, ViewStyle, StyleSheet, View } from "react-native";
|
|
|
3
3
|
import DeckSwiperComponent from "react-native-deck-swiper";
|
|
4
4
|
|
|
5
5
|
export interface DeckSwiperProps<T> {
|
|
6
|
+
onStartSwipe?: () => void;
|
|
7
|
+
onEndSwipe?: () => void;
|
|
6
8
|
onSwipe?: (index: number) => void;
|
|
7
9
|
onSwipedLeft?: (index: number) => void;
|
|
8
10
|
onSwipedRight?: (index: number) => void;
|
|
@@ -22,6 +24,8 @@ export interface DeckSwiperProps<T> {
|
|
|
22
24
|
}
|
|
23
25
|
|
|
24
26
|
const DeckSwiper = <T extends object>({
|
|
27
|
+
onStartSwipe,
|
|
28
|
+
onEndSwipe,
|
|
25
29
|
onSwipe,
|
|
26
30
|
onSwipedLeft,
|
|
27
31
|
onSwipedRight,
|
|
@@ -150,6 +154,10 @@ const DeckSwiper = <T extends object>({
|
|
|
150
154
|
onSwipedDown?.(index);
|
|
151
155
|
onSwipe?.(index);
|
|
152
156
|
}}
|
|
157
|
+
//@ts-ignore Not typed, but is implemented and works
|
|
158
|
+
dragStart={onStartSwipe}
|
|
159
|
+
//@ts-ignore
|
|
160
|
+
dragEnd={onEndSwipe}
|
|
153
161
|
/>
|
|
154
162
|
</View>
|
|
155
163
|
);
|