@draftbit/core 49.5.2-5ac7d2.2 → 49.5.2-77ae43.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/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/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/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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draftbit/core",
|
|
3
|
-
"version": "49.5.2-
|
|
3
|
+
"version": "49.5.2-77ae43.2+77ae434",
|
|
4
4
|
"description": "Core (non-native) Components",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"types": "lib/typescript/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": "^49.5.2-
|
|
44
|
+
"@draftbit/types": "^49.5.2-77ae43.2+77ae434",
|
|
45
45
|
"@expo/vector-icons": "^13.0.0",
|
|
46
46
|
"@gorhom/bottom-sheet": "5.0.0-alpha.7",
|
|
47
47
|
"@material-ui/core": "^4.11.0",
|
|
@@ -116,5 +116,5 @@
|
|
|
116
116
|
],
|
|
117
117
|
"testEnvironment": "node"
|
|
118
118
|
},
|
|
119
|
-
"gitHead": "
|
|
119
|
+
"gitHead": "77ae43423c6f90f399184532ed9aa307e8ed754b"
|
|
120
120
|
}
|
|
@@ -4,7 +4,7 @@ import { FlatList } from "react-native";
|
|
|
4
4
|
import SectionHeader, { DefaultSectionHeader } from "./SectionHeader";
|
|
5
5
|
import { flattenReactFragments } from "../../utilities";
|
|
6
6
|
export const DEFAULT_SECTION = "Uncategorized";
|
|
7
|
-
const SectionList = ({ sectionKey, stickyHeader = false, listComponent = "FlatList", data: dataProp, renderItem: renderItemProp, keyExtractor: keyExtractorProp, ...rest }) => {
|
|
7
|
+
const SectionList = React.forwardRef(({ sectionKey, stickyHeader = false, listComponent = "FlatList", data: dataProp, renderItem: renderItemProp, keyExtractor: keyExtractorProp, ...rest }, ref) => {
|
|
8
8
|
const data = React.useMemo(() => (Array.isArray(dataProp) ? dataProp : []), [dataProp]);
|
|
9
9
|
const dataWithSections = React.useMemo(() => {
|
|
10
10
|
var _a;
|
|
@@ -102,10 +102,10 @@ const SectionList = ({ sectionKey, stickyHeader = false, listComponent = "FlatLi
|
|
|
102
102
|
};
|
|
103
103
|
switch (listComponent) {
|
|
104
104
|
case "FlatList":
|
|
105
|
-
return (React.createElement(FlatList, { stickyHeaderIndices: sectionHeaderIndicies, ...rest, data: dataWithSections, renderItem: renderItem, keyExtractor: keyExtractor }));
|
|
105
|
+
return (React.createElement(FlatList, { ref: ref, stickyHeaderIndices: sectionHeaderIndicies, ...rest, data: dataWithSections, renderItem: renderItem, keyExtractor: keyExtractor }));
|
|
106
106
|
case "FlashList":
|
|
107
|
-
return (React.createElement(FlashList, { stickyHeaderIndices: sectionHeaderIndicies, ...rest, data: dataWithSections, renderItem: renderItem, keyExtractor: keyExtractor }));
|
|
107
|
+
return (React.createElement(FlashList, { ref: ref, stickyHeaderIndices: sectionHeaderIndicies, ...rest, data: dataWithSections, renderItem: renderItem, keyExtractor: keyExtractor }));
|
|
108
108
|
}
|
|
109
|
-
};
|
|
109
|
+
});
|
|
110
110
|
export default SectionList;
|
|
111
111
|
//# sourceMappingURL=SectionList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SectionList.js","sourceRoot":"","sources":["SectionList.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;AACvD,OAAO,aAAa,EAAE,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAqCxD,MAAM,CAAC,MAAM,eAAe,GAAG,eAAe,CAAC;AAE/C,MAAM,WAAW,GAAG,
|
|
1
|
+
{"version":3,"file":"SectionList.js","sourceRoot":"","sources":["SectionList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAkB,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAiB,QAAQ,EAA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AC,UAAU,CAAC,IAAI,eAAe;iBAClD,CAAC,CAAC;gBACH,OAAO,gCAAgC,CAAC,YAAY,CAAC,CAAC;aACvD;SACF;IACH,CAAC,CAAC;IAEF,MAAM,YAAY,GAAG,CAAC,IAAwB,EAAE,KAAa,EAAE,EAAE;QAC/D,QAAQ,IAAI,CAAC,IAAI,EAAE;YACjB,KAAK,cAAc,CAAC,CAAC;gBACnB,OAAO,WAAW,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC;aACtC;YACD,KAAK,WAAW,CAAC,CAAC;gBAChB,OAAO,CAAA,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAG,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,KAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;aACjE;SACF;IACH,CAAC,CAAC;IAEF,QAAQ,aAAa,EAAE;QACrB,KAAK,UAAU;YACb,OAAO,CACL,oBAAC,QAAQ,IACP,GAAG,EAAE,GAA0B,EAC/B,mBAAmB,EAAE,qBAAqB,KACrC,IAA0C,EAC/C,IAAI,EAAE,gBAAgB,EACtB,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,YAAY,GAC1B,CACH,CAAC;QACJ,KAAK,WAAW;YACd,OAAO,CACL,oBAAC,SAAS,IACR,GAAG,EAAE,GAA+C,EACpD,mBAAmB,EAAE,qBAAqB,KACrC,IAA2C,EAChD,IAAI,EAAE,gBAAgB,EACtB,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,YAAY,GAC1B,CACH,CAAC;KACL;AACH,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -41,168 +41,175 @@ type SectionListItem<T> = SectionListDataItem<T> | SectionListSectionItem;
|
|
|
41
41
|
|
|
42
42
|
export const DEFAULT_SECTION = "Uncategorized";
|
|
43
43
|
|
|
44
|
-
const SectionList =
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
)
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
for (const item of data) {
|
|
63
|
-
const section = item[sectionKey]?.toString() || DEFAULT_SECTION;
|
|
64
|
-
if (sectionDataItems[section]) {
|
|
65
|
-
sectionDataItems[section].push(item);
|
|
66
|
-
} else {
|
|
67
|
-
sectionDataItems[section] = [item];
|
|
68
|
-
}
|
|
69
|
-
}
|
|
44
|
+
const SectionList = React.forwardRef(
|
|
45
|
+
<T extends { [key: string]: any }>(
|
|
46
|
+
{
|
|
47
|
+
sectionKey,
|
|
48
|
+
stickyHeader = false,
|
|
49
|
+
listComponent = "FlatList",
|
|
50
|
+
data: dataProp,
|
|
51
|
+
renderItem: renderItemProp,
|
|
52
|
+
keyExtractor: keyExtractorProp,
|
|
53
|
+
...rest
|
|
54
|
+
}: FlatListSectionListProps<T> | FlashListSectionListProps<T>,
|
|
55
|
+
ref: React.Ref<FlatList | FlashList<any>>
|
|
56
|
+
) => {
|
|
57
|
+
const data = React.useMemo(
|
|
58
|
+
() => (Array.isArray(dataProp) ? dataProp : []) as T[],
|
|
59
|
+
[dataProp]
|
|
60
|
+
);
|
|
70
61
|
|
|
71
|
-
|
|
72
|
-
result
|
|
73
|
-
const
|
|
74
|
-
section
|
|
75
|
-
].map((item) => ({ type: "DATA_ITEM", data: item }));
|
|
76
|
-
result.push(...sectionItems);
|
|
77
|
-
}
|
|
62
|
+
const dataWithSections = React.useMemo(() => {
|
|
63
|
+
const result: SectionListItem<T>[] = [];
|
|
64
|
+
const sectionDataItems: { [key: string]: T[] } = {};
|
|
78
65
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
if (!element) {
|
|
96
|
-
return null;
|
|
97
|
-
}
|
|
66
|
+
for (const item of data) {
|
|
67
|
+
const section = item[sectionKey]?.toString() || DEFAULT_SECTION;
|
|
68
|
+
if (sectionDataItems[section]) {
|
|
69
|
+
sectionDataItems[section].push(item);
|
|
70
|
+
} else {
|
|
71
|
+
sectionDataItems[section] = [item];
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
for (const section in sectionDataItems) {
|
|
76
|
+
result.push({ type: "SECTION_ITEM", title: section });
|
|
77
|
+
const sectionItems: SectionListDataItem<T>[] = sectionDataItems[
|
|
78
|
+
section
|
|
79
|
+
].map((item) => ({ type: "DATA_ITEM", data: item }));
|
|
80
|
+
result.push(...sectionItems);
|
|
81
|
+
}
|
|
98
82
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
83
|
+
return result;
|
|
84
|
+
}, [data, sectionKey]);
|
|
85
|
+
|
|
86
|
+
const sectionHeaderIndicies = React.useMemo(
|
|
87
|
+
() =>
|
|
88
|
+
stickyHeader
|
|
89
|
+
? dataWithSections
|
|
90
|
+
.filter((item) => item.type === "SECTION_ITEM")
|
|
91
|
+
.map((item) => dataWithSections.indexOf(item))
|
|
92
|
+
: undefined,
|
|
93
|
+
[dataWithSections, stickyHeader]
|
|
102
94
|
);
|
|
103
95
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
return child;
|
|
110
|
-
}
|
|
96
|
+
const extractSectionHeader = (
|
|
97
|
+
element: JSX.Element | null
|
|
98
|
+
): JSX.Element | null => {
|
|
99
|
+
if (!element) {
|
|
100
|
+
return null;
|
|
111
101
|
}
|
|
112
|
-
}
|
|
113
|
-
return null;
|
|
114
|
-
};
|
|
115
102
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
return null;
|
|
121
|
-
}
|
|
103
|
+
const props = element.props || {};
|
|
104
|
+
const children = flattenReactFragments(
|
|
105
|
+
React.Children.toArray(props.children) as React.ReactElement[]
|
|
106
|
+
);
|
|
122
107
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
const newChildren = [];
|
|
131
|
-
for (const child of children) {
|
|
132
|
-
if (child.type !== SectionHeader) {
|
|
133
|
-
newChildren.push(child);
|
|
108
|
+
if (element.type === SectionHeader) {
|
|
109
|
+
return element;
|
|
110
|
+
} else {
|
|
111
|
+
for (const child of children) {
|
|
112
|
+
if (child.type === SectionHeader) {
|
|
113
|
+
return child;
|
|
114
|
+
}
|
|
134
115
|
}
|
|
135
116
|
}
|
|
136
|
-
return
|
|
137
|
-
|
|
138
|
-
children: newChildren,
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
};
|
|
117
|
+
return null;
|
|
118
|
+
};
|
|
142
119
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
index: number;
|
|
149
|
-
}) => {
|
|
150
|
-
switch (item.type) {
|
|
151
|
-
case "SECTION_ITEM": {
|
|
152
|
-
const renderedItem = renderItemProp({
|
|
153
|
-
index,
|
|
154
|
-
section: item.title,
|
|
155
|
-
});
|
|
156
|
-
return (
|
|
157
|
-
extractSectionHeader(renderedItem) || (
|
|
158
|
-
<DefaultSectionHeader title={item.title} />
|
|
159
|
-
)
|
|
160
|
-
);
|
|
120
|
+
const extractRemainingNonSectionHeader = (
|
|
121
|
+
element: JSX.Element | null
|
|
122
|
+
): JSX.Element | null => {
|
|
123
|
+
if (!element) {
|
|
124
|
+
return null;
|
|
161
125
|
}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
126
|
+
|
|
127
|
+
const props = element.props || {};
|
|
128
|
+
const children = flattenReactFragments(
|
|
129
|
+
React.Children.toArray(props.children) as React.ReactElement[]
|
|
130
|
+
);
|
|
131
|
+
if (element.type === SectionHeader) {
|
|
132
|
+
return null;
|
|
133
|
+
} else {
|
|
134
|
+
const newChildren = [];
|
|
135
|
+
for (const child of children) {
|
|
136
|
+
if (child.type !== SectionHeader) {
|
|
137
|
+
newChildren.push(child);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
return React.cloneElement(element, {
|
|
141
|
+
...props,
|
|
142
|
+
children: newChildren,
|
|
167
143
|
});
|
|
168
|
-
return extractRemainingNonSectionHeader(renderedItem);
|
|
169
144
|
}
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
const renderItem = ({
|
|
148
|
+
item,
|
|
149
|
+
index,
|
|
150
|
+
}: {
|
|
151
|
+
item: SectionListItem<T>;
|
|
152
|
+
index: number;
|
|
153
|
+
}) => {
|
|
154
|
+
switch (item.type) {
|
|
155
|
+
case "SECTION_ITEM": {
|
|
156
|
+
const renderedItem = renderItemProp({
|
|
157
|
+
index,
|
|
158
|
+
section: item.title,
|
|
159
|
+
});
|
|
160
|
+
return (
|
|
161
|
+
extractSectionHeader(renderedItem) || (
|
|
162
|
+
<DefaultSectionHeader title={item.title} />
|
|
163
|
+
)
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
case "DATA_ITEM": {
|
|
167
|
+
const renderedItem = renderItemProp({
|
|
168
|
+
item: item.data,
|
|
169
|
+
index,
|
|
170
|
+
section: item.data[sectionKey] || DEFAULT_SECTION,
|
|
171
|
+
});
|
|
172
|
+
return extractRemainingNonSectionHeader(renderedItem);
|
|
173
|
+
}
|
|
177
174
|
}
|
|
178
|
-
|
|
179
|
-
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
const keyExtractor = (item: SectionListItem<T>, index: number) => {
|
|
178
|
+
switch (item.type) {
|
|
179
|
+
case "SECTION_ITEM": {
|
|
180
|
+
return `section_${index.toString()}`;
|
|
181
|
+
}
|
|
182
|
+
case "DATA_ITEM": {
|
|
183
|
+
return keyExtractorProp?.(item.data, index) || index.toString();
|
|
184
|
+
}
|
|
180
185
|
}
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
switch (listComponent) {
|
|
189
|
+
case "FlatList":
|
|
190
|
+
return (
|
|
191
|
+
<FlatList
|
|
192
|
+
ref={ref as React.Ref<FlatList>}
|
|
193
|
+
stickyHeaderIndices={sectionHeaderIndicies}
|
|
194
|
+
{...(rest as FlatListProps<SectionListItem<T>>)}
|
|
195
|
+
data={dataWithSections}
|
|
196
|
+
renderItem={renderItem}
|
|
197
|
+
keyExtractor={keyExtractor}
|
|
198
|
+
/>
|
|
199
|
+
);
|
|
200
|
+
case "FlashList":
|
|
201
|
+
return (
|
|
202
|
+
<FlashList
|
|
203
|
+
ref={ref as React.Ref<FlashList<SectionListItem<T>>>}
|
|
204
|
+
stickyHeaderIndices={sectionHeaderIndicies}
|
|
205
|
+
{...(rest as FlashListProps<SectionListItem<T>>)}
|
|
206
|
+
data={dataWithSections}
|
|
207
|
+
renderItem={renderItem}
|
|
208
|
+
keyExtractor={keyExtractor}
|
|
209
|
+
/>
|
|
210
|
+
);
|
|
181
211
|
}
|
|
182
|
-
};
|
|
183
|
-
|
|
184
|
-
switch (listComponent) {
|
|
185
|
-
case "FlatList":
|
|
186
|
-
return (
|
|
187
|
-
<FlatList
|
|
188
|
-
stickyHeaderIndices={sectionHeaderIndicies}
|
|
189
|
-
{...(rest as FlatListProps<SectionListItem<T>>)}
|
|
190
|
-
data={dataWithSections}
|
|
191
|
-
renderItem={renderItem}
|
|
192
|
-
keyExtractor={keyExtractor}
|
|
193
|
-
/>
|
|
194
|
-
);
|
|
195
|
-
case "FlashList":
|
|
196
|
-
return (
|
|
197
|
-
<FlashList
|
|
198
|
-
stickyHeaderIndices={sectionHeaderIndicies}
|
|
199
|
-
{...(rest as FlashListProps<SectionListItem<T>>)}
|
|
200
|
-
data={dataWithSections}
|
|
201
|
-
renderItem={renderItem}
|
|
202
|
-
keyExtractor={keyExtractor}
|
|
203
|
-
/>
|
|
204
|
-
);
|
|
205
212
|
}
|
|
206
|
-
|
|
213
|
+
);
|
|
207
214
|
|
|
208
215
|
export default SectionList;
|
|
@@ -5,9 +5,9 @@ import useSplitContentContainerStyles from "./useSplitContentContainerStyles";
|
|
|
5
5
|
* A FlashList wrapper that takes a single `style` prop and internally extracts
|
|
6
6
|
* the appropriate style keys into the `contentContainerStyle`
|
|
7
7
|
*/
|
|
8
|
-
const SimpleStyleFlashList = ({ style: styleProp, data, ...rest }) => {
|
|
8
|
+
const SimpleStyleFlashList = React.forwardRef(({ style: styleProp, data, ...rest }, ref) => {
|
|
9
9
|
const { style, contentContainerStyle } = useSplitContentContainerStyles(styleProp);
|
|
10
|
-
return (React.createElement(FlashList, { style: style, contentContainerStyle: contentContainerStyle, data: data, ...rest }));
|
|
11
|
-
};
|
|
10
|
+
return (React.createElement(FlashList, { ref: ref, style: style, contentContainerStyle: contentContainerStyle, data: data, ...rest }));
|
|
11
|
+
});
|
|
12
12
|
export default SimpleStyleFlashList;
|
|
13
13
|
//# sourceMappingURL=SimpleStyleFlashList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SimpleStyleFlashList.js","sourceRoot":"","sources":["SimpleStyleFlashList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,OAAO,8BAA8B,MAAM,kCAAkC,CAAC;AAE9E;;;GAGG;AACH,MAAM,oBAAoB,GAAG,
|
|
1
|
+
{"version":3,"file":"SimpleStyleFlashList.js","sourceRoot":"","sources":["SimpleStyleFlashList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,OAAO,8BAA8B,MAAM,kCAAkC,CAAC;AAE9E;;;GAGG;AACH,MAAM,oBAAoB,GAAG,KAAK,CAAC,UAAU,CAC3C,CACE,EACE,KAAK,EAAE,SAAS,EAChB,IAAI,EACJ,GAAG,IAAI,EAC0C,EACnD,GAA8B,EAC9B,EAAE;IACF,MAAM,EAAE,KAAK,EAAE,qBAAqB,EAAE,GACpC,8BAA8B,CAAC,SAAS,CAAC,CAAC;IAE5C,OAAO,CACL,oBAAC,SAAS,IACR,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,qBAAqB,EAAE,qBAAqC,EAC5D,IAAI,EAAE,IAAI,KACN,IAAI,GACR,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -7,22 +7,28 @@ import useSplitContentContainerStyles from "./useSplitContentContainerStyles";
|
|
|
7
7
|
* A FlashList wrapper that takes a single `style` prop and internally extracts
|
|
8
8
|
* the appropriate style keys into the `contentContainerStyle`
|
|
9
9
|
*/
|
|
10
|
-
const SimpleStyleFlashList =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
const SimpleStyleFlashList = React.forwardRef(
|
|
11
|
+
<T extends any>(
|
|
12
|
+
{
|
|
13
|
+
style: styleProp,
|
|
14
|
+
data,
|
|
15
|
+
...rest
|
|
16
|
+
}: Omit<FlashListProps<T>, "contentContainerStyle">,
|
|
17
|
+
ref: React.Ref<FlashList<any>>
|
|
18
|
+
) => {
|
|
19
|
+
const { style, contentContainerStyle } =
|
|
20
|
+
useSplitContentContainerStyles(styleProp);
|
|
17
21
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
return (
|
|
23
|
+
<FlashList
|
|
24
|
+
ref={ref}
|
|
25
|
+
style={style}
|
|
26
|
+
contentContainerStyle={contentContainerStyle as ContentStyle}
|
|
27
|
+
data={data}
|
|
28
|
+
{...rest}
|
|
29
|
+
/>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
);
|
|
27
33
|
|
|
28
34
|
export default SimpleStyleFlashList;
|
|
@@ -5,9 +5,9 @@ import useSplitContentContainerStyles from "./useSplitContentContainerStyles";
|
|
|
5
5
|
* A FlatList wrapper that takes a single `style` prop and internally extracts
|
|
6
6
|
* the appropriate style keys into the `contentContainerStyle`
|
|
7
7
|
*/
|
|
8
|
-
const SimpleStyleFlatList = ({ style: styleProp, data, ...rest }) => {
|
|
8
|
+
const SimpleStyleFlatList = React.forwardRef(({ style: styleProp, data, ...rest }, ref) => {
|
|
9
9
|
const { style, contentContainerStyle } = useSplitContentContainerStyles(styleProp);
|
|
10
|
-
return (React.createElement(FlatList, { style: style, contentContainerStyle: contentContainerStyle, data: data, ...rest }));
|
|
11
|
-
};
|
|
10
|
+
return (React.createElement(FlatList, { ref: ref, style: style, contentContainerStyle: contentContainerStyle, data: data, ...rest }));
|
|
11
|
+
});
|
|
12
12
|
export default SimpleStyleFlatList;
|
|
13
13
|
//# sourceMappingURL=SimpleStyleFlatList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SimpleStyleFlatList.js","sourceRoot":"","sources":["SimpleStyleFlatList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,8BAA8B,MAAM,kCAAkC,CAAC;AAE9E;;;GAGG;AACH,MAAM,mBAAmB,GAAG,
|
|
1
|
+
{"version":3,"file":"SimpleStyleFlatList.js","sourceRoot":"","sources":["SimpleStyleFlatList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,8BAA8B,MAAM,kCAAkC,CAAC;AAE9E;;;GAGG;AACH,MAAM,mBAAmB,GAAG,KAAK,CAAC,UAAU,CAC1C,CACE,EACE,KAAK,EAAE,SAAS,EAChB,IAAI,EACJ,GAAG,IAAI,EACyC,EAClD,GAAwB,EACxB,EAAE;IACF,MAAM,EAAE,KAAK,EAAE,qBAAqB,EAAE,GACpC,8BAA8B,CAAC,SAAS,CAAC,CAAC;IAE5C,OAAO,CACL,oBAAC,QAAQ,IACP,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,mBAAmB,CAAC"}
|
|
@@ -7,22 +7,28 @@ import useSplitContentContainerStyles from "./useSplitContentContainerStyles";
|
|
|
7
7
|
* A FlatList wrapper that takes a single `style` prop and internally extracts
|
|
8
8
|
* the appropriate style keys into the `contentContainerStyle`
|
|
9
9
|
*/
|
|
10
|
-
const SimpleStyleFlatList =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
const SimpleStyleFlatList = React.forwardRef(
|
|
11
|
+
<T extends any>(
|
|
12
|
+
{
|
|
13
|
+
style: styleProp,
|
|
14
|
+
data,
|
|
15
|
+
...rest
|
|
16
|
+
}: Omit<FlatListProps<T>, "contentContainerStyle">,
|
|
17
|
+
ref: React.Ref<FlatList>
|
|
18
|
+
) => {
|
|
19
|
+
const { style, contentContainerStyle } =
|
|
20
|
+
useSplitContentContainerStyles(styleProp);
|
|
17
21
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
return (
|
|
23
|
+
<FlatList
|
|
24
|
+
ref={ref}
|
|
25
|
+
style={style}
|
|
26
|
+
contentContainerStyle={contentContainerStyle}
|
|
27
|
+
data={data}
|
|
28
|
+
{...rest}
|
|
29
|
+
/>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
);
|
|
27
33
|
|
|
28
34
|
export default SimpleStyleFlatList;
|
|
@@ -5,9 +5,9 @@ import useSplitContentContainerStyles from "./useSplitContentContainerStyles";
|
|
|
5
5
|
* A KeyboardAwareScrollView wrapper that takes a single `style` prop and internally extracts
|
|
6
6
|
* the appropriate style keys into the `contentContainerStyle`
|
|
7
7
|
*/
|
|
8
|
-
const SimpleStyleKeyboardAwareScrollView = ({ style: styleProp, ...rest }) => {
|
|
8
|
+
const SimpleStyleKeyboardAwareScrollView = React.forwardRef(({ style: styleProp, ...rest }, ref) => {
|
|
9
9
|
const { style, contentContainerStyle } = useSplitContentContainerStyles(styleProp);
|
|
10
|
-
return (React.createElement(KeyboardAwareScrollView, { style: style, contentContainerStyle: contentContainerStyle, ...rest }));
|
|
11
|
-
};
|
|
10
|
+
return (React.createElement(KeyboardAwareScrollView, { ref: ref, style: style, contentContainerStyle: contentContainerStyle, ...rest }));
|
|
11
|
+
});
|
|
12
12
|
export default SimpleStyleKeyboardAwareScrollView;
|
|
13
13
|
//# sourceMappingURL=SimpleStyleKeyboardAwareScrollView.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SimpleStyleKeyboardAwareScrollView.js","sourceRoot":"","sources":["SimpleStyleKeyboardAwareScrollView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAElF,OAAO,8BAA8B,MAAM,kCAAkC,CAAC;AAE9E;;;GAGG;AACH,MAAM,kCAAkC,
|
|
1
|
+
{"version":3,"file":"SimpleStyleKeyboardAwareScrollView.js","sourceRoot":"","sources":["SimpleStyleKeyboardAwareScrollView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAElF,OAAO,8BAA8B,MAAM,kCAAkC,CAAC;AAE9E;;;GAGG;AACH,MAAM,kCAAkC,GAAG,KAAK,CAAC,UAAU,CACzD,CACE,EACE,KAAK,EAAE,SAAS,EAChB,GAAG,IAAI,EACqD,EAC9D,GAAuC,EACvC,EAAE;IACF,MAAM,EAAE,KAAK,EAAE,qBAAqB,EAAE,GACpC,8BAA8B,CAAC,SAAS,CAAC,CAAC;IAE5C,OAAO,CACL,oBAAC,uBAAuB,IACtB,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,qBAAqB,EAAE,qBAAqB,KACxC,IAAI,GACR,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,kCAAkC,CAAC"}
|
|
@@ -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"}
|