@draftbit/core 50.1.2-8b3aec.2 → 50.1.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/commonjs/components/Checkbox/CheckboxRow.js +1 -1
- package/lib/commonjs/components/KeyboardAvoidingView.js +1 -1
- package/lib/commonjs/components/SectionList/SectionList.js +1 -1
- package/lib/commonjs/components/SimpleStyleScrollables/SimpleStyleFlashList.js +1 -1
- package/lib/commonjs/components/SimpleStyleScrollables/SimpleStyleFlatList.js +1 -1
- package/lib/commonjs/components/SimpleStyleScrollables/SimpleStyleKeyboardAwareScrollView.js +1 -1
- package/lib/commonjs/components/SimpleStyleScrollables/SimpleStyleMasonryFlashList.js +1 -1
- package/lib/commonjs/components/SimpleStyleScrollables/SimpleStyleScrollView.js +1 -1
- package/lib/commonjs/components/SimpleStyleScrollables/SimpleStyleSectionList.js +1 -1
- package/lib/commonjs/components/SimpleStyleScrollables/SimpleStyleSwipeableList.js +1 -1
- package/lib/commonjs/components/SwipeableItem/SwipeableList.js +1 -1
- package/lib/commonjs/components/TabView/TabView.js +1 -1
- package/lib/typescript/src/components/Checkbox/CheckboxRow.js +3 -3
- package/lib/typescript/src/components/Checkbox/CheckboxRow.js.map +1 -1
- package/lib/typescript/src/components/KeyboardAvoidingView.d.ts +1 -1
- package/lib/typescript/src/components/KeyboardAvoidingView.js +1 -1
- package/lib/typescript/src/components/KeyboardAvoidingView.js.map +1 -1
- package/lib/typescript/src/components/SectionList/SectionList.d.ts +6 -4
- package/lib/typescript/src/components/SectionList/SectionList.js +4 -4
- package/lib/typescript/src/components/SectionList/SectionList.js.map +1 -1
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleFlashList.d.ts +2 -1
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleFlashList.js +3 -3
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleFlashList.js.map +1 -1
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleFlatList.d.ts +2 -1
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleFlatList.js +3 -3
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleFlatList.js.map +1 -1
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleKeyboardAwareScrollView.d.ts +2 -1
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleKeyboardAwareScrollView.js +3 -3
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleKeyboardAwareScrollView.js.map +1 -1
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleMasonryFlashList.d.ts +2 -2
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleMasonryFlashList.js +3 -3
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleMasonryFlashList.js.map +1 -1
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleScrollView.d.ts +2 -1
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleScrollView.js +3 -3
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleScrollView.js.map +1 -1
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleSectionList.d.ts +6 -2
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleSectionList.js +3 -3
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleSectionList.js.map +1 -1
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleSwipeableList.d.ts +6 -2
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleSwipeableList.js +3 -3
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleSwipeableList.js.map +1 -1
- package/lib/typescript/src/components/SwipeableItem/SwipeableList.d.ts +3 -3
- package/lib/typescript/src/components/SwipeableItem/SwipeableList.js +4 -4
- package/lib/typescript/src/components/SwipeableItem/SwipeableList.js.map +1 -1
- package/lib/typescript/src/components/TabView/TabView.d.ts +2 -0
- package/lib/typescript/src/components/TabView/TabView.js +17 -2
- package/lib/typescript/src/components/TabView/TabView.js.map +1 -1
- package/lib/typescript/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/components/Checkbox/CheckboxRow.js +3 -3
- package/src/components/Checkbox/CheckboxRow.js.map +1 -1
- package/src/components/Checkbox/CheckboxRow.tsx +3 -3
- package/src/components/KeyboardAvoidingView.js +1 -1
- package/src/components/KeyboardAvoidingView.js.map +1 -1
- package/src/components/KeyboardAvoidingView.tsx +2 -2
- package/src/components/SectionList/SectionList.js +4 -4
- package/src/components/SectionList/SectionList.js.map +1 -1
- package/src/components/SectionList/SectionList.tsx +152 -145
- package/src/components/SimpleStyleScrollables/SimpleStyleFlashList.js +3 -3
- package/src/components/SimpleStyleScrollables/SimpleStyleFlashList.js.map +1 -1
- package/src/components/SimpleStyleScrollables/SimpleStyleFlashList.tsx +22 -16
- package/src/components/SimpleStyleScrollables/SimpleStyleFlatList.js +3 -3
- package/src/components/SimpleStyleScrollables/SimpleStyleFlatList.js.map +1 -1
- package/src/components/SimpleStyleScrollables/SimpleStyleFlatList.tsx +22 -16
- package/src/components/SimpleStyleScrollables/SimpleStyleKeyboardAwareScrollView.js +3 -3
- package/src/components/SimpleStyleScrollables/SimpleStyleKeyboardAwareScrollView.js.map +1 -1
- package/src/components/SimpleStyleScrollables/SimpleStyleKeyboardAwareScrollView.tsx +20 -13
- package/src/components/SimpleStyleScrollables/SimpleStyleMasonryFlashList.js +3 -3
- package/src/components/SimpleStyleScrollables/SimpleStyleMasonryFlashList.js.map +1 -1
- package/src/components/SimpleStyleScrollables/SimpleStyleMasonryFlashList.tsx +27 -17
- package/src/components/SimpleStyleScrollables/SimpleStyleScrollView.js +3 -3
- package/src/components/SimpleStyleScrollables/SimpleStyleScrollView.js.map +1 -1
- package/src/components/SimpleStyleScrollables/SimpleStyleScrollView.tsx +20 -13
- package/src/components/SimpleStyleScrollables/SimpleStyleSectionList.js +3 -3
- package/src/components/SimpleStyleScrollables/SimpleStyleSectionList.js.map +1 -1
- package/src/components/SimpleStyleScrollables/SimpleStyleSectionList.tsx +28 -20
- package/src/components/SimpleStyleScrollables/SimpleStyleSwipeableList.js +3 -3
- package/src/components/SimpleStyleScrollables/SimpleStyleSwipeableList.js.map +1 -1
- package/src/components/SimpleStyleScrollables/SimpleStyleSwipeableList.tsx +28 -20
- package/src/components/SwipeableItem/SwipeableList.js +4 -4
- package/src/components/SwipeableItem/SwipeableList.js.map +1 -1
- package/src/components/SwipeableItem/SwipeableList.tsx +47 -32
- package/src/components/TabView/TabView.js +17 -2
- package/src/components/TabView/TabView.js.map +1 -1
- package/src/components/TabView/TabView.tsx +19 -0
|
@@ -7,19 +7,26 @@ import useSplitContentContainerStyles from "./useSplitContentContainerStyles";
|
|
|
7
7
|
* A KeyboardAwareScrollView wrapper that takes a single `style` prop and internally extracts
|
|
8
8
|
* the appropriate style keys into the `contentContainerStyle`
|
|
9
9
|
*/
|
|
10
|
-
const SimpleStyleKeyboardAwareScrollView
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
const SimpleStyleKeyboardAwareScrollView = React.forwardRef(
|
|
11
|
+
(
|
|
12
|
+
{
|
|
13
|
+
style: styleProp,
|
|
14
|
+
...rest
|
|
15
|
+
}: Omit<KeyboardAwareScrollViewProps, "contentContainerStyle">,
|
|
16
|
+
ref: React.Ref<KeyboardAwareScrollView>
|
|
17
|
+
) => {
|
|
18
|
+
const { style, contentContainerStyle } =
|
|
19
|
+
useSplitContentContainerStyles(styleProp);
|
|
15
20
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
return (
|
|
22
|
+
<KeyboardAwareScrollView
|
|
23
|
+
ref={ref}
|
|
24
|
+
style={style}
|
|
25
|
+
contentContainerStyle={contentContainerStyle}
|
|
26
|
+
{...rest}
|
|
27
|
+
/>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
);
|
|
24
31
|
|
|
25
32
|
export default SimpleStyleKeyboardAwareScrollView;
|
|
@@ -5,9 +5,9 @@ import useSplitContentContainerStyles from "./useSplitContentContainerStyles";
|
|
|
5
5
|
* A MasonryFlashList wrapper that takes a single `style` prop and internally extracts
|
|
6
6
|
* the appropriate style keys into the `contentContainerStyle`
|
|
7
7
|
*/
|
|
8
|
-
const SimpleStyleMasonryFlashList = ({ style: styleProp, data, ...rest }) => {
|
|
8
|
+
const SimpleStyleMasonryFlashList = React.forwardRef(({ style: styleProp, data, ...rest }, ref) => {
|
|
9
9
|
const { style, contentContainerStyle } = useSplitContentContainerStyles(styleProp);
|
|
10
|
-
return (React.createElement(MasonryFlashList, { style: style, contentContainerStyle: contentContainerStyle, data: data, ...rest }));
|
|
11
|
-
};
|
|
10
|
+
return (React.createElement(MasonryFlashList, { ref: ref, style: style, contentContainerStyle: contentContainerStyle, data: data, ...rest }));
|
|
11
|
+
});
|
|
12
12
|
export default SimpleStyleMasonryFlashList;
|
|
13
13
|
//# sourceMappingURL=SimpleStyleMasonryFlashList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SimpleStyleMasonryFlashList.js","sourceRoot":"","sources":["SimpleStyleMasonryFlashList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"SimpleStyleMasonryFlashList.js","sourceRoot":"","sources":["SimpleStyleMasonryFlashList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAMvD,OAAO,8BAA8B,MAAM,kCAAkC,CAAC;AAE9E;;;GAGG;AACH,MAAM,2BAA2B,GAAG,KAAK,CAAC,UAAU,CAClD,CACE,EACE,KAAK,EAAE,SAAS,EAChB,IAAI,EACJ,GAAG,IAAI,EACiD,EAC1D,GAAwC,EACxC,EAAE;IACF,MAAM,EAAE,KAAK,EAAE,qBAAqB,EAAE,GACpC,8BAA8B,CAAC,SAAS,CAAC,CAAC;IAE5C,OAAO,CACL,oBAAC,gBAAgB,IACf,GAAG,EAAE,GAAU,EACf,KAAK,EAAE,KAAK,EACZ,qBAAqB,EAAE,qBAAqC,EAC5D,IAAI,EAAE,IAAI,KACN,IAAI,GACR,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,2BAA2B,CAAC"}
|
|
@@ -1,28 +1,38 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { MasonryFlashList } from "@shopify/flash-list";
|
|
3
|
-
import type {
|
|
3
|
+
import type {
|
|
4
|
+
MasonryFlashListProps,
|
|
5
|
+
ContentStyle,
|
|
6
|
+
MasonryFlashListRef,
|
|
7
|
+
} from "@shopify/flash-list";
|
|
4
8
|
import useSplitContentContainerStyles from "./useSplitContentContainerStyles";
|
|
5
9
|
|
|
6
10
|
/**
|
|
7
11
|
* A MasonryFlashList wrapper that takes a single `style` prop and internally extracts
|
|
8
12
|
* the appropriate style keys into the `contentContainerStyle`
|
|
9
13
|
*/
|
|
10
|
-
const SimpleStyleMasonryFlashList =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
const SimpleStyleMasonryFlashList = React.forwardRef(
|
|
15
|
+
<T extends any>(
|
|
16
|
+
{
|
|
17
|
+
style: styleProp,
|
|
18
|
+
data,
|
|
19
|
+
...rest
|
|
20
|
+
}: Omit<MasonryFlashListProps<T>, "contentContainerStyle">,
|
|
21
|
+
ref: React.Ref<MasonryFlashListRef<any>>
|
|
22
|
+
) => {
|
|
23
|
+
const { style, contentContainerStyle } =
|
|
24
|
+
useSplitContentContainerStyles(styleProp);
|
|
17
25
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
return (
|
|
27
|
+
<MasonryFlashList
|
|
28
|
+
ref={ref as any}
|
|
29
|
+
style={style}
|
|
30
|
+
contentContainerStyle={contentContainerStyle as ContentStyle}
|
|
31
|
+
data={data}
|
|
32
|
+
{...rest}
|
|
33
|
+
/>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
);
|
|
27
37
|
|
|
28
38
|
export default SimpleStyleMasonryFlashList;
|
|
@@ -5,9 +5,9 @@ import useSplitContentContainerStyles from "./useSplitContentContainerStyles";
|
|
|
5
5
|
* A ScrollView wrapper that takes a single `style` prop and internally extracts
|
|
6
6
|
* the appropriate style keys into the `contentContainerStyle`
|
|
7
7
|
*/
|
|
8
|
-
const SimpleStyleScrollView = ({ style: styleProp, ...rest }) => {
|
|
8
|
+
const SimpleStyleScrollView = React.forwardRef(({ style: styleProp, ...rest }, ref) => {
|
|
9
9
|
const { style, contentContainerStyle } = useSplitContentContainerStyles(styleProp);
|
|
10
|
-
return (React.createElement(ScrollView, { style: style, contentContainerStyle: contentContainerStyle, ...rest }));
|
|
11
|
-
};
|
|
10
|
+
return (React.createElement(ScrollView, { ref: ref, style: style, contentContainerStyle: contentContainerStyle, ...rest }));
|
|
11
|
+
});
|
|
12
12
|
export default SimpleStyleScrollView;
|
|
13
13
|
//# sourceMappingURL=SimpleStyleScrollView.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SimpleStyleScrollView.js","sourceRoot":"","sources":["SimpleStyleScrollView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,8BAA8B,MAAM,kCAAkC,CAAC;AAE9E;;;GAGG;AACH,MAAM,qBAAqB,
|
|
1
|
+
{"version":3,"file":"SimpleStyleScrollView.js","sourceRoot":"","sources":["SimpleStyleScrollView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,8BAA8B,MAAM,kCAAkC,CAAC;AAE9E;;;GAGG;AACH,MAAM,qBAAqB,GAAG,KAAK,CAAC,UAAU,CAC5C,CACE,EACE,KAAK,EAAE,SAAS,EAChB,GAAG,IAAI,EACwC,EACjD,GAA0B,EAC1B,EAAE;IACF,MAAM,EAAE,KAAK,EAAE,qBAAqB,EAAE,GACpC,8BAA8B,CAAC,SAAS,CAAC,CAAC;IAE5C,OAAO,CACL,oBAAC,UAAU,IACT,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,qBAAqB,EAAE,qBAAqB,KACxC,IAAI,GACR,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
|
|
@@ -7,19 +7,26 @@ import useSplitContentContainerStyles from "./useSplitContentContainerStyles";
|
|
|
7
7
|
* A ScrollView wrapper that takes a single `style` prop and internally extracts
|
|
8
8
|
* the appropriate style keys into the `contentContainerStyle`
|
|
9
9
|
*/
|
|
10
|
-
const SimpleStyleScrollView
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
const SimpleStyleScrollView = React.forwardRef(
|
|
11
|
+
(
|
|
12
|
+
{
|
|
13
|
+
style: styleProp,
|
|
14
|
+
...rest
|
|
15
|
+
}: Omit<ScrollViewProps, "contentContainerStyle">,
|
|
16
|
+
ref: React.Ref<ScrollView>
|
|
17
|
+
) => {
|
|
18
|
+
const { style, contentContainerStyle } =
|
|
19
|
+
useSplitContentContainerStyles(styleProp);
|
|
15
20
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
return (
|
|
22
|
+
<ScrollView
|
|
23
|
+
ref={ref}
|
|
24
|
+
style={style}
|
|
25
|
+
contentContainerStyle={contentContainerStyle}
|
|
26
|
+
{...rest}
|
|
27
|
+
/>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
);
|
|
24
31
|
|
|
25
32
|
export default SimpleStyleScrollView;
|
|
@@ -5,11 +5,11 @@ import useSplitContentContainerStyles from "./useSplitContentContainerStyles";
|
|
|
5
5
|
* A SectionList wrapper that takes a single `style` prop and internally extracts
|
|
6
6
|
* the appropriate style keys into the `contentContainerStyle`
|
|
7
7
|
*/
|
|
8
|
-
const SimpleStyleSectionList = ({ style: styleProp, data, ...rest }) => {
|
|
8
|
+
const SimpleStyleSectionList = React.forwardRef(({ style: styleProp, data, ...rest }, ref) => {
|
|
9
9
|
const { style, contentContainerStyle } = useSplitContentContainerStyles(styleProp);
|
|
10
10
|
return (
|
|
11
11
|
//@ts-ignore contentContainerStyle has different types for FlashList and FlatList implmentations and confuses TS
|
|
12
|
-
React.createElement(SectionList, { style: style, contentContainerStyle: contentContainerStyle, data: data, ...rest }));
|
|
13
|
-
};
|
|
12
|
+
React.createElement(SectionList, { ref: ref, style: style, contentContainerStyle: contentContainerStyle, data: data, ...rest }));
|
|
13
|
+
});
|
|
14
14
|
export default SimpleStyleSectionList;
|
|
15
15
|
//# sourceMappingURL=SimpleStyleSectionList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SimpleStyleSectionList.js","sourceRoot":"","sources":["SimpleStyleSectionList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAK7C,OAAO,8BAA8B,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"SimpleStyleSectionList.js","sourceRoot":"","sources":["SimpleStyleSectionList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAK7C,OAAO,8BAA8B,MAAM,kCAAkC,CAAC;AAI9E;;;GAGG;AACH,MAAM,sBAAsB,GAAG,KAAK,CAAC,UAAU,CAC7C,CACE,EACE,KAAK,EAAE,SAAS,EAChB,IAAI,EACJ,GAAG,IAAI,EAIR,EACD,GAAyC,EACzC,EAAE;IACF,MAAM,EAAE,KAAK,EAAE,qBAAqB,EAAE,GACpC,8BAA8B,CAAC,SAAS,CAAC,CAAC;IAE5C,OAAO;IACL,gHAAgH;IAChH,oBAAC,WAAW,IACV,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,qBAAqB,EAAE,qBAAqB,EAC5C,IAAI,EAAE,IAAI,KACN,IAAI,GACR,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
|
|
@@ -5,31 +5,39 @@ import type {
|
|
|
5
5
|
FlashListSectionListProps,
|
|
6
6
|
} from "../SectionList";
|
|
7
7
|
import useSplitContentContainerStyles from "./useSplitContentContainerStyles";
|
|
8
|
+
import { FlatList } from "react-native-gesture-handler";
|
|
9
|
+
import { FlashList } from "@shopify/flash-list";
|
|
8
10
|
|
|
9
11
|
/**
|
|
10
12
|
* A SectionList wrapper that takes a single `style` prop and internally extracts
|
|
11
13
|
* the appropriate style keys into the `contentContainerStyle`
|
|
12
14
|
*/
|
|
13
|
-
const SimpleStyleSectionList =
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
>
|
|
21
|
-
|
|
22
|
-
|
|
15
|
+
const SimpleStyleSectionList = React.forwardRef(
|
|
16
|
+
<T extends { [key: string]: any }>(
|
|
17
|
+
{
|
|
18
|
+
style: styleProp,
|
|
19
|
+
data,
|
|
20
|
+
...rest
|
|
21
|
+
}: Omit<
|
|
22
|
+
FlatListSectionListProps<T> | FlashListSectionListProps<T>,
|
|
23
|
+
"contentContainerStyle"
|
|
24
|
+
>,
|
|
25
|
+
ref: React.Ref<FlatList | FlashList<any>>
|
|
26
|
+
) => {
|
|
27
|
+
const { style, contentContainerStyle } =
|
|
28
|
+
useSplitContentContainerStyles(styleProp);
|
|
23
29
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
return (
|
|
31
|
+
//@ts-ignore contentContainerStyle has different types for FlashList and FlatList implmentations and confuses TS
|
|
32
|
+
<SectionList
|
|
33
|
+
ref={ref}
|
|
34
|
+
style={style}
|
|
35
|
+
contentContainerStyle={contentContainerStyle}
|
|
36
|
+
data={data}
|
|
37
|
+
{...rest}
|
|
38
|
+
/>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
);
|
|
34
42
|
|
|
35
43
|
export default SimpleStyleSectionList;
|
|
@@ -5,11 +5,11 @@ import useSplitContentContainerStyles from "./useSplitContentContainerStyles";
|
|
|
5
5
|
* A SwipeableList wrapper that takes a single `style` prop and internally extracts
|
|
6
6
|
* the appropriate style keys into the `contentContainerStyle`
|
|
7
7
|
*/
|
|
8
|
-
const SimpleStyleSwipeableList = ({ style: styleProp, data, ...rest }) => {
|
|
8
|
+
const SimpleStyleSwipeableList = React.forwardRef(({ style: styleProp, data, ...rest }, ref) => {
|
|
9
9
|
const { style, contentContainerStyle } = useSplitContentContainerStyles(styleProp);
|
|
10
10
|
return (
|
|
11
11
|
//@ts-ignore contentContainerStyle has different types for FlashList and FlatList implmentations and confuses TS
|
|
12
|
-
React.createElement(SwipeableList, { style: style, contentContainerStyle: contentContainerStyle, data: data, ...rest }));
|
|
13
|
-
};
|
|
12
|
+
React.createElement(SwipeableList, { ref: ref, style: style, contentContainerStyle: contentContainerStyle, data: data, ...rest }));
|
|
13
|
+
});
|
|
14
14
|
export default SimpleStyleSwipeableList;
|
|
15
15
|
//# sourceMappingURL=SimpleStyleSwipeableList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SimpleStyleSwipeableList.js","sourceRoot":"","sources":["SimpleStyleSwipeableList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAKjD,OAAO,8BAA8B,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"SimpleStyleSwipeableList.js","sourceRoot":"","sources":["SimpleStyleSwipeableList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAKjD,OAAO,8BAA8B,MAAM,kCAAkC,CAAC;AAI9E;;;GAGG;AACH,MAAM,wBAAwB,GAAG,KAAK,CAAC,UAAU,CAC/C,CACE,EACE,KAAK,EAAE,SAAS,EAChB,IAAI,EACJ,GAAG,IAAI,EAIR,EACD,GAAyC,EACzC,EAAE;IACF,MAAM,EAAE,KAAK,EAAE,qBAAqB,EAAE,GACpC,8BAA8B,CAAC,SAAS,CAAC,CAAC;IAE5C,OAAO;IACL,gHAAgH;IAChH,oBAAC,aAAa,IACZ,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,qBAAqB,EAAE,qBAAqB,EAC5C,IAAI,EAAE,IAAI,KACN,IAAI,GACR,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,wBAAwB,CAAC"}
|
|
@@ -5,31 +5,39 @@ import type {
|
|
|
5
5
|
FlatListSwipeableListProps,
|
|
6
6
|
} from "../SwipeableItem";
|
|
7
7
|
import useSplitContentContainerStyles from "./useSplitContentContainerStyles";
|
|
8
|
+
import { FlatList } from "react-native-gesture-handler";
|
|
9
|
+
import { FlashList } from "@shopify/flash-list";
|
|
8
10
|
|
|
9
11
|
/**
|
|
10
12
|
* A SwipeableList wrapper that takes a single `style` prop and internally extracts
|
|
11
13
|
* the appropriate style keys into the `contentContainerStyle`
|
|
12
14
|
*/
|
|
13
|
-
const SimpleStyleSwipeableList =
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
>
|
|
21
|
-
|
|
22
|
-
|
|
15
|
+
const SimpleStyleSwipeableList = React.forwardRef(
|
|
16
|
+
<T extends { [key: string]: any }>(
|
|
17
|
+
{
|
|
18
|
+
style: styleProp,
|
|
19
|
+
data,
|
|
20
|
+
...rest
|
|
21
|
+
}: Omit<
|
|
22
|
+
FlashListSwipeableListProps<T> | FlatListSwipeableListProps<T>,
|
|
23
|
+
"contentContainerStyle"
|
|
24
|
+
>,
|
|
25
|
+
ref: React.Ref<FlatList | FlashList<any>>
|
|
26
|
+
) => {
|
|
27
|
+
const { style, contentContainerStyle } =
|
|
28
|
+
useSplitContentContainerStyles(styleProp);
|
|
23
29
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
return (
|
|
31
|
+
//@ts-ignore contentContainerStyle has different types for FlashList and FlatList implmentations and confuses TS
|
|
32
|
+
<SwipeableList
|
|
33
|
+
ref={ref}
|
|
34
|
+
style={style}
|
|
35
|
+
contentContainerStyle={contentContainerStyle}
|
|
36
|
+
data={data}
|
|
37
|
+
{...rest}
|
|
38
|
+
/>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
);
|
|
34
42
|
|
|
35
43
|
export default SimpleStyleSwipeableList;
|
|
@@ -5,7 +5,7 @@ export const SwipeableListContext = React.createContext({
|
|
|
5
5
|
onStartSwiping: () => { },
|
|
6
6
|
onStopSwiping: () => { },
|
|
7
7
|
});
|
|
8
|
-
const SwipeableList = ({ disableScrollWhenSwiping = true, listComponent = "FlatList", ...rest }) => {
|
|
8
|
+
const SwipeableList = React.forwardRef(({ disableScrollWhenSwiping = true, listComponent = "FlatList", ...rest }, ref) => {
|
|
9
9
|
const [isSwiping, setIsSwiping] = React.useState(false);
|
|
10
10
|
const onStartSwiping = () => {
|
|
11
11
|
setIsSwiping(true);
|
|
@@ -17,13 +17,13 @@ const SwipeableList = ({ disableScrollWhenSwiping = true, listComponent = "FlatL
|
|
|
17
17
|
const renderListComponent = () => {
|
|
18
18
|
switch (listComponent) {
|
|
19
19
|
case "FlatList":
|
|
20
|
-
return React.createElement(FlatList, { ...rest });
|
|
20
|
+
return (React.createElement(FlatList, { ref: ref, ...rest }));
|
|
21
21
|
case "FlashList":
|
|
22
|
-
return React.createElement(FlashList, { ...rest });
|
|
22
|
+
return (React.createElement(FlashList, { ref: ref, ...rest }));
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
25
|
return (React.createElement(SwipeableListContext.Provider, { value: { onStartSwiping, onStopSwiping } },
|
|
26
26
|
React.createElement(React.Fragment, null, renderListComponent())));
|
|
27
|
-
};
|
|
27
|
+
});
|
|
28
28
|
export default SwipeableList;
|
|
29
29
|
//# sourceMappingURL=SwipeableList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwipeableList.js","sourceRoot":"","sources":["SwipeableList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAkB,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAiB,QAAQ,EAAE,MAAM,cAAc,CAAC;AAoBvD,MAAM,CAAC,MAAM,oBAAoB,GAC/B,KAAK,CAAC,aAAa,CAA2B;IAC5C,cAAc,EAAE,GAAG,EAAE,GAAE,CAAC;IACxB,aAAa,EAAE,GAAG,EAAE,GAAE,CAAC;CACxB,CAAC,CAAC;AAEL,MAAM,aAAa,GAAG,
|
|
1
|
+
{"version":3,"file":"SwipeableList.js","sourceRoot":"","sources":["SwipeableList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAkB,SAAS,EAA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;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -26,37 +26,52 @@ export const SwipeableListContext =
|
|
|
26
26
|
onStopSwiping: () => {},
|
|
27
27
|
});
|
|
28
28
|
|
|
29
|
-
const SwipeableList =
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
29
|
+
const SwipeableList = React.forwardRef(
|
|
30
|
+
<T extends object>(
|
|
31
|
+
{
|
|
32
|
+
disableScrollWhenSwiping = true,
|
|
33
|
+
listComponent = "FlatList",
|
|
34
|
+
...rest
|
|
35
|
+
}: FlashListSwipeableListProps<T> | FlatListSwipeableListProps<T>,
|
|
36
|
+
ref: React.Ref<FlatList | FlashList<any>>
|
|
37
|
+
) => {
|
|
38
|
+
const [isSwiping, setIsSwiping] = React.useState(false);
|
|
39
|
+
|
|
40
|
+
const onStartSwiping = () => {
|
|
41
|
+
setIsSwiping(true);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const onStopSwiping = () => {
|
|
45
|
+
setIsSwiping(false);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
rest.scrollEnabled = disableScrollWhenSwiping ? !isSwiping : true;
|
|
49
|
+
|
|
50
|
+
const renderListComponent = () => {
|
|
51
|
+
switch (listComponent) {
|
|
52
|
+
case "FlatList":
|
|
53
|
+
return (
|
|
54
|
+
<FlatList
|
|
55
|
+
ref={ref as React.Ref<FlatList>}
|
|
56
|
+
{...(rest as FlatListProps<T>)}
|
|
57
|
+
/>
|
|
58
|
+
);
|
|
59
|
+
case "FlashList":
|
|
60
|
+
return (
|
|
61
|
+
<FlashList
|
|
62
|
+
ref={ref as React.Ref<FlashList<T>>}
|
|
63
|
+
{...(rest as FlashListProps<T>)}
|
|
64
|
+
/>
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
return (
|
|
70
|
+
<SwipeableListContext.Provider value={{ onStartSwiping, onStopSwiping }}>
|
|
71
|
+
<>{renderListComponent()}</>
|
|
72
|
+
</SwipeableListContext.Provider>
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
);
|
|
61
76
|
|
|
62
77
|
export default SwipeableList;
|
|
@@ -3,7 +3,7 @@ import { TabView, TabBar, } from "react-native-tab-view";
|
|
|
3
3
|
import TabViewItem from "./TabViewItem";
|
|
4
4
|
import { withTheme } from "../../theming";
|
|
5
5
|
import { flattenReactFragments, extractStyles } from "../../utilities";
|
|
6
|
-
const TabViewComponent = ({ Icon, onIndexChanged, onEndReached, initialTabIndex = 0, tabBarPosition, keyboardDismissMode, swipeEnabled, scrollEnabled, activeColor, inactiveColor, pressColor, indicatorColor, tabsBackgroundColor, iconSize = 16, style, theme, children: childrenProp, }) => {
|
|
6
|
+
const TabViewComponent = ({ Icon, onIndexChanged, onEndReached, initialTabIndex = 0, tabBarPosition, keyboardDismissMode, swipeEnabled, scrollEnabled, activeColor, inactiveColor, pressColor, indicatorColor, tabsBackgroundColor, iconSize = 16, iconPosition = "top", style, theme, children: childrenProp, }) => {
|
|
7
7
|
const [index, setIndex] = React.useState(initialTabIndex);
|
|
8
8
|
const [routes, setRoutes] = React.useState([]);
|
|
9
9
|
const { textStyles, viewStyles } = extractStyles(style);
|
|
@@ -30,9 +30,24 @@ const TabViewComponent = ({ Icon, onIndexChanged, onEndReached, initialTabIndex
|
|
|
30
30
|
}
|
|
31
31
|
};
|
|
32
32
|
const renderTabBar = (props) => {
|
|
33
|
+
let tabFlexDirection;
|
|
34
|
+
switch (iconPosition) {
|
|
35
|
+
case "top":
|
|
36
|
+
tabFlexDirection = "column";
|
|
37
|
+
break;
|
|
38
|
+
case "bottom":
|
|
39
|
+
tabFlexDirection = "column-reverse";
|
|
40
|
+
break;
|
|
41
|
+
case "left":
|
|
42
|
+
tabFlexDirection = "row";
|
|
43
|
+
break;
|
|
44
|
+
case "right":
|
|
45
|
+
tabFlexDirection = "row-reverse";
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
33
48
|
return (React.createElement(TabBar, { ...props, activeColor: activeColor || theme.colors.primary, inactiveColor: inactiveColor || "rgb(200,200,200)", pressColor: pressColor || theme.colors.primary, scrollEnabled: scrollEnabled, indicatorStyle: {
|
|
34
49
|
backgroundColor: indicatorColor || theme.colors.primary,
|
|
35
|
-
}, labelStyle: [{ textTransform: "none" }, textStyles], renderIcon: ({ route, color }) => (route === null || route === void 0 ? void 0 : route.icon) ? (React.createElement(Icon, { name: route.icon, color: color, size: iconSize })) : null, style: {
|
|
50
|
+
}, labelStyle: [{ textTransform: "none" }, textStyles], tabStyle: { flexDirection: tabFlexDirection }, renderIcon: ({ route, color }) => (route === null || route === void 0 ? void 0 : route.icon) ? (React.createElement(Icon, { name: route.icon, color: color, size: iconSize })) : null, style: {
|
|
36
51
|
backgroundColor: tabsBackgroundColor || theme.colors.background,
|
|
37
52
|
} }));
|
|
38
53
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabView.js","sourceRoot":"","sources":["TabView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EACL,OAAO,EACP,MAAM,GAIP,MAAM,uBAAuB,CAAC;AAE/B,OAAO,WAAW,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"Tab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BAAmB,EACxC,YAAY,EAAE,YAAY,GAC1B,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC,gBAAgB,CAAC,CAAC"}
|
|
@@ -22,6 +22,7 @@ type TabBarProps = SceneRendererProps & {
|
|
|
22
22
|
};
|
|
23
23
|
type TabBarPosition = "top" | "bottom";
|
|
24
24
|
type KeyboardDismissMode = "none" | "auto" | "on-drag";
|
|
25
|
+
type IconPosition = "top" | "bottom" | "left" | "right";
|
|
25
26
|
|
|
26
27
|
type TabViewProps = {
|
|
27
28
|
onIndexChanged?: (index: number) => void;
|
|
@@ -37,6 +38,7 @@ type TabViewProps = {
|
|
|
37
38
|
indicatorColor?: string;
|
|
38
39
|
tabsBackgroundColor?: string;
|
|
39
40
|
iconSize?: number;
|
|
41
|
+
iconPosition?: IconPosition;
|
|
40
42
|
style?: StyleProp<ViewStyle | TextStyle>;
|
|
41
43
|
theme: Theme;
|
|
42
44
|
} & IconSlot;
|
|
@@ -56,6 +58,7 @@ const TabViewComponent: React.FC<React.PropsWithChildren<TabViewProps>> = ({
|
|
|
56
58
|
indicatorColor,
|
|
57
59
|
tabsBackgroundColor,
|
|
58
60
|
iconSize = 16,
|
|
61
|
+
iconPosition = "top",
|
|
59
62
|
style,
|
|
60
63
|
theme,
|
|
61
64
|
children: childrenProp,
|
|
@@ -101,6 +104,21 @@ const TabViewComponent: React.FC<React.PropsWithChildren<TabViewProps>> = ({
|
|
|
101
104
|
};
|
|
102
105
|
|
|
103
106
|
const renderTabBar: React.FC<TabBarProps> = (props) => {
|
|
107
|
+
let tabFlexDirection: "row" | "column" | "row-reverse" | "column-reverse";
|
|
108
|
+
switch (iconPosition) {
|
|
109
|
+
case "top":
|
|
110
|
+
tabFlexDirection = "column";
|
|
111
|
+
break;
|
|
112
|
+
case "bottom":
|
|
113
|
+
tabFlexDirection = "column-reverse";
|
|
114
|
+
break;
|
|
115
|
+
case "left":
|
|
116
|
+
tabFlexDirection = "row";
|
|
117
|
+
break;
|
|
118
|
+
case "right":
|
|
119
|
+
tabFlexDirection = "row-reverse";
|
|
120
|
+
break;
|
|
121
|
+
}
|
|
104
122
|
return (
|
|
105
123
|
<TabBar
|
|
106
124
|
{...props}
|
|
@@ -112,6 +130,7 @@ const TabViewComponent: React.FC<React.PropsWithChildren<TabViewProps>> = ({
|
|
|
112
130
|
backgroundColor: indicatorColor || theme.colors.primary,
|
|
113
131
|
}}
|
|
114
132
|
labelStyle={[{ textTransform: "none" }, textStyles]}
|
|
133
|
+
tabStyle={{ flexDirection: tabFlexDirection }}
|
|
115
134
|
renderIcon={({ route, color }) =>
|
|
116
135
|
route?.icon ? (
|
|
117
136
|
<Icon name={route.icon} color={color} size={iconSize} />
|