@fto-consult/expo-ui 8.61.2 → 8.61.4
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": "8.61.
|
3
|
+
"version": "8.61.4",
|
4
4
|
"description": "Bibliothèque de composants UI Expo,react-native",
|
5
5
|
"react-native-paper-doc": "https://github.com/callstack/react-native-paper/tree/main/docs/docs/guides",
|
6
6
|
"scripts": {
|
@@ -325,6 +325,10 @@ export default class CommonDatagridComponent extends AppComponent {
|
|
325
325
|
}
|
326
326
|
const dType = defaultStr(this.getSessionData("displayType"),this.props.displayType,"table");
|
327
327
|
this.state.displayType = this.displayTypes[dType] ? this.displayTypes[dType].code : "table" in this.displayTypes ? "table" : Object.keys(this.displayTypes)[0]?.code;
|
328
|
+
if(!this.canRenderChart()){
|
329
|
+
this.state.displayType = "table";
|
330
|
+
this.persistDisplayType("table")
|
331
|
+
}
|
328
332
|
this.state.displayOnlySectionListHeaders = defaultBool(this.getSessionData("displayOnlySectionListHeaders"),this.props.displayOnlySectionListHeaders,false)
|
329
333
|
if(this.state.displayOnlySectionListHeaders){
|
330
334
|
this.state.showFooters = true;
|
@@ -1048,6 +1052,20 @@ export default class CommonDatagridComponent extends AppComponent {
|
|
1048
1052
|
})
|
1049
1053
|
}
|
1050
1054
|
});
|
1055
|
+
customMenu.push({
|
1056
|
+
icon : "bookmark-remove",
|
1057
|
+
text : "Supprimer les données de sessions",
|
1058
|
+
onPress : ()=>{
|
1059
|
+
this.resetSessionData();
|
1060
|
+
this.setIsLoading(true,()=>{
|
1061
|
+
this.setState({
|
1062
|
+
displayType : "table",
|
1063
|
+
},()=>{
|
1064
|
+
this.removeAllColumnsInSectionList();
|
1065
|
+
});
|
1066
|
+
});
|
1067
|
+
}
|
1068
|
+
});
|
1051
1069
|
return customMenu;
|
1052
1070
|
}
|
1053
1071
|
/*** aller à la dernière page */
|
@@ -1338,7 +1356,22 @@ export default class CommonDatagridComponent extends AppComponent {
|
|
1338
1356
|
return isNonNullString(config.x) && isNonNullString(config.y);
|
1339
1357
|
}
|
1340
1358
|
canRenderChart(){
|
1341
|
-
|
1359
|
+
if(!(this.isChartRendable() && isNonNullString(this.state.displayType) && displayTypes[this.state.displayType]?.isChart === true ? true : false)) return false;
|
1360
|
+
if(!this.isValidChartConfig()) return false;
|
1361
|
+
const chartType = displayTypes[this.state.displayType];
|
1362
|
+
if(!isObj(chartType) || !isNonNullString(chartType.type)) return false;
|
1363
|
+
if(typeof chartType.isRendable =='function' && chartType.isRendable(this.getChartIsRendableArgs()) === false) {
|
1364
|
+
//console.warn("impossible d'afficher le graphe de type ",chartType.label," car le type de données requis pour le rendu de ce graphe est invalide")
|
1365
|
+
return false;
|
1366
|
+
}
|
1367
|
+
if(isObj(this.state.columns)){
|
1368
|
+
const config = this.getConfig();
|
1369
|
+
if(!this.state.columns[config.y]) return false;
|
1370
|
+
const yAxisColumn = this.state.columns[config.y];
|
1371
|
+
const type = defaultStr(yAxisColumn.jsType,yAxisColumn.type).toLowerCase();
|
1372
|
+
if(type !== 'number'&& type !== 'decimal') return false;
|
1373
|
+
}
|
1374
|
+
return true;
|
1342
1375
|
}
|
1343
1376
|
persistDisplayType(displayType){
|
1344
1377
|
this.setSessionData("displayType",displayType);
|
@@ -2222,22 +2255,19 @@ export default class CommonDatagridComponent extends AppComponent {
|
|
2222
2255
|
/*** permet de formatter les valeurs de la courbe en fonction du type passé en paramètre */
|
2223
2256
|
chartValueFormattter(value,columnType){
|
2224
2257
|
|
2258
|
+
}
|
2259
|
+
returnNull(){
|
2260
|
+
setTimeout(()=>{
|
2261
|
+
this.onRender();
|
2262
|
+
},500);
|
2263
|
+
return null;
|
2225
2264
|
}
|
2226
2265
|
renderChart(){
|
2227
|
-
if(!this.canRenderChart()) return
|
2228
|
-
if(!this.isValidChartConfig()) return null;
|
2266
|
+
if(!this.canRenderChart()) return this.returnNull();
|
2229
2267
|
const chartType = displayTypes[this.state.displayType];
|
2230
|
-
if(!isObj(chartType) || !isNonNullString(chartType.type)) return null;
|
2231
|
-
if(typeof chartType.isRendable =='function' && chartType.isRendable(this.getChartIsRendableArgs()) === false) {
|
2232
|
-
//console.warn("impossible d'afficher le graphe de type ",chartType.label," car le type de données requis pour le rendu de ce graphe est invalide")
|
2233
|
-
return null;
|
2234
|
-
}
|
2235
2268
|
const isDonut = chartType.isDonut || chartType.isRadial;
|
2236
2269
|
const config = this.getConfig();
|
2237
|
-
if(!this.state.columns[config.y]) return null;
|
2238
2270
|
const yAxisColumn = this.state.columns[config.y];
|
2239
|
-
const type = defaultStr(yAxisColumn.jsType,yAxisColumn.type).toLowerCase();
|
2240
|
-
if(type !== 'number'&& type !== 'decimal') return null;
|
2241
2271
|
const isEmptyY = config.x === this.emptySectionListHeaderValue;
|
2242
2272
|
let seriesConfig = Array.isArray(config.series) && config.series.length ? config.series : [yAxisColumn.field];
|
2243
2273
|
const snConfig = [];
|
@@ -2249,7 +2279,7 @@ export default class CommonDatagridComponent extends AppComponent {
|
|
2249
2279
|
let xAxisColumn = null;
|
2250
2280
|
if(!isEmptyY){
|
2251
2281
|
if(!this.state.columns[config.x]){
|
2252
|
-
return
|
2282
|
+
return this.returnNull();
|
2253
2283
|
}
|
2254
2284
|
xAxisColumn = this.state.columns[config.x];
|
2255
2285
|
}
|
@@ -2315,7 +2345,7 @@ export default class CommonDatagridComponent extends AppComponent {
|
|
2315
2345
|
xaxis = isObj(customXaxis)? customXaxis : xaxis;
|
2316
2346
|
customConfig = rest;
|
2317
2347
|
} else {
|
2318
|
-
return
|
2348
|
+
return this.returnNull();
|
2319
2349
|
}
|
2320
2350
|
}
|
2321
2351
|
customConfig = defaultObj(customConfig);
|
@@ -317,7 +317,7 @@ const SimpleSelect = React.forwardRef((props,ref)=>{
|
|
317
317
|
testID={testID+"_Container"}
|
318
318
|
{...contentContainerProps}
|
319
319
|
style={[{
|
320
|
-
paddingHorizontal :
|
320
|
+
paddingHorizontal : 0,
|
321
321
|
paddingVertical:0,
|
322
322
|
height : !isMob?contentContainerHeight:'90%',
|
323
323
|
width : !isMob ? Math.max(layout.width,180) : undefined,
|
@@ -391,6 +391,7 @@ const SimpleSelect = React.forwardRef((props,ref)=>{
|
|
391
391
|
width : "100%",
|
392
392
|
fontWeight : isSelected ? 'bold' : 'normal',
|
393
393
|
alignItems: "center",
|
394
|
+
paddingHorizontal : 10,
|
394
395
|
}}
|
395
396
|
onPress={(e) => {
|
396
397
|
React.stopEventPropagation(e);
|