@fto-consult/expo-ui 7.17.4 → 7.17.6

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.17.4",
3
+ "version": "7.17.6",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "scripts": {
6
6
  "clear-npx-cache": "npx clear-npx-cache",
@@ -291,7 +291,7 @@ export default class CommonDatagridComponent extends AppComponent {
291
291
  this.renderProgressBar = this.renderProgressBar.bind(this);
292
292
  this.sortRef.current.dir = defaultStr(this.sortRef.current.dir,this.sortRef.current.column == "date"?"desc":'asc')
293
293
  this.hasColumnsHalreadyInitialized = false;
294
- this.initColumns(props.columns);
294
+ this.state.columns = this.initColumns(props.columns);
295
295
  if(!isNonNullString(this.sortRef.current.column) && "date" in this.state.columns){
296
296
  this.sortRef.current.column = "date";
297
297
  }
@@ -696,10 +696,10 @@ export default class CommonDatagridComponent extends AppComponent {
696
696
  }
697
697
  initColumnsCallback(){}
698
698
  initColumns (columns){
699
- this.state.columns = {};
699
+ const newColumns = {};
700
700
  let colIndex = 0;
701
701
  if(this.canHandleSelectableColumn()){
702
- this.state.columns[this.getSelectableColumName()] = {
702
+ newColumns[this.getSelectableColumName()] = {
703
703
  field : this.getSelectableColumName(),
704
704
  style : this.getSelectableColumNameStyle(),
705
705
  width : 40,
@@ -712,7 +712,7 @@ export default class CommonDatagridComponent extends AppComponent {
712
712
  }
713
713
  if(this.canHandleIndexColumn()){
714
714
  colIndex++;
715
- this.state.columns [this.getIndexColumnName()] = {
715
+ newColumns [this.getIndexColumnName()] = {
716
716
  filter : false,
717
717
  visible : true,
718
718
  width : 50,
@@ -748,7 +748,7 @@ export default class CommonDatagridComponent extends AppComponent {
748
748
  colIndex++;
749
749
  header.visible = defaultVal(header.visible,true);
750
750
  header.colIndex = colIndex;
751
- this.state.columns[header.field] = header;
751
+ newColumns[header.field] = header;
752
752
  /*** les pieds de pages sont les données de type decimal, où qu'on peut compter */
753
753
  if(header.footer !== false && ((arrayValueExists(['decimal','number','money'],header.type) && header.format) || header.format == 'money' || header.format =='number')){
754
754
  footers[header.field] = Object.clone(header);
@@ -758,7 +758,7 @@ export default class CommonDatagridComponent extends AppComponent {
758
758
  }
759
759
  });
760
760
  this.rowKeysColumns = Object.keys(rowKeysColumns);
761
- return footers;
761
+ return newColumns;
762
762
  }
763
763
  getFootersFields(init){
764
764
  this[this.footerFieldName] = init === true ? {} : defaultObj(this[this.footerFieldName]);
@@ -3676,6 +3676,19 @@ export default class CommonDatagridComponent extends AppComponent {
3676
3676
  return false;
3677
3677
  }
3678
3678
  UNSAFE_componentWillReceiveProps(nextProps){
3679
+ if(false && !React.areEquals(this.props.columns,nextProps.columns)){
3680
+ const newColumns = this.initColumns(nextProps.columns);
3681
+ this.setIsLoading(true,()=>{
3682
+ this.setState({columns:newColumns},()=>{
3683
+ this.prepareColumns();
3684
+ this.prepareData({...nextProps,force:true},(state)=>{
3685
+ console.log("setting state data",state,this.state);
3686
+ this.setState(state)
3687
+ })
3688
+ })
3689
+ },0);
3690
+ return;
3691
+ }
3679
3692
  const cb = ()=>{
3680
3693
  if(typeof nextProps.isLoading =='boolean' && nextProps.isLoading !== this.isLoading()){
3681
3694
  this.setIsLoading(nextProps.isLoading);
@@ -9,4 +9,6 @@ Les propriétés d'états :
9
9
  - Pour faire un affichage en graphique, il faut :
10
10
  1. grouper les éléments du tableau avec au moins une colonne
11
11
  2. disposer dans le tableau, des colonnes de totalisation (de type montant et somme)
12
- 3.
12
+ 3.
13
+
14
+ - Pour que le rendu du graphe soit possible, il faut que parmis les colones du datagrid, au moins une soit de type nombre
@@ -69,7 +69,6 @@ const DrawerNavigationViewComponent = React.forwardRef((props,ref)=>{
69
69
  </DrawerHeader> : null}
70
70
  {React.isValidElement(content)? content :
71
71
  <DrawerItems
72
- {...defaultObj(opts)}
73
72
  drawerRef = {drawerRef}
74
73
  {...defaultObj(drawerItemsProps)}
75
74
  items = {drawerItems}
@@ -369,6 +369,8 @@ const iconType = PropTypes.oneOfType([
369
369
 
370
370
  DrawerComponent.propTypes = {
371
371
  ...defaultObj(DrawerLayout.propTypes),
372
+ position : PropTypes.oneOf(Object.keys(DRAWER_POSITIONS)),
373
+ minimizable : PropTypes.bool,
372
374
  permanent : PropTypes.bool,
373
375
  minimized : PropTypes.bool,
374
376
  bindResizeEvent : PropTypes.bool,