@fto-consult/expo-ui 7.6.29 → 7.6.31

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": "7.6.29",
3
+ "version": "7.6.31",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "scripts": {
6
6
  "clear-npx-cache": "npx clear-npx-cache",
@@ -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.73.14",
74
+ "@fto-consult/common": "^3.73.26",
75
75
  "@fto-consult/electron": "^1.0.27",
76
76
  "@pchmn/expo-material3-theme": "^1.3.1",
77
77
  "@react-native-async-storage/async-storage": "1.18.2",
@@ -295,7 +295,6 @@ export default class CommonDatagridComponent extends AppComponent {
295
295
  this.INITIAL_STATE = {
296
296
  data,
297
297
  }
298
- this.prepareFetchData();
299
298
  this._datagridId = isNonNullString(this.props.id)? this.props.id : uniqid("datagrid-id")
300
299
  this.canDoFilter = true;
301
300
  this.filters = {}
@@ -3243,9 +3242,6 @@ export default class CommonDatagridComponent extends AppComponent {
3243
3242
  this.refresh(true);
3244
3243
  this.previousDataSources = dataSources;
3245
3244
  }
3246
- prepareFetchData(fetchData){
3247
- this.INITIAL_STATE.fetchData = defaultVal(fetchData,this.props.fetchData);
3248
- }
3249
3245
  beforeFetchData(){}
3250
3246
  /**** retourne la liste des items, utile lorsqu'une s'agit d'une fonction
3251
3247
  Lorsque data est une chaine de caractère, alors elle doit être sous la forme recommandée par la function
@@ -3290,7 +3286,7 @@ export default class CommonDatagridComponent extends AppComponent {
3290
3286
  if(force !== true && isArray(this.INITIAL_STATE.data)) {
3291
3287
  return this.resolveFetchedDataPromise({cb,data:this.INITIAL_STATE.data}).then(resolve).catch(reject)
3292
3288
  }
3293
- let fetchData = this.INITIAL_STATE.fetchData;
3289
+ let fetchData = undefined;
3294
3290
  if(isFunction(this.props.fetchData)){
3295
3291
  /**** l'on peut définir la props fetchData, qui est la fonction appelée pour la recherche des données */
3296
3292
  fetchData = this.props.fetchData.call(this,fetchOptions);
@@ -3381,7 +3377,7 @@ export default class CommonDatagridComponent extends AppComponent {
3381
3377
  this._pagination.page = 1;
3382
3378
  this._pagination.start = 0;
3383
3379
  }
3384
- return this.fetchData({force:true});
3380
+ return this.fetchData({force:true,renderProgressBar:true});
3385
3381
  }
3386
3382
  onSetQueryLimit(){
3387
3383
  if(!this.canSetQueryLimit()) return;
@@ -208,7 +208,7 @@ const SWRDatagridComponent = React.forwardRef((props,ref)=>{
208
208
  const dataRef = React.useRef(null);
209
209
  const totalRef = React.useRef(0);
210
210
  const prevIsLoading = React.usePrevious(isLoading);
211
- const loading = (customIsLoading === true || isLoading || (prevIsLoading && isValidating && showProgressRef.current));
211
+ const loading = (customIsLoading === true || isLoading || (isValidating && showProgressRef.current));
212
212
  const {data,total} = React.useMemo(()=>{
213
213
  if((loading && customIsLoading !== false) || !isObjOrArray(result)){
214
214
  return {data:dataRef.current,total:totalRef.current};
@@ -235,8 +235,10 @@ const SWRDatagridComponent = React.forwardRef((props,ref)=>{
235
235
  },500);
236
236
  },[error]);
237
237
  const doRefresh = (showProgress)=>{
238
- showProgressRef.current = showProgress ? typeof showProgress ==='boolean' : false;
239
- refresh();
238
+ showProgressRef.current = showProgress || typeof showProgress ==='boolean' ? showProgress : false;
239
+ const fPath = isNonNullString(fetchPath)? fetchPath : fPathRef.current;
240
+ const rKey = `${setQueryParams(fPath,"swrRefreshKeyId",uniqid("swr-refresh-key"))}`;
241
+ refresh(rKey,data);
240
242
  }
241
243
  const canPaginate = ()=>{
242
244
  if(!canHandlePagination) return false;