@fto-consult/expo-ui 2.28.0 → 2.29.0

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.
@@ -1698,6 +1698,7 @@ export default class CommonDatagridComponent extends AppComponent {
1698
1698
  chartProps[settingKey] = defaultObj(chartProps[settingKey]);
1699
1699
  chartProps[settingKey][key] = config[key];
1700
1700
  });
1701
+
1701
1702
  const chartOptions = {
1702
1703
  ...chartProps,
1703
1704
  title :extendObj(true,{}, {
@@ -1738,7 +1739,10 @@ export default class CommonDatagridComponent extends AppComponent {
1738
1739
  if(typeof value =="number") return value.formatNumber();
1739
1740
  return value;
1740
1741
  }
1741
- chartOptions.chart.id = this.chartIdPrefix+defaultStr(chartType.key,"no-key")
1742
+ chartOptions.chart.id = this.chartIdPrefix+"-"+defaultStr(chartType.key,"no-key");
1743
+ if(!chartType.isDonut){
1744
+ delete chartOptions.labels;
1745
+ }
1742
1746
  return <Chart
1743
1747
  options = {chartOptions}
1744
1748
  key = {chartOptions.chart.id}
@@ -2127,7 +2131,7 @@ export default class CommonDatagridComponent extends AppComponent {
2127
2131
  if(hasSectionColumns){
2128
2132
  let sHeader = this.getSectionListHeader({data:d,columnsLength : sectionListColumnsSize,fieldsSize:sectionListColumnsSize,sectionListColumnsLength:sectionListColumnsSize,sectionListColumnsSize,allData:data,rowData:d,index:i,rowIndex,context:this,columns,fields:columns});
2129
2133
  if(sHeader === false) return;//on omet la donnée si la fonction de récupération de son header retourne false
2130
- if(!isNonNullString(sHeader)){
2134
+ if(!isNonNullString(sHeader) || sHeader.toLowerCase().trim() =="undefined"){
2131
2135
  if(this.props.ignoreEmptySectionListHeader !== false){
2132
2136
  sHeader = this.emptySectionListHeaderValue;
2133
2137
  } else return;
@@ -2233,13 +2237,15 @@ export default class CommonDatagridComponent extends AppComponent {
2233
2237
  const lStyle = typeof this.props.getSectionListHeaderLabelStyle =='function' ? this.props.getSectionListHeaderLabelStyle(args) : null;
2234
2238
 
2235
2239
  rowProps = defaultObj(rowProps);
2236
- const testID = rowProps.testID = defaultStr(args.testID,"RN_DatagridSectionListHeader")+"_"+defaultVal(args.rowIndex,args.index)
2240
+ const rowKey = defaultVal(args.rowIndex,args.index,args.rowCounterIndex);
2241
+ const testID = rowProps.testID = defaultStr(args.testID,"RN_DatagridSectionListHeader")+"_"+rowKey;
2237
2242
  if(Array.isArray(rowStyle)){
2238
2243
  if(style){
2239
2244
  rowStyle.push(style);
2240
2245
  }
2241
2246
  }
2242
2247
  let cells = null;
2248
+ const isA = this.isAccordion();
2243
2249
  if(this.canShowFooters() && isObj(this.sectionListHeaderFooters[key])){
2244
2250
  const {visibleColumnsNames,widths} = defaultObj(this.preparedColumns);
2245
2251
  if(isObj(visibleColumnsNames) &&isObj(widths)){
@@ -2249,18 +2255,16 @@ export default class CommonDatagridComponent extends AppComponent {
2249
2255
  if(typeof widths[column] !== 'number') return null;
2250
2256
  const width = widths[column];
2251
2257
  if(!column) return null;
2252
- const key = key+column;
2258
+ const key2 = key+column;
2253
2259
  if(!column || !this.state.columns[column] || !footers[column]) {
2254
2260
  if(this.isAccordion()) return null;
2255
- cells.push(<View key={key} testID={testID+"_FooterCellContainer"+key} style={[tableStyles.headerItemOrCell,{width}]}>
2256
-
2257
- </View>)
2261
+ cells.push(<View key={key2} testID={testID+"_FooterCellContainer_"+key2} style={[tableStyles.headerItemOrCell,{width}]}></View>)
2258
2262
  } else {
2259
2263
  const footer = footers[column];
2260
- cells.push(<View key={key} testID={testID+"_FooterCellContainer"+key} style={[tableStyles.headerItemOrCell,{width,alignItems:'flex-start',justifyContent:'flex-start'}]}>
2264
+ cells.push(<View key={key2} testID={testID+"_FooterCellContainer_"+key2} style={[tableStyles.headerItemOrCell,!isA?{width,alignItems:'flex-start',justifyContent:'flex-start'}:{marginLeft:0,paddingLeft:0,marginRight:5}]}>
2261
2265
  <Footer
2262
- key = {key}
2263
- testID={testID+"_FooterItem_"+key}
2266
+ key = {key2}
2267
+ testID={testID+"_FooterItem_"+key2}
2264
2268
  {...footer}
2265
2269
  aggregatorFunction = {this.getActiveAggregatorFunction().code}
2266
2270
  aggregatorFunctions = {this.aggregatorFunctions}
@@ -2269,13 +2273,12 @@ export default class CommonDatagridComponent extends AppComponent {
2269
2273
  />
2270
2274
  </View>)
2271
2275
  }
2272
-
2273
2276
  });
2274
2277
  }
2275
2278
  }
2276
- return <View testID={testID+"_ContentContainer"} style={[theme.styles.w100,theme.styles,theme.styles.justifyContentCenter,theme.styles.pt1,theme.styles.pb1,theme.styles.alignItemsCenter,!cells && theme.styles.ml1,theme.styles.mr1,cStyle]}>
2277
- <Label testID={testID+"_Label"} splitText numberOfLines={3} textBold style={[theme.styles.w100,{color:theme.colors.primaryOnSurface,fontSize:16},lStyle]}>{label}</Label>
2278
- {cells ? <View style = {[theme.styles.w100,theme.styles.row,theme.styles.alignItemsFlexStart]}
2279
+ return <View testID={testID+"_ContentContainer"} style={[theme.styles.w100,isA && theme.styles.ph2,theme.styles.justifyContentCenter,theme.styles.alignItemsCenter,theme.styles.pb1,!cells && theme.styles.ml1,theme.styles.mr1,cStyle]}>
2280
+ <Label testID={testID+"_Label"} splitText numberOfLines={3} textBold style={[theme.styles.w100,{color:theme.colors.primaryOnSurface,fontSize:isA?15 :16},lStyle]}>{label}</Label>
2281
+ {cells ? <View testID={testID+"_TableRow"} style = {[theme.styles.w100,theme.styles.row,theme.styles.alignItemsFlexStart,isA && theme.styles.mt05]}
2279
2282
  >{cells}</View> : null}
2280
2283
  </View>
2281
2284
  }
@@ -2692,10 +2695,10 @@ export default class CommonDatagridComponent extends AppComponent {
2692
2695
  }
2693
2696
  }
2694
2697
  getPointerEvents(){
2698
+ if(this.enablePointerEventsRef.current) return true;
2695
2699
  if(this.props.isLoading){
2696
2700
  return "none";
2697
2701
  }
2698
- if(this.enablePointerEventsRef.current) return true;
2699
2702
  return this.isLoading()? "none":"auto";
2700
2703
  }
2701
2704
  updateLayout(p){
@@ -291,7 +291,7 @@ const DatagridFactory = (Factory)=>{
291
291
  {this.renderSectionListMenu()}
292
292
  {this.renderDisplayTypes()}
293
293
  {this.renderAggregatorFunctionsMenu()}
294
- <View testID={testID+"_HeaderPagination"} style = {styles.paginationItem}>
294
+ <View pointerEvents={pointerEvents} testID={testID+"_HeaderPagination"} style = {styles.paginationItem}>
295
295
  <BottomSheetMenu
296
296
  testID={testID+"_HeaderMenus"}
297
297
  anchor={(props)=>(<Icon {...props} icon={'axis-z-arrow'}/>)}
@@ -22,7 +22,8 @@ DateFormatSelector.displayName = "DateFormatSelector";
22
22
  export default DateFormatSelector;
23
23
 
24
24
  /*** onAdd est appelé lorsqu'on ajoute un format personalisé */
25
- export const selectDateFormatFieldProps = ({onAdd:customOnAdd,onAddCustomFormat,...props})=>{
25
+ export const selectDateFormatFieldProps = ({onAdd:customOnAdd,onAddCustomFormat,inputProps,...props})=>{
26
+ const cRight = (p)=><Icon size={20} {...p} name ="material-help" title="Utilisez les champ d : pour date, m pour mois, y pour année, H pour heure, M pour minute, s pour seconde. les jour sur 3 lettres (Lun) sont : ddd, les jours écris complètement sont dddd (Lundi); les mois en court sont définis par mmm (Juil), les mois en complet : mmmm (Juillet)."/>;
26
27
  const onAdd = ()=>{
27
28
  const labelRef = React.createRef(null);
28
29
  const valueRef = React.createRef(null);
@@ -32,7 +33,8 @@ export const selectDateFormatFieldProps = ({onAdd:customOnAdd,onAddCustomFormat,
32
33
  <TextField
33
34
  type = "text"
34
35
  label = "Format personalisé"
35
- right ={(p)=><Icon {...p} name ="material-help" title="Utilisez les champ d : pour date, m pour mois, y pour année, H pour heure, M pour minute, s pour seconde. les jour sur 3 lettres (Lun) sont : ddd, les jours écris complètement sont ddddd (Lundi); les mois en court sont définis par mmm (Juil), les mois en complet : mmmm (Juillet)."/>}
36
+ enableCopy = {false}
37
+ right ={cRight}
36
38
  onChange = {(args)=>{
37
39
  const {value} = args;
38
40
  if(!labelRef.current || !labelRef.current.update) return;
@@ -73,12 +75,21 @@ export const selectDateFormatFieldProps = ({onAdd:customOnAdd,onAddCustomFormat,
73
75
  }],
74
76
  }))
75
77
  };
78
+ inputProps = defaultObj(props.inputProps);
76
79
  return {
77
80
  items : getDateFormatSelectorItems(),
78
81
  getItemValue : ({item})=>item.code,
79
82
  renderItem : dateFormatSelectorRenderItem,
80
83
  showAdd : true,
81
84
  ...props,
85
+ inputProps : {
86
+ enableCopy:false,...inputProps,
87
+ right : (p)=>{
88
+ const cc = cRight(p);
89
+ const r = typeof inputProps.right =='function'? inputProps.right(p) : inputProps.right;
90
+ return React.isValidElement(r) ? <>{r}{cc}</> : cc;
91
+ }
92
+ },
82
93
  defaultValue : defaultStr(props.defaultValue,props.format),
83
94
  onAdd,
84
95
  onAdd : undefined,
@@ -160,6 +160,7 @@ export default class Filter extends AppComponent {
160
160
  actions = _inActions;
161
161
  } else if(type == 'date' || type =='datetime') {
162
162
  actions = {...periodActions, ...actions}
163
+ delete actions.$between;
163
164
  } else if(type !== 'date2time' && type !== 'time' && type !== 'number' && type !== 'decimal'){
164
165
  actions = {...betweenActions,...regexActions};
165
166
  isTextFilter = true;
@@ -3,7 +3,7 @@ import React from "$react";
3
3
  import { prepareItems as customPrepareItems,getBToTopRef } from "./utils";
4
4
  import theme,{grid,StylePropTypes} from "$theme";
5
5
  import PropTypes from "prop-types";
6
- import {defaultObj,defaultDecimal,defaultArray,defaultFunc} from "$utils";
6
+ import {defaultObj,isObj,defaultDecimal,defaultArray,defaultFunc} from "$utils";
7
7
  import {isMobileMedia} from "$cplatform/dimensions";
8
8
  import BackToTop from "$ecomponents/BackToTop";
9
9
  import {FlatList,StyleSheet,View} from "react-native";
@@ -42,6 +42,9 @@ const CommonListComponent = React.forwardRef((props,ref)=>{
42
42
  },
43
43
  renderItem : function({item,index,section,...rest}){
44
44
  rest = rest ? rest : {};
45
+ if(isObj(item) && item.isSectionListHeader){
46
+ rest.isSectionListHeader = true;
47
+ }
45
48
  let ret = renderItem({item,numColumns,index,section,numColumns,itemContainerWidth:itemWindowWidth,itemWindowWidth,...rest,isScrolling:listRef.current?.isScrolling?true:false,items:defaultArray(context.items)});
46
49
  if(typeof ret =='string' || typeof ret =='number'){
47
50
  return <Label children = {ret}/>
@@ -68,8 +68,8 @@ export default TableLinKComponent;
68
68
 
69
69
 
70
70
  TableLinKComponent.propTypes = {
71
- foreignKeyColumn : PropTypes.string.isRequired,//le nom de la colonne de la clé étrangère
72
- foreignKeyTable : PropTypes.string.isRequired, //le nom de la table référencée
71
+ foreignKeyColumn : PropTypes.string,//le nom de la colonne de la clé étrangère
72
+ foreignKeyTable : PropTypes.string, //le nom de la table référencée
73
73
  fetchForeignData : PropTypes.func, // la fonction permettant de chercher la données à distance
74
74
  server : PropTypes.string,//le serveur sur lequel rechercher les données
75
75
  primary : PropTypes.bool,//si le composant sera stylé en theme primary de react