@onehat/ui 0.3.60 → 0.3.61
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/package.json
CHANGED
|
@@ -868,6 +868,41 @@ function GridComponent(props) {
|
|
|
868
868
|
sizeProps.flex = flex ?? 1;
|
|
869
869
|
}
|
|
870
870
|
|
|
871
|
+
let grid = <FlatList
|
|
872
|
+
ref={gridRef}
|
|
873
|
+
scrollEnabled={CURRENT_MODE === UI_MODE_WEB}
|
|
874
|
+
nestedScrollEnabled={true}
|
|
875
|
+
contentContainerStyle={{
|
|
876
|
+
overflow: 'auto',
|
|
877
|
+
borderWidth: isDragMode ? styles.REORDER_BORDER_WIDTH : 0,
|
|
878
|
+
borderColor: isDragMode ? styles.REORDER_BORDER_COLOR : null,
|
|
879
|
+
borderStyle: styles.REORDER_BORDER_STYLE,
|
|
880
|
+
flex: 1,
|
|
881
|
+
}}
|
|
882
|
+
refreshing={isLoading}
|
|
883
|
+
onRefresh={pullToRefresh ? onRefresh : null}
|
|
884
|
+
progressViewOffset={100}
|
|
885
|
+
data={rowData}
|
|
886
|
+
keyExtractor={(item) => {
|
|
887
|
+
let id;
|
|
888
|
+
if (item.id) {
|
|
889
|
+
id = item.id;
|
|
890
|
+
} else if (fields) {
|
|
891
|
+
id = item[idIx];
|
|
892
|
+
}
|
|
893
|
+
return String(id);
|
|
894
|
+
}}
|
|
895
|
+
initialNumToRender={initialNumToRender}
|
|
896
|
+
initialScrollIndex={0}
|
|
897
|
+
renderItem={renderRow}
|
|
898
|
+
bg="trueGray.100"
|
|
899
|
+
{...flatListProps}
|
|
900
|
+
/>
|
|
901
|
+
if (CURRENT_MODE === UI_MODE_REACT_NATIVE) {
|
|
902
|
+
grid = <ScrollView flex={1} w="100%">{grid}</ScrollView>
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
|
|
871
906
|
return <Column
|
|
872
907
|
{...testProps('Grid')}
|
|
873
908
|
ref={containerRef}
|
|
@@ -885,40 +920,7 @@ function GridComponent(props) {
|
|
|
885
920
|
deselectAll();
|
|
886
921
|
}
|
|
887
922
|
}}>
|
|
888
|
-
{!entities?.length ?
|
|
889
|
-
<NoRecordsFound text={noneFoundText} onRefresh={onRefresh} /> :
|
|
890
|
-
<ScrollView flex={1} w="100%">
|
|
891
|
-
<FlatList
|
|
892
|
-
ref={gridRef}
|
|
893
|
-
scrollEnabled={false}
|
|
894
|
-
nestedScrollEnabled={true}
|
|
895
|
-
contentContainerStyle={{
|
|
896
|
-
overflow: 'auto',
|
|
897
|
-
borderWidth: isDragMode ? styles.REORDER_BORDER_WIDTH : 0,
|
|
898
|
-
borderColor: isDragMode ? styles.REORDER_BORDER_COLOR : null,
|
|
899
|
-
borderStyle: styles.REORDER_BORDER_STYLE,
|
|
900
|
-
flex: 1,
|
|
901
|
-
}}
|
|
902
|
-
refreshing={isLoading}
|
|
903
|
-
onRefresh={pullToRefresh ? onRefresh : null}
|
|
904
|
-
progressViewOffset={100}
|
|
905
|
-
data={rowData}
|
|
906
|
-
keyExtractor={(item) => {
|
|
907
|
-
let id;
|
|
908
|
-
if (item.id) {
|
|
909
|
-
id = item.id;
|
|
910
|
-
} else if (fields) {
|
|
911
|
-
id = item[idIx];
|
|
912
|
-
}
|
|
913
|
-
return String(id);
|
|
914
|
-
}}
|
|
915
|
-
initialNumToRender={initialNumToRender}
|
|
916
|
-
initialScrollIndex={0}
|
|
917
|
-
renderItem={renderRow}
|
|
918
|
-
bg="trueGray.100"
|
|
919
|
-
{...flatListProps}
|
|
920
|
-
/>
|
|
921
|
-
</ScrollView>}
|
|
923
|
+
{!entities?.length ? <NoRecordsFound text={noneFoundText} onRefresh={onRefresh} /> : grid}
|
|
922
924
|
</Column>
|
|
923
925
|
|
|
924
926
|
{listFooterComponent}
|