@fto-consult/expo-ui 6.29.2 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@FTO-CONSULT/EXPO-UI",
3
- "version": "6.28.1",
3
+ "version": "6.30.0",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "bin": {
6
6
  "expo-ui": "./bin/index.js"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fto-consult/expo-ui",
3
- "version": "6.29.2",
3
+ "version": "6.30.1",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -43,7 +43,7 @@
43
43
  "expo-fix": "npx expo install --fix",
44
44
  "delete-node-modules": "rimraf ./**/node_modules",
45
45
  "modifier-url-remote-git": "git remote set-url origin 'https://borispipo@github.com/borispipo/smart-eneo.git'",
46
- "update": "npm i expo @emotion/native@latest @react-native-community/netinfo@latest react-native-big-list@latest apexcharts@latest file-saver@latest fs-extra@latest google-libphonenumber@latest @pchmn/expo-material3-theme@latest @emotion/native@latest @fto-consult/common@latest react-native-blob-util react-native-gesture-handler@latest react-native-iphone-x-helper@latest react-native-mime-types@latest react-native-paper@latest react-native-safe-area-context@latest react-native-paper-dates@latest @react-navigation/native@latest @react-navigation/native-stack@latest react-native-screens@latest react-virtuoso@latest tippy.js@latest websql@latest xlsx@latest && npx expo install --fix"
46
+ "update": "npm i expo @emotion/native@latest react-native-big-list@latest apexcharts@latest file-saver@latest fs-extra@latest google-libphonenumber@latest @pchmn/expo-material3-theme@latest @emotion/native@latest @fto-consult/common@latest react-native-blob-util react-native-gesture-handler@latest react-native-iphone-x-helper@latest react-native-mime-types@latest react-native-paper@latest react-native-paper-dates@latest @react-navigation/native@latest @react-navigation/native-stack@latest react-virtuoso@latest tippy.js@latest websql@latest xlsx@latest && npx expo install --fix"
47
47
  },
48
48
  "bin": {
49
49
  "expo-ui": "./bin/index.js"
@@ -105,7 +105,7 @@
105
105
  "react-native-iphone-x-helper": "^1.3.1",
106
106
  "react-native-mime-types": "^2.4.0",
107
107
  "react-native-paper": "^5.10.3",
108
- "react-native-paper-dates": "^0.18.14",
108
+ "react-native-paper-dates": "^0.18.17",
109
109
  "react-native-reanimated": "~3.3.0",
110
110
  "react-native-safe-area-context": "4.6.3",
111
111
  "react-native-screens": "~3.22.0",
@@ -76,6 +76,9 @@ const DatagridAccordionRow = React.forwardRef((props,ref)=>{
76
76
  return getRowStyle({row:item,index,selected,numColumns,isAccordion:true,rowIndex:index});
77
77
  },[selected,numColumns]);
78
78
  const viewWrapperStyle = [selectable !== false && theme.styles.cursorPointer];
79
+ if(!hasAvatar){
80
+ viewWrapperStyle.push(styles.hasNotAvatar);
81
+ }
79
82
  if(selected) {
80
83
  const handleAvatarRowToggle = (event)=>{
81
84
  React.stopEventPropagation(event);
@@ -92,7 +95,6 @@ const DatagridAccordionRow = React.forwardRef((props,ref)=>{
92
95
  title = {sTtitle}
93
96
  ></Avatar> : null;
94
97
  if(!hasAvatar){
95
- viewWrapperStyle.push(styles.hasNotAvatar);
96
98
  viewWrapperStyle.push({borderLeftColor:theme.colors.primaryOnSurface})
97
99
  }
98
100
  }
@@ -154,7 +156,7 @@ const DatagridAccordionRow = React.forwardRef((props,ref)=>{
154
156
  extrapolate: 'clamp',
155
157
  });
156
158
  return (
157
- <View style={{justifyContent:'center',flex:1}}>
159
+ <View testID={testID+"_SwipeableLeftSide"} style={{justifyContent:'center',flex:1}}>
158
160
  <Animated.Text
159
161
  style={[
160
162
  styles.actionText,
@@ -165,7 +167,7 @@ const DatagridAccordionRow = React.forwardRef((props,ref)=>{
165
167
  },
166
168
  ]}>
167
169
  {(selected?'Désélectionnez la ligne ':'Sélectionnez la ligne ')}
168
- </Animated.Text>
170
+ </Animated.Text>
169
171
  </View>
170
172
  );
171
173
  }}
@@ -178,7 +180,7 @@ const DatagridAccordionRow = React.forwardRef((props,ref)=>{
178
180
  }}
179
181
  >
180
182
  <View
181
- style={[styles.renderedContent,viewWrapperStyle]}
183
+ style={[styles.renderedContent,viewWrapperStyle,!hasAvatar && styles.contentContainerNotAvatar]}
182
184
  testID={testID+'_ContentContainer'}
183
185
  >
184
186
  {hasAvatar?<View testID={testID+"_AvatarContentContainer"} style={[styles.avatarContent]}>
@@ -245,7 +247,9 @@ const styles = StyleSheet.create({
245
247
  flexDirection : 'row',
246
248
  alignItems : 'center',
247
249
  justifyContent : 'center',
248
- paddingVertical : 10,
250
+ paddingVertical : 2,
251
+ paddingHorizontal : 0,
252
+ paddingRight : 10,
249
253
  width : "100%",
250
254
  },
251
255
  right : {
@@ -267,23 +271,27 @@ const styles = StyleSheet.create({
267
271
  container : {
268
272
  paddingVertical : 0,
269
273
  paddingHorizontal : 0,
270
- marginHorizontal : 5,
274
+ marginHorizontal : 0,
271
275
  flexWrap : 'nowrap',
272
276
  justifyContent : 'center',
273
277
  width : '100%',
274
278
  },
275
279
  avatarContent : {
276
- marginRight : 5,
280
+ marginRight : 10,
277
281
  },
278
282
  hasNotAvatar : {
279
283
  borderLeftWidth : 5,
280
284
  paddingLeft : 0,
281
- height : "100%"
285
+ height : "100%",
286
+ borderLeftColor : "transparent",
282
287
  },
283
288
  selected : {
284
289
  paddingHorizontal : 0,
285
290
  paddingVertical : 0,
286
291
  },
292
+ contentContainerNotAvatar : {
293
+ paddingLeft : 2,
294
+ },
287
295
  });
288
296
 
289
297
  DatagridAccordionRow.displayName = 'DatagridAccordionRow';
@@ -47,6 +47,13 @@ const DatagridFactory = (Factory)=>{
47
47
  this.state.refreshing = false;
48
48
  this.updateLayout = this.updateLayout.bind(this);
49
49
  }
50
+ componentDidUpdate(){
51
+ super.componentDidUpdate();
52
+ const p = this.expandedRef;
53
+ if(!p || !p?.ref) return;
54
+ const ref = p.ref;
55
+ ref?.toggleExpand && ref?.toggleExpand(false);
56
+ }
50
57
  isDatagrid(){
51
58
  return true;
52
59
  }
@@ -66,7 +73,7 @@ const DatagridFactory = (Factory)=>{
66
73
  arg.isAccordion = true;
67
74
  const {render,key,style} = super.renderRowCell(arg);
68
75
  if(render===null || !React.isValidElement(render)) return null;
69
- return <Label style={[style,{paddingTop:10,paddingBottom:10}]} key={key}>
76
+ return <Label testID={`${arg?.testID?arg.testID:""}_LabelContainer`} style={[style,{paddingTop:10,paddingBottom:10}]} key={key}>
70
77
  {render}
71
78
  </Label>
72
79
  }
@@ -265,6 +272,7 @@ const DatagridFactory = (Factory)=>{
265
272
  if(!isObj(this.bottomSheetContext) || typeof this.bottomSheetContext.open !=='function') return;
266
273
  if(!isObj(this.renderingItemsProps) || !isObj(this.renderingItemsProps[rowKey])) return;
267
274
  const callArgs = this.getItemCallArgs({item,index})
275
+ this.expandedRef = this.renderingItemsProps[rowKey];
268
276
  return this.bottomSheetContext.open({
269
277
  ...rest,
270
278
  onDismiss : ()=>{
@@ -509,7 +517,9 @@ const DatagridFactory = (Factory)=>{
509
517
  </View>
510
518
  return <DatagridProvider context={this}>
511
519
  <View testID={testID+"_Container"} pointerEvents={pointerEvents} style={[styles.container,this.props.style]} collapsable={false}>
512
- <View testID={testID+"_AccordionHeader"} style={[styles.accordionHeader]} ref={this.layoutRef} onLayout={this.updateLayout.bind(this)}>
520
+ <View testID={testID+"_AccordionHeader"} style={[styles.accordionHeader]} ref={(el)=>{
521
+ this.layoutRef.current = el;
522
+ }} onLayout={this.updateLayout.bind(this)}>
513
523
  {this.props.showActions !== false ? <DatagridActions
514
524
  testID={testID+"_Actions"}
515
525
  pointerEvents = {pointerEvents}
@@ -556,7 +566,9 @@ const DatagridFactory = (Factory)=>{
556
566
  renderItem = {this.renderItem.bind(this)}
557
567
  items = {this.state.data}
558
568
  isLoading = {isLoading}
559
- ref = {this.listRef}
569
+ ref = {(el)=>{
570
+ this.listRef.current = el;
571
+ }}
560
572
  style = {[styles.list,rest.style]}
561
573
  backToTopRef = {backToTopRef?(e)=>{
562
574
  return this.backToTopRef.current;
@@ -612,13 +624,14 @@ const styles = StyleSheet.create({
612
624
  maxHeight : 60
613
625
  },
614
626
  list : {
615
- paddingHorizontal : isNativeMobile()?10:0,
627
+ paddingHorizontal : 10,
616
628
  },
617
629
  container : {
618
630
  position : 'relative',
619
631
  flexDirection :'column',
620
632
  justifyContent : 'flex-start',
621
633
  width : '100%',
634
+ paddingHorizontal : 0,
622
635
  flex : 1,
623
636
  },
624
637
  accordionHeader : {
@@ -2890,10 +2890,13 @@ export default class CommonDatagridComponent extends AppComponent {
2890
2890
  args.columnsNames = this.preparedColumns.visibleColumnsNames;
2891
2891
  const key = item.sectionListHeaderKey;
2892
2892
  const label = key === this.emptySectionListHeaderValue ? this.getEmptySectionListHeaderValue() : key;
2893
+ const {renderSectionListHeaderOnFirstCell} = args;
2894
+ const sectionListHeaderContainerProps = defaultObj(args.sectionListHeaderContainerProps);
2893
2895
  const style = typeof this.props.getSectionListHeaderStyle =='function' ? this.props.getSectionListHeaderStyle(args) : null;
2894
2896
  const cStyle = typeof this.props.getSectionListHeaderContentContainerStyle =="function" ?this.props.getSectionListHeaderContentContainerStyle(args) : undefined;
2895
2897
  const lStyle = typeof this.props.getSectionListHeaderLabelStyle =='function' ? this.props.getSectionListHeaderLabelStyle(args) : null;
2896
2898
  const rowKey = defaultVal(args.rowIndex,args.index,args.rowCounterIndex);
2899
+ const rowIndex = defaultNumber(args.rowIndex,args.index);
2897
2900
  const testID = defaultStr(args.testID,"RN_DatagridSectionListHeader")+"_"+rowKey;
2898
2901
  if(Array.isArray(rowStyle)){
2899
2902
  if(style){
@@ -2901,25 +2904,36 @@ export default class CommonDatagridComponent extends AppComponent {
2901
2904
  }
2902
2905
  }
2903
2906
  let cells = null;
2907
+ const Cell = React.isComponent(args.Cell) ? args.Cell : View;
2904
2908
  const isA = this.isAccordion();
2909
+ const sectionListHeaderProps = defaultObj(args.sectionListHeaderProps);
2910
+ const headerContent = <Label testID={testID+"_Label"} splitText numberOfLines={3} textBold {...sectionListHeaderProps} style={[theme.styles.w100,{color:theme.colors.primaryOnSurface,fontSize:isA?15 :16},lStyle,theme.styles.ph1,sectionListHeaderProps.style]}>{label}</Label>;
2911
+ let hasAlreadRenderMainHeaderOnFirstCell = false;
2905
2912
  if(this.canShowFooters() && isObj(this.sectionListHeaderFooters[key])){
2906
2913
  const {visibleColumnsNames,widths} = defaultObj(this.preparedColumns);
2907
2914
  if(isObj(visibleColumnsNames) &&isObj(widths)){
2908
2915
  cells = [];
2909
2916
  const footers = this.sectionListHeaderFooters[key];
2910
2917
  Object.map(visibleColumnsNames,(v,column)=>{
2911
- if(!v || typeof widths[column] !== 'number') {
2918
+ if(!v || !column) {
2912
2919
  return null;
2913
2920
  }
2914
- if(!column) return null;
2915
2921
  const width = widths[column];
2916
2922
  const key2 = key+column;
2923
+ const cellProps = Cell !== View ? {width,isSectionListHeader:true,columnField:column} : {style:{width}};
2917
2924
  if(!this.state.columns[column] || !footers[column]) {
2918
2925
  if(this.isAccordion()) return null;
2919
- cells.push(<View key={key2} testID={testID+"_FooterCellContainer_"+key2} style={[{width,marginLeft:0,paddingLeft:0,marginRight:0,paddingRight:0}]}></View>)
2926
+ const canD = renderSectionListHeaderOnFirstCell && !hasAlreadRenderMainHeaderOnFirstCell;
2927
+ const cProps = canD ? sectionListHeaderContainerProps : {};
2928
+ cells.push(<Cell {...cellProps} {...cProps} key={key2} testID={testID+"_FooterCellContainer_"+key2} style={[{marginLeft:0,paddingLeft:0,marginRight:0,paddingRight:0},cellProps.style,cProps.style]}
2929
+ children = {canD ? headerContent:null}
2930
+ />)
2920
2931
  } else {
2921
2932
  const footer = footers[column];
2922
- cells.push(<View key={key2} testID={testID+"_FooterCellContainer_"+key2} style={[tableStyles.headerItemOrCell,!isA?{width,alignItems:'flex-start',justifyContent:'flex-start'}:{marginLeft:0,paddingLeft:0,marginRight:5}]}>
2933
+ const canD = renderSectionListHeaderOnFirstCell && !hasAlreadRenderMainHeaderOnFirstCell;
2934
+ const cProps = canD ? sectionListHeaderContainerProps : {};
2935
+ cells.push(<Cell {...cellProps} {...cProps} key={key2} width={width} testID={testID+"_FooterCellContainer_"+key2} style={[tableStyles.headerItemOrCell,!isA?{alignItems:'flex-start',justifyContent:'flex-start'}:{marginLeft:0,paddingLeft:0,marginRight:5},cellProps.style,cProps.style]}>
2936
+ {canD ? headerContent:null}
2923
2937
  <Footer
2924
2938
  key = {key2}
2925
2939
  testID={testID+"_FooterItem_"+key2}
@@ -2928,27 +2942,18 @@ export default class CommonDatagridComponent extends AppComponent {
2928
2942
  aggregatorFunction = {this.getActiveAggregatorFunction().code}
2929
2943
  aggregatorFunctions = {this.aggregatorFunctions}
2930
2944
  displayLabel = {this.isAccordion()}
2931
- //anchorProps = {{style:[theme.styles.ph1,theme.styles.mh05]}}
2932
2945
  />
2933
- </View>)
2946
+ </Cell>)
2934
2947
  }
2948
+ hasAlreadRenderMainHeaderOnFirstCell = true;
2935
2949
  });
2936
2950
  }
2937
2951
  }
2938
- const isCollapsed = this.isSectionListCollapsed(key);
2952
+ if(React.isComponent(args.Row)){
2953
+ return <args.Row index={rowIndex} rowData={item} rowIndex={rowIndex} isSectionListHeader cells={cells} headerContent={headerContent}/>
2954
+ }
2939
2955
  return <View testID={testID+"_ContentContainer"} style={[theme.styles.w100,isA && this.state.displayOnlySectionListHeaders && {borderTopColor:theme.colors.divider,borderTopWidth:1},isA ? [theme.styles.ph2,theme.styles.pt1] : [theme.styles.pt1,theme.styles.noPadding,theme.styles.noMargin],theme.styles.justifyContentCenter,theme.styles.alignItemsCenter,theme.styles.pb1,!cells && theme.styles.ml1,theme.styles.mr1,cStyle]}>
2940
- {false && <View testID={testID+"_LabelAndCollapsedContainer"} style={[theme.styles.w100,theme.styles.row,theme.styles.alignItemsCenter,theme.styles.justifyContentFlexStart]}>
2941
- <Icon
2942
- name = {isCollapsed?"chevron-up":"chevron-right"}
2943
- color = {theme.colors.primaryOnSurface}
2944
- style = {[theme.styles.noMargin,theme.styles.noPadding]}
2945
- size = {25}
2946
- onPress = {(e)=>{
2947
- this.toggleSectionListCollapsedState(key);
2948
- }}
2949
- />
2950
- </View>}
2951
- <Label testID={testID+"_Label"} splitText numberOfLines={3} textBold style={[theme.styles.w100,{color:theme.colors.primaryOnSurface,fontSize:isA?15 :16},lStyle,theme.styles.ph1]}>{label}</Label>
2956
+ {header}
2952
2957
  {cells ? <View testID={testID+"_TableRow"} style = {[theme.styles.w100,theme.styles.row,isA && theme.styles.pt1,theme.styles.alignItemsFlexStart,this.isAccordion() && theme.styles.rowWrap]}
2953
2958
  >{cells}</View> : null}
2954
2959
  </View>
@@ -3682,7 +3687,7 @@ export default class CommonDatagridComponent extends AppComponent {
3682
3687
  this.sort(columnField);
3683
3688
  };
3684
3689
  return <TouchableRipple disabled={!sortable} style={styles.sortableColumn} onPress={sortMe}>
3685
- <View testID={"RN_DatagridHeaderCellContainer_"+columnField} style={[tableStyles.cell,theme.styles.row,theme.styles.flex1,theme.styles.justifyContentFlexStart,theme.styles.alignItemsCenter]}>
3690
+ <View testID={"RN_DatagridHeaderCellContainer_"+columnField} style={[theme.styles.row,theme.styles.flex1,theme.styles.justifyContentFlexStart,theme.styles.alignItemsCenter]}>
3686
3691
  {isColumnSorted ? <Icon
3687
3692
  {...sortedColumn}
3688
3693
  size = {24}
@@ -3769,6 +3774,10 @@ export default class CommonDatagridComponent extends AppComponent {
3769
3774
  const renderText = isSectionListHeader === true || customRenderRowCell === false ? true : false;
3770
3775
  if(!isObj(rowData)) return renderText ? null : {render:null,extra:{}};
3771
3776
  rowIndex = isDecimal(rowIndex)? rowIndex : isDecimal(index)? index : undefined;
3777
+ isSectionListHeader = isSectionListHeader || rowData.isSectionListHeader;
3778
+ if(!isSectionListHeader && this.state.displayOnlySectionListHeaders){
3779
+ return {render:null};
3780
+ }
3772
3781
  rowKey = this.isValidRowKey(rowKey) ? rowKey : this.getRowKey(rowData,rowIndex);
3773
3782
  rowCounterIndex = isDecimal(rowCounterIndex) ? rowCounterIndex : isDecimal(rowIndex)? rowIndex+1 : defaultDecimal(rowCounterIndex);
3774
3783
  if(this.isSelectableColumn(columnDef,columnField)){
@@ -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={this.layoutRef} testID={testID+"_LayoutContainer"}>
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 = {this.listRef}
306
+ ref = {(el)=>{
307
+ this.listRef.current = el;
308
+ }}
305
309
  {...rest}
306
310
  withDatagridContext
307
311
  sortedColumn = {sortedColumn}
@@ -653,7 +653,6 @@ export default class DropdownAlert extends Component {
653
653
  elevation: elevation,
654
654
  };
655
655
  const activeOpacity = !tapToCloseEnabled || showCancel ? 1 : 0.95;
656
- console.log(contentContainerStyle," is content container style");
657
656
  const onPress = !tapToCloseEnabled
658
657
  ? null
659
658
  : () => this.closeAction(ACTION.tap);
@@ -165,7 +165,7 @@ export default class DrawerLayout extends React.PureComponent {
165
165
  if(permanent){
166
166
  dynamicDrawerStyles.position = "relative";
167
167
  }
168
- const content = <Animated.View style={[styles.main]}>
168
+ const content = <Animated.View style={[styles.main]} testID={testID+"_DrawerLayoutContent"}>
169
169
  {this.props.children}
170
170
  </Animated.View>
171
171
  return (
@@ -437,6 +437,8 @@ const styles = StyleSheet.create({
437
437
  main: {
438
438
  flex: 1,
439
439
  zIndex: 0,
440
+ width : "100%",
441
+ height : "100%",
440
442
  },
441
443
  overlay: {
442
444
  position: 'absolute',
@@ -16,8 +16,7 @@ import styles, {
16
16
  _dynamicImageBackground,
17
17
  _dynamicBackgroundOpacity,
18
18
  } from "./styles"
19
- const isNative = isNativeMobile();
20
- const Component = isNative? Animated.View : View;
19
+ import {useAppComponent} from "$econtext/hooks";
21
20
 
22
21
  const SplashScreenComponent = ({isLoaded,children , duration, delay,logoWidth,logoHeight,backgroundColor,imageBackgroundSource,imageBackgroundResizeMode,
23
22
  testID,
@@ -50,23 +49,7 @@ const SplashScreenComponent = ({isLoaded,children , duration, delay,logoWidth,lo
50
49
  testID = defaultStr(testID,"RN_SplashscreenComponent")
51
50
  logoWidth = defaultDecimal(logoWidth,150);
52
51
  logoHeight = defaultDecimal(logoHeight,250);
53
- const opacityClearToVisible = {
54
- opacity: loadingProgress.interpolate({
55
- inputRange: [0, 15, 30],
56
- outputRange: [0, 0, 1],
57
- extrapolate: "clamp",
58
- }),
59
- }
60
- const imageScale = {
61
- transform: [
62
- {
63
- scale: loadingProgress.interpolate({
64
- inputRange: [0, 10, 100],
65
- outputRange: [1, 1, 65],
66
- }),
67
- },
68
- ],
69
- }
52
+ const Component = useAppComponent("SplashScreen");
70
53
 
71
54
  const logoScale = {
72
55
  transform: [
@@ -99,6 +82,7 @@ const SplashScreenComponent = ({isLoaded,children , duration, delay,logoWidth,lo
99
82
  }
100
83
  const child = (animationDone && isLoaded)? React.isValidElement(children) && children : null;
101
84
  if(animationDone && isLoaded) return child;
85
+ const hasComponent = React.isComponent(Component);
102
86
  return <View style={[styles.container]} testID={testID} id={testID}>
103
87
  {!animationDone ? <View style={StyleSheet.absoluteFill} testID={testID+"_Animation"}/> : null}
104
88
  <View style={styles.containerGlue} testID={testID+"_ContainerGlue"}>
@@ -108,22 +92,20 @@ const SplashScreenComponent = ({isLoaded,children , duration, delay,logoWidth,lo
108
92
  testID={testID+"_AnimationDone"}
109
93
  />
110
94
  )}
111
- {false && (animationDone || isNative) && child}
112
95
  {!animationDone && (
96
+ React.isComponent(Component)? <Component testID={testID+"_CustomSplashComponent"}/> :
113
97
  <View testID={testID+"_LogoContainer"} style={[StyleSheet.absoluteFill, styles.logoStyle]}>
114
- {(
115
- <Animated.View
116
- testID={testID+"_Logo"}
117
- style={_dynamicCustomComponentStyle(
118
- logoScale,
119
- logoOpacity,
120
- logoWidth,
121
- logoHeight
122
- )}>
123
- {<LogoProgress/>}
124
- </Animated.View>
125
- )}
126
- </View>
98
+ <Animated.View
99
+ testID={testID+"_Logo"}
100
+ style={_dynamicCustomComponentStyle(
101
+ logoScale,
102
+ logoOpacity,
103
+ logoWidth,
104
+ logoHeight
105
+ )}>
106
+ {<LogoProgress />}
107
+ </Animated.View>
108
+ </View>
127
109
  )}
128
110
  </View>
129
111
  </View>
@@ -4,7 +4,7 @@ import theme from "$theme";
4
4
 
5
5
  import { StyleSheet } from "react-native";
6
6
  const TableHeaderCellComponent = React.forwardRef(({columnDef,className,width,style,children,...props},ref)=>{
7
- return <th ref={ref} className={classNames(className,"table-header-cell")} children={children} style={StyleSheet.flatten([style])}/>
7
+ return <th ref={ref} className={classNames(className,"table-header-cell")} children={children} style={StyleSheet.flatten(style)}/>
8
8
  });
9
9
  TableHeaderCellComponent.displayName = "TableTableHeaderCellComponent";
10
10
  export default TableHeaderCellComponent;
@@ -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 TableHeaderCellComponent = React.forwardRef(({width,style,...props},ref)=>{
4
+ const TableHeaderCellComponentNative = React.forwardRef(({width,style,...props},ref)=>{
5
5
  return <View ref={ref} {...props} style={[styles.cell,style,width && {width}]}/>
6
6
  });
7
- TableHeaderCellComponent.displayName = "TableTableHeaderCellComponent";
8
- export default TableHeaderCellComponent;
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 HeaderCell from "./Cell";
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,...rest} = props;
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 <HeaderCell {...containerProps} width={width} columnDef={columnDef} columnField={columnField} style={[styles.headerItem,styles.headerItemOrCell,styles.filterCell,containerProps.style,styles.cell,columnDef.style]} children={content}/>
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;
@@ -4,10 +4,9 @@
4
4
  import React from "react";
5
5
  import {classNames} from "$cutils";
6
6
  import { StyleSheet } from "react-native";
7
- import Label from "$ecomponents/Label";
8
7
 
9
- function TableCellContentComponent({children,columnDef,testID,columnField,style,...rest}){
10
- return (<td data-test-id={testID||"RN_TableCellComoponent"} className={classNames(rest.className,"table-row-cell")} style={StyleSheet.flatten([style])}>
8
+ function TableCellContentComponent({children,columnDef,width,testID,columnField,colSpan,style,...rest}){
9
+ return (<td data-test-id={testID||"RN_TableCellComoponent"} colSpan={colSpan} className={classNames(rest.className,"table-row-cell")} style={StyleSheet.flatten([style])}>
11
10
  {children}
12
11
  </td>);
13
12
  }
@@ -3,10 +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
- import {useTable} from "../../hooks";
7
- function TableCellContentComponent({children,columnField,style,colSpan,...rest}){
8
- const {colsWidths} = useTable();
9
- const width = columnField ? colsWidths[columnField] : 0;
6
+ function TableCellContentComponent({children,columnField,style,colSpan,width,...rest}){
10
7
  return (<View testID={"RN_TableRowCellContentComponent"} {...rest} style={[style,width && {width}]}>
11
8
  {children}
12
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
- const TableRowCellComponent = React.forwardRef(({children,columnDef,columnField,rowData,colSpan,isSectionListHeader,rowIndex,style,...rest},ref)=>{
7
+
8
+ const TableRowCellComponent = React.forwardRef(({children,columnDef,className,columnField,rowData,colSpan,isSectionListHeader,rowIndex,style,...rest},ref)=>{
8
9
  if(isSectionListHeader){
9
- return <CellContent colSpan={colSpan} ref={ref} style={[styles.sectionListHeader,style]} >
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={[style,containerProps.style]} >
23
- {columnDef.isSelectableColumnName ? content : <Label testID="RN_TableRowCell" style={[styles.cell]}>{content}</Label>}
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
 
@@ -0,0 +1,3 @@
1
+ export default function SectionListHeaderRow ({cells,rowIndex,headerContent}){
2
+ return cells;
3
+ }
@@ -9,20 +9,31 @@ import styles from "../styles";
9
9
  import {useTable} from "../hooks";
10
10
  import RowWrapper from "./RowWrapper";
11
11
  import React from "$react";
12
- import theme from "$theme";
12
+ import SectionListHeaderRow from "./SectionListHeaderRow";
13
+ import {isMobileNative} from "$cplatform";
14
+ const isNative = isMobileNative();
15
+ const nativeProps = isNative ? {} : {Cell,Row:SectionListHeaderRow};
13
16
  export default function TableRowComponent({cells,rowKey,rowData,index,...rest}){
14
- const {visibleColsNames,visibleColsNamesStr,renderSectionHeader,columns} = useTable();
15
- if(!isObj(rowData)) return null;
17
+ const {visibleColsNames,visibleColsNamesStr,renderSectionHeader,colsWidths,columns} = useTable();
18
+ if(!isObj(rowData)) {
19
+ return null;
20
+ };
16
21
  const content = React.useMemo(()=>{
17
- if(rowData.isSectionListHeader && typeof renderSectionHeader ==='function'){
18
- return <RowWrapper style={[styles.row,theme.styles.pv1]}>
19
- <Cell isSectionListHeader colSpan={visibleColsNames.length}>{renderSectionHeader({isSectionListHeader:true,rowData,item:rowData,index,rowIndex:index,isTable:true,rowKey})}</Cell>
20
- </RowWrapper>
22
+ if(rowData.isSectionListHeader){
23
+ if(typeof renderSectionHeader !='function'){
24
+ throw "Vous devez définir la fonction renderSectionListHeader, utile pour le rendu du contenu de section header de la table de données";
25
+ }
26
+ return renderSectionHeader({isSectionListHeader:true,renderSectionListHeaderOnFirstCell:true,
27
+ sectionListHeaderContainerProps : {
28
+ style : {position:"relative",paddingLeft:"10px",paddingRight:"10px"}
29
+ },
30
+ sectionListHeaderProps:{className:"table-section-list-header",style:styles.sectionListHeaderAbsolute,testID:"RN_TableComponentSectionListHeader"}
31
+ ,...nativeProps,rowData,item:rowData,index,rowIndex:index,isTable:true,rowKey})
21
32
  }
22
33
  return visibleColsNames.map((columnField,cIndex)=>{
23
34
  const columnDef = columns[columnField];
24
35
  if(!isObj(columnDef)) return null;
25
- return <Cell rowData={rowData} rowKey={rowKey} children={rowData[columnField]} rowIndex={index} columnDef={columnDef} index={cIndex} key={columnField} columnField={columnField}/>
36
+ return <Cell rowData={rowData} width={columnField ? colsWidths[columnField] : 0} rowKey={rowKey} children={rowData[columnField]} rowIndex={index} columnDef={columnDef} index={cIndex} key={columnField} columnField={columnField}/>
26
37
  });
27
38
  },[rowKey,index,visibleColsNamesStr]);
28
39
  return <RowWrapper {...rest} rowKey={rowKey} rowData={rowData} rowIndex={index} style={[styles.row]}>
@@ -1,5 +1,5 @@
1
1
  import View from "$ecomponents/View";
2
- import {defaultObj,defaultStr,debounce,defaultNumber,uniqid,isObj,defaultVal} from "$cutils";
2
+ import {defaultObj,defaultStr,debounce,classNames,defaultNumber,uniqid,isObj,defaultVal} from "$cutils";
3
3
  import PropTypes from "prop-types";
4
4
  import React from "$react";
5
5
  import { StyleSheet,View as RNView,ScrollView,Dimensions} from "react-native";
@@ -255,9 +255,9 @@ const TableComponent = React.forwardRef(({containerProps,listContainerStyle,onRe
255
255
  const index = props['data-index'];
256
256
  const item = getRowByIndex(index) || props?.item || null;
257
257
  if(!item) return null;
258
- const args = {rowData:item,rowIndex:index,index,bordered,isTable:true};
258
+ const args = {rowData:item,rowIndex:index,index,bordered,isTable:true};
259
259
  args.selected = withDatagridContext ? useIsRowSelected(item,index) : false;
260
- return <TableRowComponent {...props} style={[getRowStyle(args),props.style]}/>
260
+ return <TableRowComponent {...props} className={classNames(props.className,"table-row-tr")} style={[getRowStyle(args),styles.tr,props.style]}/>
261
261
  },
262
262
  Table: VirtuosoTableComponent,
263
263
  EmptyPlaceholder : (props)=>{
@@ -1,4 +1,4 @@
1
- import { StyleSheet } from "react-native";
1
+ import { StyleSheet,Platform } from "react-native";
2
2
  import {isMobileNative} from "$cplatform";
3
3
 
4
4
  const styles = StyleSheet.create({
@@ -9,6 +9,9 @@ const styles = StyleSheet.create({
9
9
  flex:1,
10
10
  },
11
11
  headerCellLabel : {maxHeight:70},
12
+ tdSectionHeader : {
13
+ width : "100%",
14
+ },
12
15
  container : {
13
16
  width : '100%',
14
17
  minHeight : 300,
@@ -77,6 +80,9 @@ const styles = StyleSheet.create({
77
80
  justifyContent : 'center',
78
81
  alignItems : 'flex-start',
79
82
  },
83
+ tr : {
84
+ position : "relative",
85
+ },
80
86
  row : {
81
87
  flexDirection : "row",
82
88
  justifyContent : "flex-start",
@@ -96,7 +102,7 @@ const styles = StyleSheet.create({
96
102
  },
97
103
  cell : isMobileNative()? {
98
104
  paddingLeft:10,
99
- paddingRight : 5,
105
+ paddingRight : 10,
100
106
  paddingBottom : 2,
101
107
  paddingTop : 2,
102
108
  } : {
@@ -108,6 +114,16 @@ const styles = StyleSheet.create({
108
114
  sectionListHeader : {
109
115
  paddingVertical : 10,
110
116
  paddingHorizontal : 10,
111
- }
117
+ },
118
+ sectionListHeaderAbsolute : {
119
+ position : "relative",
120
+ top : "0",
121
+ left : "0",
122
+ width : "100%",
123
+ paddingLeft : 0,
124
+ paddingRight : 0,
125
+ textAlign : "center",
126
+ whiteSpace : "nowrap",
127
+ },
112
128
  });
113
129
  export default styles;
@@ -30,6 +30,8 @@ export const useAppGetComponent = (componentName)=>{
30
30
  return components[componentName] || components[componentName.toLowerCase()] || components[componentName.ucFirst()] || components[camCase] || components[lowerFirst] || components[componentName.toUpperCase()] || null;
31
31
  }
32
32
 
33
+ export const useAppComponent = useAppGetComponent;
34
+
33
35
  /*** permet d'attacher un lister sur la modification des props de manière responsive :
34
36
  permet de récupérer la fonction à attacher par défaut au listener DimensionChange, pour la mise à jour automatique de la propriété style
35
37
  * @param mediaQueryUpdateStyleCb{function}, la fonction permettant de mettre à jour les props lorsque la taille de l'écran change
@@ -52,13 +52,14 @@ export default function MainScreenScreenWithoutAuthContainer(props) {
52
52
  testID,
53
53
  right,
54
54
  keyboardAvoidingViewProps,
55
+ backgroundColor,
55
56
  ...rest
56
57
  } = props;
57
58
  const insets = useSafeAreaInsets();
58
59
  keyboardAvoidingViewProps = defaultObj(keyboardAvoidingViewProps);
59
60
  testID = defaultStr(testID,"RN_MainScreenScreenWithoutAuthContainer")
60
61
  containerProps = defaultObj(containerProps);
61
- const backgroundColor = theme.colors.background;
62
+ backgroundColor = theme.Colors.isValid(backgroundColor)? backgroundColor : theme.colors.background;
62
63
  const containerStyle = [
63
64
  styles.container,
64
65
  {
@@ -423,7 +423,7 @@ export default class TableDataScreenComponent extends FormDataScreen{
423
423
  appBarProps.elevation = 0;
424
424
  restProps.elevation = 0;
425
425
  }
426
- return <ScreenContainer {...restProps} appBarProps = {appBarProps} testID={testID}>
426
+ return <ScreenContainer backgroundColor={theme.surfaceBackground} {...restProps} appBarProps = {appBarProps} testID={testID}>
427
427
  {this.wrapRenderingContent(mainContent,{testID})}
428
428
  </ScreenContainer>
429
429
  }
@@ -1 +1 @@
1
- module.exports = {"@FTO-CONSULT/EXPO-UI":{"name":"@FTO-CONSULT/EXPO-UI","version":"6.28.1","homepage":"https://github.com/borispipo/expo-ui#readme"}};
1
+ module.exports = {"@FTO-CONSULT/EXPO-UI":{"name":"@FTO-CONSULT/EXPO-UI","version":"6.30.0","homepage":"https://github.com/borispipo/expo-ui#readme"}};
@@ -1,8 +0,0 @@
1
- if(isFilter){
2
- console.log(forceRender,"is force render heeeeein manaa",rest.style);
3
- return colsNames.map((columnField,index)=>{
4
- const visible = columnsVisibilities[index];
5
- if(!visible) return null;
6
- return <CellWrapper isFilter key={columnField} columnField={columnField} columIndex={index}/>
7
- })
8
- }
@@ -1,10 +0,0 @@
1
- import React from "$react";
2
- import View from "$ecomponents/View";
3
-
4
- const RowHeaderComponent = React.forwardRef(({...props},ref)=>{
5
-
6
- });
7
-
8
-
9
- RowHeaderComponent.displayName = "TableRowHeaderComponent";
10
- export default RowHeaderComponent;
@@ -1,9 +0,0 @@
1
- import React from "$react";
2
-
3
- const RowHeaderComponent = React.forwardRef(({...props},ref)=>{
4
-
5
- });
6
-
7
-
8
- RowHeaderComponent.displayName = "TableRowHeaderComponent";
9
- export default RowHeaderComponent;