@fto-consult/expo-ui 2.23.7 → 2.23.8

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fto-consult/expo-ui",
3
- "version": "2.23.7",
3
+ "version": "2.23.8",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -83,8 +83,10 @@ const SWRDatagridComponent = React.forwardRef((props,ref)=>{
83
83
  ListFooterComponent,
84
84
  testID,
85
85
  autoSort,
86
+ fetchOptions:customFetchOptions,
86
87
  handleQueryLimit,
87
88
  onFetchData,
89
+ beforeFetchData,
88
90
  ...rest
89
91
  } = props;
90
92
  rest = defaultObj(rest);
@@ -122,7 +124,7 @@ const SWRDatagridComponent = React.forwardRef((props,ref)=>{
122
124
  fileName : rest.exportTableProps.fileName,
123
125
  title
124
126
  },rest.exportTableProps.pdf);
125
- const fetchOptionsRef = React.useRef({});
127
+ const fetchOptionsRef = React.useRef(defaultObj(customFetchOptions));
126
128
  const refreshCBRef = React.useRef(null);
127
129
  fetchPath = defaultStr(fetchPath,table.queryPath,tableName.toLowerCase()).trim();
128
130
  const innerRef = React.useRef(null);
@@ -390,7 +392,9 @@ const SWRDatagridComponent = React.forwardRef((props,ref)=>{
390
392
  handlePagination = {false}
391
393
  autoSort = {canSortRemotely()? false : true}
392
394
  isLoading = {loading && !error && showProgressRef.current && true || false}
393
- beforeFetchData = {({fetchOptions:opts,force})=>{
395
+ beforeFetchData = {(args)=>{
396
+ let {fetchOptions:opts,force} = args;
397
+ if(typeof beforeFetchData =="function" && beforeFetchData(fetchData)==false) return;
394
398
  opts.fields = fetchFields;
395
399
  opts = getFetchOptions({showError:showProgressRef.current,...opts});
396
400
  isInitializedRef.current = true;