@fto-consult/expo-ui 2.47.8 → 2.48.2
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 +2 -2
- package/src/components/AppBar/index.js +1 -1
- package/src/components/BottomSheet/Menu.js +1 -1
- package/src/components/Checkbox/index.js +1 -1
- package/src/components/Color/index.js +1 -1
- package/src/components/Datagrid/Accordion/Row.js +1 -1
- package/src/components/Datagrid/Actions/index.js +1 -1
- package/src/components/Datagrid/Footer/index.js +1 -1
- package/src/components/Date/DatePickerInput/index.js +1 -1
- package/src/components/Date/Time.js +1 -1
- package/src/components/Dialog/Dialog.js +1 -1
- package/src/components/Drawer/DrawerItems/ExpandableItem.js +1 -1
- package/src/components/Drawer/index.js +1 -1
- package/src/components/Dropdown/index.js +4 -1
- package/src/components/Fab/Group.js +1 -1
- package/src/components/Form/FormData/componentsTypes.js +2 -2
- package/src/components/Icon/Checkbox.js +2 -2
- package/src/components/Image/Editor/index copy.js +1 -1
- package/src/components/Image/Editor/index.js +2 -2
- package/src/components/Label/index.js +1 -1
- package/src/components/Menu/index.js +1 -1
- package/src/components/Modal/index.js +1 -1
- package/src/components/PhoneInput/index.js +1 -1
- package/src/components/Radio/index.js +1 -1
- package/src/components/SimpleSelect/index.js +1 -1
- package/src/components/Slider/index.js +1 -1
- package/src/components/Switch/index.js +1 -1
- package/src/components/Table/FiltersOrFooters.js +18 -0
- package/src/components/Table/index.js +32 -14
- package/src/components/TextField/index.js +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fto-consult/expo-ui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.48.2",
|
|
4
4
|
"description": "Bibliothèque de composants UI Expo,react-native",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"@emotion/native": "^11.10.0",
|
|
62
62
|
"@expo/html-elements": "^0.2.0",
|
|
63
63
|
"@expo/vector-icons": "^13.0.0",
|
|
64
|
-
"@fto-consult/common": "^2.
|
|
64
|
+
"@fto-consult/common": "^2.12.2",
|
|
65
65
|
"@gorhom/portal": "^1.0.14",
|
|
66
66
|
"@react-native-async-storage/async-storage": "~1.17.3",
|
|
67
67
|
"@react-native-community/datetimepicker": "6.5.2",
|
|
@@ -93,7 +93,7 @@ const AppBarComponent = React.forwardRef((props,ref)=> {
|
|
|
93
93
|
const [context] = React.useState({});
|
|
94
94
|
actions = typeof actions =='function'? actions(getCallAgs()) : actions;
|
|
95
95
|
const dimensions = Dimensions.get("window");
|
|
96
|
-
const [layout,setLayout] = React.
|
|
96
|
+
const [layout,setLayout] = React.useState({
|
|
97
97
|
width : dimensions.width,
|
|
98
98
|
height : dimensions.height,
|
|
99
99
|
})
|
|
@@ -12,7 +12,7 @@ const BottomSheetMenuComponent = React.forwardRef((props,ref)=>{
|
|
|
12
12
|
rest = defaultObj(rest);
|
|
13
13
|
const isControlled = controlled ? true : false;
|
|
14
14
|
const visibleRef = React.useRef(null);
|
|
15
|
-
const [state,setState] = React.
|
|
15
|
+
const [state,setState] = React.useState({
|
|
16
16
|
visible : false,
|
|
17
17
|
height : undefined,
|
|
18
18
|
});
|
|
@@ -58,7 +58,7 @@ const CheckboxComponent = React.forwardRef((props,ref)=>{
|
|
|
58
58
|
}
|
|
59
59
|
delete p.checked;
|
|
60
60
|
defaultValue = defaultVal(defaultValue,value,0);
|
|
61
|
-
const [status,setStatus] = React.
|
|
61
|
+
const [status,setStatus] = React.useState(defaultValue == checkedValue ? checkedStatus : uncheckedStatus)
|
|
62
62
|
const previousStatus = React.usePrevious(status);
|
|
63
63
|
const checked = status===checkedStatus?true:false;
|
|
64
64
|
if(checked){
|
|
@@ -19,7 +19,7 @@ const ColorPickerComponent = React.forwardRef ((props,ref)=>{
|
|
|
19
19
|
const isMob = isMobileOrTabletMedia();
|
|
20
20
|
const _label = defaultStr(label,text);
|
|
21
21
|
const pickerRef = React.useRef(null);
|
|
22
|
-
const [state,setState] = React.
|
|
22
|
+
const [state,setState] = React.useState({
|
|
23
23
|
color : Colors.isValid(defaultValue)? defaultValue : undefined,
|
|
24
24
|
visible : false,
|
|
25
25
|
})
|
|
@@ -16,7 +16,7 @@ export default function DatagridActions (_props){
|
|
|
16
16
|
let {actions,actionProps,selectedRowsActions,bindResizeEvent,context,selectedRows:_selectedRows,...props} = _props;
|
|
17
17
|
props = defaultObj(props);
|
|
18
18
|
context = defaultObj(context);
|
|
19
|
-
const [state,setState] = React.
|
|
19
|
+
const [state,setState] = React.useState({
|
|
20
20
|
selectedRows : defaultObj(_selectedRows),
|
|
21
21
|
});
|
|
22
22
|
const selectedRowsCallBackRef = React.useRef(null);
|
|
@@ -65,7 +65,7 @@ const DatePickerInput = React.forwardRef(({
|
|
|
65
65
|
inputMode = defaultStr(inputMode,"start");
|
|
66
66
|
locale = defaultStr(locale,defaultLocale);
|
|
67
67
|
const theme = useTheme()
|
|
68
|
-
const [state,setState] = React.
|
|
68
|
+
const [state,setState] = React.useState({
|
|
69
69
|
errorText : null,
|
|
70
70
|
inputDate : toDateObj(defaultValue,format),
|
|
71
71
|
visible : false
|
|
@@ -54,7 +54,7 @@ export default function TimePickerComponent (props){
|
|
|
54
54
|
}
|
|
55
55
|
withSeconds = defaultBool(withSeconds,true);
|
|
56
56
|
const prevDefaultValue = React.usePrevious(defaultValue);
|
|
57
|
-
const [state,setState] = React.
|
|
57
|
+
const [state,setState] = React.useState({
|
|
58
58
|
visible : false,
|
|
59
59
|
...parseTime(defaultValue,withSeconds),
|
|
60
60
|
})
|
|
@@ -308,7 +308,7 @@ DialogComponent.propTypes= {
|
|
|
308
308
|
|
|
309
309
|
|
|
310
310
|
export const DialogControlledComponent = React.forwardRef(({visible:dVisible,...props},ref)=>{
|
|
311
|
-
const [visible,setVisible] = React.
|
|
311
|
+
const [visible,setVisible] = React.useState(defaultBool(dVisible,false));
|
|
312
312
|
const {onDismiss,onClose,onVisibilityChanged,...rest} = props;
|
|
313
313
|
React.useEffect(()=>{
|
|
314
314
|
if(typeof dVisible =='boolean' && dVisible !== visible){
|
|
@@ -11,7 +11,7 @@ export default function ExpandableItem(props){
|
|
|
11
11
|
let {children,expanded,expandedIcon,testID,minimized,onPress,expandIconProps,unexpandedIcon,onToggleExpand,wrapperProps,...rest} = props;
|
|
12
12
|
testID = defaultStr(testID,"RN_ExpandableDrawerItemComponent")
|
|
13
13
|
wrapperProps = defaultObj(wrapperProps);
|
|
14
|
-
const [expandedControled,setExpended] = React.
|
|
14
|
+
const [expandedControled,setExpended] = React.useState(defaultBool(expanded,false))
|
|
15
15
|
let _expanded = expanded;
|
|
16
16
|
if(!isBool(expanded)){
|
|
17
17
|
_expanded = expandedControled;
|
|
@@ -605,7 +605,7 @@ class DropdownComponent extends AppComponent {
|
|
|
605
605
|
}
|
|
606
606
|
UNSAFE_componentWillReceiveProps(nextProps){
|
|
607
607
|
const {items,defaultValue,selected} = nextProps;
|
|
608
|
-
if(items
|
|
608
|
+
if(!React.areEquals(items,this.props.items)){
|
|
609
609
|
const nState = this.prepareItems({items,defaultValue,selected});
|
|
610
610
|
return this.updateSelected(nState);
|
|
611
611
|
}
|
|
@@ -983,6 +983,9 @@ class DropdownComponent extends AppComponent {
|
|
|
983
983
|
const ListComponent = isBigList ? BigList : List;
|
|
984
984
|
const autoFocus = canAutoFocusSearchField({visible,items:renderingItems});
|
|
985
985
|
dialogProps = defaultObj(dialogProps);
|
|
986
|
+
if(this.props.name =="RG_Compta"){
|
|
987
|
+
restProps.testMeCompta = true;
|
|
988
|
+
}
|
|
986
989
|
return (
|
|
987
990
|
<Fragment>
|
|
988
991
|
{!withBottomSheet && isMob && anchor}
|
|
@@ -125,7 +125,7 @@ const FabGroupComponent = React.forwardRef((props,innerRef)=>{
|
|
|
125
125
|
const fabIdRef = React.useRef(defaultStr(fabId,uniqid("fab-id-ref")));
|
|
126
126
|
fabId = fabIdRef.current;
|
|
127
127
|
const isMountedRef = React.useRef(false);
|
|
128
|
-
const [state, setState] = React.
|
|
128
|
+
const [state, setState] = React.useState({
|
|
129
129
|
open: typeof customOpen =='boolean'? customOpen : false,
|
|
130
130
|
display : typeof customDisplay ==='boolean'? customDisplay : true,
|
|
131
131
|
});
|
|
@@ -89,8 +89,8 @@ export const getFilterComponentProps = (_props)=>{
|
|
|
89
89
|
} else if(type == 'switch' || type =='radio' || type ==='checkbox') {
|
|
90
90
|
type = 'select';
|
|
91
91
|
let {checkedLabel,checkedTooltip,uncheckedTooltip,checkedValue,uncheckedLabel,uncheckedValue,...pR} = props;
|
|
92
|
-
checkedLabel = defaultVal(checkedLabel,'
|
|
93
|
-
uncheckedLabel = defaultVal(uncheckedLabel,'
|
|
92
|
+
checkedLabel = defaultVal(checkedLabel,'Oui')
|
|
93
|
+
uncheckedLabel = defaultVal(uncheckedLabel,'Non')
|
|
94
94
|
checkedValue = defaultVal(checkedValue,1); uncheckedValue = defaultVal(uncheckedValue,0)
|
|
95
95
|
props = pR;
|
|
96
96
|
props.items = [{code:checkedValue,label:checkedLabel},{code:uncheckedValue,label:uncheckedLabel}];
|
|
@@ -10,7 +10,7 @@ const Checkbox = React.forwardRef((props,ref)=>{
|
|
|
10
10
|
const {checked:customChecked,color:customColor,primary,secondary,primaryOnCheck,secondaryOnCheck,onChange,checkedIcon:customCheckedIcon,uncheckedIcon:customUncheckedIcon,onPress,...rest} = props;
|
|
11
11
|
const checkedIcon = defaultStr(checkedIcon,CHECKED_ICON);
|
|
12
12
|
const uncheckedIcon = defaultStr(uncheckedIcon,UNCHECKED_ICON);
|
|
13
|
-
const [checked,setIsChecked] = React.
|
|
13
|
+
const [checked,setIsChecked] = React.useState(!!checked);
|
|
14
14
|
const isMounted = React.useIsMounted();
|
|
15
15
|
const prevChecked = React.usePrevious(checked);
|
|
16
16
|
const callOnChangeRef = React.useRef(true);
|
|
@@ -26,7 +26,7 @@ const Checkbox = React.forwardRef((props,ref)=>{
|
|
|
26
26
|
onChange({value:checked?1:0,checked});
|
|
27
27
|
}
|
|
28
28
|
},[checked])
|
|
29
|
-
const [context] = React.
|
|
29
|
+
const [context] = React.useState({
|
|
30
30
|
check : (callOnChange)=>{
|
|
31
31
|
if(!isMounted()) return;
|
|
32
32
|
if(typeof callOnChange =='boolean'){
|
|
@@ -9,7 +9,7 @@ import Dialog from "$ecomponents/Dialog";
|
|
|
9
9
|
const ImageEditorComponent = React.forwardRef((props,ref)=>{
|
|
10
10
|
let {source,dialogProps,visible,imageProps,...rest} = props;
|
|
11
11
|
const isMounted = React.useIsMounted();
|
|
12
|
-
const [context] = React.
|
|
12
|
+
const [context] = React.useState({});
|
|
13
13
|
imageProps = defaultObj(imageProps);
|
|
14
14
|
dialogProps = defaultObj(dialogProps);
|
|
15
15
|
context.dialogRef = React.useRef(null);
|
|
@@ -7,11 +7,11 @@ import {defaultObj} from "$utils";
|
|
|
7
7
|
const ImageEditorComponent = React.forwardRef((props,ref)=>{
|
|
8
8
|
let {source,uri,onSuccess,imageUri,lockAspectRatio,dialogProps,onDismiss,visible,imageProps,...rest} = props;
|
|
9
9
|
const isMounted = React.useIsMounted();
|
|
10
|
-
const [context] = React.
|
|
10
|
+
const [context] = React.useState({});
|
|
11
11
|
imageProps = defaultObj(imageProps);
|
|
12
12
|
dialogProps = defaultObj(dialogProps);
|
|
13
13
|
context.dialogRef = React.useRef(null);
|
|
14
|
-
const [imageData,setImageData] = React.
|
|
14
|
+
const [imageData,setImageData] = React.useState(null);
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
return <View style={[styles.container]}>
|
|
@@ -113,7 +113,7 @@ LabelComponentExported.propTypes = {
|
|
|
113
113
|
export default LabelComponentExported;
|
|
114
114
|
|
|
115
115
|
LabelComponentExported.withRef = React.forwardRef((props,ref)=>{
|
|
116
|
-
const [state,setState] = React.
|
|
116
|
+
const [state,setState] = React.useState({
|
|
117
117
|
children : props.children,
|
|
118
118
|
});
|
|
119
119
|
const context = {
|
|
@@ -30,7 +30,7 @@ const MenuComponent = React.forwardRef((props,ref)=>{
|
|
|
30
30
|
testID = defaultStr(testID,"RN_MenuComponent");
|
|
31
31
|
anchorProps.testID = defaultStr(anchorProps.testID,testID+"_Anchor");
|
|
32
32
|
menuProps = defaultObj(menuProps);
|
|
33
|
-
const [visible, setVisible] = React.
|
|
33
|
+
const [visible, setVisible] = React.useState(false);
|
|
34
34
|
const prevSibible = React.usePrevious(visible);
|
|
35
35
|
const openMenu = (event,callback) => {
|
|
36
36
|
if(callback === true && typeof onAnchorPress ==='function' && onAnchorPress(event) ===false){
|
|
@@ -61,7 +61,7 @@ export default function PhoneInputComponent(props){
|
|
|
61
61
|
contentContainerProps = defaultObj(contentContainerProps);
|
|
62
62
|
contentContainerProps.style = [styles.inputContainer,contentContainerProps.style];
|
|
63
63
|
const ref = React.useRef(null);
|
|
64
|
-
const [state,setState] = React.
|
|
64
|
+
const [state,setState] = React.useState({
|
|
65
65
|
visible : false,
|
|
66
66
|
...prepareState({defaultValue,country})
|
|
67
67
|
})
|
|
@@ -55,7 +55,7 @@ const RadioComponent = React.forwardRef((props,ref)=>{
|
|
|
55
55
|
}
|
|
56
56
|
delete p.checked;
|
|
57
57
|
defaultValue = defaultVal(defaultValue,value,0);
|
|
58
|
-
const [status,setStatus] = React.
|
|
58
|
+
const [status,setStatus] = React.useState(defaultValue == checkedValue ? checkedStatus : uncheckedStatus)
|
|
59
59
|
const previousStatus = React.usePrevious(status);
|
|
60
60
|
const checked = status===checkedStatus?true:false;
|
|
61
61
|
if(checked){
|
|
@@ -255,7 +255,7 @@ const SimpleSelect = React.forwardRef((props,ref)=>{
|
|
|
255
255
|
/>
|
|
256
256
|
const inputRef = React.useRef(null);
|
|
257
257
|
const canFilter = !props.disabled && !props.readOnly && props.editable !== false && visible;
|
|
258
|
-
const [filterText,setFilterText] = React.
|
|
258
|
+
const [filterText,setFilterText] = React.useState("");
|
|
259
259
|
let filterRegex = undefined;
|
|
260
260
|
if(canFilter && isNonNullString(filterText)){
|
|
261
261
|
filterRegex = new RegExp(filterText.replace(matchOperators, '\\$&'), 'gi');
|
|
@@ -45,7 +45,7 @@ const SliderComponent = React.forwardRef((props,ref)=>{
|
|
|
45
45
|
valueProps = defaultObj(valueProps);
|
|
46
46
|
contentProps = defaultObj(contentProps);
|
|
47
47
|
const defVal = prepareValue({value,defaultValue});
|
|
48
|
-
const [sValue,setSValue] = React.
|
|
48
|
+
const [sValue,setSValue] = React.useState(defVal)
|
|
49
49
|
const prevValue = React.usePrevious(isArray(sValue) && isDecimal(sValue[0])? sValue[0]:sValue);
|
|
50
50
|
React.useEffect(()=>{
|
|
51
51
|
const value = isArray(sValue) && isDecimal(sValue[0]) ? sValue[0] : isDecimal(sValue)? sValue : undefined;
|
|
@@ -59,7 +59,7 @@ const SwitchComponent = React.forwardRef((props,ref)=>{
|
|
|
59
59
|
defaultValue = on ?checkedValue : uncheckedValue;
|
|
60
60
|
}
|
|
61
61
|
defaultValue = defaultVal(defaultValue,value,0);
|
|
62
|
-
const [isSwitchOn,setIsSwitchOn] = React.
|
|
62
|
+
const [isSwitchOn,setIsSwitchOn] = React.useState(defaultValue == checkedValue ? true : false)
|
|
63
63
|
const toggleIsSwitchOn = (a)=> {
|
|
64
64
|
if(typeof onPress ==='function' && onPress(a) === false){
|
|
65
65
|
return;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Copyright 2023 @fto-consult/Boris Fouomene. All rights reserved.
|
|
2
|
+
// Use of this source code is governed by a BSD-style
|
|
3
|
+
// license that can be found in the LICENSE file.
|
|
4
|
+
import React from "$react";
|
|
5
|
+
import { View } from "react-native";
|
|
6
|
+
import PropTypes from "prop-types";
|
|
7
|
+
export default function TableFiltersComponent({visible,children:cChildren,...rest}){
|
|
8
|
+
const children = React.useMemo(()=>{
|
|
9
|
+
return cChildren;
|
|
10
|
+
},[cChildren]);
|
|
11
|
+
return <View {...rest} style={[rest.style,!visible && {height:0,opacity:0,display:'none'}]}>
|
|
12
|
+
{children}
|
|
13
|
+
</View>
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
TableFiltersComponent.propTypes = {
|
|
17
|
+
visible : PropTypes.bool,
|
|
18
|
+
}
|
|
@@ -7,11 +7,13 @@ import Label from "$ecomponents/Label";
|
|
|
7
7
|
import { StyleSheet,View as RNView,ScrollView,Dimensions} from "react-native";
|
|
8
8
|
import { getRowStyle } from "$ecomponents/Datagrid/utils";
|
|
9
9
|
import {isMobileNative} from "$cplatform";
|
|
10
|
+
import {isMobileMedia} from "$dimensions";
|
|
10
11
|
import theme from "$theme";
|
|
11
12
|
import AbsoluteScrollView from "./AbsoluteScrollView";
|
|
12
13
|
import Cell from "./Cell";
|
|
13
14
|
import Row from "./Row";
|
|
14
15
|
import List from "./List";
|
|
16
|
+
import FiltersOrFooters from "./FiltersOrFooters";
|
|
15
17
|
const isSCrollingRef = React.createRef();
|
|
16
18
|
const scrollLists = (opts,refs)=>{
|
|
17
19
|
refs.map((ref)=>{
|
|
@@ -57,7 +59,7 @@ const TableComponent = React.forwardRef(({containerProps,sortedColumn,listContai
|
|
|
57
59
|
const emptyData = renderListContent === false ?null : typeof renderEmpty =='function' && !Object.size(data,true)? renderEmpty() : null;
|
|
58
60
|
const hasEmptyData = emptyData && React.isValidElement(emptyData);
|
|
59
61
|
const layoutRef = React.useRef({});
|
|
60
|
-
|
|
62
|
+
|
|
61
63
|
const preparedColumns = React.useStableMemo(()=>{
|
|
62
64
|
const cols = {},headers = {},footers = {},filters = {},vColumnsMapping = [],visibleColumns = [],columnsNames = [];
|
|
63
65
|
let hasFooters = false;
|
|
@@ -151,10 +153,14 @@ const TableComponent = React.forwardRef(({containerProps,sortedColumn,listContai
|
|
|
151
153
|
const prevData = React.usePrevious(data);
|
|
152
154
|
const prevColumns = React.usePrevious(columns);
|
|
153
155
|
const itemsRef = React.useRef(null);
|
|
156
|
+
const hasChangedDataRef = React.useRef(false);
|
|
157
|
+
hasChangedDataRef.current = false;
|
|
154
158
|
const items = React.useMemo(()=>{
|
|
155
159
|
if(data === prevData && prevColumns == columns && Array.isArray(itemsRef.current)){
|
|
160
|
+
hasChangedDataRef.current = false;
|
|
156
161
|
return itemsRef.current;
|
|
157
162
|
}
|
|
163
|
+
hasChangedDataRef.current = true;
|
|
158
164
|
const items = [];
|
|
159
165
|
const filter = typeof customFilter =='function'? customFilter : x=>true;
|
|
160
166
|
data.map((item,index)=>{
|
|
@@ -230,15 +236,6 @@ const TableComponent = React.forwardRef(({containerProps,sortedColumn,listContai
|
|
|
230
236
|
get headerScrollViewContext(){return headerScrollViewRef.current},
|
|
231
237
|
}
|
|
232
238
|
const showTableHeaders = showHeaders !== false || showFilters ;
|
|
233
|
-
const hContent = showTableHeaders && headersContent.length ? <View testID={testID+"_Header"} {...headerContainerProps} style={[styles.header,headerContainerProps.style,footersContent.length]}>
|
|
234
|
-
{headersContent}
|
|
235
|
-
</View> : null,
|
|
236
|
-
fContent = showTableHeaders && footersContent.length ? <View testID={testID+"_Footer"} {...footerContainerProps} style={[styles.header,styles.footers,footerContainerProps.style,theme.styles.pt0,theme.styles.pb0,theme.styles.ml0,theme.styles.mr0]}>
|
|
237
|
-
{footersContent}
|
|
238
|
-
</View> : null,
|
|
239
|
-
filtersContent = fFilters.length ? <View testID={testID+"_Filters"} style={[styles.header,styles.footers,theme.styles.pt0,theme.styles.pb0,theme.styles.ml0,theme.styles.mr0]}>
|
|
240
|
-
{fFilters}
|
|
241
|
-
</View> : null
|
|
242
239
|
const absoluteScrollViewRefCanScroll = React.useRef(true);
|
|
243
240
|
React.setRef(tableRef,context);
|
|
244
241
|
const cStyle = {width:listWidth}
|
|
@@ -254,6 +251,20 @@ const TableComponent = React.forwardRef(({containerProps,sortedColumn,listContai
|
|
|
254
251
|
}
|
|
255
252
|
}
|
|
256
253
|
}
|
|
254
|
+
React.useOnRender((a,b,c)=>{
|
|
255
|
+
if(onRender){
|
|
256
|
+
onRender(a,b,c);
|
|
257
|
+
}
|
|
258
|
+
if(hasChangedDataRef.current){
|
|
259
|
+
if(headerScrollViewRef.current && headerScrollViewRef.current.scrollTo){
|
|
260
|
+
headerScrollViewRef.current.scrollTo({
|
|
261
|
+
x : 0,
|
|
262
|
+
y : 0,
|
|
263
|
+
animated : true,
|
|
264
|
+
})
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
});
|
|
257
268
|
return <View testID= {testID+"_Container"} {...containerProps} onLayout={(e)=>{
|
|
258
269
|
layoutRef.current = e.nativeEvent.layout;
|
|
259
270
|
if(containerProps.onLayout){
|
|
@@ -266,7 +277,8 @@ const TableComponent = React.forwardRef(({containerProps,sortedColumn,listContai
|
|
|
266
277
|
{...headerScrollViewProps}
|
|
267
278
|
contentContainerStyle = {[allScrollViewProps.contentContainerStyle,headerScrollViewProps.contentContainerStyle,{flex:1,flexWrap: 'wrap'}]}
|
|
268
279
|
style = {[allScrollViewProps.style,headerScrollViewProps.style,{height:'100%',flex:1,flexWrap:'wrap'}]}
|
|
269
|
-
ref={headerScrollViewRef}
|
|
280
|
+
ref={headerScrollViewRef}
|
|
281
|
+
horizontal {...allScrollViewProps}
|
|
270
282
|
onScroll = {getOnScrollCb([scrollViewRef,footerScrollViewRef],null,(args)=>{
|
|
271
283
|
return;
|
|
272
284
|
const nativeEvent = args.nativeEvent;
|
|
@@ -275,9 +287,15 @@ const TableComponent = React.forwardRef(({containerProps,sortedColumn,listContai
|
|
|
275
287
|
showsHorizontalScrollIndicator
|
|
276
288
|
>
|
|
277
289
|
<View testID={testID+"Header2FootersWrapper"} style={[theme.styles.w100]}>
|
|
278
|
-
{
|
|
279
|
-
|
|
280
|
-
|
|
290
|
+
<FiltersOrFooters visible={!!(showTableHeaders && headersContent.length)} testID={testID+"_Header"} {...headerContainerProps} style={[styles.header,headerContainerProps.style,footersContent.length]}>
|
|
291
|
+
{headersContent}
|
|
292
|
+
</FiltersOrFooters>
|
|
293
|
+
<FiltersOrFooters visible = {!!fFilters.length} testID={testID+"_Filters"} style={[styles.header,styles.footers,theme.styles.pt0,theme.styles.pb0,theme.styles.ml0,theme.styles.mr0]}>
|
|
294
|
+
{fFilters}
|
|
295
|
+
</FiltersOrFooters>
|
|
296
|
+
<FiltersOrFooters visible={!!(showTableHeaders && footersContent.length)} testID={testID+"_Footer"} {...footerContainerProps} style={[styles.header,styles.footers,footerContainerProps.style,theme.styles.pt0,theme.styles.pb0,theme.styles.ml0,theme.styles.mr0]}>
|
|
297
|
+
{footersContent}
|
|
298
|
+
</FiltersOrFooters>
|
|
281
299
|
</View>
|
|
282
300
|
</ScrollView>
|
|
283
301
|
</RNView>
|
|
@@ -126,7 +126,7 @@ const TextFieldComponent = React.forwardRef((componentProps,inputRef)=>{
|
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
128
|
const isSecureText = type =="password"?true : false;
|
|
129
|
-
const [secureTextEntry,setSecureTextEntry] = React.
|
|
129
|
+
const [secureTextEntry,setSecureTextEntry] = React.useState(isSecureText);
|
|
130
130
|
const prevSecureTextEntry = React.usePrevious(secureTextEntry);
|
|
131
131
|
containerProps = defaultObj(containerProps);
|
|
132
132
|
mode = defaultStr(mode,theme.textFieldMode);
|
|
@@ -138,7 +138,7 @@ const TextFieldComponent = React.forwardRef((componentProps,inputRef)=>{
|
|
|
138
138
|
const isNormalMode = mode == normalMode ? true : false;
|
|
139
139
|
const isFlatMode = mode == flatMode ? true : false;
|
|
140
140
|
|
|
141
|
-
const [inputState, setInputState] = React.
|
|
141
|
+
const [inputState, setInputState] = React.useState({
|
|
142
142
|
focused : false,
|
|
143
143
|
touched: false,
|
|
144
144
|
});
|
|
@@ -152,7 +152,7 @@ const TextFieldComponent = React.forwardRef((componentProps,inputRef)=>{
|
|
|
152
152
|
if((upper !== true && lower !== true) || isAndroid) return typeof t =='string'? t : "";
|
|
153
153
|
return isNonNullString(t)? (upper ? t.toUpperCase() : lower ? t.toLowerCase():t) : ""
|
|
154
154
|
};
|
|
155
|
-
const [text, _setText] = React.
|
|
155
|
+
const [text, _setText] = React.useState(toCase(defaultValue));
|
|
156
156
|
const previousText = React.usePrevious(text);
|
|
157
157
|
|
|
158
158
|
|