@fto-consult/expo-ui 6.70.3 → 6.70.4
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
@@ -3242,11 +3242,11 @@ export default class CommonDatagridComponent extends AppComponent {
|
|
3242
3242
|
this.isFetchingData = false;
|
3243
3243
|
return resolve(sData);
|
3244
3244
|
}
|
3245
|
-
if(this.beforeFetchData(fetchOptions) === false) return resolve(sData);
|
3245
|
+
if(this.beforeFetchData({fetchOptions,force,context:this,renderProgressBar}) === false) return resolve(sData);
|
3246
3246
|
if(this.willConvertFiltersToSQL()){
|
3247
3247
|
fetchOptions.selector = convertToSQL(fetchOptions.selector);
|
3248
3248
|
}
|
3249
|
-
if(typeof this.props.beforeFetchData =='function' && this.props.beforeFetchData({...rest,context:this,force,fetchOptions,options:fetchOptions}) === false){
|
3249
|
+
if(typeof this.props.beforeFetchData =='function' && this.props.beforeFetchData({...rest,renderProgressBar,context:this,force,fetchOptions,options:fetchOptions}) === false){
|
3250
3250
|
this.isFetchingData = false;
|
3251
3251
|
return resolve(sData);
|
3252
3252
|
}
|
@@ -166,6 +166,9 @@ const SWRDatagridComponent = React.forwardRef((props,ref)=>{
|
|
166
166
|
const limitRef = React.useRef(!canHandleLimit ?0 : defaultNumber(getSessionData("limit"),500));
|
167
167
|
const isInitializedRef = React.useRef(false);
|
168
168
|
testID = defaultStr(testID,"RNSWRDatagridComponent");
|
169
|
+
React.useEffect(()=>{
|
170
|
+
showProgressRef.current = false;
|
171
|
+
},[showProgressRef.current]);
|
169
172
|
const {error, isValidating,isLoading,data:result,refresh} = useSWR(fetchPath,{
|
170
173
|
fetcher : (url,opts)=>{
|
171
174
|
if(!isInitializedRef.current) {
|
@@ -193,27 +196,15 @@ const SWRDatagridComponent = React.forwardRef((props,ref)=>{
|
|
193
196
|
opts.showError = false;
|
194
197
|
}
|
195
198
|
if(typeof fetcher =='function'){
|
196
|
-
return fetcher(url,opts)
|
197
|
-
showProgressRef.current = false;
|
198
|
-
return r;
|
199
|
-
}).catch((r)=>{
|
200
|
-
showProgressRef.current = false;
|
201
|
-
return r;
|
202
|
-
});
|
199
|
+
return fetcher(url,opts);
|
203
200
|
}
|
204
|
-
return apiFetch(url,opts)
|
205
|
-
showProgressRef.current = false;
|
206
|
-
return r;
|
207
|
-
}).catch((r)=>{
|
208
|
-
showProgressRef.current = false;
|
209
|
-
return r;
|
210
|
-
});
|
201
|
+
return apiFetch(url,opts);
|
211
202
|
},
|
212
203
|
swrOptions : getSWROptions(swrConfig.refreshTimeout)
|
213
204
|
});
|
214
205
|
const dataRef = React.useRef(null);
|
215
206
|
const totalRef = React.useRef(0);
|
216
|
-
const loading = (customIsLoading === true || isLoading || (
|
207
|
+
const loading = (customIsLoading === true || isLoading || (isValidating && showProgressRef.current));
|
217
208
|
const {data,total} = React.useMemo(()=>{
|
218
209
|
if((loading && customIsLoading !== false) || !isObjOrArray(result)){
|
219
210
|
return {data:dataRef.current,total:totalRef.current};
|
package/src/layouts/Fab/index.js
CHANGED
@@ -1,21 +1,19 @@
|
|
1
1
|
import Fab from "$ecomponents/Fab";
|
2
2
|
import { StyleSheet } from "react-native";
|
3
3
|
import {isObjOrArray,isObj,defaultStr,defaultObj} from "$cutils";
|
4
|
-
import APP from "$capp";
|
5
4
|
import React from "$react";
|
6
5
|
import {navigateToTableData} from "$enavigation/utils";
|
7
6
|
import PropTypes from "prop-types";
|
8
7
|
import theme from "$theme";
|
9
|
-
import {isLoggedIn as isAuthLoggedIn} from "$cauth/utils/session";
|
10
8
|
import useExpoUI from "$econtext/hooks";
|
11
|
-
import Auth from "$cauth";
|
9
|
+
import Auth,{useIsSignedIn} from "$cauth";
|
12
10
|
|
13
11
|
export * from "./utils";
|
14
12
|
|
15
13
|
const FabLayoutComponent = React.forwardRef((p,ref)=>{
|
16
14
|
const {components:{fabPropsMutator},tablesData} = useExpoUI();
|
17
15
|
const {style,actions:fabActions,...props} = typeof fabPropsMutator == 'function'? extendObj({},p,fabPropsMutator({...p,isLoggedIn})) : p;
|
18
|
-
const
|
16
|
+
const isLoggedIn = useIsSignedIn();
|
19
17
|
const isMounted = React.useIsMounted();
|
20
18
|
const tables = isObjOrArray(fabActions)? fabActions : tablesData;
|
21
19
|
const actions = React.useMemo(()=>{
|
@@ -51,22 +49,6 @@ const FabLayoutComponent = React.forwardRef((p,ref)=>{
|
|
51
49
|
})
|
52
50
|
return a.length ? a : null;
|
53
51
|
},[isLoggedIn,fabActions,tables]);
|
54
|
-
|
55
|
-
React.useEffect(()=>{
|
56
|
-
const onLogin = ()=>{
|
57
|
-
if(!isMounted())return;
|
58
|
-
setIsLoggedIn(true);
|
59
|
-
},onLogout = ()=>{
|
60
|
-
if(!isMounted()) return;
|
61
|
-
setIsLoggedIn(false);
|
62
|
-
}
|
63
|
-
APP.on(APP.EVENTS.AUTH_LOGIN_USER,onLogin);
|
64
|
-
APP.on(APP.EVENTS.AUTH_LOGOUT_USER,onLogout);
|
65
|
-
return ()=>{
|
66
|
-
APP.off(APP.EVENTS.AUTH_LOGIN_USER,onLogin);
|
67
|
-
APP.off(APP.EVENTS.AUTH_LOGOUT_USER,onLogout);
|
68
|
-
}
|
69
|
-
},[])
|
70
52
|
return actions ? <Fab.Group
|
71
53
|
{...props}
|
72
54
|
ref = {ref}
|
@@ -1 +1 @@
|
|
1
|
-
module.exports = {"@fto-consult/expo-ui":{"name":"@fto-consult/expo-ui","version":"6.
|
1
|
+
module.exports = {"@fto-consult/expo-ui":{"name":"@fto-consult/expo-ui","version":"6.70.3","repository":{"type":"git","url":"git+https://github.com/borispipo/expo-ui.git"},"homepage":"https://github.com/borispipo/expo-ui#readme"},"@babel/plugin-proposal-export-namespace-from":{"version":"7.18.9","url":"https://babel.dev/docs/en/next/babel-plugin-proposal-export-namespace-from","license":"MIT"},"@emotion/native":{"version":"11.11.0","url":"https://emotion.sh","license":"MIT"},"@emotion/react":{"version":"11.11.1","url":"https://github.com/emotion-js/emotion/tree/main/packages/react","license":"MIT"},"@expo/html-elements":{"version":"0.5.1","url":"https://github.com/expo/expo/tree/main/packages/html-elements","license":"MIT"},"@expo/metro-config":{"version":"0.10.7","url":"https://github.com/expo/expo.git","license":"MIT"},"@expo/vector-icons":{"version":"13.0.0","url":"https://expo.github.io/vector-icons","license":"MIT"},"@expo/webpack-config":{"version":"19.0.0","url":"https://github.com/expo/expo-cli.git","license":"MIT"},"@faker-js/faker":{"version":"8.0.2","url":"https://github.com/faker-js/faker.git","license":"MIT"},"@fto-consult/common":{"version":"3.59.3","url":"https://github.com/borispipo/common#readme","license":"ISC"},"@pchmn/expo-material3-theme":{"version":"1.3.1","url":"https://github.com/pchmn/expo-material3-theme#readme","license":"MIT"},"@react-native-async-storage/async-storage":{"version":"1.18.2","url":"https://github.com/react-native-async-storage/async-storage#readme","license":"MIT"},"@react-native-community/datetimepicker":{"version":"7.2.0","url":"https://github.com/react-native-community/datetimepicker#readme","license":"MIT"},"@react-native-community/netinfo":{"version":"9.3.10","url":"https://github.com/react-native-netinfo/react-native-netinfo#readme","license":"MIT"},"@react-native/assets-registry":{"version":"0.72.0","url":"git@github.com:facebook/react-native.git","license":"MIT"},"@react-navigation/native":{"version":"6.1.9","url":"https://reactnavigation.org","license":"MIT"},"@react-navigation/native-stack":{"version":"6.9.16","url":"https://github.com/software-mansion/react-native-screens#readme","license":"MIT"},"@react-navigation/stack":{"version":"6.3.20","url":"https://reactnavigation.org/docs/stack-navigator/","license":"MIT"},"@shopify/flash-list":{"version":"1.4.3","url":"https://shopify.github.io/flash-list/","license":"MIT"},"apexcharts":{"version":"3.44.0","url":"https://apexcharts.com","license":"MIT"},"babel-plugin-inline-dotenv":{"version":"1.7.0","url":"https://github.com/brysgo/babel-plugin-inline-dotenv#readme","license":"ISC"},"babel-plugin-module-resolver":{"version":"5.0.0","url":"https://github.com/tleunen/babel-plugin-module-resolver.git","license":"MIT"},"expo":{"version":"49.0.16","url":"https://github.com/expo/expo/tree/main/packages/expo","license":"MIT"},"expo-camera":{"version":"13.4.4","url":"https://docs.expo.dev/versions/latest/sdk/camera/","license":"MIT"},"expo-clipboard":{"version":"4.3.1","url":"https://docs.expo.dev/versions/latest/sdk/clipboard","license":"MIT"},"expo-font":{"version":"11.4.0","url":"https://docs.expo.dev/versions/latest/sdk/font/","license":"MIT"},"expo-image-picker":{"version":"14.3.2","url":"https://docs.expo.dev/versions/latest/sdk/imagepicker/","license":"MIT"},"expo-linking":{"version":"5.0.2","url":"https://docs.expo.dev/versions/latest/sdk/linking","license":"MIT"},"expo-sharing":{"version":"11.5.0","url":"https://docs.expo.dev/versions/latest/sdk/sharing/","license":"MIT"},"expo-sqlite":{"version":"11.3.3","url":"https://docs.expo.dev/versions/latest/sdk/sqlite/","license":"MIT"},"expo-status-bar":{"version":"1.6.0","url":"https://docs.expo.dev/versions/latest/sdk/status-bar/","license":"MIT"},"expo-system-ui":{"version":"2.4.0","url":"https://docs.expo.dev/versions/latest/sdk/system-ui","license":"MIT"},"expo-web-browser":{"version":"12.3.2","url":"https://docs.expo.dev/versions/latest/sdk/webbrowser/","license":"MIT"},"file-saver":{"version":"2.0.5","url":"https://github.com/eligrey/FileSaver.js#readme","license":"MIT"},"fs-extra":{"version":"11.1.1","url":"https://github.com/jprichardson/node-fs-extra","license":"MIT"},"google-libphonenumber":{"version":"3.2.33","url":"https://ruimarinho.github.io/google-libphonenumber/","license":"(MIT AND Apache-2.0)"},"htmlparser2-without-node-native":{"version":"3.9.2","url":"git://github.com/fb55/htmlparser2.git","license":"MIT"},"is-plain-obj":{"version":"4.1.0","license":"MIT"},"js-base64":{"version":"3.7.5","license":"BSD-3-Clause"},"pdfmake":{"version":"0.2.7","url":"http://pdfmake.org","license":"MIT"},"process":{"version":"0.11.10","url":"git://github.com/shtylman/node-process.git","license":"MIT"},"prop-types":{"version":"15.8.1","url":"https://facebook.github.io/react/","license":"MIT"},"react":{"version":"18.2.0","url":"https://reactjs.org/","license":"MIT"},"react-content-loader":{"version":"6.2.1","url":"https://github.com/danilowoz/react-content-loader","license":"MIT"},"react-dom":{"version":"18.2.0","url":"https://reactjs.org/","license":"MIT"},"react-native":{"version":"0.72.6","license":"MIT"},"react-native-big-list":{"version":"1.6.1","url":"https://marcocesarato.github.io/react-native-big-list-docs/","license":"GPL-3.0-or-later"},"react-native-blob-util":{"version":"0.18.6","url":"https://github.com/RonRadtke/react-native-blob-util","license":"MIT"},"react-native-gesture-handler":{"version":"2.12.1","url":"https://github.com/software-mansion/react-native-gesture-handler#readme","license":"MIT"},"react-native-get-random-values":{"version":"1.9.0","license":"MIT"},"react-native-iphone-x-helper":{"version":"1.3.1","url":"https://github.com/ptelad/react-native-iphone-x-helper#readme","license":"MIT"},"react-native-mime-types":{"version":"2.4.0","license":"MIT"},"react-native-paper":{"version":"5.11.1","url":"https://callstack.github.io/react-native-paper","license":"MIT"},"react-native-paper-dates":{"version":"0.20.3","url":"https://github.com/web-ridge/react-native-paper-dates#readme","license":"MIT"},"react-native-reanimated":{"version":"3.3.0","url":"https://github.com/software-mansion/react-native-reanimated#readme","license":"MIT"},"react-native-safe-area-context":{"version":"4.6.3","url":"https://github.com/th3rdwave/react-native-safe-area-context#readme","license":"MIT"},"react-native-screens":{"version":"3.22.1","url":"https://github.com/software-mansion/react-native-screens#readme","license":"MIT"},"react-native-svg":{"version":"13.9.0","url":"https://github.com/react-native-community/react-native-svg","license":"MIT"},"react-native-web":{"version":"0.19.9","url":"git://github.com/necolas/react-native-web.git","license":"MIT"},"react-native-webview":{"version":"13.2.2","url":"https://github.com/react-native-webview/react-native-webview#readme","license":"MIT"},"react-virtuoso":{"version":"4.6.2","url":"https://virtuoso.dev/","license":"MIT"},"sharp-cli":{"version":"2.1.0","url":"https://github.com/vseventer/sharp-cli","license":"MIT"},"tippy.js":{"version":"6.3.7","url":"https://atomiks.github.io/tippyjs/","license":"MIT"},"websql":{"version":"2.0.3","url":"git://github.com/nolanlawson/node-websql.git","license":"Apache-2.0"},"xlsx":{"version":"0.18.5","url":"https://sheetjs.com/","license":"Apache-2.0"}};
|