@fto-consult/expo-ui 6.76.2 → 6.76.5

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": "6.76.2",
3
+ "version": "6.76.5",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "main": "main",
6
6
  "scripts": {
@@ -71,7 +71,7 @@
71
71
  "@expo/html-elements": "^0.5.1",
72
72
  "@expo/vector-icons": "^13.0.0",
73
73
  "@faker-js/faker": "^8.0.2",
74
- "@fto-consult/common": "^3.61.7",
74
+ "@fto-consult/common": "^3.61.23",
75
75
  "@pchmn/expo-material3-theme": "^1.3.1",
76
76
  "@react-native-async-storage/async-storage": "1.18.2",
77
77
  "@react-native-community/datetimepicker": "7.2.0",
@@ -3398,8 +3398,8 @@ export default class CommonDatagridComponent extends AppComponent {
3398
3398
  </Tooltip>
3399
3399
  }
3400
3400
  /*** récupère les fetchOptions du datagrid */
3401
- getFetchOptions({fetchOptions,convertToSQL}){
3402
- const fetchFilters = this.getFilters({convertToSQL:typeof convertToSQL =='boolean'? convertToSQL : false});
3401
+ getFetchOptions({fetchOptions}){
3402
+ const fetchFilters = this.getFilters({convertToSQL : false});
3403
3403
  fetchOptions = Object.clone(isObj(fetchOptions)? fetchOptions : {});
3404
3404
  fetchOptions.selector = defaultObj(fetchOptions.selector);
3405
3405
  fetchOptions.dataSources = this.currentDataSources;
@@ -152,7 +152,7 @@ const SWRDatagridComponent = React.forwardRef((props,ref)=>{
152
152
  fileName : rest.exportTableProps.fileName,
153
153
  title : React.getTextContent(title),
154
154
  },rest.exportTableProps.pdf);
155
- const fetchOptionsRef = React.useRef(defaultObj(customFetchOptions));
155
+ const fetchOptionsRef = React.useRef({});
156
156
  const fPathRef = React.useRef(defaultStr(fetchPathKey,uniqid("fetchPath")));
157
157
  fetchPath = defaultStr(fetchPath,table?.queryPath,tableName.toLowerCase()).trim();
158
158
  if(fetchPath){
@@ -174,7 +174,7 @@ const SWRDatagridComponent = React.forwardRef((props,ref)=>{
174
174
  }
175
175
  opts = defaultObj(opts);
176
176
  opts.fetchOptions = isObj(opts.fetchOptions)? Object.clone(opts.fetchOptions) : {};
177
- extendObj(true,opts.fetchOptions,fetchOptionsRef.current?.fetchOptions);
177
+ extendObj(true,opts.fetchOptions,fetchOptionsRef.current);
178
178
  if(props.convertFiltersToSQL === false){
179
179
  opts.fetchOptions.selector = extendObj(true,{},opts.fetchOptions.selector,fetchOptionsRef.current?.selector);
180
180
  }
@@ -297,6 +297,7 @@ const SWRDatagridComponent = React.forwardRef((props,ref)=>{
297
297
  testID = {testID}
298
298
  {...defaultObj(table?.datagrid)}
299
299
  {...rest}
300
+ fetchOptions = {customFetchOptions}
300
301
  title = {customTitle || title || undefined}
301
302
  sort = {sort}
302
303
  onSort = {({sort})=>{
@@ -401,12 +402,13 @@ const SWRDatagridComponent = React.forwardRef((props,ref)=>{
401
402
  let {fetchOptions:opts,force,renderProgressBar} = args;
402
403
  opts = getFetchOptions({showError:showProgressRef.current,...opts});
403
404
  isInitializedRef.current = true;
404
- fetchOptionsRef.current = opts;
405
- opts.withTotal = true;
405
+ fetchOptionsRef.current = opts.fetchOptions;
406
+ opts.fetchOptions.withTotal = true;
406
407
  sortRef.current = opts.fetchOptions.sort;
407
408
  if(force){
408
409
  pageRef.current = firstPage;
409
410
  }
411
+ console.log(fetchOptionsRef.current," is current fetching options heee");
410
412
  doRefresh(typeof renderProgressBar =='boolean'? renderProgressBar : force);
411
413
  return false;
412
414
  }}