@fto-consult/expo-ui 2.48.0 → 2.48.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.
Files changed (52) hide show
  1. package/package.json +2 -2
  2. package/src/auth/Login.js +5 -1
  3. package/src/components/AppBar/index.js +1 -1
  4. package/src/components/AppBar/utils.js +2 -2
  5. package/src/components/BottomSheet/Menu.js +1 -1
  6. package/src/components/Button/index.js +11 -5
  7. package/src/components/Checkbox/index.js +1 -1
  8. package/src/components/Color/index.js +1 -1
  9. package/src/components/Countries/resources/countries-normalized.json +1987 -1987
  10. package/src/components/Countries/resources/countries-with-not-extra.json +1211 -1211
  11. package/src/components/Countries/resources/countries.sql +243 -243
  12. package/src/components/Datagrid/Accordion/Row.js +1 -1
  13. package/src/components/Datagrid/Actions/index.js +1 -1
  14. package/src/components/Datagrid/Footer/index.js +1 -1
  15. package/src/components/Date/DatePickerInput/index.js +1 -1
  16. package/src/components/Date/Time.js +1 -1
  17. package/src/components/Dialog/Dialog.js +9 -5
  18. package/src/components/Drawer/DrawerItems/ExpandableItem.js +1 -1
  19. package/src/components/Drawer/index.js +1 -1
  20. package/src/components/Dropdown/index.js +4 -1
  21. package/src/components/Fab/Group.js +1 -1
  22. package/src/components/Form/Fields/Checkbox.js +0 -5
  23. package/src/components/Form/Fields/Field.js +2 -1
  24. package/src/components/Form/Fields/Radio.js +0 -5
  25. package/src/components/Form/Fields/SelectField.js +1 -0
  26. package/src/components/Form/Fields/Slider.js +0 -5
  27. package/src/components/Form/Fields/Switch.js +0 -5
  28. package/src/components/Form/FormData/DialogProvider.js +4 -2
  29. package/src/components/Form/FormData/FormDataActions.js +1 -0
  30. package/src/components/Form/FormData/componentsTypes.js +2 -2
  31. package/src/components/Form/FormData/utils.js +1 -2
  32. package/src/components/Icon/Checkbox.js +2 -2
  33. package/src/components/Icon/utils.js +2 -0
  34. package/src/components/Image/Editor/index copy.js +1 -1
  35. package/src/components/Image/Editor/index.js +2 -2
  36. package/src/components/Label/index.js +1 -1
  37. package/src/components/Menu/index.js +1 -1
  38. package/src/components/Modal/index.js +1 -1
  39. package/src/components/PhoneInput/index.js +1 -1
  40. package/src/components/Radio/index.js +1 -1
  41. package/src/components/ScrollView/index.js +9 -2
  42. package/src/components/SimpleSelect/index.js +1 -1
  43. package/src/components/Slider/index.js +1 -1
  44. package/src/components/Switch/index.js +1 -1
  45. package/src/components/Table/FiltersOrFooters.js +18 -0
  46. package/src/components/Table/index.js +32 -14
  47. package/src/components/TextField/index.js +3 -3
  48. package/src/screens/Auth/PermLines.js +417 -0
  49. package/src/screens/Auth/PermProfile.js +182 -0
  50. package/src/screens/Auth/PermProfiles.js +38 -0
  51. package/src/screens/Auth/Profile.js +1 -1
  52. package/src/screens/Auth/index.js +8 -1
@@ -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 !== this.props.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.useStateIfMounted({
128
+ const [state, setState] = React.useState({
129
129
  open: typeof customOpen =='boolean'? customOpen : false,
130
130
  display : typeof customDisplay ==='boolean'? customDisplay : true,
131
131
  });
@@ -6,11 +6,6 @@ export default class FormCheckboxField extends Field{
6
6
  canFocus(){
7
7
  return false;
8
8
  }
9
- setValue (value){
10
- if(this._fieldRef && this._fieldRef.setValue){
11
- return this._fieldRef.setValue(value);
12
- }
13
- }
14
9
  _render(props,setRef){
15
10
  props.onChange = (args)=>{
16
11
  args.value = this.parseDecimal(args.value);
@@ -287,7 +287,8 @@ export default class Field extends AppComponent {
287
287
  onValidatorValid(args){
288
288
  if(!this.isFilter() && ((this.props.allowWhiteSpaces === false) || ((this.type ==='id' || this.type =='piece') && this.props.allowWhiteSpaces !== true))){
289
289
  const value = isNonNullString(args.value) && args.value.replaceAll("/","").replaceAll("\\",'') || undefined;
290
- if(value && (value.contains(" ") || !isValidDataFileName(value))){
290
+
291
+ if(value && this.type !=='email' && !defaultStr(this.getValidRule()).toLowerCase().contains('email') && (value.contains(" ") || !isValidDataFileName(value.replaceAll("@","")))){
291
292
  return "Veuillez renseigner une valeur ne contenant pas d'espace ou de caractère accentués";
292
293
  }
293
294
  }
@@ -9,11 +9,6 @@ export default class FormRadioField extends Field{
9
9
  isTextField(){
10
10
  return false;
11
11
  }
12
- setValue (value){
13
- if(this._fieldRef && this._fieldRef.setValue){
14
- return this._fieldRef.setValue(value);
15
- }
16
- }
17
12
  _render(props,setRef){
18
13
  props.onChange = (args)=>{
19
14
  this.validate(args);
@@ -82,6 +82,7 @@ export default class FormSelectField extends Field{
82
82
  if(this._field && isFunction(this._field.selectValue)){
83
83
  this._field.selectValue(value,reset,cb);
84
84
  }
85
+ return super.setValue(value,reset,cb);
85
86
  }
86
87
  removeNotAllowedProps(props,{formName}){
87
88
  return;
@@ -9,11 +9,6 @@ export default class FormSliderField extends Field{
9
9
  isTextField(){
10
10
  return false;
11
11
  }
12
- setValue (value){
13
- if(this._fieldRef && this._fieldRef.setValue){
14
- return this._fieldRef.setValue(value);
15
- }
16
- }
17
12
  _render(props,setRef){
18
13
  props.onChange = (args)=>{
19
14
  args.value = this.parseDecimal(args.value);
@@ -9,11 +9,6 @@ export default class FormSwitchField extends Field{
9
9
  isTextField(){
10
10
  return false;
11
11
  }
12
- setValue (value){
13
- if(this._fieldRef && this._fieldRef.setValue){
14
- return this._fieldRef.setValue(value);
15
- }
16
- }
17
12
  _render(props,setRef){
18
13
  props.onChange = (args)=>{
19
14
  this.validate(args);
@@ -5,6 +5,7 @@ import {isMobileOrTabletMedia} from "$cplatform/dimensions";
5
5
  import {MAX_WIDTH} from "$ecomponents/Dialog/utils";
6
6
  import {extendObj,defaultObj,isObj,defaultBool,defaultStr} from "$utils";
7
7
  import grid from "$theme/grid";
8
+ import {isDesktopMedia} from "$cdimensions";
8
9
 
9
10
  let dialogProviderRef = null;
10
11
 
@@ -59,7 +60,8 @@ const FormDataDialogProvider = React.forwardRef((props,innerRef)=>{
59
60
  const isMob = isMobileOrTabletMedia();
60
61
  if(closeAction === true || state.closeAction === true) return rest;
61
62
  rest.windowWidth = !isMob ? MAX_WIDTH : undefined;
62
- rest.actions = Array.isArray(rest.actions)? [...rest.actions] : isObj(rest.actions)? {...rest.actions} : null;
63
+ rest.actions = Array.isArray(rest.actions)? Object.clone(rest.actions) : isObj(rest.actions)? Object.clone(rest.actions) : null;
64
+ rest.cancelButton = false;
63
65
  if(rest.actions && (!isMob || rest.fullScreen === false)){
64
66
  if(isDesktopMedia() && typeof rest.maxActions !=='number'){
65
67
  rest.maxActions = 2;
@@ -67,7 +69,7 @@ const FormDataDialogProvider = React.forwardRef((props,innerRef)=>{
67
69
  const closeBtn ={
68
70
  text : 'Annuler',
69
71
  icon : 'close',
70
- secondary : true,
72
+ isCancelButton : true,
71
73
  ...defaultObj(closeAction),
72
74
  onPress : context.close,
73
75
  isAction : false,
@@ -59,6 +59,7 @@ export default class FormDataActionComponent extends FormData {
59
59
  const cb = ()=>{
60
60
  if(typeof mainProps.onBackActionPress =='function' && mainProps.onBackActionPress(args) === false) return
61
61
  else if(hasP && typeof this.props.onBackActionPress =='function' && this.props.onBackActionPress(args) === false) return;
62
+ else if(typeof this.props.onCancel =='function' && this.props.onCancel(args) === false) return;
62
63
  if(typeof callback =='function'){
63
64
  return callback(args);
64
65
  }
@@ -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,'Non')
93
- uncheckedLabel = defaultVal(uncheckedLabel,'Oui')
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}];
@@ -48,7 +48,7 @@ export const getAppBarActionsProps = function(_props){
48
48
  action.tooltip +=" ("+keyboardShortcuts[shortcut]+")";
49
49
  }
50
50
  }
51
- isAction = defaultBool(isAction,canSave,true);
51
+ isAction = defaultBool(isAction,canSave,rest.isAction,rest.canSave,true);
52
52
  action.formName = formName;
53
53
  if(isAction) {
54
54
  action.isFormAction = true;
@@ -91,7 +91,6 @@ export const handleBeforeSaveCallback = (beforeSaveCallback,successCb,arg)=>{
91
91
  }
92
92
  successCb(arg);
93
93
  }).catch((e)=>{
94
- console.log(e,' form-list-saving-data')
95
94
  if(isNonNullString(e)){
96
95
  notify.error(e);
97
96
  } else if(e){
@@ -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.useStateIfMounted(!!checked);
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.useStateIfMounted({
29
+ const [context] = React.useState({
30
30
  check : (callOnChange)=>{
31
31
  if(!isMounted()) return;
32
32
  if(typeof callOnChange =='boolean'){
@@ -15,4 +15,6 @@ export const ICON_OFFSET = 12;
15
15
 
16
16
  export const CHECKED_ICON = isIos()? 'check' : "checkbox-marked";
17
17
 
18
+ export const CHECK_ICON = 'check';
19
+
18
20
  export const UNCHECKED_ICON = "checkbox-blank-outline";
@@ -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.useStateIfMounted({});
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.useStateIfMounted({});
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.useStateIfMounted(null);
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.useStateIfMounted({
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.useStateIfMounted(false);
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){
@@ -92,7 +92,7 @@ const ModalComponent = React.forwardRef((props,ref)=>{
92
92
  removeListeners();
93
93
  }
94
94
  setTimeout(()=>{
95
- if(prevVisible.current ===visible) return;
95
+ if(prevVisible ===visible) return;
96
96
  if(visible){
97
97
  if(onShow){
98
98
  onShow();
@@ -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.useStateIfMounted({
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.useStateIfMounted(defaultValue == checkedValue ? checkedStatus : uncheckedStatus)
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){
@@ -5,10 +5,13 @@ import View from "$ecomponents/View";
5
5
  import theme from "$theme";
6
6
  import {defaultStr,defaultObj} from "$utils";
7
7
  import APP from "$capp/instance";
8
- const ScrollViewComponent = React.forwardRef(({virtualized,contentProps,containerProps,mediaQueryUpdateNativeProps,testID:customTestID,children:cChildren,screenIndent:sIndent,...rest},ref) => {
9
- const isKeyboardOpenRef = React.useRef(false);
8
+ const ScrollViewComponent = React.forwardRef(({virtualized,vertical,horizontal,contentProps,containerProps,mediaQueryUpdateNativeProps,testID:customTestID,children:cChildren,screenIndent:sIndent,...rest},ref) => {
10
9
  const testID = defaultStr(customTestID,'RN_ScrollViewComponent');
11
10
  containerProps = defaultObj(containerProps)
11
+ if(horizontal === true || vertical === false){
12
+ return <ScrollView horizontal testID={testID} ref={ref} {...rest} children={cChildren}/>
13
+ }
14
+ const isKeyboardOpenRef = React.useRef(false);
12
15
  const layoutRef = React.useRef(null);
13
16
  const [layout,setLayout] = React.useState(Dimensions.get("window"));
14
17
  const {height} = layout;
@@ -60,6 +63,7 @@ const ScrollViewComponent = React.forwardRef(({virtualized,contentProps,containe
60
63
  }} {...containerProps} style={[theme.styles.w100,containerProps.style]} testID={testID+"_ScrollViewContainer"}>
61
64
  <ScrollView
62
65
  ref={ref} {...rest}
66
+ vertical = {vertical}
63
67
  testID={testID}
64
68
  children={children}
65
69
  contentContainerStyle = {contentContainerStyle}
@@ -71,6 +75,9 @@ ScrollViewComponent.displayName = "ScrollViewComponent";
71
75
  export default ScrollViewComponent;
72
76
 
73
77
  ScrollViewComponent.propTypes = {
78
+ ...defaultObj(ScrollView.propTypes),
79
+ horizontal : PropTypes.bool,
80
+ vertical : PropTypes.bool,
74
81
  virtualized : PropTypes.bool,
75
82
  contentProps : PropTypes.object,
76
83
  }
@@ -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.useStateIfMounted("");
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.useStateIfMounted(defVal)
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.useStateIfMounted(defaultValue == checkedValue ? true : false)
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
- React.useOnRender(onRender);
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} horizontal {...allScrollViewProps}
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
- {hContent}
279
- {filtersContent}
280
- {fContent}
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.useStateIfMounted(isSecureText);
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.useStateIfMounted({
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.useStateIfMounted(toCase(defaultValue));
155
+ const [text, _setText] = React.useState(toCase(defaultValue));
156
156
  const previousText = React.usePrevious(text);
157
157
 
158
158