@fto-consult/expo-ui 2.21.2 → 2.22.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/appConfig.txt +11 -0
- package/package.json +2 -2
- package/src/components/Chart/appexChart/index.js +3 -1
- package/src/components/Chart/index.js +9 -20
- package/src/components/Chart/utils.js +10 -21
- package/src/components/Countries/resources/countries-normalized.json +1987 -1987
- package/src/components/Countries/resources/countries-with-not-extra.json +1211 -1211
- package/src/components/Countries/resources/countries.sql +243 -243
- package/src/components/Datagrid/Accordion/index.js +7 -6
- package/src/components/Datagrid/Common/Common.js +354 -127
- package/src/components/Datagrid/Footer/Footer.js +0 -1
- package/src/components/Datagrid/Footer/index.js +17 -11
- package/src/components/Datagrid/Table/index.js +8 -7
- package/src/components/Date/FormatSelector.js +2 -1
- package/src/components/Form/Fields/Field.js +1 -1
|
@@ -3,21 +3,27 @@ import View from "$ecomponents/View";
|
|
|
3
3
|
import React from "$react";
|
|
4
4
|
import memoize from "$react/memoize";
|
|
5
5
|
export {default as FooterItem} from "./Footer";
|
|
6
|
-
import {parseDecimal} from "$utils";
|
|
6
|
+
import {parseDecimal,defaultObj,defaultStr,isNonNullString} from "$utils";
|
|
7
7
|
|
|
8
|
-
export
|
|
9
|
-
|
|
8
|
+
export * from "./Footer";
|
|
9
|
+
|
|
10
|
+
/***évalue la valeur décimale selon les paramètres */
|
|
11
|
+
export const getFooterColumnValue = ({data,columnDef,field,result,columnField}) =>{
|
|
12
|
+
data = defaultObj(data)
|
|
13
|
+
columnDef = defaultObj(columnDef);
|
|
14
|
+
columnField = defaultStr(columnField,columnDef.field,field);
|
|
15
|
+
let val = data[columnField];
|
|
16
|
+
if(typeof columnDef.multiplicater ==='function'){
|
|
17
|
+
val = defaultDecimal(columnDef.multiplicater({value:val,columnField,field,columnDef,rowData:data,item:data}),val)
|
|
18
|
+
}
|
|
19
|
+
return typeof val =='number'? parseDecimal(val.toFixed(12)) : 0;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const evalSingleValue = ({data,columnDef,field,columnField,withLabel,result,displayLabel,onlyVisible})=>{
|
|
10
23
|
if(!isNonNullString(field) || !isObj(columnDef)) return result;
|
|
11
24
|
onlyVisible = defaultBool(onlyVisible,true);
|
|
12
25
|
if(onlyVisible === true && !(columnDef.visible !== false)) result;
|
|
13
|
-
let val = data
|
|
14
|
-
if(isFunction(columnDef.multiplicater)){
|
|
15
|
-
val = defaultDecimal(columnDef.multiplicater({value:val,columnField:field,field,columnDef,rowData:data,item:data}),val)
|
|
16
|
-
}
|
|
17
|
-
if(!isDecimal(val)){
|
|
18
|
-
return result;
|
|
19
|
-
}
|
|
20
|
-
val = parseDecimal(val.toFixed(10));
|
|
26
|
+
let val = getFooterColumnValue({data,columnDef,columnField,result,field});
|
|
21
27
|
(Array.isArray(result) ? result : [result]).map((currentResult)=>{
|
|
22
28
|
currentResult = defaultObj(currentResult);
|
|
23
29
|
if(!isObj(currentResult[field])){
|
|
@@ -53,7 +53,7 @@ const DatagridFactory = (Factory)=>{
|
|
|
53
53
|
renderFooterCell(props){
|
|
54
54
|
const {columnField,style} = props;
|
|
55
55
|
let footersValues = this.getFooterValues();
|
|
56
|
-
const footerFields = this.
|
|
56
|
+
const footerFields = this.getFootersFields();
|
|
57
57
|
if(isObj(footerFields[columnField])){
|
|
58
58
|
return <Footer
|
|
59
59
|
//{...footerFields[columnField]}
|
|
@@ -160,8 +160,9 @@ const DatagridFactory = (Factory)=>{
|
|
|
160
160
|
total:pagination.rows,pages:countPages
|
|
161
161
|
})*/
|
|
162
162
|
const {visibleColumns} = this.preparedColumns;
|
|
163
|
-
const
|
|
164
|
-
const {columnsWidths:widths
|
|
163
|
+
const hasFootersFields = this.hasFootersFields();
|
|
164
|
+
const {columnsWidths:widths} = this.state;
|
|
165
|
+
const showFooters = this.canShowFooters(), showFilters = this.canShowFilters();
|
|
165
166
|
const isLoading = this.isLoading();
|
|
166
167
|
let _progressBar = this.getProgressBar();
|
|
167
168
|
const pointerEvents = this.getPointerEvents();
|
|
@@ -219,13 +220,13 @@ const DatagridFactory = (Factory)=>{
|
|
|
219
220
|
{showFilters?'Masquer/Filtres':'Afficher/Filtres'}
|
|
220
221
|
</Button>
|
|
221
222
|
)}
|
|
222
|
-
{
|
|
223
|
+
{hasFootersFields && !canRenderChart ? <Button
|
|
223
224
|
normal
|
|
224
225
|
style={styles.paginationItem}
|
|
225
226
|
onPress = {()=>{this.toggleFooters(!showFooters)} }
|
|
226
227
|
icon = {showFooters?'view-column':'view-module'}
|
|
227
228
|
>
|
|
228
|
-
{showFooters?'Masquer
|
|
229
|
+
{showFooters?'Masquer les totaux':'Afficher les totaux'}
|
|
229
230
|
</Button>:null}
|
|
230
231
|
{restItems.map((item,index)=>{
|
|
231
232
|
return <Button
|
|
@@ -277,7 +278,7 @@ const DatagridFactory = (Factory)=>{
|
|
|
277
278
|
,icon : showFilters?'eye-off':'eye'
|
|
278
279
|
,text : (showFilters?'Masquer/Filtres':'Afficher/Filtres')
|
|
279
280
|
} : null,
|
|
280
|
-
isMobile &&
|
|
281
|
+
isMobile && hasFootersFields?{
|
|
281
282
|
onPress : ()=>{this.toggleFooters(!showFooters)}
|
|
282
283
|
,icon : showFooters?'view-column':'view-module'
|
|
283
284
|
,text : (showFooters?'Masquer/Ligne des totaux':'Afficher/Ligne des totaux')
|
|
@@ -344,7 +345,7 @@ const DatagridFactory = (Factory)=>{
|
|
|
344
345
|
</View> : null}
|
|
345
346
|
getItemType = {this.getFlashListItemType.bind(this)}
|
|
346
347
|
renderItem = {this.renderFlashListItem.bind(this)}
|
|
347
|
-
hasFooters = {
|
|
348
|
+
hasFooters = {hasFootersFields && !canRenderChart ? true : false}
|
|
348
349
|
showFilters = {showFilters}
|
|
349
350
|
showFooters = {showFooters && !canRenderChart ? true : false}
|
|
350
351
|
showHeaders = { canRenderChart ? !!showFilters : true}
|
|
@@ -79,7 +79,8 @@ export const selectDateFormatFieldProps = ({onAdd:customOnAdd,onAddCustomFormat,
|
|
|
79
79
|
getItemValue : ({item})=>item.code,
|
|
80
80
|
renderItem : dateFormatSelectorRenderItem,
|
|
81
81
|
showAdd : true,
|
|
82
|
-
...
|
|
82
|
+
...props,
|
|
83
|
+
defaultValue : defaultStr(props.defaultValue,props.format),
|
|
83
84
|
onAdd,
|
|
84
85
|
onAdd : undefined,
|
|
85
86
|
showAdd : false,
|
|
@@ -889,7 +889,7 @@ export default class Field extends AppComponent {
|
|
|
889
889
|
|
|
890
890
|
this.___formattedField = undefined;
|
|
891
891
|
let _type = this.type;
|
|
892
|
-
format = defaultStr(format)
|
|
892
|
+
format = defaultStr(format);
|
|
893
893
|
tooltip = defaultVal(tooltip,title);
|
|
894
894
|
|
|
895
895
|
const isEditable = rest.disabled !== true && rest.readOnly !== true && rest.editable !== false ? true : false;
|