@fto-consult/expo-ui 8.61.11 → 8.62.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fto-consult/expo-ui",
3
- "version": "8.61.11",
3
+ "version": "8.62.1",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "react-native-paper-doc": "https://github.com/callstack/react-native-paper/tree/main/docs/docs/guides",
6
6
  "scripts": {
@@ -374,7 +374,7 @@ const DatagridFactory = (Factory)=>{
374
374
  const showFooters = this.canShowFooters();
375
375
  let restItems = [];
376
376
  let max = this.getMaxSelectableRows();
377
- if(max && this.isSelectableMultiple()){
377
+ if(max && this.isSelectableMultiple() && this.canRenderActions()){
378
378
  max = max.formatNumber();
379
379
  restItems = [
380
380
  {
@@ -412,10 +412,16 @@ export default class CommonDatagridComponent extends AppComponent {
412
412
  canHandleColumnResize(){
413
413
  return false;
414
414
  }
415
- getSessionKey (){
415
+ hasSessionName(){
416
416
  const sessionName = this.props.sessionName;
417
417
  const userCode = Auth.getLoggedUserCode();
418
418
  if(!isNonNullString(sessionName) || (!isNonNullString(userCode) && !this.isDatagrid())) return false;
419
+ return true;
420
+ }
421
+ getSessionKey (){
422
+ const sessionName = this.props.sessionName;
423
+ const userCode = Auth.getLoggedUserCode();
424
+ if(!isNonNullString(sessionName) || (!isNonNullString(userCode) && !this.isDatagrid())) return "";
419
425
  return this.getSessionPrefix()+sessionName.ltrim(this.getSessionPrefix()).replaceAll(" ",'_')+userCode;
420
426
  }
421
427
  getSessionData (sessionKey){
@@ -1052,21 +1058,23 @@ export default class CommonDatagridComponent extends AppComponent {
1052
1058
  })
1053
1059
  }
1054
1060
  });
1055
- customMenu.push({
1056
- icon : "bookmark-remove",
1057
- text : "Suppr données de session",
1058
- tooltip : "Cliquez pour rénitialiser les données de sessions liés au composant Datagrid",
1059
- onPress : ()=>{
1060
- this.resetSessionData();
1061
- this.setIsLoading(true,()=>{
1062
- this.setState({
1063
- displayType : "table",
1064
- },()=>{
1065
- this.removeAllColumnsInSectionList();
1061
+ if(this.hasSessionName() && this.props.displayResetSessionButton !== false){
1062
+ customMenu.push({
1063
+ icon : "bookmark-remove",
1064
+ text : "Suppr données de session",
1065
+ tooltip : "Cliquez pour rénitialiser les données de sessions liés au composant Datagrid",
1066
+ onPress : ()=>{
1067
+ this.resetSessionData();
1068
+ this.setIsLoading(true,()=>{
1069
+ this.setState({
1070
+ displayType : "table",
1071
+ },()=>{
1072
+ this.removeAllColumnsInSectionList();
1073
+ });
1066
1074
  });
1067
- });
1068
- }
1069
- });
1075
+ }
1076
+ });
1077
+ }
1070
1078
  return customMenu;
1071
1079
  }
1072
1080
  /*** aller à la dernière page */
@@ -4126,6 +4134,7 @@ CommonDatagridComponent.propTypes = {
4126
4134
  style : StyleProps,
4127
4135
  testID : PropTypes.string,///le test id
4128
4136
  }),
4137
+ displayResetSessionButton : PropTypes.bool,//si le bouton supprimer les données de sessions sera affiché où pas,
4129
4138
  ///pour l'affichage où non des filtres
4130
4139
  toggleFilters : PropTypes.bool,
4131
4140
  desktop: PropTypes.bool,
@@ -165,7 +165,7 @@ const DatagridFactory = (Factory)=>{
165
165
  let max = this.getMaxSelectableRows();
166
166
  if(selectableMultiple && max){
167
167
  max = max.formatNumber();
168
- if(selectableMultiple && !canRenderChart){
168
+ if(selectableMultiple && !canRenderChart && this.canRenderActions()){
169
169
  restItems.push({
170
170
  label : "Sélectionner "+max.formatNumber(),
171
171
  icon : "select-all",