@draftbit/core 47.2.14-9580d7.2 → 47.2.14-f3390b.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.
Files changed (59) hide show
  1. package/lib/src/components/SwipeableItem/SwipeableItem.d.ts +43 -0
  2. package/lib/src/components/SwipeableItem/SwipeableItem.js +114 -0
  3. package/lib/src/components/SwipeableItem/SwipeableItem.js.map +1 -0
  4. package/lib/src/components/SwipeableItem/SwipeableItemButton.d.ts +5 -0
  5. package/lib/src/components/SwipeableItem/SwipeableItemButton.js +6 -0
  6. package/lib/src/components/SwipeableItem/SwipeableItemButton.js.map +1 -0
  7. package/lib/src/components/SwipeableItem/SwipeableItemCommon.d.ts +30 -0
  8. package/lib/src/components/SwipeableItem/SwipeableItemCommon.js +44 -0
  9. package/lib/src/components/SwipeableItem/SwipeableItemCommon.js.map +1 -0
  10. package/lib/src/components/SwipeableItem/SwipeableList.d.ts +17 -0
  11. package/lib/src/components/SwipeableItem/SwipeableList.js +29 -0
  12. package/lib/src/components/SwipeableItem/SwipeableList.js.map +1 -0
  13. package/lib/src/components/SwipeableItem/index.d.ts +3 -0
  14. package/lib/src/components/SwipeableItem/index.js +4 -0
  15. package/lib/src/components/{SwipeableView → SwipeableItem}/index.js.map +1 -1
  16. package/lib/src/index.d.ts +1 -1
  17. package/lib/src/index.js +1 -1
  18. package/lib/src/index.js.map +1 -1
  19. package/lib/tsconfig.tsbuildinfo +1 -1
  20. package/package.json +3 -3
  21. package/src/components/SwipeableItem/SwipeableItem.js +114 -0
  22. package/src/components/SwipeableItem/SwipeableItem.js.map +1 -0
  23. package/src/components/{SwipeableView/SwipeableView.tsx → SwipeableItem/SwipeableItem.tsx} +95 -88
  24. package/src/components/SwipeableItem/SwipeableItemButton.js +6 -0
  25. package/src/components/SwipeableItem/SwipeableItemButton.js.map +1 -0
  26. package/src/components/SwipeableItem/SwipeableItemButton.tsx +11 -0
  27. package/src/components/SwipeableItem/SwipeableItemCommon.js +44 -0
  28. package/src/components/SwipeableItem/SwipeableItemCommon.js.map +1 -0
  29. package/src/components/SwipeableItem/SwipeableItemCommon.ts +80 -0
  30. package/src/components/SwipeableItem/SwipeableList.js +29 -0
  31. package/src/components/SwipeableItem/SwipeableList.js.map +1 -0
  32. package/src/components/SwipeableItem/SwipeableList.tsx +62 -0
  33. package/src/components/SwipeableItem/index.js +4 -0
  34. package/src/components/{SwipeableView → SwipeableItem}/index.js.map +1 -1
  35. package/src/components/SwipeableItem/index.tsx +3 -0
  36. package/src/index.js +1 -1
  37. package/src/index.js.map +1 -1
  38. package/src/index.tsx +4 -4
  39. package/lib/src/components/SwipeableView/SwipeableView.d.ts +0 -28
  40. package/lib/src/components/SwipeableView/SwipeableView.js +0 -119
  41. package/lib/src/components/SwipeableView/SwipeableView.js.map +0 -1
  42. package/lib/src/components/SwipeableView/SwipeableViewButton.d.ts +0 -12
  43. package/lib/src/components/SwipeableView/SwipeableViewButton.js +0 -6
  44. package/lib/src/components/SwipeableView/SwipeableViewButton.js.map +0 -1
  45. package/lib/src/components/SwipeableView/SwipeableViewSwipeHandler.d.ts +0 -12
  46. package/lib/src/components/SwipeableView/SwipeableViewSwipeHandler.js +0 -6
  47. package/lib/src/components/SwipeableView/SwipeableViewSwipeHandler.js.map +0 -1
  48. package/lib/src/components/SwipeableView/index.d.ts +0 -3
  49. package/lib/src/components/SwipeableView/index.js +0 -4
  50. package/src/components/SwipeableView/SwipeableView.js +0 -119
  51. package/src/components/SwipeableView/SwipeableView.js.map +0 -1
  52. package/src/components/SwipeableView/SwipeableViewButton.js +0 -6
  53. package/src/components/SwipeableView/SwipeableViewButton.js.map +0 -1
  54. package/src/components/SwipeableView/SwipeableViewButton.tsx +0 -18
  55. package/src/components/SwipeableView/SwipeableViewSwipeHandler.js +0 -6
  56. package/src/components/SwipeableView/SwipeableViewSwipeHandler.js.map +0 -1
  57. package/src/components/SwipeableView/SwipeableViewSwipeHandler.tsx +0 -20
  58. package/src/components/SwipeableView/index.js +0 -4
  59. package/src/components/SwipeableView/index.tsx +0 -3
@@ -0,0 +1,62 @@
1
+ import React from "react";
2
+ import { FlashListProps, FlashList } from "@shopify/flash-list";
3
+ import { FlatListProps, FlatList } from "react-native";
4
+
5
+ type ListComponentType = "FlatList" | "FlashList";
6
+
7
+ interface AdditionalSwipeableListProps {
8
+ disableScrollWhenSwiping?: boolean;
9
+ listComponent?: ListComponentType;
10
+ }
11
+
12
+ type FlatListSwipeableListProps<T> = FlatListProps<T> &
13
+ AdditionalSwipeableListProps;
14
+
15
+ type FlashListSwipeableListProps<T> = FlashListProps<T> &
16
+ AdditionalSwipeableListProps;
17
+
18
+ type SwipeableListContextType = {
19
+ onStartSwiping: () => void;
20
+ onStopSwiping: () => void;
21
+ };
22
+
23
+ export const SwipeableListContext =
24
+ React.createContext<SwipeableListContextType>({
25
+ onStartSwiping: () => {},
26
+ onStopSwiping: () => {},
27
+ });
28
+
29
+ const SwipeableList = <T extends object>({
30
+ disableScrollWhenSwiping = true,
31
+ listComponent = "FlatList",
32
+ ...rest
33
+ }: FlashListSwipeableListProps<T> | FlatListSwipeableListProps<T>) => {
34
+ const [isSwiping, setIsSwiping] = React.useState(false);
35
+
36
+ const onStartSwiping = () => {
37
+ setIsSwiping(true);
38
+ };
39
+
40
+ const onStopSwiping = () => {
41
+ setIsSwiping(false);
42
+ };
43
+
44
+ rest.scrollEnabled = disableScrollWhenSwiping ? !isSwiping : true;
45
+
46
+ const renderListComponent = () => {
47
+ switch (listComponent) {
48
+ case "FlatList":
49
+ return <FlatList {...(rest as FlatListProps<T>)} />;
50
+ case "FlashList":
51
+ return <FlashList {...(rest as FlashListProps<T>)} />;
52
+ }
53
+ };
54
+
55
+ return (
56
+ <SwipeableListContext.Provider value={{ onStartSwiping, onStopSwiping }}>
57
+ <>{renderListComponent()}</>
58
+ </SwipeableListContext.Provider>
59
+ );
60
+ };
61
+
62
+ export default SwipeableList;
@@ -0,0 +1,4 @@
1
+ export { default as SwipeableItem } from "./SwipeableItem";
2
+ export { default as SwipeableItemButton } from "./SwipeableItemButton";
3
+ export { default as SwipeableList } from "./SwipeableList";
4
+ //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAAM,6BAA6B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { default as SwipeableItem } from "./SwipeableItem";
2
+ export { default as SwipeableItemButton } from "./SwipeableItemButton";
3
+ export { default as SwipeableList } from "./SwipeableList";
package/src/index.js CHANGED
@@ -38,7 +38,7 @@ export { default as Markdown } from "./components/Markdown";
38
38
  export { BottomSheet } from "./components/BottomSheet";
39
39
  export { YoutubePlayer } from "./components/YoutubePlayer";
40
40
  export { Table, TableRow, TableCell } from "./components/Table";
41
- export { SwipeableView, SwipeableViewButton, SwipeableViewSwipeHandler, } from "./components/SwipeableView";
41
+ export { SwipeableItem, SwipeableItemButton, SwipeableList, } from "./components/SwipeableItem";
42
42
  /* Deprecated: Fix or Delete! */
43
43
  export { default as DatePicker } from "./components/DatePicker/DatePicker";
44
44
  export { default as Picker } from "./components/Picker/Picker";
package/src/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAAA,OAAO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AAO,IAAI,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC1F,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACpF,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD,2CAA2C"}
package/src/index.tsx CHANGED
@@ -65,10 +65,10 @@ export { YoutubePlayer } from "./components/YoutubePlayer";
65
65
  export { Table, TableRow, TableCell } from "./components/Table";
66
66
 
67
67
  export {
68
- SwipeableView,
69
- SwipeableViewButton,
70
- SwipeableViewSwipeHandler,
71
- } from "./components/SwipeableView";
68
+ SwipeableItem,
69
+ SwipeableItemButton,
70
+ SwipeableList,
71
+ } from "./components/SwipeableItem";
72
72
 
73
73
  /* Deprecated: Fix or Delete! */
74
74
  export { default as DatePicker } from "./components/DatePicker/DatePicker";
@@ -1,28 +0,0 @@
1
- import React from "react";
2
- import { StyleProp, ViewStyle, TextStyle } from "react-native";
3
- import { IconSlot } from "../../interfaces/Icon";
4
- import type { Theme } from "../../styles/DefaultTheme";
5
- export interface SwipeableViewProps extends IconSlot {
6
- closeOnPress?: boolean;
7
- leftOpenValue?: number;
8
- rightOpenValue?: number;
9
- leftActivationValue?: number;
10
- rightActivationValue?: number;
11
- swipeActivationPercentage?: number;
12
- stopLeftSwipe?: number;
13
- stopRightSwipe?: number;
14
- directionalDistanceChangeThreshold?: number;
15
- friction?: number;
16
- tension?: number;
17
- disableLeftSwipe?: boolean;
18
- disableRightSwipe?: boolean;
19
- swipeToOpenVelocityContribution?: number;
20
- swipeToOpenPercent?: number;
21
- swipeToClosePercent?: number;
22
- style?: StyleProp<ViewStyle | TextStyle>;
23
- theme: Theme;
24
- }
25
- declare const _default: React.ComponentType<import("@draftbit/react-theme-provider").$Without<React.PropsWithChildren<SwipeableViewProps>, "theme"> & {
26
- theme?: import("@draftbit/react-theme-provider").$DeepPartial<any> | undefined;
27
- }> & import("@draftbit/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<React.ComponentType<React.PropsWithChildren<SwipeableViewProps>> & React.FC<React.PropsWithChildren<SwipeableViewProps>>, {}>;
28
- export default _default;
@@ -1,119 +0,0 @@
1
- import React from "react";
2
- import { View, StyleSheet, Text, } from "react-native";
3
- import Pressable from "../Pressable";
4
- import { extractBorderAndMarginStyles, extractEffectStyles, extractFlexItemStyles, extractPositionStyles, extractSizeStyles, extractStyles, } from "../../utilities";
5
- import { SwipeRow } from "react-native-swipe-list-view";
6
- import { withTheme } from "../../theming";
7
- const SwipeableView = ({ theme, style, children, Icon, closeOnPress, leftOpenValue, rightOpenValue, leftActivationValue, rightActivationValue, swipeActivationPercentage = 80, stopLeftSwipe, stopRightSwipe, friction = 20, ...rest }) => {
8
- const instanceOfSwipeableViewButtonProps = (object) => {
9
- return "title" in object && "side" in object && "onPress" in object;
10
- };
11
- const instanceOfSwipeableViewSwipeHandlerProps = (object) => {
12
- return "title" in object && "side" in object && "onSwipe" in object;
13
- };
14
- const { viewStyles, textStyles } = extractStyles(style);
15
- const { borderStyles, marginStyles } = extractBorderAndMarginStyles(viewStyles);
16
- const sizeStyles = extractSizeStyles(viewStyles);
17
- const parentContainerStyles = StyleSheet.flatten([
18
- borderStyles,
19
- marginStyles,
20
- extractFlexItemStyles(viewStyles),
21
- extractPositionStyles(viewStyles),
22
- extractEffectStyles(viewStyles),
23
- sizeStyles,
24
- ]);
25
- //Remove styles already consumed from viewStyles
26
- Object.keys(parentContainerStyles).forEach((key) => delete viewStyles[key]);
27
- const surfaceContainerStyles = StyleSheet.flatten([
28
- viewStyles,
29
- sizeStyles /* Size styles needs to be readded to surface container due to inconsistencies on web */,
30
- ]);
31
- const [componentWidth, setComponentWidth] = React.useState(null);
32
- const leftButtons = React.useMemo(() => React.Children.toArray(children).filter((child) => React.isValidElement(child) &&
33
- instanceOfSwipeableViewButtonProps(child.props) &&
34
- child.props.side === "left"), [children]);
35
- const rightButtons = React.useMemo(() => React.Children.toArray(children).filter((child) => React.isValidElement(child) &&
36
- instanceOfSwipeableViewButtonProps(child.props) &&
37
- child.props.side === "right"), [children]);
38
- const leftSwipeHandlers = React.useMemo(() => React.Children.toArray(children).filter((child) => React.isValidElement(child) &&
39
- instanceOfSwipeableViewSwipeHandlerProps(child.props) &&
40
- child.props.side === "left"), [children]);
41
- const rightSwipeHandlers = React.useMemo(() => React.Children.toArray(children).filter((child) => React.isValidElement(child) &&
42
- instanceOfSwipeableViewSwipeHandlerProps(child.props) &&
43
- child.props.side === "right"), [children]);
44
- const remainingChildren = React.useMemo(() => React.Children.toArray(children).filter((child) => React.isValidElement(child) &&
45
- !instanceOfSwipeableViewSwipeHandlerProps(child.props) &&
46
- !instanceOfSwipeableViewButtonProps(child.props)), [children]);
47
- if (leftButtons.length > 2 || rightButtons.length > 2) {
48
- throw Error("Cannot have more than 2 buttons per side");
49
- }
50
- if (leftSwipeHandlers.length > 1 || rightSwipeHandlers.length > 1) {
51
- throw Error("Cannot have more than 1 swiper handler per side");
52
- }
53
- if ((leftButtons.length && leftSwipeHandlers.length) ||
54
- (rightButtons.length && rightSwipeHandlers.length)) {
55
- throw Error("Cannot combine swiper handler and buttons on the same side");
56
- }
57
- //Renders a single button/item. Used for both buttons and swipe handler
58
- const renderBehindItem = (props, index) => (React.createElement(Pressable, { key: index.toString(), onPress: props.onPress, style: [
59
- styles.buttonContainer,
60
- { backgroundColor: props.backgroundColor || theme.colors.primary },
61
- ] },
62
- props.icon && (React.createElement(Icon, { name: props.icon, size: props.iconSize || 25, color: props.color || theme.colors.surface })),
63
- React.createElement(Text, { style: [textStyles, { color: props.color || theme.colors.surface }] }, props.title)));
64
- const isLeftSwipeHandler = !!leftSwipeHandlers.length;
65
- const isRightSwipeHandler = !!rightSwipeHandlers.length;
66
- const defaultLeftOpenValue = componentWidth ? componentWidth / 2 : 0;
67
- const defaultRightOpenValue = componentWidth ? -componentWidth / 2 : 0;
68
- return (React.createElement(View, { onLayout: (event) => {
69
- setComponentWidth(event.nativeEvent.layout.width);
70
- }, style: [styles.parentContainer, parentContainerStyles] },
71
- React.createElement(SwipeRow, { leftOpenValue: isLeftSwipeHandler ? 0 : leftOpenValue || defaultLeftOpenValue //If in swiping mode, don't keep open
72
- , rightOpenValue: isRightSwipeHandler ? 0 : rightOpenValue || defaultRightOpenValue, leftActivationValue: leftActivationValue || isLeftSwipeHandler
73
- ? defaultLeftOpenValue * (swipeActivationPercentage / 100) //When swipe passes activation percentage then it should be considered activated (call onSwipe)
74
- : defaultLeftOpenValue, rightActivationValue: rightActivationValue || isRightSwipeHandler
75
- ? defaultRightOpenValue * (swipeActivationPercentage / 100)
76
- : defaultRightOpenValue, stopLeftSwipe: stopLeftSwipe || defaultLeftOpenValue, stopRightSwipe: stopRightSwipe || defaultRightOpenValue, onLeftAction: isLeftSwipeHandler
77
- ? () => { var _a, _b; return (_b = (_a = leftSwipeHandlers[0].props).onSwipe) === null || _b === void 0 ? void 0 : _b.call(_a); }
78
- : undefined, onRightAction: isRightSwipeHandler
79
- ? () => { var _a, _b; return (_b = (_a = rightSwipeHandlers[0].props).onSwipe) === null || _b === void 0 ? void 0 : _b.call(_a); }
80
- : undefined, closeOnRowPress: closeOnPress, friction: friction, ...rest },
81
- React.createElement(View, { style: styles.behindContainer },
82
- React.createElement(View, { style: styles.behindContainerItem }, (isLeftSwipeHandler ? leftSwipeHandlers : leftButtons).map((item, index) => renderBehindItem(item.props, index))),
83
- React.createElement(View, { style: styles.behindContainerItem }, (isRightSwipeHandler ? rightSwipeHandlers : rightButtons).map((item, index) => renderBehindItem(item.props, index)))),
84
- React.createElement(View, { style: [
85
- styles.surfaceContainer,
86
- {
87
- backgroundColor: theme.colors.background,
88
- },
89
- surfaceContainerStyles,
90
- ] }, remainingChildren))));
91
- };
92
- const styles = StyleSheet.create({
93
- parentContainer: {
94
- overflow: "hidden",
95
- minHeight: 50,
96
- },
97
- behindContainer: {
98
- flex: 1,
99
- width: "100%",
100
- height: "100%",
101
- flexDirection: "row",
102
- },
103
- behindContainerItem: {
104
- flex: 1,
105
- flexDirection: "row",
106
- },
107
- buttonContainer: {
108
- flex: 1,
109
- alignItems: "center",
110
- justifyContent: "center",
111
- },
112
- surfaceContainer: {
113
- width: "100%",
114
- minHeight: 50,
115
- overflow: "hidden",
116
- },
117
- });
118
- export default withTheme(SwipeableView);
119
- //# sourceMappingURL=SwipeableView.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SwipeableView.js","sourceRoot":"","sources":["../../../../src/components/SwipeableView/SwipeableView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,IAAI,EAIJ,UAAU,EACV,IAAI,GACL,MAAM,cAAc,CAAC;AACtB,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,EACL,4BAA4B,EAC5B,mBAAmB,EACnB,qBAAqB,EACrB,qBAAqB,EACrB,iBAAiB,EACjB,aAAa,GACd,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAGxD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAyB1C,MAAM,aAAa,GAA0D,CAAC,EAC5E,KAAK,EACL,KAAK,EACL,QAAQ,EACR,IAAI,EACJ,YAAY,EACZ,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACpB,yBAAyB,GAAG,EAAE,EAC9B,aAAa,E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AAK,EAAE;oBACL,MAAM,CAAC,gBAAgB;oBACvB;wBACE,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,UAAU;qBACzC;oBACD,sBAAsB;iBACvB,IAEA,iBAAiB,CACb,CACE,CACN,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,eAAe,EAAE;QACf,QAAQ,EAAE,QAAQ;QAClB,SAAS,EAAE,EAAE;KACd;IACD,eAAe,EAAE;QACf,IAAI,EAAE,CAAC;QACP,KAAK,EAAE,MAAM;QACb,MAAM,EAAE,MAAM;QACd,aAAa,EAAE,KAAK;KACrB;IACD,mBAAmB,EAAE;QACnB,IAAI,EAAE,CAAC;QACP,aAAa,EAAE,KAAK;KACrB;IACD,eAAe,EAAE;QACf,IAAI,EAAE,CAAC;QACP,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,QAAQ;KACzB;IACD,gBAAgB,EAAE;QAChB,KAAK,EAAE,MAAM;QACb,SAAS,EAAE,EAAE;QACb,QAAQ,EAAE,QAAQ;KACnB;CACF,CAAC,CAAC;AAEH,eAAe,SAAS,CAAC,aAAa,CAAC,CAAC"}
@@ -1,12 +0,0 @@
1
- import React from "react";
2
- export interface SwipeableViewButtonProps {
3
- title: string;
4
- side: "left" | "right";
5
- onPress?: () => void;
6
- icon?: string;
7
- iconSize?: number;
8
- backgroundColor?: string;
9
- color?: string;
10
- }
11
- declare const SwipeableViewButton: React.FC<SwipeableViewButtonProps>;
12
- export default SwipeableViewButton;
@@ -1,6 +0,0 @@
1
- //Renders nothing, acts as a wrapper be used by SwipeableView
2
- const SwipeableViewButton = () => {
3
- return null;
4
- };
5
- export default SwipeableViewButton;
6
- //# sourceMappingURL=SwipeableViewButton.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SwipeableViewButton.js","sourceRoot":"","sources":["../../../../src/components/SwipeableView/SwipeableViewButton.tsx"],"names":[],"mappings":"AAYA,6DAA6D;AAC7D,MAAM,mBAAmB,GAAuC,GAAG,EAAE;IACnE,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -1,12 +0,0 @@
1
- import React from "react";
2
- export interface SwipeableViewSwipeHandlerProps {
3
- title: string;
4
- side: "left" | "right";
5
- onSwipe?: () => void;
6
- icon?: string;
7
- iconSize?: number;
8
- backgroundColor?: string;
9
- color?: string;
10
- }
11
- declare const SwipeableViewSwipeHandler: React.FC<SwipeableViewSwipeHandlerProps>;
12
- export default SwipeableViewSwipeHandler;
@@ -1,6 +0,0 @@
1
- //Renders nothing, acts as a wrapper to be used by SwipeableView
2
- const SwipeableViewSwipeHandler = () => {
3
- return null;
4
- };
5
- export default SwipeableViewSwipeHandler;
6
- //# sourceMappingURL=SwipeableViewSwipeHandler.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SwipeableViewSwipeHandler.js","sourceRoot":"","sources":["../../../../src/components/SwipeableView/SwipeableViewSwipeHandler.tsx"],"names":[],"mappings":"AAYA,gEAAgE;AAChE,MAAM,yBAAyB,GAE3B,GAAG,EAAE;IACP,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,eAAe,yBAAyB,CAAC"}
@@ -1,3 +0,0 @@
1
- export { default as SwipeableView } from "./SwipeableView";
2
- export { default as SwipeableViewButton } from "./SwipeableViewButton";
3
- export { default as SwipeableViewSwipeHandler } from "./SwipeableViewSwipeHandler";
@@ -1,4 +0,0 @@
1
- export { default as SwipeableView } from "./SwipeableView";
2
- export { default as SwipeableViewButton } from "./SwipeableViewButton";
3
- export { default as SwipeableViewSwipeHandler } from "./SwipeableViewSwipeHandler";
4
- //# sourceMappingURL=index.js.map
@@ -1,119 +0,0 @@
1
- import React from "react";
2
- import { View, StyleSheet, Text, } from "react-native";
3
- import Pressable from "../Pressable";
4
- import { extractBorderAndMarginStyles, extractEffectStyles, extractFlexItemStyles, extractPositionStyles, extractSizeStyles, extractStyles, } from "../../utilities";
5
- import { SwipeRow } from "react-native-swipe-list-view";
6
- import { withTheme } from "../../theming";
7
- const SwipeableView = ({ theme, style, children, Icon, closeOnPress, leftOpenValue, rightOpenValue, leftActivationValue, rightActivationValue, swipeActivationPercentage = 80, stopLeftSwipe, stopRightSwipe, friction = 20, ...rest }) => {
8
- const instanceOfSwipeableViewButtonProps = (object) => {
9
- return "title" in object && "side" in object && "onPress" in object;
10
- };
11
- const instanceOfSwipeableViewSwipeHandlerProps = (object) => {
12
- return "title" in object && "side" in object && "onSwipe" in object;
13
- };
14
- const { viewStyles, textStyles } = extractStyles(style);
15
- const { borderStyles, marginStyles } = extractBorderAndMarginStyles(viewStyles);
16
- const sizeStyles = extractSizeStyles(viewStyles);
17
- const parentContainerStyles = StyleSheet.flatten([
18
- borderStyles,
19
- marginStyles,
20
- extractFlexItemStyles(viewStyles),
21
- extractPositionStyles(viewStyles),
22
- extractEffectStyles(viewStyles),
23
- sizeStyles,
24
- ]);
25
- //Remove styles already consumed from viewStyles
26
- Object.keys(parentContainerStyles).forEach((key) => delete viewStyles[key]);
27
- const surfaceContainerStyles = StyleSheet.flatten([
28
- viewStyles,
29
- sizeStyles /* Size styles needs to be readded to surface container due to inconsistencies on web */,
30
- ]);
31
- const [componentWidth, setComponentWidth] = React.useState(null);
32
- const leftButtons = React.useMemo(() => React.Children.toArray(children).filter((child) => React.isValidElement(child) &&
33
- instanceOfSwipeableViewButtonProps(child.props) &&
34
- child.props.side === "left"), [children]);
35
- const rightButtons = React.useMemo(() => React.Children.toArray(children).filter((child) => React.isValidElement(child) &&
36
- instanceOfSwipeableViewButtonProps(child.props) &&
37
- child.props.side === "right"), [children]);
38
- const leftSwipeHandlers = React.useMemo(() => React.Children.toArray(children).filter((child) => React.isValidElement(child) &&
39
- instanceOfSwipeableViewSwipeHandlerProps(child.props) &&
40
- child.props.side === "left"), [children]);
41
- const rightSwipeHandlers = React.useMemo(() => React.Children.toArray(children).filter((child) => React.isValidElement(child) &&
42
- instanceOfSwipeableViewSwipeHandlerProps(child.props) &&
43
- child.props.side === "right"), [children]);
44
- const remainingChildren = React.useMemo(() => React.Children.toArray(children).filter((child) => React.isValidElement(child) &&
45
- !instanceOfSwipeableViewSwipeHandlerProps(child.props) &&
46
- !instanceOfSwipeableViewButtonProps(child.props)), [children]);
47
- if (leftButtons.length > 2 || rightButtons.length > 2) {
48
- throw Error("Cannot have more than 2 buttons per side");
49
- }
50
- if (leftSwipeHandlers.length > 1 || rightSwipeHandlers.length > 1) {
51
- throw Error("Cannot have more than 1 swiper handler per side");
52
- }
53
- if ((leftButtons.length && leftSwipeHandlers.length) ||
54
- (rightButtons.length && rightSwipeHandlers.length)) {
55
- throw Error("Cannot combine swiper handler and buttons on the same side");
56
- }
57
- //Renders a single button/item. Used for both buttons and swipe handler
58
- const renderBehindItem = (props, index) => (React.createElement(Pressable, { key: index.toString(), onPress: props.onPress, style: [
59
- styles.buttonContainer,
60
- { backgroundColor: props.backgroundColor || theme.colors.primary },
61
- ] },
62
- props.icon && (React.createElement(Icon, { name: props.icon, size: props.iconSize || 25, color: props.color || theme.colors.surface })),
63
- React.createElement(Text, { style: [textStyles, { color: props.color || theme.colors.surface }] }, props.title)));
64
- const isLeftSwipeHandler = !!leftSwipeHandlers.length;
65
- const isRightSwipeHandler = !!rightSwipeHandlers.length;
66
- const defaultLeftOpenValue = componentWidth ? componentWidth / 2 : 0;
67
- const defaultRightOpenValue = componentWidth ? -componentWidth / 2 : 0;
68
- return (React.createElement(View, { onLayout: (event) => {
69
- setComponentWidth(event.nativeEvent.layout.width);
70
- }, style: [styles.parentContainer, parentContainerStyles] },
71
- React.createElement(SwipeRow, { leftOpenValue: isLeftSwipeHandler ? 0 : leftOpenValue || defaultLeftOpenValue //If in swiping mode, don't keep open
72
- , rightOpenValue: isRightSwipeHandler ? 0 : rightOpenValue || defaultRightOpenValue, leftActivationValue: leftActivationValue || isLeftSwipeHandler
73
- ? defaultLeftOpenValue * (swipeActivationPercentage / 100) //When swipe passes activation percentage then it should be considered activated (call onSwipe)
74
- : defaultLeftOpenValue, rightActivationValue: rightActivationValue || isRightSwipeHandler
75
- ? defaultRightOpenValue * (swipeActivationPercentage / 100)
76
- : defaultRightOpenValue, stopLeftSwipe: stopLeftSwipe || defaultLeftOpenValue, stopRightSwipe: stopRightSwipe || defaultRightOpenValue, onLeftAction: isLeftSwipeHandler
77
- ? () => { var _a, _b; return (_b = (_a = leftSwipeHandlers[0].props).onSwipe) === null || _b === void 0 ? void 0 : _b.call(_a); }
78
- : undefined, onRightAction: isRightSwipeHandler
79
- ? () => { var _a, _b; return (_b = (_a = rightSwipeHandlers[0].props).onSwipe) === null || _b === void 0 ? void 0 : _b.call(_a); }
80
- : undefined, closeOnRowPress: closeOnPress, friction: friction, ...rest },
81
- React.createElement(View, { style: styles.behindContainer },
82
- React.createElement(View, { style: styles.behindContainerItem }, (isLeftSwipeHandler ? leftSwipeHandlers : leftButtons).map((item, index) => renderBehindItem(item.props, index))),
83
- React.createElement(View, { style: styles.behindContainerItem }, (isRightSwipeHandler ? rightSwipeHandlers : rightButtons).map((item, index) => renderBehindItem(item.props, index)))),
84
- React.createElement(View, { style: [
85
- styles.surfaceContainer,
86
- {
87
- backgroundColor: theme.colors.background,
88
- },
89
- surfaceContainerStyles,
90
- ] }, remainingChildren))));
91
- };
92
- const styles = StyleSheet.create({
93
- parentContainer: {
94
- overflow: "hidden",
95
- minHeight: 50,
96
- },
97
- behindContainer: {
98
- flex: 1,
99
- width: "100%",
100
- height: "100%",
101
- flexDirection: "row",
102
- },
103
- behindContainerItem: {
104
- flex: 1,
105
- flexDirection: "row",
106
- },
107
- buttonContainer: {
108
- flex: 1,
109
- alignItems: "center",
110
- justifyContent: "center",
111
- },
112
- surfaceContainer: {
113
- width: "100%",
114
- minHeight: 50,
115
- overflow: "hidden",
116
- },
117
- });
118
- export default withTheme(SwipeableView);
119
- //# sourceMappingURL=SwipeableView.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SwipeableView.js","sourceRoot":"","sources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,QAAQ,EAAE,QAAQ;KACnB;CACF,CAAC,CAAC;AAEH,eAAe,SAAS,CAAC,aAAa,CAAC,CAAC"}
@@ -1,6 +0,0 @@
1
- //Renders nothing, acts as a wrapper be used by SwipeableView
2
- const SwipeableViewButton = () => {
3
- return null;
4
- };
5
- export default SwipeableViewButton;
6
- //# sourceMappingURL=SwipeableViewButton.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SwipeableViewButton.js","sourceRoot":"","sources":["SwipeableViewButton.tsx"],"names":[],"mappings":"AAYA,6DAA6D;AAC7D,MAAM,mBAAmB,GAAuC,GAAG,EAAE;IACnE,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -1,18 +0,0 @@
1
- import React from "react";
2
-
3
- export interface SwipeableViewButtonProps {
4
- title: string;
5
- side: "left" | "right";
6
- onPress?: () => void;
7
- icon?: string;
8
- iconSize?: number;
9
- backgroundColor?: string;
10
- color?: string;
11
- }
12
-
13
- //Renders nothing, acts as a wrapper be used by SwipeableView
14
- const SwipeableViewButton: React.FC<SwipeableViewButtonProps> = () => {
15
- return null;
16
- };
17
-
18
- export default SwipeableViewButton;
@@ -1,6 +0,0 @@
1
- //Renders nothing, acts as a wrapper to be used by SwipeableView
2
- const SwipeableViewSwipeHandler = () => {
3
- return null;
4
- };
5
- export default SwipeableViewSwipeHandler;
6
- //# sourceMappingURL=SwipeableViewSwipeHandler.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SwipeableViewSwipeHandler.js","sourceRoot":"","sources":["SwipeableViewSwipeHandler.tsx"],"names":[],"mappings":"AAYA,gEAAgE;AAChE,MAAM,yBAAyB,GAE3B,GAAG,EAAE;IACP,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,eAAe,yBAAyB,CAAC"}
@@ -1,20 +0,0 @@
1
- import React from "react";
2
-
3
- export interface SwipeableViewSwipeHandlerProps {
4
- title: string;
5
- side: "left" | "right";
6
- onSwipe?: () => void;
7
- icon?: string;
8
- iconSize?: number;
9
- backgroundColor?: string;
10
- color?: string;
11
- }
12
-
13
- //Renders nothing, acts as a wrapper to be used by SwipeableView
14
- const SwipeableViewSwipeHandler: React.FC<
15
- SwipeableViewSwipeHandlerProps
16
- > = () => {
17
- return null;
18
- };
19
-
20
- export default SwipeableViewSwipeHandler;
@@ -1,4 +0,0 @@
1
- export { default as SwipeableView } from "./SwipeableView";
2
- export { default as SwipeableViewButton } from "./SwipeableViewButton";
3
- export { default as SwipeableViewSwipeHandler } from "./SwipeableViewSwipeHandler";
4
- //# sourceMappingURL=index.js.map
@@ -1,3 +0,0 @@
1
- export { default as SwipeableView } from "./SwipeableView";
2
- export { default as SwipeableViewButton } from "./SwipeableViewButton";
3
- export { default as SwipeableViewSwipeHandler } from "./SwipeableViewSwipeHandler";