@fto-consult/expo-ui 2.18.3 → 2.18.5
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 +1 -1
- package/src/components/Datagrid/Accordion/index.js +4 -9
- package/src/components/Datagrid/Common/Common.js +98 -37
- package/src/components/Datagrid/RenderType.js +1 -1
- package/src/components/Datagrid/RenderTypes/index.web.js +1 -1
- package/src/components/Datagrid/SWRDatagrid.js +4 -0
- package/src/components/Datagrid/Table/index.js +23 -12
- package/src/components/List/FlashList.js +2 -2
- package/src/components/Table/index.js +5 -1
package/package.json
CHANGED
|
@@ -317,7 +317,7 @@ const DatagridFactory = (Factory)=>{
|
|
|
317
317
|
}
|
|
318
318
|
render (){
|
|
319
319
|
let {
|
|
320
|
-
filters,
|
|
320
|
+
filters:customFilters,
|
|
321
321
|
filter,
|
|
322
322
|
actions,
|
|
323
323
|
sortable,
|
|
@@ -396,10 +396,6 @@ const DatagridFactory = (Factory)=>{
|
|
|
396
396
|
let exportTableProps = this.getExportableProps();
|
|
397
397
|
|
|
398
398
|
filter = defaultFunc(filter,x=>true);
|
|
399
|
-
filters = defaultVal(filters,true);
|
|
400
|
-
if(toggleFilters === false){
|
|
401
|
-
filters = false;
|
|
402
|
-
}
|
|
403
399
|
let {showFilters,showFooters} = this.state;
|
|
404
400
|
let max = this.getMaxSelectableRows();
|
|
405
401
|
let restItems = [];
|
|
@@ -429,8 +425,7 @@ const DatagridFactory = (Factory)=>{
|
|
|
429
425
|
this.renderedListHeight = Math.max(300,containerHeight - (this.hasScrollViewParent() ? 50:0));
|
|
430
426
|
const isLoading = this.isLoading();
|
|
431
427
|
const _progressBar = this.getProgressBar();
|
|
432
|
-
const pointerEvents =
|
|
433
|
-
|
|
428
|
+
const pointerEvents = this.getPointerEvents();
|
|
434
429
|
const {
|
|
435
430
|
sortedColumns:sortColumns,
|
|
436
431
|
sortedColumnsLength,
|
|
@@ -486,7 +481,7 @@ const DatagridFactory = (Factory)=>{
|
|
|
486
481
|
}}
|
|
487
482
|
/>
|
|
488
483
|
</View> : null}
|
|
489
|
-
{
|
|
484
|
+
{this.isFilterable() && showFilters ? <View>
|
|
490
485
|
<FiltersAccordionComponent
|
|
491
486
|
testID={testID+"_HeaderFilters"}
|
|
492
487
|
isLoading = {isLoading}
|
|
@@ -516,7 +511,7 @@ const DatagridFactory = (Factory)=>{
|
|
|
516
511
|
closeOnPress : false,
|
|
517
512
|
} : null,
|
|
518
513
|
hasFooterFields ? {
|
|
519
|
-
onPress : ()=>{
|
|
514
|
+
onPress : ()=>{this.toggleFooters(!showFooters)}
|
|
520
515
|
,icon : showFooters?'view-column':'view-module'
|
|
521
516
|
,text : (showFooters?'Masquer/Ligne des totaux':'Afficher/Ligne des totaux')
|
|
522
517
|
}:null,
|
|
@@ -76,11 +76,11 @@ export default class CommonDatagridComponent extends AppComponent {
|
|
|
76
76
|
});
|
|
77
77
|
selectedRows = sRows;
|
|
78
78
|
let sData = this.getSessionData()
|
|
79
|
-
sData.showFooters = defaultVal(sData.showFooters,
|
|
79
|
+
sData.showFooters = defaultVal(sData.showFooters,this.isTableData());
|
|
80
80
|
sData.fixedTable = defaultBool(sData.fixedTable,false);
|
|
81
81
|
extendObj(this.state, {
|
|
82
82
|
data,
|
|
83
|
-
showFilters : defaultBool(props.showFilters,(sData.showFilter? true : this.isPivotDatagrid())),
|
|
83
|
+
showFilters : this.isFilterable() && defaultBool(props.showFilters,(sData.showFilter? true : this.isPivotDatagrid())) || false,
|
|
84
84
|
showFooters : defaultBool(props.showFooters,(sData.showFooters? true : false)),
|
|
85
85
|
fixedTable : sData.fixedTable
|
|
86
86
|
});
|
|
@@ -116,6 +116,7 @@ export default class CommonDatagridComponent extends AppComponent {
|
|
|
116
116
|
hasFoundSectionData : {value : {current: false}},
|
|
117
117
|
sectionListHeaderFooters : {value : {}},
|
|
118
118
|
sectionListDataSize : {value : {current : 0}},
|
|
119
|
+
enablePointerEventsRef : {value : {current:false}},
|
|
119
120
|
sectionListColumnsSize : {value : {current:0}}, //la taille du nombre d'éléments de section dans les colonnes
|
|
120
121
|
})
|
|
121
122
|
this.isLoading = this.isLoading.bind(this);
|
|
@@ -874,9 +875,11 @@ export default class CommonDatagridComponent extends AppComponent {
|
|
|
874
875
|
value = defaultDecimal(value);
|
|
875
876
|
this.handlePagination(0, value, 1);
|
|
876
877
|
};
|
|
877
|
-
|
|
878
|
+
isFilterable(){
|
|
879
|
+
return this.props.filterable !== false && this.props.filters !== false ? true : false;
|
|
880
|
+
}
|
|
878
881
|
showFilters(){
|
|
879
|
-
if(!this._isMounted()) {
|
|
882
|
+
if(!this._isMounted() || !this.isFilterable()) {
|
|
880
883
|
this.isUpdating = false;
|
|
881
884
|
return;
|
|
882
885
|
}
|
|
@@ -888,7 +891,7 @@ export default class CommonDatagridComponent extends AppComponent {
|
|
|
888
891
|
})
|
|
889
892
|
}
|
|
890
893
|
hideFilters (){
|
|
891
|
-
if(!this._isMounted()) {
|
|
894
|
+
if(!this._isMounted() || !this.isFilterable()) {
|
|
892
895
|
this.isUpdating = false;
|
|
893
896
|
return;
|
|
894
897
|
}
|
|
@@ -899,33 +902,42 @@ export default class CommonDatagridComponent extends AppComponent {
|
|
|
899
902
|
})
|
|
900
903
|
}
|
|
901
904
|
|
|
902
|
-
|
|
903
|
-
|
|
905
|
+
toggleFooters(showOrHide){
|
|
906
|
+
if(typeof showOrHide !=='boolean' || this.state.showFooters === showOrHide) return;
|
|
904
907
|
if(!this._isMounted()) {
|
|
905
908
|
this.isUpdating = false;
|
|
906
909
|
return;
|
|
907
910
|
}
|
|
908
911
|
if(this.isUpdating) return false;
|
|
909
912
|
this.isUpdating = true;
|
|
910
|
-
|
|
911
|
-
this.
|
|
912
|
-
|
|
913
|
-
|
|
913
|
+
setTimeout(()=>{
|
|
914
|
+
if(this.hasSectionListData() && this.getSectionListDataSize()){
|
|
915
|
+
return this.setIsLoading(true,()=>{
|
|
916
|
+
this.prepareData({data:this.INITIAL_STATE.data},(state)=>{
|
|
917
|
+
this.setState({...state,showFooters:showOrHide},()=>{
|
|
918
|
+
this.setIsLoading(false,false);
|
|
919
|
+
this.isUpdating = false;
|
|
920
|
+
this.setSessionData({showFooters:showOrHide});
|
|
921
|
+
})
|
|
922
|
+
})
|
|
923
|
+
},true)
|
|
924
|
+
}
|
|
925
|
+
this.setState( {showFooters:showOrHide},()=>{
|
|
926
|
+
this.isUpdating = false;
|
|
927
|
+
this.setSessionData({showFooters:showOrHide})
|
|
928
|
+
})
|
|
929
|
+
},200)
|
|
930
|
+
}
|
|
931
|
+
showFooters(){
|
|
932
|
+
return this.toggleFooters(true);
|
|
933
|
+
}
|
|
934
|
+
hideFooters (){
|
|
935
|
+
return this.toggleFooters(false);
|
|
914
936
|
}
|
|
915
937
|
setState(a,b){
|
|
916
938
|
super.setState(a,b);
|
|
917
939
|
}
|
|
918
|
-
|
|
919
|
-
if(!this._isMounted()) {
|
|
920
|
-
this.isUpdating = false;
|
|
921
|
-
return;
|
|
922
|
-
}
|
|
923
|
-
if(this.isUpdating) return false;
|
|
924
|
-
this.setState({showFooters:false},()=>{
|
|
925
|
-
this.isUpdating = false;
|
|
926
|
-
this.setSessionData({showFooters:false});
|
|
927
|
-
})
|
|
928
|
-
}
|
|
940
|
+
|
|
929
941
|
|
|
930
942
|
toggleFixedTableState(){
|
|
931
943
|
const fixedTable = !this.state.fixedTable;
|
|
@@ -993,19 +1005,23 @@ export default class CommonDatagridComponent extends AppComponent {
|
|
|
993
1005
|
sectionListColumns[columnName] = {};
|
|
994
1006
|
}
|
|
995
1007
|
const {sectionListColumns:pSListColumns} = this.prepareColumns({sectionListColumns});
|
|
996
|
-
this.
|
|
997
|
-
this.
|
|
998
|
-
this.
|
|
1008
|
+
this.setIsLoading(true,()=>{
|
|
1009
|
+
this.prepareData({data:this.INITIAL_STATE.data,sectionListColumns:pSListColumns},(state)=>{
|
|
1010
|
+
this.setState({...state,sectionListColumns:pSListColumns},()=>{
|
|
1011
|
+
this.setIsLoading(false,false);
|
|
1012
|
+
});
|
|
999
1013
|
});
|
|
1000
|
-
});
|
|
1014
|
+
},true);
|
|
1001
1015
|
}
|
|
1002
1016
|
removeAllColumnsInSectionList(){
|
|
1003
1017
|
const {sectionListColumns} = this.prepareColumns({sectionListColumns:{}});
|
|
1004
|
-
this.
|
|
1005
|
-
this.
|
|
1006
|
-
this.
|
|
1018
|
+
this.setIsLoading(true,()=>{
|
|
1019
|
+
this.prepareData({data:this.INITIAL_STATE.data,sectionListColumns},(state)=>{
|
|
1020
|
+
this.setState({...state,sectionListColumns},()=>{
|
|
1021
|
+
this.setIsLoading(false,false);
|
|
1022
|
+
});
|
|
1007
1023
|
});
|
|
1008
|
-
});
|
|
1024
|
+
},true);
|
|
1009
1025
|
}
|
|
1010
1026
|
/*** permet d'effectuer le rendu des colonnes groupable dans le menu item */
|
|
1011
1027
|
renderSectionListMenu(){
|
|
@@ -1470,7 +1486,7 @@ export default class CommonDatagridComponent extends AppComponent {
|
|
|
1470
1486
|
}
|
|
1471
1487
|
}
|
|
1472
1488
|
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]}>
|
|
1473
|
-
<Label testID={testID+"_Label"} splitText numberOfLines={3} textBold style={[theme.styles.w100,lStyle]}>{label}</Label>
|
|
1489
|
+
<Label testID={testID+"_Label"} splitText numberOfLines={3} textBold style={[theme.styles.w100,{color:theme.colors.primaryOnSurface,fontSize:16},lStyle]}>{label}</Label>
|
|
1474
1490
|
{cells ? <View style = {[theme.styles.w100,theme.styles.row,theme.styles.alignItemsFlexStart]}
|
|
1475
1491
|
>{cells}</View> : null}
|
|
1476
1492
|
</View>
|
|
@@ -1627,6 +1643,22 @@ export default class CommonDatagridComponent extends AppComponent {
|
|
|
1627
1643
|
}
|
|
1628
1644
|
beforeFetchData(){}
|
|
1629
1645
|
fetchData({fetchOptions}){
|
|
1646
|
+
if(typeof this.props.fetchData =='function'){
|
|
1647
|
+
const r = this.props.fetchData(fetchOptions);
|
|
1648
|
+
if(isPromise(r)){
|
|
1649
|
+
return r.then((data)=>{
|
|
1650
|
+
if(isObjOrArray(data)){
|
|
1651
|
+
this.setIsLoading(true,()=>{
|
|
1652
|
+
this.prepareData({data},(state)=>{
|
|
1653
|
+
this.setState(state,()=>{
|
|
1654
|
+
this.setIsLoading(false,false);
|
|
1655
|
+
})
|
|
1656
|
+
})
|
|
1657
|
+
},true)
|
|
1658
|
+
}
|
|
1659
|
+
})
|
|
1660
|
+
}
|
|
1661
|
+
}
|
|
1630
1662
|
return Promise.resolve(this.state.data);
|
|
1631
1663
|
}
|
|
1632
1664
|
/**** Filtre le tableau */
|
|
@@ -1728,6 +1760,9 @@ export default class CommonDatagridComponent extends AppComponent {
|
|
|
1728
1760
|
if(isFunction(cb)){
|
|
1729
1761
|
cb(data);
|
|
1730
1762
|
}
|
|
1763
|
+
if(typeof this.props.onRefreshDatagrid ==='function'){
|
|
1764
|
+
this.props.onRefreshDatagrid({context:this,force});
|
|
1765
|
+
}
|
|
1731
1766
|
})
|
|
1732
1767
|
}
|
|
1733
1768
|
onResizePage(){}
|
|
@@ -1782,7 +1817,20 @@ export default class CommonDatagridComponent extends AppComponent {
|
|
|
1782
1817
|
canSetIsLoading(){
|
|
1783
1818
|
return isObj(this.progressBarRef.current) && typeof this.progressBarRef.current.setIsLoading =='function' ? true : false;
|
|
1784
1819
|
}
|
|
1785
|
-
|
|
1820
|
+
/***
|
|
1821
|
+
* @param {boolean} loading
|
|
1822
|
+
* @param {function | boolean} cb | enablePointerEvents
|
|
1823
|
+
* @param {boolean|function} enablePointerEvents
|
|
1824
|
+
*/
|
|
1825
|
+
setIsLoading(loading,cb,enablePointerEvents){
|
|
1826
|
+
if(typeof cb =='boolean'){
|
|
1827
|
+
const t = enablePointerEvents;
|
|
1828
|
+
enablePointerEvents = cb;
|
|
1829
|
+
cb = t;
|
|
1830
|
+
}
|
|
1831
|
+
if(typeof enablePointerEvents =='boolean'){
|
|
1832
|
+
this.enablePointerEventsRef.current = enablePointerEvents;
|
|
1833
|
+
}
|
|
1786
1834
|
if(this.canSetIsLoading() && typeof loading =='boolean'){
|
|
1787
1835
|
return this.progressBarRef.current.setIsLoading(loading,()=>{
|
|
1788
1836
|
if(typeof cb =='function'){
|
|
@@ -1839,6 +1887,13 @@ export default class CommonDatagridComponent extends AppComponent {
|
|
|
1839
1887
|
layout,
|
|
1840
1888
|
}
|
|
1841
1889
|
}
|
|
1890
|
+
getPointerEvents(){
|
|
1891
|
+
if(this.props.isLoading){
|
|
1892
|
+
return "none";
|
|
1893
|
+
}
|
|
1894
|
+
if(this.enablePointerEventsRef.current) return true;
|
|
1895
|
+
return this.isLoading()? "none":"auto";
|
|
1896
|
+
}
|
|
1842
1897
|
updateLayout(p){
|
|
1843
1898
|
this.measureLayout(state=>{
|
|
1844
1899
|
if(isObj(state)){
|
|
@@ -1859,9 +1914,13 @@ export default class CommonDatagridComponent extends AppComponent {
|
|
|
1859
1914
|
}
|
|
1860
1915
|
return false;
|
|
1861
1916
|
}
|
|
1862
|
-
this.
|
|
1863
|
-
this.
|
|
1864
|
-
|
|
1917
|
+
this.setIsLoading(true,()=>{
|
|
1918
|
+
this.prepareData({...nextProps,force:true},(state)=>{
|
|
1919
|
+
this.setState(state,()=>{
|
|
1920
|
+
this.setIsLoading(false,false);
|
|
1921
|
+
})
|
|
1922
|
+
});
|
|
1923
|
+
},true);
|
|
1865
1924
|
}
|
|
1866
1925
|
getDefaultPreloader(props){
|
|
1867
1926
|
return CommonDatagridComponent.getDefaultPreloader();
|
|
@@ -2008,10 +2067,10 @@ export default class CommonDatagridComponent extends AppComponent {
|
|
|
2008
2067
|
_render = <Hashtag>{_render}</Hashtag>
|
|
2009
2068
|
} else if(typeof columnDef.render === "function"){
|
|
2010
2069
|
_render = columnDef.render.call(this,renderArgs);
|
|
2011
|
-
} else if(arrayValueExists( _type,["date","datetime","time"])
|
|
2070
|
+
} else if(arrayValueExists( _type,["date","datetime","time"])){
|
|
2012
2071
|
let _dd =DateLib.parse(rowData[columnField],_type === 'time'?DateLib.isoTimeFormat:DateLib.SQLDateFormat);
|
|
2013
2072
|
if(DateLib.isDateObj(_dd)){
|
|
2014
|
-
_render = DateLib.format(_dd,(_type === 'time'?DateLib.defaultTimeFormat:DateLib.masks.defaultDate));
|
|
2073
|
+
_render = DateLib.format(_dd,defaultStr(columnDef.format,(_type === 'time'?DateLib.defaultTimeFormat:DateLib.masks.defaultDate)));
|
|
2015
2074
|
}
|
|
2016
2075
|
if(!_render) _render = rowData[columnField]
|
|
2017
2076
|
} else if(arrayValueExists(_type,['switch','checkbox'])){
|
|
@@ -2174,6 +2233,7 @@ CommonDatagridComponent.propTypes = {
|
|
|
2174
2233
|
PropTypes.object,
|
|
2175
2234
|
PropTypes.func,
|
|
2176
2235
|
]),
|
|
2236
|
+
filterable : PropTypes.bool, //si le composant peut être filtrable
|
|
2177
2237
|
/*** si les filtres de données seront convertis au format SQL avant d'effectuer la requête distante */
|
|
2178
2238
|
convertFiltersToSQL : PropTypes.bool,
|
|
2179
2239
|
isLoading : PropTypes.bool,///si les données sont en train d'être chargées
|
|
@@ -2297,6 +2357,7 @@ CommonDatagridComponent.propTypes = {
|
|
|
2297
2357
|
///pour l'affichage où non des filtres
|
|
2298
2358
|
toggleFilters : PropTypes.bool,
|
|
2299
2359
|
desktop: PropTypes.bool,
|
|
2360
|
+
onRefreshDatagrid : PropTypes.func,//lorsque le datagrid est actualisé, rafraichir
|
|
2300
2361
|
///les props à apppliquer à l'accordion
|
|
2301
2362
|
/**** l'accordion peut rendre un objet ou un objet react ou null
|
|
2302
2363
|
* si c'est un objet, alors il peut être de la forme :
|
|
@@ -18,7 +18,7 @@ const DatagridRenderTypeComponent = (props)=>{
|
|
|
18
18
|
let type = defaultStr(get(typeKey),isDesk? "fixed":'accordion').toLowerCase().trim();
|
|
19
19
|
const rTypes = [
|
|
20
20
|
{...getActiveProps(type,'accordion'),tooltip:"Les éléments de liste s'affichent de manière optimisé pour téléphone mobile",code:'accordion',icon:accordionIcon,label:'Mobile',labelText:'environnement optimisé pour téléphone mobile'},
|
|
21
|
-
{...getActiveProps(type,'table'),tooltip:"Les éléments de listes s'affichent dans un tableau rééel",code:'table',icon:tableIcon,label:'Tableau réel avec pagination'}
|
|
21
|
+
//{...getActiveProps(type,'table'),tooltip:"Les éléments de listes s'affichent dans un tableau rééel",code:'table',icon:tableIcon,label:'Tableau réel avec pagination'}
|
|
22
22
|
]
|
|
23
23
|
Object.map(rendersTypes,(t,i)=>{
|
|
24
24
|
if(isObj(t)){
|
|
@@ -84,6 +84,7 @@ const SWRDatagridComponent = React.forwardRef((props,ref)=>{
|
|
|
84
84
|
testID,
|
|
85
85
|
autoSort,
|
|
86
86
|
handleQueryLimit,
|
|
87
|
+
onFetchData,
|
|
87
88
|
...rest
|
|
88
89
|
} = props;
|
|
89
90
|
rest = defaultObj(rest);
|
|
@@ -166,6 +167,9 @@ const SWRDatagridComponent = React.forwardRef((props,ref)=>{
|
|
|
166
167
|
*/
|
|
167
168
|
dataRef.current = data;
|
|
168
169
|
hasResultRef.current = true;
|
|
170
|
+
if(onFetchData && typeof onFetchData =='function'){
|
|
171
|
+
onFetchData({allData:data,total,data,context:innerRef.current})
|
|
172
|
+
}
|
|
169
173
|
return data;
|
|
170
174
|
};
|
|
171
175
|
hasResultRef.current = false;
|
|
@@ -82,10 +82,6 @@ const DatagridFactory = (Factory)=>{
|
|
|
82
82
|
}
|
|
83
83
|
return null;
|
|
84
84
|
}
|
|
85
|
-
updateLayout(e){
|
|
86
|
-
if(this.state.fixedTable === false) return;
|
|
87
|
-
return super.updateLayout(e);
|
|
88
|
-
}
|
|
89
85
|
scrollToEnd(){
|
|
90
86
|
if(!this.canScrollTo()) return;
|
|
91
87
|
if(this.listRef.current && this.listRef.current.scrollToEnd){
|
|
@@ -163,10 +159,9 @@ const DatagridFactory = (Factory)=>{
|
|
|
163
159
|
const {visibleColumns} = this.preparedColumns;
|
|
164
160
|
const hasFooterFields = this.hasFooterFields();
|
|
165
161
|
const {columnsWidths:widths,showFilters,showFooters} = this.state;
|
|
166
|
-
let isAllRowsSelected = this.isAllRowsSelected();
|
|
167
162
|
const isLoading = this.isLoading();
|
|
168
163
|
let _progressBar = this.getProgressBar();
|
|
169
|
-
const pointerEvents =
|
|
164
|
+
const pointerEvents = this.getPointerEvents();
|
|
170
165
|
|
|
171
166
|
let restItems = [...this.renderCustomMenu()];
|
|
172
167
|
let max = this.getMaxSelectableRows();
|
|
@@ -189,7 +184,17 @@ const DatagridFactory = (Factory)=>{
|
|
|
189
184
|
}] : [])
|
|
190
185
|
]
|
|
191
186
|
}
|
|
192
|
-
const {width,height} = Dimensions.get("window");
|
|
187
|
+
const {width,height:winheight} = Dimensions.get("window");
|
|
188
|
+
const {layout} = this.state;
|
|
189
|
+
let maxHeight = winheight-100;
|
|
190
|
+
if(layout && typeof layout.windowHeight =='number' && layout.windowHeight){
|
|
191
|
+
const diff = winheight - Math.max(defaultNumber(layout.y,layout.top),150);
|
|
192
|
+
if(winheight<=300){
|
|
193
|
+
maxHeight = 300;
|
|
194
|
+
} else {
|
|
195
|
+
maxHeight = diff;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
193
198
|
const rPagination = showPagination ? <View style={[styles.paginationContainer]}>
|
|
194
199
|
<ScrollView horizontal showsHorizontalScrollIndicator={!isLoading} style={styles.paginationContainerStyle} contentContainerStyle={styles.minW100}>
|
|
195
200
|
<View style={[styles.paginationContent]}>
|
|
@@ -201,7 +206,7 @@ const DatagridFactory = (Factory)=>{
|
|
|
201
206
|
<Button normal style={[styles.paginationItem]} icon = {"refresh"} onPress = {this.refresh.bind(this)}>
|
|
202
207
|
Rafraichir
|
|
203
208
|
</Button>
|
|
204
|
-
{
|
|
209
|
+
{this.isFilterable() && (
|
|
205
210
|
<Button
|
|
206
211
|
normal
|
|
207
212
|
style={styles.paginationItem}
|
|
@@ -214,7 +219,7 @@ const DatagridFactory = (Factory)=>{
|
|
|
214
219
|
{hasFooterFields ? <Button
|
|
215
220
|
normal
|
|
216
221
|
style={styles.paginationItem}
|
|
217
|
-
onPress = {()=>{
|
|
222
|
+
onPress = {()=>{this.toggleFooters(!showFooters)} }
|
|
218
223
|
icon = {showFooters?'view-column':'view-module'}
|
|
219
224
|
>
|
|
220
225
|
{showFooters?'Masquer/Ligne des totaux':'Afficher/Ligne des totaux'}
|
|
@@ -264,13 +269,13 @@ const DatagridFactory = (Factory)=>{
|
|
|
264
269
|
closeOnPress : false,
|
|
265
270
|
items : visibleColumns
|
|
266
271
|
},
|
|
267
|
-
isMobile &&
|
|
272
|
+
isMobile && this.isFilterable() ?{
|
|
268
273
|
onPress : ()=>{showFilters?this.hideFilters():this.showFilters()}
|
|
269
274
|
,icon : showFilters?'eye-off':'eye'
|
|
270
275
|
,text : (showFilters?'Masquer/Filtres':'Afficher/Filtres')
|
|
271
276
|
} : null,
|
|
272
277
|
isMobile && hasFooterFields?{
|
|
273
|
-
onPress : ()=>{
|
|
278
|
+
onPress : ()=>{this.toggleFooters(!showFooters)}
|
|
274
279
|
,icon : showFooters?'view-column':'view-module'
|
|
275
280
|
,text : (showFooters?'Masquer/Ligne des totaux':'Afficher/Ligne des totaux')
|
|
276
281
|
} : null,
|
|
@@ -307,7 +312,7 @@ const DatagridFactory = (Factory)=>{
|
|
|
307
312
|
</View>
|
|
308
313
|
</ScrollView>
|
|
309
314
|
</View> : null;
|
|
310
|
-
return <View style={[styles.container,{maxHeight
|
|
315
|
+
return <View style={[styles.container,{maxHeight}]} pointerEvents={pointerEvents}>
|
|
311
316
|
<View ref={this.layoutRef}>
|
|
312
317
|
{this.props.showActions !== false ? <DatagridActions
|
|
313
318
|
pointerEvents = {pointerEvents}
|
|
@@ -323,6 +328,12 @@ const DatagridFactory = (Factory)=>{
|
|
|
323
328
|
<Table
|
|
324
329
|
ref = {this.listRef}
|
|
325
330
|
{...rest}
|
|
331
|
+
onLayout = {(args)=>{
|
|
332
|
+
if(rest.onLayout){
|
|
333
|
+
rest.onLayout(args);
|
|
334
|
+
}
|
|
335
|
+
this.updateLayout(args);
|
|
336
|
+
}}
|
|
326
337
|
getItemType = {this.getFlashListItemType.bind(this)}
|
|
327
338
|
renderItem = {this.renderFlashListItem.bind(this)}
|
|
328
339
|
hasFooters = {hasFooterFields}
|
|
@@ -12,8 +12,8 @@ const FlashListComponent = React.forwardRef((props,ref)=>{
|
|
|
12
12
|
ListHeaderComponent={() => (
|
|
13
13
|
<View testID={(testID||'RN_FlashListComponent')+"_Header"}>{props.children}</View>
|
|
14
14
|
)}
|
|
15
|
-
disableAutoLayout
|
|
16
|
-
disableHorizontalListHeightMeasurement = {props.horizontal?undefined : true}
|
|
15
|
+
//disableAutoLayout
|
|
16
|
+
//disableHorizontalListHeightMeasurement = {props.horizontal?undefined : true}
|
|
17
17
|
{...props}
|
|
18
18
|
contentContainerStyle = {undefined}
|
|
19
19
|
style = {undefined}
|
|
@@ -250,9 +250,13 @@ const TableComponent = React.forwardRef(({containerProps,renderEmpty,renderItem,
|
|
|
250
250
|
absoluteScrollViewRef.current.checkVisibility(nativeEvent);
|
|
251
251
|
}
|
|
252
252
|
})}
|
|
253
|
-
onLayout={(
|
|
253
|
+
onLayout={(args) => {
|
|
254
|
+
const {nativeEvent:{layout}} = args;
|
|
254
255
|
scrollViewLayoutRef.current.layout = layout;
|
|
255
256
|
toggleAbsoluteScrollVisible();
|
|
257
|
+
if(typeof props.onContainerLayout =='function'){
|
|
258
|
+
props.onContainerLayout(args);
|
|
259
|
+
}
|
|
256
260
|
}}
|
|
257
261
|
ref={scrollViewRef}
|
|
258
262
|
testID={testID+"_ScrollView"}
|