@fto-consult/expo-ui 2.30.0 → 2.31.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": "2.30.0",
3
+ "version": "2.31.1",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -61,7 +61,7 @@
61
61
  "@emotion/native": "^11.10.0",
62
62
  "@expo/html-elements": "^0.2.0",
63
63
  "@expo/vector-icons": "^13.0.0",
64
- "@fto-consult/common": "^1.25.10",
64
+ "@fto-consult/common": "^1.25.17",
65
65
  "@gorhom/portal": "^1.0.14",
66
66
  "@react-native-async-storage/async-storage": "~1.17.3",
67
67
  "@react-native-community/datetimepicker": "6.5.2",
@@ -40,6 +40,7 @@ import {styles as tableStyles} from "$ecomponents/Table";
40
40
  import {DialogProvider} from "$ecomponents/Form/FormData";
41
41
  import Chart,{getMaxSupportedSeriesSize} from "$ecomponents/Chart";
42
42
  import notify from "$cnotify";
43
+ import Divider from "$ecomponents/Divider";
43
44
 
44
45
  export const donutChart = {
45
46
  isChart : true,
@@ -273,10 +274,10 @@ export default class CommonDatagridComponent extends AppComponent {
273
274
  if(isPlainObject(f)){
274
275
  this.filters[v] = {...f};
275
276
  this.filters[v].field = defaultStr(f.field,v);
276
- this.filters[v].originValue = defaultVal(f.originValue,f.defaultValue,f.value)
277
+ this.filters[v].defaultValue = defaultVal(f.defaultValue,f.value)
277
278
  } else {
278
279
  this.filters[v] = {
279
- originValue : f,
280
+ defaultValue : f,
280
281
  field : v
281
282
  }
282
283
  }
@@ -355,6 +356,8 @@ export default class CommonDatagridComponent extends AppComponent {
355
356
  (Array.isArray(props.sectionListColumns) ? props.sectionListColumns : defaultArray(this.getSessionData("sectionListColumns"))).map((col)=>{
356
357
  if(isNonNullString(col)){
357
358
  l[col.trim()] = {};
359
+ } else if(isObj(col) && isNonNullString(col.field)){
360
+ l[col.field] = col;
358
361
  }
359
362
  })
360
363
  return l;
@@ -2044,7 +2047,7 @@ export default class CommonDatagridComponent extends AppComponent {
2044
2047
  andOperator : filterAndOperator,
2045
2048
  searchIconTooltip : 'Filtre',
2046
2049
  searchIcon : 'filter_list',
2047
- defaultValue : fCol.originValue,
2050
+ defaultValue : defaultVal(fCol.defaultValue,restCol.defaultValue),
2048
2051
  name : header.field,
2049
2052
  onClearFilter : this.onClearFilter.bind(this),
2050
2053
  onChange : this.onFilterChange.bind(this),
@@ -2373,9 +2376,9 @@ export default class CommonDatagridComponent extends AppComponent {
2373
2376
  });
2374
2377
  }
2375
2378
  }
2376
- return <View testID={testID+"_ContentContainer"} style={[theme.styles.w100,isA ? theme.styles.ph2 : theme.styles.pt1,theme.styles.justifyContentCenter,theme.styles.alignItemsCenter,theme.styles.pb1,!cells && theme.styles.ml1,theme.styles.mr1,cStyle]}>
2379
+ return <View testID={testID+"_ContentContainer"} style={[theme.styles.w100,isA && this.state.displayOnlySectionListHeaders && {borderTopColor:theme.colors.divider,borderTopWidth:1},isA ? [theme.styles.ph2,theme.styles.pt1] : theme.styles.pt1,theme.styles.justifyContentCenter,theme.styles.alignItemsCenter,theme.styles.pb1,!cells && theme.styles.ml1,theme.styles.mr1,cStyle]}>
2377
2380
  <Label testID={testID+"_Label"} splitText numberOfLines={3} textBold style={[theme.styles.w100,{color:theme.colors.primaryOnSurface,fontSize:isA?15 :16},lStyle]}>{label}</Label>
2378
- {cells ? <View testID={testID+"_TableRow"} style = {[theme.styles.w100,theme.styles.row,theme.styles.alignItemsFlexStart,isA && theme.styles.mt05]}
2381
+ {cells ? <View testID={testID+"_TableRow"} style = {[theme.styles.w100,theme.styles.row,isA && theme.styles.pt1,theme.styles.alignItemsFlexStart]}
2379
2382
  >{cells}</View> : null}
2380
2383
  </View>
2381
2384
  }
@@ -2457,7 +2460,7 @@ export default class CommonDatagridComponent extends AppComponent {
2457
2460
  if(!isObj(f)) return;
2458
2461
  defValue = undefined;
2459
2462
  if(f.type =="select") defValue = [];
2460
- filters[i] = {...f,value:defValue,defaultValue:defValue,originValue:defValue}
2463
+ filters[i] = {...f,value:defValue,defaultValue:defValue}
2461
2464
  })
2462
2465
  this.filters = filters;
2463
2466
  this.refresh(true);
@@ -2483,7 +2486,7 @@ export default class CommonDatagridComponent extends AppComponent {
2483
2486
  field = defaultStr(field,name);
2484
2487
  if(field){
2485
2488
  let v = defaultStr(type).toLowerCase() == "select"? []:undefined
2486
- this.filters[field] = {value:v,defaultValue:v,originValue:v,originValue:v}
2489
+ this.filters[field] = {value:v,defaultValue:v}
2487
2490
  this.doFilter({value:v,field,force:true})
2488
2491
  }
2489
2492
  }
@@ -2500,7 +2503,7 @@ export default class CommonDatagridComponent extends AppComponent {
2500
2503
  this.filteredValues[field] = {
2501
2504
  operator,action,value,field
2502
2505
  }
2503
- filter.originValue = filter.defaultValue = arg.defaultValue;
2506
+ filter.defaultValue = arg.defaultValue;
2504
2507
  filter.operator = operator;
2505
2508
  filter.action = defaultStr(originAction,action);
2506
2509
  }
@@ -3317,6 +3320,11 @@ CommonDatagridComponent.propTypes = {
3317
3320
  PropTypes.arrayOf(PropTypes.object),
3318
3321
  PropTypes.objectOf(PropTypes.object),
3319
3322
  ]),
3323
+ /****les colonnes via lesquelles le tableau est groupé par defaut */
3324
+ sectionListColumns : PropTypes.oneOfType([
3325
+ PropTypes.arrayOf(PropTypes.object),
3326
+ PropTypes.arrayOf(PropTypes.string),
3327
+ ]),
3320
3328
  sectionListHeaderEmptyValue : PropTypes.string, //la valeur vide par défaut à afficher dans les entêtes du table
3321
3329
  ignoreCaseOnSectionListHeader : PropTypes.bool,//si l'on ignorera la casse dans le sectionlISThEADER
3322
3330
  sectoonListHeaderUpperCase : PropTypes.bool, //si le sectionListHeader sera en majuscule
@@ -96,7 +96,6 @@ export default class CommonTableDatagrid extends CommonDatagrid{
96
96
  fetchOptions.selector = defaultObj(fetchOptions.selector);
97
97
  fetchOptions.dataSources = this.currentDataSources;
98
98
  fetchOptions = extendObj(true,true,{},fetchOptions,{selector : fetchFilters});
99
- console.log(fetchOptions," is fetchOptions ",this.getFiltersProps(),fetchFilters)
100
99
  fetchOptions.dataSources = this.currentDataSources;
101
100
  fetchOptions.sort = this.getSort();
102
101
  let limit = this.getQueryLimit();
@@ -10,7 +10,6 @@ import {defaultObj,isNumber,defaultNumber,defaultStr,defaultBool,isNonNullString
10
10
  import theme,{flattenStyle} from "$theme";
11
11
  import DateLib from "$date";
12
12
  import { toDateObj } from "./utils";
13
- import TextField from "$components/TextField";
14
13
  import PeriodActionComponent from "./PeriodAction";
15
14
 
16
15
  export default function DateTimePickerComponent({left,isPeriodAction,contentProps,withSeconds,right,format,dateFormat,timeFormat,defaultValue,onChange,testID,dateProps,disabled,readOnly,timeProps,...rest}){
@@ -8,7 +8,7 @@ import DateLib from "$date";
8
8
 
9
9
  const PeriodActionComponent = React.forwardRef(({defaultValue,label,isDateTime,...props},ref)=>{
10
10
  if(isNonNullString(label)){
11
- label+=" [Période1]";
11
+ label+=" [Période]";
12
12
  }
13
13
  const datePeriod= DateLib.formatPeriod(defaultValue,isDateTime);
14
14
  if(datePeriod){
@@ -178,7 +178,6 @@ export default class Filter extends AppComponent {
178
178
  if(!isObjOrArray(value) && (isNullOrEmpty(value,true) || value ==='undefined') ){
179
179
  value = undefined;
180
180
  }
181
- let originValue = value;
182
181
  if(action =="$today" || action =='$yesterday'){
183
182
  force = true;
184
183
  }
@@ -230,7 +229,7 @@ export default class Filter extends AppComponent {
230
229
  }
231
230
  }
232
231
  }
233
- this.props.onChange({...this.getStateValues(),value,originValue:originValue,originValue,field:this.props.field,action,operator,selector,originAction,context:this});
232
+ this.props.onChange({...this.getStateValues(),value,field:this.props.field,action,operator,selector,originAction,context:this});
234
233
  }
235
234
  }
236
235
  componentDidUpdate (){