@fto-consult/expo-ui 6.25.3 → 6.26.1
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/babel.config.alias.js +1 -1
- package/package.json +2 -2
- package/src/App.js +1 -10
- package/src/components/Datagrid/Accordion/Row.js +24 -20
- package/src/components/Datagrid/Accordion/index.js +5 -8
- package/src/components/Datagrid/Actions/index.js +1 -1
- package/src/components/Datagrid/Common/Common.js +2 -1
- package/src/components/Datagrid/utils.js +5 -1
- package/src/components/Drawer/DrawerItems/index.js +7 -6
- package/src/components/ErrorBoundary/index.js +0 -1
- package/src/components/List/Common.js +3 -10
- package/src/components/List/Virtuoso/index.js +4 -2
- package/src/components/List/hooks.js +15 -2
- package/src/components/Menu/Menu.js +97 -113
- package/src/components/SplashScreen/index.js +16 -25
- package/src/components/Table/Row/RowWrapper.native.js +1 -1
- package/src/components/Table/index.js +3 -3
- package/src/index.js +48 -41
- package/src/navigation/Drawer/index.js +5 -3
- package/src/navigation/Drawer/items/index.js +2 -2
- package/src/screens/Help/openLibraries.js +1 -1
package/babel.config.alias.js
CHANGED
|
@@ -83,7 +83,7 @@ module.exports = (opts)=>{
|
|
|
83
83
|
const outputPath = path.resolve(HelpScreen,"openLibraries.js");
|
|
84
84
|
r.$nodeModulesPath = r.$enodeModulesPath= nodeModulesPath;
|
|
85
85
|
require("./find-licenses")({
|
|
86
|
-
paths : [root,r["$expo-ui-root-path",path.resolve(process.cwd())]
|
|
86
|
+
paths : [root,r["$expo-ui-root-path"],path.resolve(process.cwd())],
|
|
87
87
|
nodeModulesPath : nodeModulesPath,
|
|
88
88
|
outputPath
|
|
89
89
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fto-consult/expo-ui",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.26.1",
|
|
4
4
|
"description": "Bibliothèque de composants UI Expo,react-native",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"@emotion/react": "^11.11.1",
|
|
68
68
|
"@expo/html-elements": "^0.5.1",
|
|
69
69
|
"@expo/vector-icons": "^13.0.0",
|
|
70
|
-
"@fto-consult/common": "^3.28.
|
|
70
|
+
"@fto-consult/common": "^3.28.4",
|
|
71
71
|
"@gorhom/portal": "^1.0.14",
|
|
72
72
|
"@pchmn/expo-material3-theme": "^1.3.1",
|
|
73
73
|
"@react-native-async-storage/async-storage": "1.18.2",
|
package/src/App.js
CHANGED
|
@@ -3,9 +3,6 @@ import React from 'react';
|
|
|
3
3
|
import {SWRConfig} from "$swr";
|
|
4
4
|
import Index from './index';
|
|
5
5
|
import notify from "$notify";
|
|
6
|
-
import { SafeAreaProvider } from 'react-native-safe-area-context';
|
|
7
|
-
import {GestureHandlerRootView} from "react-native-gesture-handler";
|
|
8
|
-
import KeyboardAvoidingViewComponent from '$ecomponents/KeyboardAvoidingView';
|
|
9
6
|
import APP from "$app";
|
|
10
7
|
import {isMobileNative} from "$cplatform";
|
|
11
8
|
import {setDeviceIdRef} from "$capp";
|
|
@@ -144,13 +141,7 @@ export default function getIndex({onMount,onUnmount,render,onRender,init}){
|
|
|
144
141
|
}
|
|
145
142
|
}}
|
|
146
143
|
>
|
|
147
|
-
|
|
148
|
-
<KeyboardAvoidingViewComponent testID={"RN_AppKeyboardAvoidingView"}>
|
|
149
|
-
<SafeAreaProvider testID={"RN_AppSafeAreaProvider"}>
|
|
150
|
-
<Index onMount={onMount} render={render} onUnmount={onUnmount} onRender={onRender} init={init}/>
|
|
151
|
-
</SafeAreaProvider>
|
|
152
|
-
</KeyboardAvoidingViewComponent>
|
|
153
|
-
</GestureHandlerRootView>
|
|
144
|
+
<Index onMount={onMount} render={render} onUnmount={onUnmount} onRender={onRender} init={init}/>
|
|
154
145
|
</SWRConfig>
|
|
155
146
|
);
|
|
156
147
|
};
|
|
@@ -64,7 +64,6 @@ const DatagridAccordionRow = React.forwardRef((props,ref)=>{
|
|
|
64
64
|
let rowIndex = defaultDecimal(index);
|
|
65
65
|
let rowIndexCount = index+1;
|
|
66
66
|
const testID = defaultStr(props.testID,"RN_DatagridAccordionRow"+(rowKey||rowIndex))
|
|
67
|
-
let _rP = {}
|
|
68
67
|
const hasAvatar = React.isValidElement(avatarContent);
|
|
69
68
|
const handleRowToggle = (event)=>{
|
|
70
69
|
if(selectable === false) return;
|
|
@@ -75,8 +74,8 @@ const DatagridAccordionRow = React.forwardRef((props,ref)=>{
|
|
|
75
74
|
}
|
|
76
75
|
const wrapStyle = React.useMemo(()=>{
|
|
77
76
|
return getRowStyle({row:item,index,selected,numColumns,isAccordion:true,rowIndex:index});
|
|
78
|
-
},[selected])
|
|
79
|
-
|
|
77
|
+
},[selected,numColumns]);
|
|
78
|
+
const viewWrapperStyle = [];
|
|
80
79
|
if(selected) {
|
|
81
80
|
const handleAvatarRowToggle = (event)=>{
|
|
82
81
|
React.stopEventPropagation(event);
|
|
@@ -93,7 +92,8 @@ const DatagridAccordionRow = React.forwardRef((props,ref)=>{
|
|
|
93
92
|
title = {sTtitle}
|
|
94
93
|
></Avatar> : null;
|
|
95
94
|
if(!hasAvatar){
|
|
96
|
-
viewWrapperStyle
|
|
95
|
+
viewWrapperStyle.push(styles.hasNotAvatar);
|
|
96
|
+
viewWrapperStyle.push({borderLeftColor:theme.colors.primaryOnSurface})
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
99
|
|
|
@@ -105,26 +105,24 @@ const DatagridAccordionRow = React.forwardRef((props,ref)=>{
|
|
|
105
105
|
icon = {"information-outline"}
|
|
106
106
|
></Avatar>
|
|
107
107
|
}
|
|
108
|
-
} else if(selectable === false){
|
|
109
|
-
_rP.disabled = true;
|
|
110
108
|
}
|
|
111
109
|
right = typeof right === 'function'? right ({color:theme.colors.primaryOnSurface,selectable:true,style:[rStyles.lineHeight,styles.right]}) : right;
|
|
112
110
|
const swipeableRef = React.useRef(null);
|
|
113
111
|
return <Pressable
|
|
114
|
-
{
|
|
112
|
+
disabled = {selectable===false?true : false}
|
|
115
113
|
{...rowProps}
|
|
116
114
|
testID={testID}
|
|
117
115
|
children = {null}
|
|
118
116
|
onPress = {toggleExpander}
|
|
119
117
|
onLongPress={handleRowToggle}
|
|
120
118
|
style = {[
|
|
121
|
-
_rP.style,rowProps.style,
|
|
122
119
|
styles.container,
|
|
123
|
-
numColumns > 1 && {width:'99%'},
|
|
124
120
|
styles.bordered,
|
|
125
|
-
wrapperStyle,
|
|
126
121
|
wrapStyle,
|
|
127
|
-
style,
|
|
122
|
+
rowProps.style,
|
|
123
|
+
numColumns > 1 && styles.multiColumns,
|
|
124
|
+
selected && styles.selected,
|
|
125
|
+
//style,
|
|
128
126
|
]}
|
|
129
127
|
ref = {React.useMergeRefs(ref,innerRef)}
|
|
130
128
|
>
|
|
@@ -221,11 +219,17 @@ const styles = StyleSheet.create({
|
|
|
221
219
|
bordered : {
|
|
222
220
|
//borderColor: "#ced4da",
|
|
223
221
|
//borderWidth : 1,
|
|
222
|
+
//paddingHorizontal:10,
|
|
223
|
+
},
|
|
224
|
+
multiColumns : {
|
|
225
|
+
paddingHorizontal : 5,
|
|
226
|
+
width : "98%"
|
|
224
227
|
},
|
|
225
228
|
renderedContent : {
|
|
226
229
|
flexDirection : 'row',
|
|
227
230
|
alignItems : 'center',
|
|
228
|
-
justifyContent : 'center'
|
|
231
|
+
justifyContent : 'center',
|
|
232
|
+
paddingVertical : 10,
|
|
229
233
|
},
|
|
230
234
|
right : {
|
|
231
235
|
marginHorizontal : 0,
|
|
@@ -244,25 +248,25 @@ const styles = StyleSheet.create({
|
|
|
244
248
|
alignSelf : 'flex-start',
|
|
245
249
|
},
|
|
246
250
|
container : {
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
paddingHorizontal : isMobileNative()? 10 : 0,
|
|
251
|
+
paddingVertical : 0,
|
|
252
|
+
paddingHorizontal : 0,
|
|
250
253
|
marginHorizontal : 5,
|
|
251
254
|
flexWrap : 'nowrap',
|
|
252
255
|
justifyContent : 'center',
|
|
253
256
|
width : '100%',
|
|
254
257
|
},
|
|
255
|
-
containerSelected : {
|
|
256
|
-
paddingLeft : 2,
|
|
257
|
-
},
|
|
258
258
|
avatarContent : {
|
|
259
259
|
marginRight : 5,
|
|
260
260
|
},
|
|
261
261
|
hasNotAvatar : {
|
|
262
262
|
borderLeftWidth : 5,
|
|
263
|
-
paddingLeft :
|
|
263
|
+
paddingLeft : 0,
|
|
264
264
|
height : "100%"
|
|
265
|
-
}
|
|
265
|
+
},
|
|
266
|
+
selected : {
|
|
267
|
+
paddingHorizontal : 0,
|
|
268
|
+
paddingVertical : 0,
|
|
269
|
+
},
|
|
266
270
|
});
|
|
267
271
|
|
|
268
272
|
DatagridAccordionRow.displayName = 'DatagridAccordionRow';
|
|
@@ -23,7 +23,7 @@ import RenderType from "../RenderType";
|
|
|
23
23
|
import { flatMode} from "$ecomponents/TextField";
|
|
24
24
|
import List from "$ecomponents/Table/List";
|
|
25
25
|
import theme,{Colors} from "$theme";
|
|
26
|
-
import {
|
|
26
|
+
import {styles as rStyles} from "../utils";
|
|
27
27
|
import Avatar from "$ecomponents/Avatar";
|
|
28
28
|
import {defaultObj,isOb,isNonNullString} from "$cutils";
|
|
29
29
|
import PropTypes from "prop-types";
|
|
@@ -94,13 +94,10 @@ const DatagridFactory = (Factory)=>{
|
|
|
94
94
|
const formatValue = this.formatValue.bind(this);
|
|
95
95
|
return {...this.getActionsArgs(),valueFormatter:formatValue,formatValue,abreviateValues:this.state.abreviateValues,row:item,items:this.state.data,item,rowData:item,index,rowIndex:index,rowCounterIndex:rowIndexCount,rowIndexCount};
|
|
96
96
|
}
|
|
97
|
-
getRenderingItemProps ({item,rowKey,
|
|
97
|
+
getRenderingItemProps ({item,rowKey,index}){
|
|
98
98
|
this.renderingItemsProps = isObj(this.renderingItemsProps)? this.renderingItemsProps : {};
|
|
99
|
-
const wrapperStyle = getRowStyle({row:item,index,numColumns,isAccordion:true,rowIndex:index});
|
|
100
99
|
if(this.renderingItemsProps[rowKey]){
|
|
101
|
-
|
|
102
|
-
it.wrapperStyle = wrapperStyle;
|
|
103
|
-
return it;
|
|
100
|
+
return this.renderingItemsProps[rowKey];
|
|
104
101
|
}
|
|
105
102
|
const callArgs = this.getItemCallArgs({item,index});
|
|
106
103
|
const accordion = this.props.accordion;
|
|
@@ -169,7 +166,7 @@ const DatagridFactory = (Factory)=>{
|
|
|
169
166
|
}
|
|
170
167
|
this.renderingItemsProps[rowKey] = {
|
|
171
168
|
testID,
|
|
172
|
-
|
|
169
|
+
title,right,rightProps,description,avatarContent,rowProps,avatarProps,
|
|
173
170
|
bottomSheetTitlePrefix : defaultStr(renderedContent?.bottomSheetTitlePrefix,accordionProps.bottomSheetTitlePrefix,accordion?.bottomSheetTitlePrefix)
|
|
174
171
|
}
|
|
175
172
|
return this.renderingItemsProps[rowKey];
|
|
@@ -200,8 +197,8 @@ const DatagridFactory = (Factory)=>{
|
|
|
200
197
|
selectable = {this.props.selectable}
|
|
201
198
|
{...defaultObj(this.props.accordionProps)}
|
|
202
199
|
accordion = {this.props.accordion}
|
|
200
|
+
{...this.getRenderingItemProps({item,index,rowKey})}
|
|
203
201
|
numColumns = {numColumns}
|
|
204
|
-
{...this.getRenderingItemProps({item,numColumns,index,rowKey})}
|
|
205
202
|
key = {index}
|
|
206
203
|
ref = {(el)=>{
|
|
207
204
|
if(isObj(this.renderingItemsProps) && isObj(this.renderingItemsProps[rowKey]) ){
|
|
@@ -16,7 +16,7 @@ export default function DatagridActions ({actions,actionProps,...props}){
|
|
|
16
16
|
const selectedRowsCount = useGetSelectedRowsCount();
|
|
17
17
|
useWindowDimensions();
|
|
18
18
|
const selected = !!selectedRowsCount;
|
|
19
|
-
actions = selected ? context?.renderSelectedRowsActions.call(context,
|
|
19
|
+
actions = selected ? context?.renderSelectedRowsActions.call(context,{}) : actions;
|
|
20
20
|
if(selected){
|
|
21
21
|
actionProps = Object.assign({},actionProps);
|
|
22
22
|
actionProps.style = Object.assign({},StyleSheet.flatten(actionProps.style));
|
|
@@ -3560,7 +3560,8 @@ export default class CommonDatagridComponent extends AppComponent {
|
|
|
3560
3560
|
}
|
|
3561
3561
|
isAllRowsSelected(){
|
|
3562
3562
|
const count = this.getSelectedRowsCount() - this.getSectionListDataSize();
|
|
3563
|
-
|
|
3563
|
+
if(count <= 0) return false;
|
|
3564
|
+
return count >= this.getMaxSelectableRows();
|
|
3564
3565
|
}
|
|
3565
3566
|
getDefaultPaginationRowsPerPageItems (){
|
|
3566
3567
|
return [5,10,15,20,25,30,40,50,60,80,100];
|
|
@@ -103,6 +103,8 @@ export const ROW_SELECTED_STYLE = {
|
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
+
export const SELECTED_BORDER_COLOR = "rgb(251, 207, 232)";
|
|
107
|
+
|
|
106
108
|
export const ROW_BORDER_STYLE = {
|
|
107
109
|
marginHorizontal : 0,
|
|
108
110
|
marginVertical : 0,
|
|
@@ -171,7 +173,9 @@ export const getRowStyle = ({row,bordered,numColumns,rowData,isAccordion,isTable
|
|
|
171
173
|
style.push(rowIndex%2===0?styles.even : theme.isDark()?styles.oddDark : styles.odd)
|
|
172
174
|
}
|
|
173
175
|
if(selected){
|
|
174
|
-
|
|
176
|
+
//const selectedBcolor = theme.isDark()? SELECTED_BORDER_COLOR : theme.colors.primary;
|
|
177
|
+
//const bordered = null;//isAccordion ? null : {borderBottomWidth:1,borderBottomColor:selectedBcolor,borderTopWidth:1,borderTopColor:selectedBcolor};
|
|
178
|
+
style.push(styles.selected);
|
|
175
179
|
}
|
|
176
180
|
if(paid || row.paid){
|
|
177
181
|
style.push(styles.paid);
|
|
@@ -6,12 +6,13 @@ import DrawerSection from "./DrawerSection"
|
|
|
6
6
|
import PropTypes from "prop-types";
|
|
7
7
|
import Divider from "$ecomponents/Divider";
|
|
8
8
|
import View from "$ecomponents/View";
|
|
9
|
+
import Auth from "$cauth";
|
|
10
|
+
import { useDrawer } from '../Provider';
|
|
9
11
|
|
|
10
12
|
export * from "./utils";
|
|
11
13
|
|
|
12
14
|
const DrawerItemsComponent = React.forwardRef((props,ref)=> {
|
|
13
15
|
let {items:_items,minimized} = props;
|
|
14
|
-
const hasAuth = typeof window.Auth !=='undefined' && Auth && Auth.isAllowedFromStr ? true : false;
|
|
15
16
|
_items = typeof _items ==='function'? _items(props) : _items;
|
|
16
17
|
if(React.isValidElement(_items)){
|
|
17
18
|
return _items;
|
|
@@ -19,7 +20,7 @@ const DrawerItemsComponent = React.forwardRef((props,ref)=> {
|
|
|
19
20
|
const r = React.useMemo(()=>{
|
|
20
21
|
let items = []
|
|
21
22
|
const renderExpandableOrSection = ({item,key,items})=>{
|
|
22
|
-
if(
|
|
23
|
+
if(isNonNullString(item.perm) && !Auth.isAllowedFromStr(item.perm)) return null;
|
|
23
24
|
const {section,items:itx2,...rest} = item;
|
|
24
25
|
if(section){
|
|
25
26
|
return <DrawerSection
|
|
@@ -53,7 +54,7 @@ const DrawerItemsComponent = React.forwardRef((props,ref)=> {
|
|
|
53
54
|
Object.map(item.items,(it,j)=>{
|
|
54
55
|
if(!isObj(it)) return ;
|
|
55
56
|
getDefaultProps(it);
|
|
56
|
-
const r = renderItem({minimized,
|
|
57
|
+
const r = renderItem({minimized,renderExpandableOrSection,items:item.items,item:it,key:i+j,props});
|
|
57
58
|
if(r){
|
|
58
59
|
itx.push(r);
|
|
59
60
|
}
|
|
@@ -65,7 +66,7 @@ const DrawerItemsComponent = React.forwardRef((props,ref)=> {
|
|
|
65
66
|
}
|
|
66
67
|
}
|
|
67
68
|
} else {
|
|
68
|
-
const r = renderItem({minimized,
|
|
69
|
+
const r = renderItem({minimized,renderExpandableOrSection,items:_items,item,key:i+"",props});
|
|
69
70
|
if(r){
|
|
70
71
|
items.push(r);
|
|
71
72
|
}
|
|
@@ -120,14 +121,14 @@ const getDefaultProps = function(item){
|
|
|
120
121
|
return item;
|
|
121
122
|
}
|
|
122
123
|
|
|
123
|
-
const renderItem = ({item,minimized,
|
|
124
|
+
const renderItem = ({item,minimized,renderExpandableOrSection,index,key})=>{
|
|
124
125
|
key = key||index;
|
|
125
126
|
if(React.isValidElement(item)){
|
|
126
127
|
return <React.Fragment key={key}>
|
|
127
128
|
{item}
|
|
128
129
|
</React.Fragment>
|
|
129
130
|
} else {
|
|
130
|
-
if(
|
|
131
|
+
if(isNonNullString(item.perm) && !Auth.isAllowedFromStr(item.perm)) return null;
|
|
131
132
|
if(!item.label && !item.text && !item.icon) {
|
|
132
133
|
if(item.divider === true){
|
|
133
134
|
const {divider,...rest} = item;
|
|
@@ -9,22 +9,15 @@ import BackToTop from "$ecomponents/BackToTop";
|
|
|
9
9
|
import {FlatList,StyleSheet,View} from "react-native";
|
|
10
10
|
import Label from "$ecomponents/Label";
|
|
11
11
|
import { useWindowDimensions,Dimensions } from "react-native";
|
|
12
|
-
import { useList } from "./hooks";
|
|
12
|
+
import { useList,useGetNumColumns } from "./hooks";
|
|
13
13
|
|
|
14
14
|
const CommonListComponent = React.forwardRef((props,ref)=>{
|
|
15
15
|
const context = useList(props);
|
|
16
|
-
let {
|
|
16
|
+
let {testID,defaultItemHeight,itemHeight,onRender,componentProps,columnWrapperStyle,onViewableItemsChanged,withFlatListItem,Component,withBackToTop,backToTopRef:customBackToTopRef,withBackToTopButton,onScroll,onScrollEnd,onMount,onUnmount,renderScrollViewWrapper,prepareItems,getItemKey,getKey,keyExtractor,items,filter,renderItem,numColumns,containerProps,bindResizeEvents,...rest} = props;
|
|
17
17
|
withBackToTopButton = withBackToTop === true || withBackToTopButton == true || isMobileMedia()? true : false;
|
|
18
18
|
rest = defaultObj(rest);
|
|
19
19
|
containerProps = defaultObj(containerProps);
|
|
20
|
-
|
|
21
|
-
const dimensions = responsive ? useWindowDimensions() : Dimensions.get("window");
|
|
22
|
-
if(responsive){
|
|
23
|
-
numColumns = grid.numColumns(windowWidth);
|
|
24
|
-
} else {
|
|
25
|
-
numColumns = defaultDecimal(numColumns,1);
|
|
26
|
-
}
|
|
27
|
-
const itemWindowWidth = dimensions.width/numColumns;
|
|
20
|
+
const {itemWindowWidth} = useGetNumColumns(props);
|
|
28
21
|
let scrollEndTimeout = React.useRef(null);
|
|
29
22
|
const listRef = React.useRef(null);
|
|
30
23
|
const hasCustomBackToTop = typeof customBackToTopRef == 'function'? true : false;
|
|
@@ -13,6 +13,7 @@ import Dimensions from "$cdimensions";
|
|
|
13
13
|
import { StyleSheet } from "react-native";
|
|
14
14
|
import {isMobileNative} from "$cplatform";
|
|
15
15
|
import {addClassName,removeClassName} from "$cutils/dom";
|
|
16
|
+
import { useGetNumColumns } from "../hooks";
|
|
16
17
|
|
|
17
18
|
const propTypes = {
|
|
18
19
|
...defaultObj(Virtuoso.propTypes),
|
|
@@ -32,10 +33,11 @@ const propTypes = {
|
|
|
32
33
|
isScrolling : PropTypes.func,
|
|
33
34
|
};
|
|
34
35
|
/***@see : https://virtuoso.dev/virtuoso-api-reference/ */
|
|
35
|
-
const VirtuosoListComponent = React.forwardRef(({onRender,id,fixedHeaderContent,rowProps,renderTable,listClassName,components,itemProps,windowWidth,
|
|
36
|
+
const VirtuosoListComponent = React.forwardRef(({onRender,id,fixedHeaderContent,numColumns:cNumCol,rowProps,renderTable,listClassName,components,itemProps,windowWidth,responsive,testID,renderItem,onEndReached,onLayout,onContentSizeChange,onScroll,isScrolling,estimatedItemSize,onEndReachedThreshold,containerProps,style,autoSizedStyle,...props},ref)=>{
|
|
36
37
|
if(renderTable){
|
|
37
38
|
responsive = false;
|
|
38
39
|
}
|
|
40
|
+
const {numColumns} = useGetNumColumns({responsive,numColumns:cNumCol,windowWidth})
|
|
39
41
|
const Component = React.useMemo(()=>renderTable ? TableVirtuoso : responsive?VirtuosoGrid:Virtuoso,[responsive,renderTable]);
|
|
40
42
|
const context = useList(props);
|
|
41
43
|
itemProps = defaultObj(itemProps);
|
|
@@ -162,7 +164,7 @@ const VirtuosoListComponent = React.forwardRef(({onRender,id,fixedHeaderContent,
|
|
|
162
164
|
useWindowScroll = {false}
|
|
163
165
|
totalCount = {items.length}
|
|
164
166
|
itemContent = {(index)=>{
|
|
165
|
-
return renderItem({index,item:items[index],items})
|
|
167
|
+
return renderItem({index,numColumns,item:items[index],items})
|
|
166
168
|
}}
|
|
167
169
|
atBottomStateChange = {()=>{
|
|
168
170
|
if(typeof onEndReached =='function'){
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from "$react";
|
|
2
2
|
import { prepareItems as customPrepareItems} from "./utils";
|
|
3
|
-
import {defaultFunc} from "$cutils";
|
|
4
|
-
|
|
3
|
+
import {defaultFunc,defaultBool,defaultDecimal} from "$cutils";
|
|
4
|
+
import Dimensions,{isMobileMedia,useWindowDimensions} from "$cdimensions";
|
|
5
|
+
import {grid} from "$theme";
|
|
5
6
|
/**** retourne le contexte associé au composant List
|
|
6
7
|
|
|
7
8
|
*/
|
|
@@ -20,4 +21,16 @@ export const useList = ({items,filter,prepareItems,...props})=>{
|
|
|
20
21
|
return r;
|
|
21
22
|
},[items,canPrepareItems]);
|
|
22
23
|
return context;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export const useGetNumColumns = ({windowWidth,numColumns,responsive})=>{
|
|
27
|
+
responsive = defaultBool(responsive,false);
|
|
28
|
+
const dimensions = responsive ? useWindowDimensions() : Dimensions.get("window");
|
|
29
|
+
if(responsive){
|
|
30
|
+
numColumns = grid.numColumns(windowWidth);
|
|
31
|
+
} else {
|
|
32
|
+
numColumns = defaultDecimal(numColumns,1);
|
|
33
|
+
}
|
|
34
|
+
const itemWindowWidth = dimensions.width/numColumns;
|
|
35
|
+
return {numColumns,itemWindowWidth,responsive};
|
|
23
36
|
}
|
|
@@ -94,16 +94,12 @@ class _Menu extends AppComponent {
|
|
|
94
94
|
});
|
|
95
95
|
|
|
96
96
|
updateVisibility = async () => {
|
|
97
|
-
// _Menu is rendered in Portal, which updates items asynchronously
|
|
98
|
-
// We need to do the same here so that the ref is up-to-date
|
|
99
|
-
await Promise.resolve();
|
|
100
|
-
|
|
101
97
|
if (this.props.visible) {
|
|
102
98
|
this.show();
|
|
103
99
|
} else {
|
|
104
100
|
this.hide();
|
|
105
101
|
}
|
|
106
|
-
}
|
|
102
|
+
}
|
|
107
103
|
|
|
108
104
|
isBrowser = () => Platform.OS === 'web' && 'document' in global;
|
|
109
105
|
|
|
@@ -161,69 +157,62 @@ class _Menu extends AppComponent {
|
|
|
161
157
|
document.removeEventListener('keyup', this.handleKeypress);
|
|
162
158
|
};
|
|
163
159
|
|
|
164
|
-
show
|
|
160
|
+
show (){
|
|
165
161
|
if(!this._isMounted()) return;
|
|
166
|
-
|
|
167
|
-
const [menuLayout, anchorLayout] = await Promise.all([
|
|
162
|
+
return Promise.all([
|
|
168
163
|
this.measureMenuLayout(),
|
|
169
164
|
this.measureAnchorLayout(),
|
|
170
|
-
])
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
!menuLayout.height ||
|
|
183
|
-
(!anchorLayout.width) ||
|
|
184
|
-
(!anchorLayout.height)
|
|
185
|
-
) {
|
|
186
|
-
requestAnimationFrame(this.show);
|
|
187
|
-
return;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
this.setState(
|
|
191
|
-
() => ({
|
|
192
|
-
left: anchorLayout.x,
|
|
193
|
-
top: anchorLayout.y,
|
|
194
|
-
anchorLayout: {
|
|
195
|
-
height: anchorLayout.height,
|
|
196
|
-
width: anchorLayout.width,
|
|
197
|
-
},
|
|
198
|
-
menuLayout: {
|
|
199
|
-
width: menuLayout.width,
|
|
200
|
-
height: menuLayout.height,
|
|
201
|
-
},
|
|
202
|
-
}),
|
|
203
|
-
() => {
|
|
204
|
-
this.attachListeners();
|
|
205
|
-
|
|
206
|
-
const animation = theme.animation;
|
|
207
|
-
Animated.parallel([
|
|
208
|
-
Animated.timing(this.state.scaleAnimation, {
|
|
209
|
-
toValue: { x: menuLayout.width, y: menuLayout.height },
|
|
210
|
-
duration: ANIMATION_DURATION * animation.scale,
|
|
211
|
-
easing: EASING,
|
|
212
|
-
useNativeDriver: true,
|
|
213
|
-
}),
|
|
214
|
-
Animated.timing(this.state.opacityAnimation, {
|
|
215
|
-
toValue: 1,
|
|
216
|
-
duration: ANIMATION_DURATION * animation.scale,
|
|
217
|
-
easing: EASING,
|
|
218
|
-
useNativeDriver: true,
|
|
219
|
-
}),
|
|
220
|
-
]).start(({ finished }) => {
|
|
221
|
-
if (finished) {
|
|
222
|
-
this.focusFirstDOMNode(this.menu);
|
|
223
|
-
}
|
|
224
|
-
});
|
|
165
|
+
]).then(([menuLayout, anchorLayout])=>{
|
|
166
|
+
const windowLayout = Dimensions.get('window');
|
|
167
|
+
if (
|
|
168
|
+
!windowLayout.width ||
|
|
169
|
+
!windowLayout.height ||
|
|
170
|
+
!menuLayout.width ||
|
|
171
|
+
!menuLayout.height ||
|
|
172
|
+
(!anchorLayout.width) ||
|
|
173
|
+
(!anchorLayout.height)
|
|
174
|
+
) {
|
|
175
|
+
requestAnimationFrame(this.show.bind(this));
|
|
176
|
+
return;
|
|
225
177
|
}
|
|
226
|
-
|
|
178
|
+
this.setState({
|
|
179
|
+
left: anchorLayout.x,
|
|
180
|
+
top: anchorLayout.y,
|
|
181
|
+
rendered : true,
|
|
182
|
+
anchorLayout: {
|
|
183
|
+
height: anchorLayout.height,
|
|
184
|
+
width: anchorLayout.width,
|
|
185
|
+
},
|
|
186
|
+
menuLayout: {
|
|
187
|
+
width: menuLayout.width,
|
|
188
|
+
height: menuLayout.height,
|
|
189
|
+
},
|
|
190
|
+
},
|
|
191
|
+
() => {
|
|
192
|
+
this.attachListeners();
|
|
193
|
+
|
|
194
|
+
const animation = theme.animation;
|
|
195
|
+
Animated.parallel([
|
|
196
|
+
Animated.timing(this.state.scaleAnimation, {
|
|
197
|
+
toValue: { x: menuLayout.width, y: menuLayout.height },
|
|
198
|
+
duration: ANIMATION_DURATION * animation.scale,
|
|
199
|
+
easing: EASING,
|
|
200
|
+
useNativeDriver: true,
|
|
201
|
+
}),
|
|
202
|
+
Animated.timing(this.state.opacityAnimation, {
|
|
203
|
+
toValue: 1,
|
|
204
|
+
duration: ANIMATION_DURATION * animation.scale,
|
|
205
|
+
easing: EASING,
|
|
206
|
+
useNativeDriver: true,
|
|
207
|
+
}),
|
|
208
|
+
]).start(({ finished }) => {
|
|
209
|
+
if (finished) {
|
|
210
|
+
this.focusFirstDOMNode(this.menu);
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
);
|
|
215
|
+
});
|
|
227
216
|
};
|
|
228
217
|
|
|
229
218
|
hide = (cb) => {
|
|
@@ -237,7 +226,7 @@ class _Menu extends AppComponent {
|
|
|
237
226
|
useNativeDriver: true,
|
|
238
227
|
}).start(({ finished }) => {
|
|
239
228
|
if (finished) {
|
|
240
|
-
this.setState({ menuLayout: { width: 0, height: 0 }},(e)=>{if(typeof cb ==='function') cb();});
|
|
229
|
+
this.setState({ rendered:false,menuLayout: { width: 0, height: 0 }},(e)=>{if(typeof cb ==='function') cb();});
|
|
241
230
|
this.state.scaleAnimation.setValue({ x: 0, y: 0 });
|
|
242
231
|
this.focusFirstDOMNode(this.anchor);
|
|
243
232
|
}
|
|
@@ -294,7 +283,7 @@ class _Menu extends AppComponent {
|
|
|
294
283
|
|
|
295
284
|
// We need to translate menu while animating scale to imitate transform origin for scale animation
|
|
296
285
|
const positionTransforms = [];
|
|
297
|
-
|
|
286
|
+
|
|
298
287
|
// Check if menu fits horizontally and if not align it to right.
|
|
299
288
|
if (left <= windowLayout.width - menuLayout.width - SCREEN_INDENT) {
|
|
300
289
|
positionTransforms.push({
|
|
@@ -315,9 +304,7 @@ class _Menu extends AppComponent {
|
|
|
315
304
|
outputRange: [menuLayout.width / 2, 0],
|
|
316
305
|
}),
|
|
317
306
|
});
|
|
318
|
-
|
|
319
307
|
left += anchorLayout.width - menuLayout.width;
|
|
320
|
-
|
|
321
308
|
const right = left + menuLayout.width;
|
|
322
309
|
// Check if menu position has enough space from right side
|
|
323
310
|
if (right > windowLayout.width - SCREEN_INDENT) {
|
|
@@ -325,7 +312,6 @@ class _Menu extends AppComponent {
|
|
|
325
312
|
}
|
|
326
313
|
}
|
|
327
314
|
const handleScroll = canHandleScroll !== false? true : false;
|
|
328
|
-
|
|
329
315
|
// If the menu is larger than available vertical space,
|
|
330
316
|
// calculate the height of scrollable view
|
|
331
317
|
let scrollableMenuHeight = 0;
|
|
@@ -469,50 +455,48 @@ class _Menu extends AppComponent {
|
|
|
469
455
|
style = {{backgroundColor:'transparent'}}
|
|
470
456
|
>
|
|
471
457
|
{anchor}
|
|
472
|
-
|
|
473
|
-
<
|
|
474
|
-
{
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
>
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
>
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
</Portal>
|
|
515
|
-
) : null}
|
|
458
|
+
<Portal>
|
|
459
|
+
{rendered ? <TouchableWithoutFeedback
|
|
460
|
+
testID={testID+"_MenuTouchableWithoutFeedBack"}
|
|
461
|
+
accessibilityLabel={overlayAccessibilityLabel}
|
|
462
|
+
role="button"
|
|
463
|
+
onPress={onDismiss}
|
|
464
|
+
style = {[hiddenStyle]}
|
|
465
|
+
>
|
|
466
|
+
<View style={[StyleSheet.absoluteFill,{flex:1,backgroundColor:'transparent'}]} testID={testID+"_Backdrop"} />
|
|
467
|
+
</TouchableWithoutFeedback>:null}
|
|
468
|
+
<View
|
|
469
|
+
testID = {testID+"_MenuContentContainer"}
|
|
470
|
+
ref={(ref) => {
|
|
471
|
+
this.menu = ref;
|
|
472
|
+
}}
|
|
473
|
+
collapsable={false}
|
|
474
|
+
accessibilityViewIsModal={visible}
|
|
475
|
+
style={[styles.wrapper, positionStyle, style,hiddenStyle]}
|
|
476
|
+
pointerEvents={visible ? 'box-none' : 'none'}
|
|
477
|
+
onAccessibilityEscape={onDismiss}
|
|
478
|
+
>
|
|
479
|
+
{rendered?<Animated.View style={{ transform: positionTransforms }} testID={testID+"_Animated"}>
|
|
480
|
+
<Surface
|
|
481
|
+
elevation = {5}
|
|
482
|
+
testID= {testID+"_MenuContent"}
|
|
483
|
+
style={
|
|
484
|
+
[
|
|
485
|
+
styles.shadowMenuContainer,
|
|
486
|
+
shadowMenuContainerStyle,
|
|
487
|
+
contentStyle,
|
|
488
|
+
{backgroundColor : theme.colors.surface},
|
|
489
|
+
minWidth && {minWidth : Math.max(minWidth,MIN_WIDTH)},
|
|
490
|
+
sameWidth && anchorLayout.width ? {width:Math.max(anchorLayout.width,minWidth,MIN_WIDTH)} : undefined,
|
|
491
|
+
]
|
|
492
|
+
}
|
|
493
|
+
>
|
|
494
|
+
{((scrollableMenuHeight|| contentContainerStyle) && (<ScrollView contentContainerStyle={contentContainerStyle} testID={testID+"_ScrollView"}>{children}</ScrollView>
|
|
495
|
+
)) || children}
|
|
496
|
+
</Surface>
|
|
497
|
+
</Animated.View> : null}
|
|
498
|
+
</View>
|
|
499
|
+
</Portal>
|
|
516
500
|
</View>
|
|
517
501
|
);
|
|
518
502
|
}
|
|
@@ -7,8 +7,6 @@ import View from "$ecomponents/View";
|
|
|
7
7
|
import {isNativeMobile} from "$cplatform";
|
|
8
8
|
import {defaultDecimal} from "$cutils";
|
|
9
9
|
import {LogoProgress} from "$ecomponents/Logo";
|
|
10
|
-
import { Provider as PaperProvider,Portal as PaperPortal} from "react-native-paper";
|
|
11
|
-
import {PortalProvider } from '$ecomponents/Portal';
|
|
12
10
|
import {defaultStr} from "$cutils";
|
|
13
11
|
import styles, {
|
|
14
12
|
_solidBackground,
|
|
@@ -100,8 +98,8 @@ const SplashScreenComponent = ({isLoaded,children , duration, delay,logoWidth,lo
|
|
|
100
98
|
],
|
|
101
99
|
}
|
|
102
100
|
const child = (animationDone && isLoaded)? React.isValidElement(children) && children : null;
|
|
103
|
-
return
|
|
104
|
-
|
|
101
|
+
if(animationDone) return child;
|
|
102
|
+
return <View style={[styles.container]} testID={testID} id={testID}>
|
|
105
103
|
{!animationDone ? <View style={StyleSheet.absoluteFill} testID={testID+"_Animation"}/> : null}
|
|
106
104
|
<View style={styles.containerGlue} testID={testID+"_ContainerGlue"}>
|
|
107
105
|
{!animationDone && (
|
|
@@ -112,30 +110,23 @@ const SplashScreenComponent = ({isLoaded,children , duration, delay,logoWidth,lo
|
|
|
112
110
|
)}
|
|
113
111
|
{(animationDone || isNative) && child}
|
|
114
112
|
{!animationDone && (
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
<
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
</Animated.View>
|
|
130
|
-
)}
|
|
131
|
-
</View>
|
|
132
|
-
</PaperPortal.Host>
|
|
133
|
-
</PaperProvider>
|
|
134
|
-
</PortalProvider>
|
|
113
|
+
<View testID={testID+"_LogoContainer"} style={[StyleSheet.absoluteFill, styles.logoStyle]}>
|
|
114
|
+
{(
|
|
115
|
+
<Animated.View
|
|
116
|
+
testID={testID+"_Logo"}
|
|
117
|
+
style={_dynamicCustomComponentStyle(
|
|
118
|
+
logoScale,
|
|
119
|
+
logoOpacity,
|
|
120
|
+
logoWidth,
|
|
121
|
+
logoHeight
|
|
122
|
+
)}>
|
|
123
|
+
{<LogoProgress/>}
|
|
124
|
+
</Animated.View>
|
|
125
|
+
)}
|
|
126
|
+
</View>
|
|
135
127
|
)}
|
|
136
128
|
</View>
|
|
137
129
|
</View>
|
|
138
|
-
)
|
|
139
130
|
}
|
|
140
131
|
|
|
141
132
|
|
|
@@ -7,7 +7,7 @@ import { getRowStyle } from "$ecomponents/Datagrid/utils";
|
|
|
7
7
|
|
|
8
8
|
const TableRowWrapperComponent = forwardRef(({children,colSpan,...props},ref)=>{
|
|
9
9
|
const {bordered,withDatagridContext} = useTable();
|
|
10
|
-
const selected = withDatagridContext ? useIsRowSelected(props) : false;
|
|
10
|
+
const selected = withDatagridContext ? useIsRowSelected(props.rowData || props.rowKey, props.rowIndex) : false;
|
|
11
11
|
const rowStyle = useMemo(()=>{
|
|
12
12
|
return getRowStyle({...props,bordered});
|
|
13
13
|
},[selected])
|
|
@@ -51,7 +51,7 @@ const getOnScrollCb = (refs,pos,cb2)=>{
|
|
|
51
51
|
return isMobileNative()? cb : debounce(cb,200);
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
const TableComponent = React.forwardRef(({containerProps,listContainerStyle,onRender,height,progressBar,renderListContent,children,renderEmpty,renderItem,
|
|
54
|
+
const TableComponent = React.forwardRef(({containerProps,listContainerStyle,onRender,height,progressBar,renderListContent,children,renderEmpty,renderItem,headerScrollViewProps,footerScrollViewProps,scrollViewProps,renderFooterCell,footerCellContainerProps,filterCellContainerProps,headerCellContainerProps,headerProps,rowProps:customRowProps,cellContainerProps,hasFooters,renderHeaderCell,renderFilterCell,columnProps,getRowKey,columnsWidths,colsWidths,columns,...props},tableRef)=>{
|
|
55
55
|
containerProps = defaultObj(containerProps);
|
|
56
56
|
cellContainerProps = defaultObj(cellContainerProps);
|
|
57
57
|
scrollViewProps = defaultObj(scrollViewProps);
|
|
@@ -252,8 +252,8 @@ const TableComponent = React.forwardRef(({containerProps,listContainerStyle,onRe
|
|
|
252
252
|
const index = props['data-index'];
|
|
253
253
|
const item = getRowByIndex(index) || props?.item || null;
|
|
254
254
|
if(!item) return null;
|
|
255
|
-
const args = {rowData:item,rowIndex:index,bordered,isTable:true};
|
|
256
|
-
args.
|
|
255
|
+
const args = {rowData:item,rowIndex:index,index,bordered,isTable:true};
|
|
256
|
+
args.selected = withDatagridContext ? useIsRowSelected(item,index) : false;
|
|
257
257
|
return <TableRowComponent {...props} style={[getRowStyle(args),props.style]}/>
|
|
258
258
|
},
|
|
259
259
|
Table: VirtuosoTableComponent,
|
package/src/index.js
CHANGED
|
@@ -40,6 +40,9 @@ import StatusBar from "$ecomponents/StatusBar";
|
|
|
40
40
|
import {Provider as PaperProvider } from 'react-native-paper';
|
|
41
41
|
import FontIcon from "$ecomponents/Icon/Font";
|
|
42
42
|
import useContext from "$econtext/hooks";
|
|
43
|
+
import {GestureHandlerRootView} from "react-native-gesture-handler";
|
|
44
|
+
import KeyboardAvoidingViewComponent from '$ecomponents/KeyboardAvoidingView';
|
|
45
|
+
import { SafeAreaProvider } from 'react-native-safe-area-context';
|
|
43
46
|
export * from "./context";
|
|
44
47
|
|
|
45
48
|
let MAX_BACK_COUNT = 1;
|
|
@@ -253,55 +256,59 @@ function App({init:initApp,initialRouteName:appInitialRouteName,render,onMount})
|
|
|
253
256
|
onMountRef.current = true;
|
|
254
257
|
}
|
|
255
258
|
},[isLoaded])
|
|
256
|
-
const child = isLoaded ? <
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
<Portal.Host>
|
|
266
|
-
<PreloaderProvider/>
|
|
267
|
-
<DialogProvider responsive/>
|
|
268
|
-
<AlertProvider SimpleSelect={SimpleSelect}/>
|
|
269
|
-
<FormDataDialogProvider/>
|
|
270
|
-
<BottomSheetProvider/>
|
|
271
|
-
<DropdownAlert ref={notificationRef}/>
|
|
272
|
-
<ErrorBoundaryProvider/>
|
|
273
|
-
<Navigation
|
|
274
|
-
initialRouteName = {defaultStr(hasGetStarted ? appInitialRouteName : getStartedRouteName,"Home")}
|
|
275
|
-
state = {state}
|
|
276
|
-
hasGetStarted = {hasGetStarted}
|
|
277
|
-
isInitialized = {isInitialized}
|
|
278
|
-
onGetStart = {(e)=>{
|
|
279
|
-
setState({...state,hasGetStarted:true})
|
|
280
|
-
}}
|
|
281
|
-
/>
|
|
282
|
-
</Portal.Host>
|
|
283
|
-
</PortalProvider>
|
|
284
|
-
</NavigationContainer> : null;
|
|
259
|
+
const child = isLoaded ? <Navigation
|
|
260
|
+
initialRouteName = {defaultStr(hasGetStarted ? appInitialRouteName : getStartedRouteName,"Home")}
|
|
261
|
+
state = {state}
|
|
262
|
+
hasGetStarted = {hasGetStarted}
|
|
263
|
+
isInitialized = {isInitialized}
|
|
264
|
+
onGetStart = {(e)=>{
|
|
265
|
+
setState({...state,hasGetStarted:true})
|
|
266
|
+
}}
|
|
267
|
+
/>: null;
|
|
285
268
|
const content = isLoaded ? typeof render == 'function'? render({children:child,appConfig,config:appConfig}) : child : null;
|
|
286
|
-
return
|
|
287
|
-
<
|
|
288
|
-
|
|
269
|
+
return <AuthProvider>
|
|
270
|
+
<NavigationContainer
|
|
271
|
+
ref={navigationRef}
|
|
272
|
+
initialState={initialState}
|
|
273
|
+
onStateChange={(state) =>{
|
|
274
|
+
if(!isLoaded) return;
|
|
275
|
+
setSession(NAVIGATION_PERSISTENCE_KEY,decycle(state),false);
|
|
276
|
+
}}
|
|
277
|
+
>
|
|
278
|
+
<PaperProvider
|
|
289
279
|
theme={theme}
|
|
290
280
|
settings={{
|
|
291
281
|
icon: (props) => {
|
|
292
282
|
return <FontIcon {...props}/>
|
|
293
283
|
},
|
|
294
284
|
}}
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
<
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
285
|
+
>
|
|
286
|
+
<PortalProvider>
|
|
287
|
+
<Portal.Host>
|
|
288
|
+
<PreloaderProvider/>
|
|
289
|
+
<DialogProvider responsive/>
|
|
290
|
+
<AlertProvider SimpleSelect={SimpleSelect}/>
|
|
291
|
+
<FormDataDialogProvider/>
|
|
292
|
+
<BottomSheetProvider/>
|
|
293
|
+
<DropdownAlert ref={notificationRef}/>
|
|
294
|
+
<ErrorBoundaryProvider/>
|
|
295
|
+
<GestureHandlerRootView style={{ flex: 1,flexGrow:1,flexShrink:1}} testID={"RN_GestureHandlerRootView"}>
|
|
296
|
+
<SafeAreaProvider testID={"RN_AppSafeAreaProvider"}>
|
|
297
|
+
<SplashScreen isLoaded={isLoaded}>
|
|
298
|
+
<ErrorBoundary>
|
|
299
|
+
<StatusBar/>
|
|
300
|
+
<PreferencesContext.Provider value={preferences}>
|
|
301
|
+
{React.isValidElement(content) && content || child}
|
|
302
|
+
</PreferencesContext.Provider>
|
|
303
|
+
</ErrorBoundary>
|
|
304
|
+
</SplashScreen>
|
|
305
|
+
</SafeAreaProvider>
|
|
306
|
+
</GestureHandlerRootView>
|
|
307
|
+
</Portal.Host>
|
|
308
|
+
</PortalProvider>
|
|
302
309
|
</PaperProvider>
|
|
303
|
-
|
|
304
|
-
</
|
|
310
|
+
</NavigationContainer>
|
|
311
|
+
</AuthProvider>
|
|
305
312
|
}
|
|
306
313
|
|
|
307
314
|
export default App;
|
|
@@ -25,9 +25,11 @@ const DrawerNavigator = React.forwardRef(({content,children:customChildren,state
|
|
|
25
25
|
setIsLoggedIn(false);
|
|
26
26
|
}
|
|
27
27
|
const refreshItems = ()=>{
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
setTimeout(()=>{
|
|
29
|
+
refreshItemsRef.current = true;
|
|
30
|
+
forceRender();
|
|
31
|
+
refreshItemsRef.current = false;
|
|
32
|
+
},100)
|
|
31
33
|
};
|
|
32
34
|
APP.on(APP.EVENTS.AUTH_LOGOUT_USER,onLogoutUser);
|
|
33
35
|
APP.on(APP.EVENTS.UPDATE_THEME,refreshItems);
|
|
@@ -29,12 +29,12 @@ const useGetItems = (options)=>{
|
|
|
29
29
|
APP.on(APP.EVENTS.REFRESH_MAIN_DRAWER,refreshItems);
|
|
30
30
|
APP.on(APP.EVENTS.AUTH_LOGIN_USER,refreshItems);
|
|
31
31
|
APP.on(APP.EVENTS.AUTH_LOGOUT_USER,refreshItems);
|
|
32
|
-
APP.on(APP.EVENTS.UPDATE_THEME,refreshItems);
|
|
32
|
+
//APP.on(APP.EVENTS.UPDATE_THEME,refreshItems);
|
|
33
33
|
return ()=>{
|
|
34
34
|
APP.off(APP.EVENTS.REFRESH_MAIN_DRAWER,refreshItems);
|
|
35
35
|
APP.off(APP.EVENTS.AUTH_LOGIN_USER,refreshItems);
|
|
36
36
|
APP.off(APP.EVENTS.AUTH_LOGOUT_USER,refreshItems);
|
|
37
|
-
APP.off(APP.EVENTS.UPDATE_THEME,refreshItems);
|
|
37
|
+
//APP.off(APP.EVENTS.UPDATE_THEME,refreshItems);
|
|
38
38
|
}
|
|
39
39
|
},[])
|
|
40
40
|
return useMemo(()=>{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
module.exports = {"@
|
|
1
|
+
module.exports = {"@fto-consult/expo-ui":{"name":"@fto-consult/expo-ui","version":"6.25.1","repository":{"type":"git","url":"git+https://github.com/borispipo/expo-ui.git"},"homepage":"https://github.com/borispipo/expo-ui#readme"}};
|