@fto-consult/expo-ui 6.55.1 → 6.55.3
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/Common/Common.js +5 -3
- package/src/components/Datagrid/Footer/Footer.js +1 -2
- package/src/components/Datagrid/Table/index.js +3 -2
- package/src/components/Table/Header/CellWrapper.js +2 -2
- package/src/components/Table/Headers/index.js +7 -8
- package/src/components/Table/hooks.js +2 -1
package/package.json
CHANGED
@@ -42,6 +42,7 @@ import * as XLSX from "xlsx";
|
|
42
42
|
import {convertToSQL} from "$ecomponents/Filter";
|
43
43
|
import events from "../events";
|
44
44
|
import {MORE_ICON} from "$ecomponents/Icon"
|
45
|
+
import ActivityIndicator from "$ecomponents/ActivityIndicator";
|
45
46
|
|
46
47
|
export const TIMEOUT = 100;
|
47
48
|
|
@@ -3648,7 +3649,7 @@ export default class CommonDatagridComponent extends AppComponent {
|
|
3648
3649
|
},0);
|
3649
3650
|
}
|
3650
3651
|
getDefaultPreloader(props){
|
3651
|
-
return CommonDatagridComponent.getDefaultPreloader();
|
3652
|
+
return CommonDatagridComponent.getDefaultPreloader({isDashboard:this.isDashboard()});
|
3652
3653
|
}
|
3653
3654
|
isLoading (){
|
3654
3655
|
if(this.state.isReady === false) return true;
|
@@ -3842,8 +3843,9 @@ export default class CommonDatagridComponent extends AppComponent {
|
|
3842
3843
|
|
3843
3844
|
export const ProgressBar = CommonDatagridComponent.LinesProgressBar;
|
3844
3845
|
|
3845
|
-
CommonDatagridComponent.getDefaultPreloader = (
|
3846
|
-
|
3846
|
+
CommonDatagridComponent.getDefaultPreloader = (r)=>{
|
3847
|
+
const {isDashboard,...props} = defaultObj(r);
|
3848
|
+
return isDashboard? <ActivityIndicator size={"large"} {...props} style={[theme.styles.pb10,props.style]}/> : <Preloader {...props}/>
|
3847
3849
|
}
|
3848
3850
|
|
3849
3851
|
const chartDisplayType = PropTypes.oneOf(Object.keys(displayTypes).filter(type=>{
|
@@ -88,8 +88,7 @@ const formatValue = ({value,format,abreviate,aggregatorFunction})=>{
|
|
88
88
|
}
|
89
89
|
return abreviate? value.abreviate():value.formatNumber();
|
90
90
|
}
|
91
|
-
export default function DGGridFooterValue (props){
|
92
|
-
let {label,text,displayLabel,withLabel,abreviate,style,aggregatorFunctions,aggregatorFunction,format,testID,anchorProps} = props;
|
91
|
+
export default function DGGridFooterValue ({label,text,displayLabel,isFooterCell,withLabel,abreviate,style,aggregatorFunctions,aggregatorFunction,format,testID,anchorProps,...props}){
|
93
92
|
aggregatorFunctions = defaultObj(aggregatorFunctions);
|
94
93
|
anchorProps = defaultObj(anchorProps);
|
95
94
|
testID = defaultStr(testID,"RN_DatagridFooterComponent");
|
@@ -50,7 +50,7 @@ const DatagridFactory = (Factory)=>{
|
|
50
50
|
}
|
51
51
|
renderFooterCell(props){
|
52
52
|
const {columnField,style} = props;
|
53
|
-
|
53
|
+
const footersValues = this.getFooterValues();
|
54
54
|
const footerFields = this.getFootersFields();
|
55
55
|
if(isObj(footerFields[columnField])){
|
56
56
|
return <Footer
|
@@ -59,7 +59,8 @@ const DatagridFactory = (Factory)=>{
|
|
59
59
|
displayLabel = {false}
|
60
60
|
style = {[style]}
|
61
61
|
aggregatorFunction = {this.getActiveAggregatorFunction().code}
|
62
|
-
aggregatorFunctions = {this.aggregatorFunctions}
|
62
|
+
aggregatorFunctions = {this.aggregatorFunctions}
|
63
|
+
isFooterCell
|
63
64
|
/>
|
64
65
|
}
|
65
66
|
return null;
|
@@ -7,10 +7,10 @@ import Label from "$ecomponents/Label";
|
|
7
7
|
import theme from "$theme";
|
8
8
|
|
9
9
|
export default function HeaderCellWrapper({columnField,isFilter,isFooter}){
|
10
|
-
const {render,sortedColumn,filtersValues,...props} = useGetColumnProps({columnField,isFilter,isFooter});
|
10
|
+
const {render,sortedColumn,filtersValues,data,...props} = useGetColumnProps({columnField,isFilter,isFooter});
|
11
11
|
const columnDef = props.columnDef;
|
12
12
|
const isHeader = !isFilter && !isFooter;
|
13
|
-
const rProps = isHeader ? sortedColumn : undefined;
|
13
|
+
const rProps = isHeader ? sortedColumn : isFooter ? data : undefined;
|
14
14
|
const width = props.width;
|
15
15
|
const {containerProps} = props;
|
16
16
|
return React.useMemo(()=>{
|
@@ -7,15 +7,14 @@ import {classNames} from "$cutils";
|
|
7
7
|
|
8
8
|
const TableHeadersWrapperComponent = React.forwardRef(({className},ref)=>{
|
9
9
|
const {testID,tableHeadId} = useTable();
|
10
|
-
const
|
11
|
-
<Header isHeader={true} testID={testID+"_TableHeader"}/>
|
12
|
-
<Header isFilter={true} testID={testID+"_TableFilters"} style={[styles.header,styles.filters,theme.styles.pt0,theme.styles.pb0,theme.styles.ml0,theme.styles.mr0]}/>
|
13
|
-
<Header isFooter testID={testID+"_TableFooter"} style={[styles.header,styles.footers,theme.styles.pt0,theme.styles.pb0,theme.styles.ml0,theme.styles.mr0]}/>
|
14
|
-
</>,[])
|
10
|
+
const filters = React.useMemo(()=><Header isFilter={true} testID={testID+"_TableFilters"} style={[styles.header,styles.filters,theme.styles.pt0,theme.styles.pb0,theme.styles.ml0,theme.styles.mr0]}/>,[])
|
15
11
|
return <thead ref={ref} id={tableHeadId} className={classNames(className,"virtuoso-list-render-table-thead")}
|
16
|
-
style = {{zIndex:100, position: 'sticky', top: 0 ,width:"100%"}}
|
17
|
-
|
18
|
-
|
12
|
+
style = {{zIndex:100, position: 'sticky', top: 0 ,width:"100%"}}>
|
13
|
+
<>
|
14
|
+
<Header isHeader={true} testID={testID+"_TableHeader"}/>
|
15
|
+
{filters}
|
16
|
+
<Header isFooter testID={testID+"_TableFooter"} style={[styles.header,styles.footers,theme.styles.pt0,theme.styles.pb0,theme.styles.ml0,theme.styles.mr0]}/>
|
17
|
+
</>
|
19
18
|
</thead>
|
20
19
|
});
|
21
20
|
|
@@ -45,7 +45,7 @@ export const usePrepareColumns = ({columns,testID,columnsWidths,headerCellContai
|
|
45
45
|
import useTable from "./useTable";
|
46
46
|
|
47
47
|
export const useGetColumnProps = ({columnField,isFilter,isFooter})=>{
|
48
|
-
const {renderFilterCell,renderFooterCell,filtersValues,renderHeaderCell,sortedColumn,columns,filterCellContainerProps,footerCellContainerProps,headerCellContainerProps,testID,colsWidths} = useTable();
|
48
|
+
const {renderFilterCell,renderFooterCell,filtersValues,renderHeaderCell,data,sortedColumn,columns,filterCellContainerProps,footerCellContainerProps,headerCellContainerProps,testID,colsWidths} = useTable();
|
49
49
|
const columnDef = columns[columnField];
|
50
50
|
const props = isFilter ? {
|
51
51
|
containerProps : defaultObj(filterCellContainerProps),
|
@@ -57,6 +57,7 @@ export const useGetColumnProps = ({columnField,isFilter,isFooter})=>{
|
|
57
57
|
containerProps : defaultObj(headerCellContainerProps),
|
58
58
|
render : renderHeaderCell
|
59
59
|
}
|
60
|
+
props.data = data;
|
60
61
|
props.width = colsWidths[columnField];
|
61
62
|
props.columnField = columnField;
|
62
63
|
props.columnDef = columnDef;
|