@fto-consult/expo-ui 6.71.5 → 6.72.0
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/{AutoSizer1 → AutoSizer}/Vertical.js +0 -1
- package/src/components/Datagrid/Common/Common.js +3 -0
- package/src/components/Datagrid/Common/utils.js +24 -10
- 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 +6 -7
- package/src/layouts/Screen/utils.js +1 -1
- /package/src/components/{AutoSizer1 → AutoSizer}/AutoResizer.js +0 -0
- /package/src/components/{AutoSizer1 → AutoSizer}/index.js +0 -0
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
|
/***
|
@@ -3925,6 +3925,9 @@ CommonDatagridComponent.propTypes = {
|
|
3925
3925
|
showFooters : PropTypes.bool,
|
3926
3926
|
/*** les donnnées peuvent être soient retournées par une fonction, soit par un tableau soit une promesse */
|
3927
3927
|
data : PropTypes.oneOfType([PropTypes.array, PropTypes.func,PropTypes.object]),//.isRequired,
|
3928
|
+
/****
|
3929
|
+
la prop column def contient dans la propriété datagrid, la prop maxItemsToRender, le nombre d'items maximal à rendre pour le composant de type select table data multiple
|
3930
|
+
*/
|
3928
3931
|
columns:PropTypes.oneOfType([PropTypes.array,PropTypes.object]),//.isRequired,
|
3929
3932
|
selectable : PropTypes.bool, //si les lignes sont sélectionnables,
|
3930
3933
|
/*** Si plusieurs lignes peuvent être sélectionnées au même moment */
|
@@ -1,7 +1,7 @@
|
|
1
1
|
// Copyright 2023 @fto-consult/Boris Fouomene. All rights reserved.
|
2
2
|
// Use of this source code is governed by a BSD-style
|
3
3
|
// license that can be found in the LICENSE file.
|
4
|
-
import {isNonNullString,isArray,isObjOrArray,defaultStr,defaultArray,defaultObj,isObj} from "$cutils";
|
4
|
+
import {isNonNullString,isArray,isObjOrArray,maxItemsToRender,defaultStr,defaultArray,defaultObj,isObj} from "$cutils";
|
5
5
|
import Hashtag from "$ecomponents/Hashtag";
|
6
6
|
import DateLib from "$date";
|
7
7
|
import Image from "$ecomponents/Image";
|
@@ -82,22 +82,36 @@ export const renderRowCell = (arg)=>{
|
|
82
82
|
const sepp = ",";
|
83
83
|
if(columnDef.multiple && id.contains(sepp)){
|
84
84
|
let hasC = false,sep2 ="";
|
85
|
+
const maxItemsToRender = defaultNumber(columnDef?.datagrid?.maxItemsToRender,5);
|
86
|
+
let renderedItems = 0;
|
87
|
+
const idSplit = id.split(sepp);
|
85
88
|
_render = <View style={[style,theme.styles.row,theme.styles.flexWrap]} testID={"RN_RowCell_"+columnDef.field+"multiple_"}>
|
86
|
-
{
|
87
|
-
if(!isNonNullString(idd)) return null;
|
89
|
+
{idSplit.map((idd,index)=>{
|
90
|
+
if(!isNonNullString(idd) || maxItemsToRender === renderedItems) return null;
|
88
91
|
idd = idd.trim();
|
89
92
|
if(!idd) return null;
|
90
93
|
if(hasC){
|
91
94
|
sep2=", ";
|
92
95
|
}
|
93
96
|
hasC = true;
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
97
|
+
renderedItems++;
|
98
|
+
const suffix = renderedItems === maxItemsToRender && idSplit.length > maxItemsToRender ? <Label>...</Label> : null;
|
99
|
+
return suffix ? <>
|
100
|
+
<TableLink
|
101
|
+
key = {index}
|
102
|
+
{...rProps}
|
103
|
+
id = {idd}
|
104
|
+
>
|
105
|
+
{sep2+idd}
|
106
|
+
</TableLink>
|
107
|
+
{suffix}
|
108
|
+
</> : <TableLink
|
109
|
+
key = {index}
|
110
|
+
{...rProps}
|
111
|
+
id = {idd}
|
112
|
+
>
|
113
|
+
{sep2+idd}
|
114
|
+
</TableLink>
|
101
115
|
})}
|
102
116
|
</View>
|
103
117
|
|
@@ -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,7 +440,7 @@ 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 = <
|
443
|
+
mainContent = <Vertical {...contentProps} testID={testID+"_ContentContainer"} style={[styles.container,styles.noPadding,contentProps.style]}>
|
445
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}
|
@@ -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
|
)
|
File without changes
|
File without changes
|