@fto-consult/expo-ui 6.71.4 → 6.71.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/components/AutoSizer/Vertical.js +0 -1
- package/src/components/ScrollView/index.js +2 -6
- package/src/components/Swiper/index.js +5 -4
- package/src/components/Table/List/index.js +2 -9
- package/src/components/Table/Row/index.js +1 -1
- package/src/components/Table/styles.js +1 -1
- package/src/layouts/Screen/TableData.js +7 -8
- package/src/layouts/Screen/utils.js +1 -1
package/package.json
CHANGED
@@ -4,7 +4,6 @@ import PropTypes from "prop-types";
|
|
4
4
|
import View from "$ecomponents/View";
|
5
5
|
import theme from "$theme";
|
6
6
|
import {defaultStr,defaultObj,defaultNumber} from "$cutils";
|
7
|
-
import APP from "$capp/instance";
|
8
7
|
import ActivityIndicator from "$ecomponents/ActivityIndicator";
|
9
8
|
|
10
9
|
/***
|
@@ -1,9 +1,8 @@
|
|
1
1
|
import React from '$react';
|
2
2
|
import { ScrollView} from 'react-native';
|
3
|
-
import PropTypes from "prop-types";
|
4
3
|
|
5
|
-
const ScrollViewComponent = React.forwardRef(({
|
6
|
-
return <ScrollView testID={testID} {...rest} ref={ref}/>
|
4
|
+
const ScrollViewComponent = React.forwardRef(({testID,...rest},ref) => {
|
5
|
+
return <ScrollView testID={testID || "RN_ScrollViewComponent"} {...rest} ref={ref}/>
|
7
6
|
});
|
8
7
|
|
9
8
|
ScrollViewComponent.displayName = "ScrollViewComponent";
|
@@ -11,7 +10,4 @@ export default ScrollViewComponent;
|
|
11
10
|
|
12
11
|
ScrollViewComponent.propTypes = {
|
13
12
|
...defaultObj(ScrollView.propTypes),
|
14
|
-
withAutoSizer : PropTypes.bool,//si le contenu du scrollView sera wrap par le composant AutoSizer
|
15
|
-
maxHeight : PropTypes.number,
|
16
|
-
minHeight : PropTypes.number,
|
17
13
|
}
|
@@ -279,14 +279,14 @@ class SwiperComponent extends React.Component {
|
|
279
279
|
contentContainerProps = defaultObj(contentContainerProps);
|
280
280
|
swipeAreaProps = defaultObj(swipeAreaProps);
|
281
281
|
contentProps = defaultObj(contentProps);
|
282
|
-
withScrollView = typeof withScrollView ==='boolean'? withScrollView : false;
|
282
|
+
withScrollView = true;//typeof withScrollView ==='boolean'? withScrollView : false;
|
283
283
|
const Wrapper = withScrollView ? ScrollView : React.Fragment;
|
284
284
|
const wrapperProps = withScrollView ? Object.assign({},scrollViewProps) : {};
|
285
285
|
testID = defaultStr(testID,'RN_SwiperComponent');
|
286
286
|
childrenProps = Array.isArray(childrenProps)? childrenProps : [];
|
287
287
|
const isReady = customHeight > 40 ? true : false;
|
288
288
|
const autoHeight = !!this.props.autoHeight;
|
289
|
-
const height = autoHeight ?
|
289
|
+
const height = autoHeight ? this.state.height : !isReady ? WIDTH_HEIGHT : customHeight;
|
290
290
|
if(withScrollView){
|
291
291
|
if(typeof wrapperProps.showsVerticalScrollIndicator !=='boolean'){
|
292
292
|
wrapperProps.showsVerticalScrollIndicator = !isNative;
|
@@ -373,6 +373,7 @@ class SwiperComponent extends React.Component {
|
|
373
373
|
|
374
374
|
SwiperComponent.propTypes = {
|
375
375
|
vertical: PropTypes.bool,
|
376
|
+
autoHeight : PropTypes.bool,//cette prop permet de redimensionner automatiquement le tab sur la page, utilise lorsque l'on souhaite que le tab aucupe toute les page
|
376
377
|
activeIndex: PropTypes.number,
|
377
378
|
autoHeight : PropTypes.bool,//si la valeur de la taille des éléments sera automatiquement réajusté
|
378
379
|
loop: PropTypes.bool,
|
@@ -458,9 +459,9 @@ const styles = {
|
|
458
459
|
left: 0,
|
459
460
|
width:vertical ? width : width * count,
|
460
461
|
flexDirection: vertical ? 'column' : 'row',
|
461
|
-
}),typeof height ==='number'? (vertical ? height * count : height) :
|
462
|
+
}),typeof height ==='number'? (vertical ? height * count : height) : undefined,autoHeight),
|
462
463
|
scrollViewContentContainer : {
|
463
|
-
paddingBottom :
|
464
|
+
paddingBottom : 0,
|
464
465
|
flex : 1,
|
465
466
|
},
|
466
467
|
preloaderContainer : {
|
@@ -1,15 +1,8 @@
|
|
1
1
|
import React from "$react";
|
2
|
-
import {Vertical as AutoSizeVertical} from "$ecomponents/AutoSizer";
|
3
2
|
import List from "$ecomponents/List/Virtuoso";
|
4
|
-
import {defaultStr,isObj,defaultObj} from "$cutils";
|
5
3
|
|
6
|
-
const AutoSizeVerticalList = React.forwardRef((
|
7
|
-
|
8
|
-
autoSizerProps = defaultObj(autoSizerProps);
|
9
|
-
return <List {...props} style={[props.style]} ref={ref}/>;
|
10
|
-
return <AutoSizeVertical withPadding={false} testID={testID+"_AutoSizerVertical"} {...autoSizerProps} >
|
11
|
-
<List {...props} style={[props.style]} ref={ref}/>
|
12
|
-
</AutoSizeVertical>
|
4
|
+
const AutoSizeVerticalList = React.forwardRef((props,ref)=>{
|
5
|
+
return <List {...props} ref={ref}/>;
|
13
6
|
})
|
14
7
|
|
15
8
|
AutoSizeVerticalList.displayName = "AutoSizeVerticalListComponent";
|
@@ -22,7 +22,7 @@ export default function TableRowComponent({cells,rowKey,rowData,index,...rest}){
|
|
22
22
|
}
|
23
23
|
return renderSectionHeader({isSectionListHeader:true,renderSectionListHeaderOnFirstCell:true,
|
24
24
|
sectionListHeaderContainerProps : {
|
25
|
-
style : {position:"relative",paddingLeft:
|
25
|
+
style : {position:"relative",paddingLeft:10,paddingRight:10}
|
26
26
|
},
|
27
27
|
sectionListHeaderProps:{className:"table-section-list-header",style:styles.sectionListHeaderAbsolute,testID:"RN_TableComponentSectionListHeader"}
|
28
28
|
,...nativeProps,rowData,item:rowData,index,rowIndex:index,isTable:true,rowKey})
|
@@ -13,7 +13,6 @@ import {canMakePhoneCall, makePhoneCall as makePCall} from "$app/makePhoneCall";
|
|
13
13
|
import copyToClipboard from "$app/clipboard";
|
14
14
|
import {isMobileOrTabletMedia} from "$platform/dimensions";
|
15
15
|
import Tab from "$ecomponents/Tab";
|
16
|
-
import Surface from "$ecomponents/Surface";
|
17
16
|
import View from "$ecomponents/View";
|
18
17
|
import {goBack as navGoBack} from "$cnavigation";
|
19
18
|
import {renderTabsContent,renderActions} from "./utils";
|
@@ -25,6 +24,7 @@ import {isDocEditing,checkPrimaryKey} from "$ecomponents/Form";
|
|
25
24
|
import i18n from "$i18n";
|
26
25
|
import fetch from "$capi/fetch";
|
27
26
|
import appConfig from "$capp/config";
|
27
|
+
import {Vertical} from "$ecomponents/AutoSizer";
|
28
28
|
|
29
29
|
|
30
30
|
const HIDE_PRELOADER_TIMEOUT = 300;
|
@@ -416,14 +416,13 @@ export default class TableDataScreenComponent extends FormDataScreen{
|
|
416
416
|
restProps.tabProps = tabProps = defaultObj(tabProps);
|
417
417
|
const tabs = this.renderTabs(restProps);
|
418
418
|
const tabKey = this.getTabsKey();
|
419
|
-
const
|
419
|
+
const isMobOrTab = isMobileOrTabletMedia();
|
420
|
+
tabsProps.tabContentProps.autoHeight = typeof tabsProps.tabContentProps.autoHeight =="boolean"? tabsProps.tabContentProps.autoHeight : isMobOrTab;
|
420
421
|
const contentProps = restProps.contentProps;
|
421
|
-
const
|
422
|
-
const renderingTabsProps = {tabs,data:this.getCurrentData(),isMobile,sessionName:this.getSessionName(),props:restProps,tabProps,tabsProps,context,tabKey};
|
422
|
+
const renderingTabsProps = {tabs,data:this.getCurrentData(),isMobile:isMobOrTab,sessionName:this.getSessionName(),props:restProps,tabProps,tabsProps,context,tabKey};
|
423
423
|
const hasTabs = Object.size(tabs,true);
|
424
424
|
let mainContent = undefined;
|
425
425
|
testID = defaultStr(testID,"RN_TableDataScreenItem_"+restProps.tableName);
|
426
|
-
const isMobOrTab = isMobileOrTabletMedia();
|
427
426
|
firstTabProps = extendObj({},tabProps,firstTabProps);
|
428
427
|
if(hasTabs){
|
429
428
|
if(isMobOrTab){
|
@@ -441,8 +440,8 @@ export default class TableDataScreenComponent extends FormDataScreen{
|
|
441
440
|
contentProps.style = [contentProps.style,styles.noMargin,styles.noPadding,styles.content]
|
442
441
|
mainContent = ct;
|
443
442
|
} else {
|
444
|
-
mainContent = <
|
445
|
-
<ScrollView
|
443
|
+
mainContent = <Vertical {...contentProps} testID={testID+"_ContentContainer"} style={[styles.container,styles.noPadding,contentProps.style]}>
|
444
|
+
<ScrollView testID={testID+"_MainContentScrollView"} contentProps={{style:theme.styles.p1}}>
|
446
445
|
<View testID={testID+"_ContentHeader"} style={[styles.screenContent,theme.styles.p1,header?styles.screenContentWithHeader:null]}>
|
447
446
|
{header}
|
448
447
|
{content}
|
@@ -451,7 +450,7 @@ export default class TableDataScreenComponent extends FormDataScreen{
|
|
451
450
|
{ct}
|
452
451
|
</View> : null}
|
453
452
|
</ScrollView>
|
454
|
-
</
|
453
|
+
</Vertical>
|
455
454
|
}
|
456
455
|
} else {
|
457
456
|
mainContent = <ScrollView testID={testID+"_MainContentScrollViewWithoutTab"}>
|
@@ -44,7 +44,7 @@ export const renderTabsContent = ({tabs,context,data,sessionName,isMobile,props,
|
|
44
44
|
}
|
45
45
|
if(React.isValidElement(children)){
|
46
46
|
tabsArr.push(
|
47
|
-
<Tab.Item testID={testID+"_Item_"+key} label={label} {...tabP}
|
47
|
+
<Tab.Item testID={testID+"_Item_"+key} label={label} {...tabP} key={key}>
|
48
48
|
{children}
|
49
49
|
</Tab.Item>
|
50
50
|
)
|