@fto-consult/expo-ui 6.1.4 → 6.1.6

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.1.4",
3
+ "version": "6.1.6",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -61,7 +61,7 @@
61
61
  "@emotion/native": "^11.11.0",
62
62
  "@expo/html-elements": "^0.5.1",
63
63
  "@expo/vector-icons": "^13.0.0",
64
- "@fto-consult/common": "^3.18.32",
64
+ "@fto-consult/common": "^3.18.33",
65
65
  "@gorhom/portal": "^1.0.14",
66
66
  "@pchmn/expo-material3-theme": "^1.0.1",
67
67
  "@react-native-async-storage/async-storage": "1.18.2",
package/src/App.js CHANGED
@@ -10,7 +10,7 @@ import APP from "$app";
10
10
  import {isMobileNative} from "$cplatform";
11
11
  import {setDeviceIdRef} from "$capp";
12
12
  import appConfig from "$capp/config";
13
- import {showPrompt} from "$components/Dialog/confirm";
13
+ import {showPrompt} from "$ecomponents/Dialog/confirm";
14
14
  import { AppState } from 'react-native'
15
15
  import {canFetchOffline} from "$capi/utils";
16
16
  import {defaultNumber} from "$cutils";
@@ -1,13 +1,13 @@
1
1
  // Copyright 2022 @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 Button from "$components/Button";
5
- import Menu from "$components/Menu";
4
+ import Button from "$ecomponents/Button";
5
+ import Menu from "$ecomponents/Menu";
6
6
  import theme from "$theme";
7
7
  import React from "$react";
8
8
  import {isObj,defaultStr,defaultObj} from "$cutils";
9
9
  import PropTypes from "prop-types";
10
- import View from "$components/View";
10
+ import View from "$ecomponents/View";
11
11
 
12
12
  /****le selecteur de provider, pour l'authentification */
13
13
  const ProviderSelector = React.forwardRef(({providers,anchorProps,containerProps,anchor,activeProvider,testID,onChange,...props},ref)=>{
@@ -5,7 +5,7 @@ import {
5
5
  TouchableWithoutFeedback,
6
6
  View,
7
7
  } from 'react-native';
8
- import Label from "$comonents/Label";
8
+ import Label from "$ecomponents/Label";
9
9
  import theme,{Colors} from "$theme";
10
10
  import {isIos,isWeb} from "$cplatform";
11
11
  import {defaultObj,defaultStr} from "$cutils";
@@ -23,6 +23,7 @@ const AppbarContent = ({
23
23
  containerProps,
24
24
  titleProps,
25
25
  subtitleProps,
26
+ testID,
26
27
  ...rest
27
28
  }) => {
28
29
 
@@ -32,7 +33,7 @@ const AppbarContent = ({
32
33
  testID = defaultStr(testID,"RN_AppBarContentComponent")
33
34
  subtitle = subtitle === false ? null : subtitle;
34
35
  const subtitleColor = Colors.setAlpha(titleTextColor,0.7);
35
-
36
+ const webStyle = isWeb() && theme.styles.webFontFamilly;
36
37
  const content = (
37
38
  <View
38
39
  pointerEvents="box-none"
@@ -40,17 +41,16 @@ const AppbarContent = ({
40
41
  testID={testID}
41
42
  {...rest}
42
43
  >
43
- {typeof title === 'string' ? (
44
- <Label
44
+ <Label
45
45
  ref={titleRef}
46
46
  {...titleProps}
47
47
  style={[
48
- styles.title,
49
48
  {
50
- color: titleTextColor,
51
- ...(isIos()? theme.fonts.regular: theme.fonts.medium),
49
+ color: titleTextColor,
50
+ ...(isIos()? theme.fonts.regular: theme.fonts.medium),
52
51
  },
53
- isWeb() && theme.styles.webFontFamilly,
52
+ webStyle,
53
+ titleProps.style,
54
54
  titleStyle,
55
55
  ]}
56
56
  numberOfLines={1}
@@ -67,15 +67,12 @@ const AppbarContent = ({
67
67
  testID={`${testID}-title-text`}
68
68
  >
69
69
  {title}
70
- </Label>
71
- ) : (
72
- title
73
- )}
70
+ </Label>
74
71
  {subtitle ? (
75
72
  <Label
76
73
  testID = {testID+"_Subtitle"}
77
74
  {...subtitleProps}
78
- style={[styles.subtitle, { color: subtitleColor }, subtitleStyle]}
75
+ style={[styles.subtitle, { color: subtitleColor },webStyle, subtitleProps.style, subtitleStyle]}
79
76
  numberOfLines={1}
80
77
  >
81
78
  {subtitle}
@@ -135,4 +132,8 @@ const iosTouchableRole = ['button', 'header'];
135
132
  const touchableRole = Platform.select({
136
133
  ios: iosTouchableRole,
137
134
  default: iosTouchableRole[0],
138
- });
135
+ });
136
+
137
+ export default AppbarContent;
138
+
139
+ AppbarContent.displayName = "AppBarContentComponent";
@@ -125,19 +125,15 @@ const AppBarComponent = React.forwardRef((props,ref)=> {
125
125
  const hasRight = React.isValidElement(renderedActions) || React.isValidElement(renderedRight);
126
126
  return (
127
127
  <Appbar.Header elevation={elevation} {...appBarProps} testID={testID} style={[styles.header,{backgroundColor},elevStyle,appBarProps.style]} onLayout={onPageResize}>
128
- <View style={styles.title2Back} testID={testID+"_AppBarBack2Titlte"}>
129
- {backAction}
130
- <Content {...defaultObj(appBarProps.contentProps)}
131
- title={title}
132
- titleProps = {{...titleProps,style:[styles.title,{color:primaryText},titleProps.style]}}
133
- subtitle = {defaultVal(subtitle,params.subtitle,options.subtitle)}
134
- subtitleProps = {subtitleProps}
135
- />
136
- </View>
137
- {hasRight ? <View testID={testID+"_Actions"} style={styles.actions2right}>
138
- {renderedActions}
139
- {renderedRight}
140
- </View> : null}
128
+ {backAction}
129
+ <Content {...defaultObj(appBarProps.contentProps)}
130
+ title={title}
131
+ titleProps = {{...titleProps,style:[styles.title,{color:primaryText},titleProps.style]}}
132
+ subtitle = {defaultVal(subtitle,params.subtitle,options.subtitle)}
133
+ subtitleProps = {subtitleProps}
134
+ />
135
+ {renderedActions}
136
+ {renderedRight}
141
137
  </Appbar.Header>
142
138
  );
143
139
  });
@@ -7,7 +7,7 @@ import Text from "./Text";
7
7
  import theme from "$theme";
8
8
  import AvatarImage from "./Image";
9
9
  import { Pressable } from "react-native";
10
- import Tooltip from "$components/Tooltip";
10
+ import Tooltip from "$ecomponents/Tooltip";
11
11
 
12
12
  const defaultSize = 40;
13
13
 
@@ -1,6 +1,6 @@
1
1
  import ApexChart from 'apexcharts/dist/apexcharts.min';
2
2
  import React from "$react";
3
- import View from "$components/View";
3
+ import View from "$ecomponents/View";
4
4
  import { destroyChart } from './utils';
5
5
  import theme from "$theme";
6
6
 
@@ -1,10 +1,10 @@
1
1
  import React from "$react";
2
- import Image from "$components/Image";
2
+ import Image from "$ecomponents/Image";
3
3
  import { getCountry,styles} from "./utils";
4
4
  import {isNonNullString,defaultStr,isNumber} from "$cutils";
5
5
  import View from "$ecomponents/View"
6
6
  import theme from "$theme";
7
- import Label from "$components/Label";
7
+ import Label from "$ecomponents/Label";
8
8
 
9
9
  export default function CountryFlagComponent({code,label,withName,withCode,text,containerProps,labelProps,withLabel,testID,...props}){
10
10
  if(!isNonNullString(code)) return null;
@@ -10,7 +10,7 @@ import Label from "$ecomponents/Label";
10
10
  import theme from "$theme"
11
11
  import Expandable from "$ecomponents/Expandable";
12
12
  import { Dimensions } from "react-native";
13
- import Grid from "$components/Grid";
13
+ import Grid from "$ecomponents/Grid";
14
14
  import { Pressable } from "react-native";
15
15
  import Tooltip from "$ecomponents/Tooltip";
16
16
 
@@ -1,6 +1,6 @@
1
1
  import {get,set} from "./Common/session";
2
2
  import Icon from "$ecomponents/Icon";
3
- import {notify} from "$ecomponents/Dialog";
3
+ import notify from "$enotify";
4
4
  import {isDesktopMedia} from "$cplatform/dimensions";
5
5
  import {defaultStr} from "$cutils";
6
6
  import {Menu} from "$ecomponents/BottomSheet";
@@ -2,7 +2,7 @@
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
4
  import React from "$react";
5
- import TextField from "$components/TextField";
5
+ import TextField from "$ecomponents/TextField";
6
6
  import {isNonNullString} from "$cutils";
7
7
  import DateLib from "$date";
8
8
 
@@ -17,7 +17,7 @@ import Preloader from "$epreloader";
17
17
  import {Elevations} from "$ecomponents/Surface";
18
18
 
19
19
  const MIN_SWIPE_DISTANCE = 3;
20
- const DEVICE_WIDTH = parseFloat(Dimensions.get('window').width);
20
+ const DEVICE_WIDTH = Math.max(Dimensions.get('window').width,280);
21
21
  const THRESHOLD = DEVICE_WIDTH / 2;
22
22
  const VX_MAX = 0.1;
23
23
 
@@ -3,8 +3,8 @@
3
3
  // license that can be found in the LICENSE file.
4
4
 
5
5
  import React from "$react";
6
- import View from "$components/View";
7
- import Label from "$components/Label";
6
+ import View from "$ecomponents/View";
7
+ import Label from "$ecomponents/Label";
8
8
  import PropTypes from 'prop-types';
9
9
  import { StyleSheet } from "react-native";
10
10
  import {defaultStr,defaultObj} from "$cutils";
@@ -15,7 +15,7 @@ import React,{Component as AppComponent} from "$react";
15
15
  import theme from "$theme";
16
16
  import {isMobileMedia} from "$cplatform/dimensions";
17
17
  import { ActivityIndicator } from "react-native-paper";
18
- import DialogProvider from "$components/Form/FormData/DialogProvider";
18
+ import DialogProvider from "$ecomponents/Form/FormData/DialogProvider";
19
19
  import FilterBetweenComponent from "./BetweenComponent";
20
20
 
21
21
  const manualRunKey = "manual-run";
@@ -1,6 +1,6 @@
1
1
  import React from "$react";
2
2
  import PropTypes from "prop-types";
3
- import Button from "$components/Button";
3
+ import Button from "$ecomponents/Button";
4
4
  import notify from "$notify";
5
5
  import FormsManager from "./utils/FormsManager";
6
6
  import {uniqid} from "$cutils";
@@ -20,7 +20,7 @@ import defaultKeyboardEvents from "../utils/keyboardEvents";
20
20
  import sprintf from "./sprintf";
21
21
  import ErrorMessage from "$ecomponents/ErrorBoundary/ErrorMessage";
22
22
  import { UPPER_CASE, LOWER_CASE} from "$common/lib/validator";
23
- import Label from "$components/Label";
23
+ import Label from "$ecomponents/Label";
24
24
 
25
25
 
26
26
  export default class Field extends AppComponent {
@@ -1,5 +1,5 @@
1
1
  import React from "$react";
2
- import Divider from "$components/Divider";
2
+ import Divider from "$ecomponents/Divider";
3
3
  import {isObj,isNonNullString,defaultStr,defaultObj} from "$utils";
4
4
  import getComponentFromType from "./componentsTypes";
5
5
  import appConfig from "$capp/config";
@@ -83,6 +83,7 @@ const GridCellComponent = React.forwardRef((p,ref)=>{
83
83
  {...props}
84
84
  testID={testID}
85
85
  mediaQueryUpdateNativeProps = {(args)=>{
86
+ console.log("calling ",args);
86
87
  if(typeof mediaQueryUpdateNativeProps =='function' && mediaQueryUpdateNativeProps(args) === false) return;
87
88
  return getSizeStyle(p);
88
89
  }}
@@ -1,5 +1,5 @@
1
1
  import React from '$react';
2
- import {Pressable,StyleSheet} from 'react-native';
2
+ import {Pressable,StyleSheet,useWindowDimensions} from 'react-native';
3
3
  import {grid} from "$theme";
4
4
  import {defaultStr} from "$cutils";
5
5
  import PropTypes from "prop-types";
@@ -2,7 +2,7 @@ import {Image,View} from "react-native";
2
2
  import Menu from "$ecomponents/Menu";
3
3
  import Avatar from "$ecomponents/Avatar";
4
4
  import {isDecimal,setQueryParams,isValidURL,defaultDecimal,defaultStr as defaultString,isDataURL,isPromise,defaultBool,isObj,isNonNullString} from "$cutils";
5
- import {notify} from "$ecomponents/Dialog";
5
+ import notify from "$enotify";
6
6
  let maxWidthDiff = 150, maxHeightDiff = 150;
7
7
  import {StyleSheet} from "react-native";
8
8
  import React from "$react";
@@ -1,5 +1,5 @@
1
1
  import React,{BaseComponent as AppComponent} from '$react';
2
- import View from "$components/View";
2
+ import View from "$ecomponents/View";
3
3
  import { ScrollView } from 'react-native';
4
4
  import {
5
5
  Platform,
@@ -14,7 +14,6 @@ import {
14
14
  import BackHandler from "$ecomponents/BackHandler";
15
15
  import PropTypes from "prop-types";
16
16
  import { withTheme,Surface,Portal} from 'react-native-paper';
17
- //import Surface from "$components/Surface";
18
17
  import { NativeModules} from 'react-native';
19
18
  import {defaultDecimal,extendObj} from "$cutils";
20
19
  import theme,{StylePropTypes} from "$theme";
@@ -16,7 +16,7 @@ import useEventCallback from '$react/useEventCallback';
16
16
  import PropTypes from "prop-types";
17
17
  import Surface from '$ecomponents/Surface';
18
18
  import Label from "$ecomponents/Label"
19
- import Button from "$components/Button";
19
+ import Button from "$ecomponents/Button";
20
20
 
21
21
  const DURATION_SHORT = 4000;
22
22
  const DURATION_MEDIUM = 7000;
@@ -1,5 +1,5 @@
1
1
  import Screen from "$screen";
2
- import Grid,{Cell} from "$components/Grid";
2
+ import Grid,{Cell} from "$ecomponents/Grid";
3
3
  import {defaultStr,defaultNumber,defaultVal} from "$cutils";
4
4
  import React from "$react";
5
5
  import DatabaseStatistic from "./DatabaseStatistic";
@@ -1,5 +1,5 @@
1
1
  import {isObj} from "$cutils";
2
- import {notify} from "$components/Dialog";
2
+ import notify from "$enotify";
3
3
  import Camera from "./camera";
4
4
  import {isMobileNative} from "$platform";
5
5
  import React from "react";
@@ -1,20 +1,19 @@
1
- import showConfirm from "$components/Dialog/confirm";
1
+ import showConfirm from "$ecomponents/Dialog/confirm";
2
2
  import notify from "$notify";
3
3
  import {defaultArray,arrayValueExists,defaultStr,uniqid} from "$cutils";
4
4
  import userDbName from "$database/tables/users/dbName";
5
5
  import Auth from "$auth";
6
6
  import getData from "$database/getData";
7
7
  import getDB from "$database/getDB";
8
- import {FormData,getForm,getFormData} from "$components/Form";
9
- import Icon from "$components/Icon";
8
+ import Icon from "$ecomponents/Icon";
10
9
  import React from "$react";
11
- import Label from "$components/Label";
10
+ import Label from "$ecomponents/Label";
12
11
  import {open as showPreloader,close as hidePreloader} from "$preloader";
13
- import Expandable from "$components/Expandable";
12
+ import Expandable from "$ecomponents/Expandable";
14
13
  import theme from "$theme";
15
- import View from "$components/View";
16
- import Link from "$components/Link";
17
- import Button from "$components/Button";
14
+ import View from "$ecomponents/View";
15
+ import Link from "$ecomponents/Link";
16
+ import Button from "$ecomponents/Button";
18
17
 
19
18
  const tableName = Auth.permProfilesTableName.toUpperCase();
20
19
 
@@ -2,7 +2,7 @@ import FormDataScreen from "$elayouts/Screen/FormData";
2
2
  import {defaultStr,defaultObj} from "$cutils";
3
3
  import PermLines from "./PermLines";
4
4
  import PropTypes from "prop-types";
5
- import Label from "$components/Label";
5
+ import Label from "$ecomponents/Label";
6
6
  import theme from "$theme";
7
7
 
8
8
  export const screenName = "PermProfileScreens";
@@ -2,7 +2,7 @@
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
4
 
5
- import Label from "$components/Label";
5
+ import Label from "$ecomponents/Label";
6
6
 
7
7
  export default function ContentPrivacy (){
8
8
  return <Label primary style={{fontSize:15,fontWeight:'bold',padding:10}}>
@@ -2,7 +2,7 @@
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
4
 
5
- import Label from "$components/Label";
5
+ import Label from "$ecomponents/Label";
6
6
 
7
7
  export default function ContentTermsOfUses (){
8
8
  return <Label primary style={{fontSize:15,fontWeight:'bold',padding:10}}>