@fto-consult/expo-ui 6.30.0 → 6.30.1
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/app.config.json +1 -1
- package/package.json +1 -1
- package/src/components/Datagrid/Accordion/index.js +6 -2
- package/src/components/Datagrid/Table/index.js +6 -2
- package/src/components/Table/Header/Cell/index.native.js +4 -4
- package/src/components/Table/Header/CellWrapper.js +4 -4
- package/src/components/Table/Header/index.js +2 -2
- package/src/components/Table/Row/Cell/Content.native.js +1 -2
- package/src/components/Table/Row/Cell/index.js +6 -4
- package/src/components/Table/styles.js +1 -1
- package/src/screens/Help/openLibraries.js +1 -1
package/app.config.json
CHANGED
package/package.json
CHANGED
|
@@ -517,7 +517,9 @@ const DatagridFactory = (Factory)=>{
|
|
|
517
517
|
</View>
|
|
518
518
|
return <DatagridProvider context={this}>
|
|
519
519
|
<View testID={testID+"_Container"} pointerEvents={pointerEvents} style={[styles.container,this.props.style]} collapsable={false}>
|
|
520
|
-
<View testID={testID+"_AccordionHeader"} style={[styles.accordionHeader]} ref={
|
|
520
|
+
<View testID={testID+"_AccordionHeader"} style={[styles.accordionHeader]} ref={(el)=>{
|
|
521
|
+
this.layoutRef.current = el;
|
|
522
|
+
}} onLayout={this.updateLayout.bind(this)}>
|
|
521
523
|
{this.props.showActions !== false ? <DatagridActions
|
|
522
524
|
testID={testID+"_Actions"}
|
|
523
525
|
pointerEvents = {pointerEvents}
|
|
@@ -564,7 +566,9 @@ const DatagridFactory = (Factory)=>{
|
|
|
564
566
|
renderItem = {this.renderItem.bind(this)}
|
|
565
567
|
items = {this.state.data}
|
|
566
568
|
isLoading = {isLoading}
|
|
567
|
-
ref = {
|
|
569
|
+
ref = {(el)=>{
|
|
570
|
+
this.listRef.current = el;
|
|
571
|
+
}}
|
|
568
572
|
style = {[styles.list,rest.style]}
|
|
569
573
|
backToTopRef = {backToTopRef?(e)=>{
|
|
570
574
|
return this.backToTopRef.current;
|
|
@@ -287,7 +287,9 @@ const DatagridFactory = (Factory)=>{
|
|
|
287
287
|
</View> : null;
|
|
288
288
|
return <DatagridProvider context={this}>
|
|
289
289
|
<View style={[styles.container,{flex:1}]} testID={testID+"_TableContainer"} pointerEvents={pointerEvents}>
|
|
290
|
-
<View ref={
|
|
290
|
+
<View ref={(el)=>{
|
|
291
|
+
this.layoutRef.current = el;
|
|
292
|
+
}} testID={testID+"_LayoutContainer"}>
|
|
291
293
|
{this.props.showActions !== false ? <DatagridActions
|
|
292
294
|
pointerEvents = {pointerEvents}
|
|
293
295
|
title = {this.renderDataSourceSelector()}
|
|
@@ -301,7 +303,9 @@ const DatagridFactory = (Factory)=>{
|
|
|
301
303
|
{this.renderChart()}
|
|
302
304
|
</View> :
|
|
303
305
|
<Table
|
|
304
|
-
ref = {
|
|
306
|
+
ref = {(el)=>{
|
|
307
|
+
this.listRef.current = el;
|
|
308
|
+
}}
|
|
305
309
|
{...rest}
|
|
306
310
|
withDatagridContext
|
|
307
311
|
sortedColumn = {sortedColumn}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import View from "$ecomponents/View";
|
|
2
2
|
import React from "$react";
|
|
3
3
|
import styles from "../../styles";
|
|
4
|
-
const
|
|
5
|
-
return <View ref={ref} {...props} style={[style,width && {width}]}/>
|
|
4
|
+
const TableHeaderCellComponentNative = React.forwardRef(({width,style,...props},ref)=>{
|
|
5
|
+
return <View ref={ref} {...props} style={[styles.cell,style,width && {width}]}/>
|
|
6
6
|
});
|
|
7
|
-
|
|
8
|
-
export default
|
|
7
|
+
TableHeaderCellComponentNative.displayName = "TableTableHeaderCellComponentNative";
|
|
8
|
+
export default TableHeaderCellComponentNative;
|
|
@@ -2,17 +2,17 @@ import React from "$react";
|
|
|
2
2
|
import {useTable,useGetColumnProps} from "../hooks";
|
|
3
3
|
import {defaultObj,defaultVal} from "$cutils";
|
|
4
4
|
import styles from "../styles";
|
|
5
|
-
import
|
|
5
|
+
import RowCell from "./Cell";
|
|
6
6
|
import Label from "$ecomponents/Label";
|
|
7
7
|
import theme from "$theme";
|
|
8
8
|
|
|
9
9
|
export default function HeaderCellWrapper({columnField,isFilter,isFooter}){
|
|
10
10
|
const {render,sortedColumn,filtersValues,...props} = useGetColumnProps({columnField,isFilter,isFooter});
|
|
11
11
|
const columnDef = props.columnDef;
|
|
12
|
-
const rProps = isFilter ? sortedColumn : undefined;
|
|
13
12
|
const isHeader = !isFilter && !isFooter;
|
|
13
|
+
const rProps = isHeader ? sortedColumn : undefined;
|
|
14
14
|
const width = props.width;
|
|
15
|
-
const {containerProps
|
|
15
|
+
const {containerProps} = props;
|
|
16
16
|
return React.useMemo(()=>{
|
|
17
17
|
let content = typeof render ==='function' ? render(props) : isHeader ? defaultVal(columnDef?.text,columnDef?.label,columnField):null;
|
|
18
18
|
const wStyle = width && {width} || null;
|
|
@@ -21,6 +21,6 @@ export default function HeaderCellWrapper({columnField,isFilter,isFooter}){
|
|
|
21
21
|
} else if(isFooter){
|
|
22
22
|
content = <Label primary textBold children={content}/>
|
|
23
23
|
}
|
|
24
|
-
return <
|
|
24
|
+
return <RowCell {...containerProps} width={width} columnDef={columnDef} columnField={columnField} style={[styles.headerItem,styles.headerItemOrCell,styles.filterCell,containerProps.style,styles.cell,columnDef.style]} children={content}/>
|
|
25
25
|
},[columnField,width,rProps]);
|
|
26
26
|
}
|
|
@@ -15,14 +15,14 @@ import styles from "../styles";
|
|
|
15
15
|
import CellWrapper from "./CellWrapper";
|
|
16
16
|
|
|
17
17
|
export default function RowHeaderComponent({isFilter,isFooter,isHeader,className,children:cChildren,...rest}){
|
|
18
|
-
const {showHeaders,visibleColsNames,filterable,visibleColsNamesStr,headerContainerProps,footerContainerProps,filtersContainerProps,showFilters,filters,showFooters} = useTable();
|
|
18
|
+
const {showHeaders,visibleColsNames,colsWidths,filterable,visibleColsNamesStr,headerContainerProps,footerContainerProps,filtersContainerProps,showFilters,filters,showFooters} = useTable();
|
|
19
19
|
const canV = showHeaders === false ? false : Array.isArray(children)? !!children.length : true;
|
|
20
20
|
const visible = canV && (isHeader ? true : isFilter ? !!showFilters && filterable !== false : isFooter ? !!showFooters: true);
|
|
21
21
|
const containerProps = defaultObj( isHeader ? headerContainerProps : isFooter ? footerContainerProps : filtersContainerProps);
|
|
22
22
|
const style = filters ? styles.filters : isFooter ? styles.footer : null;
|
|
23
23
|
const children = React.useMemo(()=>{
|
|
24
24
|
return visibleColsNames.map((columnField,index)=>{
|
|
25
|
-
return <CellWrapper isFilter={isFilter} isFooter={isFooter} key={columnField} columnField={columnField} columIndex={index}/>
|
|
25
|
+
return <CellWrapper width={colsWidths[columnField]} isFilter={isFilter} isFooter={isFooter} key={columnField} columnField={columnField} columIndex={index}/>
|
|
26
26
|
});
|
|
27
27
|
},[visibleColsNamesStr]);
|
|
28
28
|
if(!visible) return null;
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
// license that can be found in the LICENSE file.
|
|
4
4
|
import React from "react";
|
|
5
5
|
import View from "$ecomponents/View";
|
|
6
|
-
|
|
7
|
-
function TableCellContentComponent({children,width,columnField,style,colSpan,...rest}){
|
|
6
|
+
function TableCellContentComponent({children,columnField,style,colSpan,width,...rest}){
|
|
8
7
|
return (<View testID={"RN_TableRowCellContentComponent"} {...rest} style={[style,width && {width}]}>
|
|
9
8
|
{children}
|
|
10
9
|
</View>);
|
|
@@ -4,23 +4,25 @@ import { useTable } from "../../hooks";
|
|
|
4
4
|
import {defaultObj} from "$cutils";
|
|
5
5
|
import Label from "$ecomponents/Label";
|
|
6
6
|
import styles from "../../styles";
|
|
7
|
+
|
|
7
8
|
const TableRowCellComponent = React.forwardRef(({children,columnDef,className,columnField,rowData,colSpan,isSectionListHeader,rowIndex,style,...rest},ref)=>{
|
|
8
9
|
if(isSectionListHeader){
|
|
9
10
|
return <CellContent colSpan={colSpan} className={className} ref={ref} style={[styles.sectionListHeader,styles.cell,style]} >
|
|
10
11
|
{children}
|
|
11
12
|
</CellContent>
|
|
12
13
|
}
|
|
13
|
-
const {renderCell} = useTable();
|
|
14
|
+
const {renderCell,colsWidths} = useTable();
|
|
15
|
+
const width = colsWidths && columnField ? colsWidths[columnField] : undefined;
|
|
14
16
|
const {content,containerProps} = React.useMemo(()=>{
|
|
15
|
-
const rArgs = {...rest,columnDef,columnField,rowData,rowIndex,containerProps : {}};
|
|
17
|
+
const rArgs = {...rest,columnDef,columnField,rowData,width,rowIndex,containerProps : {}};
|
|
16
18
|
const r = typeof renderCell =='function' && renderCell (rArgs) || children;
|
|
17
19
|
return {
|
|
18
20
|
content : r && React.isValidElement(r,true)? r : children,
|
|
19
21
|
containerProps : defaultObj(rArgs.containerProps)
|
|
20
22
|
}
|
|
21
23
|
},[children]);
|
|
22
|
-
return (<CellContent ref={ref} {...containerProps} columnField={columnField} style={[styles.cell,style,containerProps.style]} >
|
|
23
|
-
|
|
24
|
+
return (<CellContent ref={ref} {...containerProps} width={width} columnField={columnField} style={[styles.cell,style,containerProps.style]} >
|
|
25
|
+
<Label>{content}</Label>
|
|
24
26
|
</CellContent>);
|
|
25
27
|
});
|
|
26
28
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
module.exports = {"@
|
|
1
|
+
module.exports = {"@FTO-CONSULT/EXPO-UI":{"name":"@FTO-CONSULT/EXPO-UI","version":"6.30.0","homepage":"https://github.com/borispipo/expo-ui#readme"}};
|