@fto-consult/expo-ui 6.9.0 → 6.10.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fto-consult/expo-ui",
3
- "version": "6.9.0",
3
+ "version": "6.10.1",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -73,11 +73,11 @@
73
73
  "@react-navigation/native-stack": "^6.9.13",
74
74
  "@shopify/flash-list": "1.4.3",
75
75
  "apexcharts": "^3.41.0",
76
- "expo": "^49.0.4",
76
+ "expo": "^49.0.5",
77
77
  "expo-camera": "~13.4.2",
78
78
  "expo-clipboard": "~4.3.0",
79
79
  "expo-font": "~11.4.0",
80
- "expo-image-picker": "~14.3.1",
80
+ "expo-image-picker": "~14.3.2",
81
81
  "expo-linking": "~5.0.2",
82
82
  "expo-sqlite": "~11.3.1",
83
83
  "expo-status-bar": "~1.6.0",
@@ -94,7 +94,7 @@
94
94
  "react-dom": "^18.2.0",
95
95
  "react-native": "0.72.3",
96
96
  "react-native-big-list": "^1.6.1",
97
- "react-native-blob-util": "^0.18.4",
97
+ "react-native-blob-util": "^0.18.6",
98
98
  "react-native-gesture-handler": "^2.12.0",
99
99
  "react-native-iphone-x-helper": "^1.3.1",
100
100
  "react-native-mime-types": "^2.4.0",
@@ -102,11 +102,11 @@
102
102
  "react-native-paper-dates": "^0.18.12",
103
103
  "react-native-reanimated": "~3.3.0",
104
104
  "react-native-safe-area-context": "4.6.3",
105
- "react-native-screens": "^3.22.1",
105
+ "react-native-screens": "~3.22.0",
106
106
  "react-native-svg": "13.9.0",
107
107
  "react-native-web": "~0.19.6",
108
108
  "react-native-webview": "13.2.2",
109
- "react-virtuoso": "^4.4.1",
109
+ "react-virtuoso": "^4.4.2",
110
110
  "sharp-cli": "^4.1.1",
111
111
  "tippy.js": "^6.3.7",
112
112
  "websql": "^2.0.3",
@@ -185,4 +185,4 @@ export const getRowStyle = ({row,bordered,numColumns,rowData,isAccordion,isTable
185
185
  return style;
186
186
  }
187
187
 
188
- export const willConvertFiltersToSQL = x=>!!appConfig.get("convertDatagridFiltersToSQL");
188
+ export const willConvertFiltersToSQL = x=>!!appConfig.get("convertFiltersToSQL");
@@ -19,9 +19,9 @@ import useApp from "$econtext/hooks";
19
19
  * foreignKeyTable : la tableData dans laquelle effectuer les donées de la requêtes
20
20
  * foreignKeyLabel : Le libélé dans la table étrangère
21
21
  */
22
- const TableDataSelectField = React.forwardRef(({foreignKeyColumn,prepareFilters:cPrepareFilters,bindUpsert2RemoveEvents,onAdd,showAdd:customShowAdd,canShowAdd,foreignKeyTable,fetchItemsPath,foreignKeyLabel,foreignKeyLabelIndex,dropdownActions,fields,fetchItems:customFetchItem,convertFiltersToSQL,mutateFetchedItems,onFetchItems,isFilter,isUpdate,isDocEditing,items,onAddProps,fetchOptions,...props},ref)=>{
22
+ const TableDataSelectField = React.forwardRef(({foreignKeyColumn,isStructData,getForeignKeyTable:cGetForeignKeyTable,prepareFilters:cPrepareFilters,bindUpsert2RemoveEvents,onAdd,showAdd:customShowAdd,canShowAdd,foreignKeyTable,fetchItemsPath,foreignKeyLabel,foreignKeyLabelIndex,dropdownActions,fields,fetchItems:customFetchItem,convertFiltersToSQL,mutateFetchedItems,onFetchItems,isFilter,isUpdate,isDocEditing,items,onAddProps,fetchOptions,...props},ref)=>{
23
23
  props.data = defaultObj(props.data);
24
- const {getTableData:getForeignKeyTable} = useApp();
24
+ const {getTableData:appGetForeignKeyTable,getStructData} = useApp();
25
25
  if(!foreignKeyColumn && isNonNullString(props.field)){
26
26
  foreignKeyColumn = props.field;
27
27
  }
@@ -32,6 +32,7 @@ const TableDataSelectField = React.forwardRef(({foreignKeyColumn,prepareFilters:
32
32
  foreignKeyLabel = foreignKeyLabel.trim();
33
33
  foreignKeyLabel = foreignKeyLabel.ltrim("[").rtrim("]").split(",");
34
34
  }
35
+ const getForeignKeyTable = typeof cGetForeignKeyTable =='function'? cGetForeignKeyTable : isStructData ? getStructData: appGetForeignKeyTable;
35
36
  convertFiltersToSQL = defaultVal(convertFiltersToSQL,willConvertFiltersToSQL());
36
37
  const foreignKeyTableStr = defaultStr(foreignKeyTable,props.tableName,props.table);
37
38
  if(typeof getForeignKeyTable !=='function'){
@@ -462,7 +462,7 @@ export default class FormListComponent extends AppComponent {
462
462
  renderAvatar = defaultFunc(renderAvatar,x=>null);
463
463
  /*** les props de chaque items de la liste */
464
464
  itemProps= {...defaultObj(itemProps)}
465
- const descriptionNumberOfLines = typeof itemProps.numberOfLines ==='number' && itemProps.numberOfLines ? itemProps.numberOfLines : 3;
465
+ const descriptionNumberOfLines = typeof itemProps.rows ==='number' && itemProps.rows ? itemProps.rows : 3;
466
466
  let counter = -1;
467
467
  let is_o = this.isHandlingObject;
468
468
  let addIconObj = null;
@@ -288,7 +288,6 @@ class SwiperComponent extends React.Component {
288
288
  const autoHeight = !!this.props.autoHeight;
289
289
  const height = autoHeight ? undefined : !isReady ? WIDTH_HEIGHT : customHeight;
290
290
  if(withScrollView){
291
- wrapperProps.nestedScrollEnabled = typeof wrapperProps.nestedScrollEnabled ==="boolean"? wrapperProps.nestedScrollEnabled : isNative;
292
291
  if(typeof wrapperProps.showsVerticalScrollIndicator !=='boolean'){
293
292
  wrapperProps.showsVerticalScrollIndicator = !isNative;
294
293
  }
@@ -367,7 +367,7 @@ const TextFieldComponent = React.forwardRef((componentProps,inputRef)=>{
367
367
  formattedValue,
368
368
  displayText,
369
369
  parsedValue,
370
- numberOfLines,
370
+ rows:numberOfLines,
371
371
  onChange : ({ nativeEvent: {target, text:text2} }) => {
372
372
  if(canValueBeDecimal && (text2 && !text2.isNumber() && !text2.endsWith(".") && !text2.endsWith(","))) {
373
373
  return;
@@ -376,12 +376,23 @@ const TextFieldComponent = React.forwardRef((componentProps,inputRef)=>{
376
376
  text2 = "0"+text2;
377
377
  }
378
378
  if(multiline){
379
- if(!text2 || text2.length < 30){
380
- heightRef.current = MULTIPLE_HEIGHT;
381
- setToggle(!toggle);
382
- } else if(target.scrollHeight > heightRef.current){
383
- heightRef.current = Math.max(target.scrollHeight,MULTIPLE_HEIGHT);
384
- setToggle(!toggle);
379
+ let hasS = false;
380
+ if(text2){
381
+ const spl = text2.trim().split('\n');
382
+ if(spl.length>1){
383
+ heightRef.current+=MULTIPLE_HEIGHT+(10*(spl.length-1));
384
+ hasS = true;
385
+ setToggle(!toggle);
386
+ }
387
+ }
388
+ if(!hasS){
389
+ if(!text2 || text2.length < 30){
390
+ heightRef.current = MULTIPLE_HEIGHT;
391
+ setToggle(!toggle);
392
+ } else if(target.scrollHeight > heightRef.current){
393
+ heightRef.current = Math.max(target.scrollHeight,MULTIPLE_HEIGHT);
394
+ setToggle(!toggle);
395
+ }
385
396
  }
386
397
  }
387
398
  const tVal = toCase(text2);
@@ -17,6 +17,7 @@ import Login from "$eauth/Login";
17
17
  getStructData : ()=>{object|array}
18
18
  tablesData : {object}, la liste des tables de données
19
19
  strucsData : {object}, la liste des données de structures
20
+ convertFiltersToSQL : {boolean}, si les filtres de datagrid ou filtres seront convertis au format SQL
20
21
  components : {
21
22
  logo : {
22
23
  object |
@@ -31,7 +32,7 @@ import Login from "$eauth/Login";
31
32
  drawerItems : {object|array|function}, la fonction permettant d'obtenir les items du drawer principal de l'application
32
33
  }
33
34
  */
34
- const Provider = ({children,getTableData,navigation,components,getStructData,tablesData,structsData,...props})=>{
35
+ const Provider = ({children,getTableData,navigation,components,convertFiltersToSQL,getStructData,tablesData,structsData,...props})=>{
35
36
  const {extendAppTheme} = appConfig;
36
37
  const { theme : pTheme } = useMaterial3Theme();
37
38
  navigation = defaultObj(navigation);
@@ -44,6 +45,9 @@ const Provider = ({children,getTableData,navigation,components,getStructData,tab
44
45
  getTableData = appConfig.getTable = appConfig.getTableData = getTableOrStructDataCall(tablesData,getTableData);
45
46
  getStructData = appConfig.getStructData = getTableOrStructDataCall(structsData,getStructData);
46
47
  appConfig.LoginComponent = Login;
48
+ if(convertFiltersToSQL !== undefined){
49
+ appConfig.set("convertFiltersToSQL",convertFiltersToSQL);
50
+ }
47
51
  //const colorScheme = useColorScheme();
48
52
  appConfig.extendAppTheme = (theme)=>{
49
53
  if(!isObj(theme)) return;
@@ -77,6 +81,7 @@ const Provider = ({children,getTableData,navigation,components,getStructData,tab
77
81
  value={{
78
82
  ...props,
79
83
  navigation,
84
+ convertFiltersToSQL,
80
85
  components : {
81
86
  ...components,
82
87
  loginPropsMutator : (props)=>{
@@ -377,11 +377,7 @@ export default class TableDataScreenComponent extends FormDataScreen{
377
377
  const isMobile = isMobileOrTabletMedia();
378
378
  const contentProps = restProps.contentProps;
379
379
  const elevation = restProps.elevation;
380
- const renderingTabsProps = {tabs,data:this.getCurrentData(),tabsPropsMutator:({tabs,tabsProps})=>{
381
- if(!isMobileOrTabletMedia()){
382
- tabsProps.withScrollView = false;
383
- }
384
- },isMobile,sessionName:this.getSessionName(),props:restProps,tabProps,tabsProps,context,tabKey};
380
+ const renderingTabsProps = {tabs,data:this.getCurrentData(),isMobile,sessionName:this.getSessionName(),props:restProps,tabProps,tabsProps,context,tabKey};
385
381
  const hasTabs = Object.size(tabs,true);
386
382
  let mainContent = undefined;
387
383
  testID = defaultStr(testID,"RN_TableDataScreenItem_"+restProps.tableName);
@@ -430,7 +426,7 @@ export default class TableDataScreenComponent extends FormDataScreen{
430
426
  appBarProps.elevation = 0;
431
427
  restProps.elevation = 0;
432
428
  }
433
- return <ScreenContainer {...restProps} withScrollView={false} appBarProps = {appBarProps} testID={testID}>
429
+ return <ScreenContainer {...restProps} appBarProps = {appBarProps} testID={testID}>
434
430
  {this.wrapRenderingContent(mainContent,{testID})}
435
431
  </ScreenContainer>
436
432
  }
@@ -8,7 +8,7 @@ import {getTableDataRouteName} from "$enavigation/utils";
8
8
  //@seee : https://github.com/typeorm/typeorm/blob/master/src/entity-schema/EntitySchemaColumnOptions.ts
9
9
  export const generatedColumnsProperties = ["createDate","updateDate","deleteDate","createBy","updateBy","deleteBy"]
10
10
 
11
- export const renderTabsContent = ({tabs,context,data,sessionName,tabsPropsMutator,isMobile,props,firstTab,tabKey,tabProps,tabsProps})=>{
11
+ export const renderTabsContent = ({tabs,context,data,sessionName,isMobile,props,firstTab,tabKey,tabProps,tabsProps})=>{
12
12
  let tabsArr = [],hasFirstTab = false;
13
13
  if(React.isValidElement(firstTab)){
14
14
  tabsArr.push(firstTab);
@@ -52,9 +52,6 @@ export const renderTabsContent = ({tabs,context,data,sessionName,tabsPropsMutato
52
52
  })
53
53
  }
54
54
  if(tabsArr.length> (hasFirstTab ? 1 : 0)){
55
- if(typeof tabsPropsMutator =='function' && tabsPropsMutator({tabsProps,tabs:tabsArr,hasFirstTab}) === false){
56
- return null;
57
- }
58
55
  return <Tab testID={testID}
59
56
  {...tabsProps}
60
57
  onChange={(args)=>{