@fto-consult/expo-ui 7.15.1 → 7.16.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.
package/package.json
CHANGED
@@ -186,11 +186,14 @@ export default class CommonDatagridComponent extends AppComponent {
|
|
186
186
|
SET_DATAGRID_QUERY_LIMIT : this.onSetQueryLimit.bind(this),
|
187
187
|
});
|
188
188
|
}
|
189
|
+
if(this.props.resetSessionData === true){
|
190
|
+
this.resetSessionData();
|
191
|
+
}
|
189
192
|
rest = defaultObj(rest);
|
190
193
|
this._pagination = defaultObj(rest.pagination);
|
191
194
|
this.hasLocalFilters = false;
|
192
195
|
data = (data && typeof data == 'object')? Object.toArray(data):[];
|
193
|
-
|
196
|
+
const sData = this.getSessionData()
|
194
197
|
sData.showFooters = defaultVal(sData.showFooters,this.isTableData());
|
195
198
|
sData.fixedTable = defaultBool(sData.fixedTable,false);
|
196
199
|
this.rowsByKeys = {};
|
@@ -274,14 +277,15 @@ export default class CommonDatagridComponent extends AppComponent {
|
|
274
277
|
chartSeriesNamesColumnsMapping : {value : {}},//le mappage entre les index des series et les colonnes coorespondantes
|
275
278
|
});
|
276
279
|
this.setSelectedRows(selectedRows);
|
277
|
-
const config = extendObj(true,{},this.getSessionData("config")
|
280
|
+
const config = extendObj(true,{},this.props.chartConfig,this.getSessionData("config"));
|
278
281
|
Object.map(config,(v,k)=>{
|
279
282
|
if(typeof v =='function'){
|
280
283
|
delete config[k];
|
281
284
|
}
|
282
285
|
});
|
283
286
|
this.state.fetchOnlyVisibleColumns = !!defaultVal(this.props.fetchOnlyVisibleColumns,config.fetchOnlyVisibleColumns,this.getSessionData("fetchOnlyVisibleColumns"));
|
284
|
-
|
287
|
+
const abreviateVals = this.getSessionData("abreviateValues");
|
288
|
+
this.state.abreviateValues = abreviateVals !== undefined ? !!abreviateVals : "abreviateValues" in this.props? !!this.props.abreviateValues : true;
|
285
289
|
const sessionAggregator = this.getSessionData("aggregatorFunction");
|
286
290
|
this.state.aggregatorFunction= this.isValidAggregator(config.aggregatorFunction) && config.aggregatorFunction || this.isValidAggregator(this.props.aggregatorFunction) && this.props.aggregatorFunction || this.isValidAggregator(sessionAggregator) && sessionAggregator || Object.keys(this.aggregatorFunctions)[0];;
|
287
291
|
this.isLoading = this.isLoading.bind(this);
|
@@ -433,10 +437,14 @@ export default class CommonDatagridComponent extends AppComponent {
|
|
433
437
|
}
|
434
438
|
},
|
435
439
|
setSessionData : {
|
436
|
-
value : (sessionKey,sessionValue)=>{
|
440
|
+
value : (sessionKey,sessionValue,reset)=>{
|
437
441
|
if(this.props.session === false) return;
|
438
442
|
let key = this.getSessionKey();
|
439
443
|
if(!isNonNullString(key)) return false;
|
444
|
+
if(reset === true){
|
445
|
+
$session.set(key,{});
|
446
|
+
return {};
|
447
|
+
}
|
440
448
|
let dat = defaultObj(this.getSessionData());
|
441
449
|
if(isNonNullString(sessionKey)){
|
442
450
|
dat[sessionKey] = sessionValue;
|
@@ -451,6 +459,9 @@ export default class CommonDatagridComponent extends AppComponent {
|
|
451
459
|
}
|
452
460
|
})
|
453
461
|
}
|
462
|
+
resetSessionData(){
|
463
|
+
return this.setSessionData(null,null,true);
|
464
|
+
}
|
454
465
|
/*** lorsque les filtres locaux changes */
|
455
466
|
onLocalFiltersChange(localFilters){
|
456
467
|
return;
|
@@ -1609,12 +1620,18 @@ export default class CommonDatagridComponent extends AppComponent {
|
|
1609
1620
|
text : "Largeur du graphe",
|
1610
1621
|
tooltip : "Définissez la valeur 0 si vous voulez que le graphe occupe toute la largeur de con contenueur",
|
1611
1622
|
defaultValue : this.getDefaultChartWidth(),
|
1623
|
+
formatValue : ({value})=>{
|
1624
|
+
return value.formatNumber()+" px";
|
1625
|
+
},
|
1612
1626
|
},
|
1613
1627
|
height : {
|
1614
1628
|
type : "number",
|
1615
1629
|
text : "Hauteur du graphe",
|
1616
1630
|
validType : "numberGreaterThan[0]",
|
1617
1631
|
defaultValue : this.getDefaultChartHeight(),
|
1632
|
+
formatValue : ({value})=>{
|
1633
|
+
return value.formatNumber()+" px";
|
1634
|
+
},
|
1618
1635
|
},
|
1619
1636
|
stacked : stackSettings,
|
1620
1637
|
sparkline : {
|
@@ -4164,6 +4181,7 @@ CommonDatagridComponent.propTypes = {
|
|
4164
4181
|
aggregatorFunction : PropTypes.string,
|
4165
4182
|
/*** permet de faire une mutation sur les options de la recherche, immédiatement avant le lancement de la recherche */
|
4166
4183
|
fetchOptionsMutator : PropTypes.func,
|
4184
|
+
resetSessionData : PropTypes.bool, //pour forcer la réinitialisation des données de sessions liés à la table data
|
4167
4185
|
/*** si les données à récupérer à distance seront */
|
4168
4186
|
fetchOnlyVisibleColumns : PropTypes.bool,
|
4169
4187
|
canFetchOnlyVisibleColumns : PropTypes.bool,//si l'on peut modifier le type d'affichage lié à la possibilité de récupérer uniquement les données reletives aux colonnes visibles
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import {TableData} from "../Common";
|
2
|
-
import {defaultObj,defaultArray,defaultStr,
|
2
|
+
import {defaultObj,defaultArray,defaultStr,defaultNumber} from "$cutils";
|
3
3
|
import View from "$ecomponents/View";
|
4
4
|
import { StyleSheet,Dimensions,Pressable } from "react-native";
|
5
5
|
import Icon,{MENU_ICON} from "$ecomponents/Icon";
|
@@ -96,8 +96,9 @@ export default class DatagridDashboard extends TableData {
|
|
96
96
|
testID = this.getTestID();
|
97
97
|
rest = defaultObj(rest);
|
98
98
|
const pointerEvents = this.getPointerEvents();
|
99
|
-
const maxHeight = 300;
|
100
99
|
const chartData = this.renderChart();
|
100
|
+
const max = defaultNumber(chartData?.props?.options?.chart?.height);
|
101
|
+
const maxHeight = Math.max(300,max+80);
|
101
102
|
return <View {...rest} testID={testID} style={[styles.container,{maxHeight},rest.style]} pointerEvents={pointerEvents}>
|
102
103
|
{this.renderTitle()}
|
103
104
|
{showPagination ? <View style={[styles.paginationContainer]}>
|