@fto-consult/expo-ui 7.12.3 → 7.13.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fto-consult/expo-ui",
3
- "version": "7.12.3",
3
+ "version": "7.13.0",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "scripts": {
6
6
  "clear-npx-cache": "npx clear-npx-cache",
@@ -71,7 +71,7 @@
71
71
  "@expo/html-elements": "^0.5.1",
72
72
  "@expo/vector-icons": "^13.0.0",
73
73
  "@faker-js/faker": "^8.0.2",
74
- "@fto-consult/common": "^3.75.2",
74
+ "@fto-consult/common": "^4.0.0",
75
75
  "@fto-consult/electron-gen": "^2.2.0",
76
76
  "@pchmn/expo-material3-theme": "^1.3.1",
77
77
  "@react-native-async-storage/async-storage": "1.18.2",
@@ -2040,6 +2040,7 @@ export default class CommonDatagridComponent extends AppComponent {
2040
2040
  divider : true,
2041
2041
  text : "Configurer les graphes",
2042
2042
  icon :"material-settings",
2043
+ tooltip : "Cliquez pour configurer les graphes",
2043
2044
  onPress : ()=>{
2044
2045
  this.configureChart(false).then((config)=>{
2045
2046
  this.setIsLoading(true,()=>{
@@ -2208,7 +2209,7 @@ export default class CommonDatagridComponent extends AppComponent {
2208
2209
  }
2209
2210
  }
2210
2211
  getDefaultChartHeight(){
2211
- return defaultNumber(this.props.chartProps?.height,this.isDashboard()?80:350);
2212
+ return defaultNumber(this.props.chartProps?.height,this.props.chartConfig?.height,this.isDashboard()?90:350);
2212
2213
  }
2213
2214
  getDefaultChartWidth(){
2214
2215
  return defaultNumber(this.props.chartProps?.width);
@@ -2414,10 +2415,12 @@ export default class CommonDatagridComponent extends AppComponent {
2414
2415
  //const spackLine = chartOptions.chart.sparkline;
2415
2416
  chartOptions.xaxis = defaultObj(chartOptions.xaxis);
2416
2417
  chartOptions.xaxis.labels = defaultObj(chartOptions.xaxis.labels);
2417
- chartOptions.xaxis.labels.show = ("showXaxis" in config) ? !!config.showXaxis : !this.isDashboard();
2418
+ chartOptions.xaxis.labels.show = ("showXaxis" in config) ? !!config.showXaxis : this.isDashboard();
2419
+
2420
+ console.log("rendering char ",chartOptions,config);
2418
2421
 
2419
2422
  chartOptions.yaxis.labels = defaultObj(chartOptions.yaxis.labels);
2420
- chartOptions.yaxis.labels.show = ("showYaxis" in config) ? !!config.showYaxis : !this.isDashboard();
2423
+ chartOptions.yaxis.labels.show = ("showYaxis" in config) ? !!config.showYaxis : this.isDashboard();
2421
2424
 
2422
2425
  chartOptions.legend = defaultObj(chartOptions.legend);
2423
2426
  chartOptions.legend.show = ("showLegend" in config) ? !!config.showLegend : !this.isDashboard();
@@ -3777,7 +3780,7 @@ export default class CommonDatagridComponent extends AppComponent {
3777
3780
  }
3778
3781
  renderTitle (){
3779
3782
  const testID = this.getTestID();
3780
- const title = typeof this.props.title =="function"? this.props.title({context:this}) : this.props.title;
3783
+ const title = typeof this.props.title =="function"? this.props.title({context:this,config:this.getConfig()}) : this.props.title;
3781
3784
  const titleProps = defaultObj(this.props.titleProps);
3782
3785
  return React.isValidElement(title) ? <Label testID={testID+"_Title"} {...titleProps} style={[theme.styles.w100,titleProps.style]}>
3783
3786
  {title}
@@ -108,7 +108,7 @@ export default class DatagridDashboard extends TableData {
108
108
  items = {this.renderMenu()}
109
109
  />
110
110
  </View> : null}
111
- {<View testID={testID+"_ChartContainer"} {...chartContainerProps} style={[theme.styles.w100,chartContainerProps.style]}>
111
+ {<View testID={testID+"_ChartContainer"} {...chartContainerProps} style={[theme.styles.w100,styles.chartContainer,chartContainerProps.style]}>
112
112
  {this.renderProgressBar()}
113
113
  {this.renderChart()}
114
114
  </View>}
@@ -140,4 +140,7 @@ const styles = StyleSheet.create({
140
140
  width : '100%',
141
141
  //flex:1,
142
142
  },
143
+ chartContainer : {
144
+ //minHeight : 200,
145
+ }
143
146
  })
@@ -91,7 +91,7 @@ export default class Filter extends AppComponent {
91
91
  this.manualRunRef.current = value;
92
92
  }
93
93
  getSessionManualRunValue(){
94
- if(this.manualRunRef.current === undefined && this.isFilterSelect()){
94
+ if(false && this.manualRunRef.current === undefined && this.isFilterSelect()){
95
95
  this.manualRunRef.current = true;
96
96
  }
97
97
  return this.manualRunRef.current;
@@ -378,7 +378,7 @@ SwiperComponent.propTypes = {
378
378
  autoHeight : PropTypes.bool,//si la valeur de la taille des éléments sera automatiquement réajusté
379
379
  loop: PropTypes.bool,
380
380
  timeout: PropTypes.number,
381
- gesturesEnabled: PropTypes.func,
381
+ gesturesEnabled: PropTypes.func, //pour permettre les gestures
382
382
  withScrollView : PropTypes.oneOfType([
383
383
  PropTypes.bool,
384
384
  PropTypes.func,
@@ -4,6 +4,7 @@ import {defaultStr} from "$cutils";
4
4
  import Swiper from "$ecomponents/Swiper";
5
5
  import PropTypes from "prop-types";
6
6
  import { StylePropTypes } from '$theme';
7
+ import {isTouchDevice} from "$cplatform";
7
8
 
8
9
  const TabContentBase = ({
9
10
  children,
@@ -14,6 +15,7 @@ const TabContentBase = ({
14
15
  }) => {
15
16
  return (
16
17
  <Swiper
18
+ gesturesEnabled ={x=>!isTouchDevice()}
17
19
  {...rest}
18
20
  children = {children}
19
21
  testId = {defaultStr(testId,'RN_SwiperTabComponent')}
@@ -7,14 +7,12 @@ import {colorsAlias,Colors} from "$theme";
7
7
  import {isObj,isNonNullString,defaultStr,extendObj,defaultNumber} from "$cutils";
8
8
  import {getMainScreens} from "$escreens/mainScreens";
9
9
  import {ExpoUIContext} from "./hooks";
10
- import {enableAuth,disableAuth} from "$cauth/perms";
11
10
  import Login from "$eauth/Login";
12
11
  import {modes} from "$ecomponents/TextField";
13
12
  import {isMobileMedia} from "$cdimensions";
14
13
  import { prepareScreens } from "./TableData";
15
14
  import {extendFormFields} from "$ecomponents/Form/Fields";
16
- import {AuthProvider} from '$cauth';
17
- import { signInRef } from "$cauth/authSignIn2SignOut";
15
+ import Auth,{AuthProvider,enableAuth,disableAuth} from '$cauth';
18
16
  import APP from "$capp/instance";
19
17
  import { AppState } from 'react-native'
20
18
  import {canFetchOffline} from "$capi/utils";
@@ -101,7 +99,7 @@ const Provider = ({children,getTableData,handleHelpScreen,navigation,swrConfig,a
101
99
  return extendProps(cAuth?.loginPropsMutator,props);
102
100
  },
103
101
  }
104
- extendObj(signInRef.current,auth);
102
+ Auth.setRef(auth);
105
103
  extendFormFields(customFormFields);
106
104
  structsData = isObj(structsData)? structsData : null;
107
105
  appConfig.tablesData = tablesData;
@@ -104,6 +104,8 @@ export default function DatabaseStatisticContainer ({dashboardProps,onRefreshAll
104
104
  return fetchFields;
105
105
  },[columns]);
106
106
  const counUpStyle = {fontSize:20,fontWeight:'bold',color:theme.colors.secondaryOnSurface};
107
+ title = defaultVal(title,table.label,table.text);
108
+ icon = defaultVal(icon,table.icon);
107
109
  title = React.isValidElement(title,true)?<Label splitText numberOfLines={1} color={theme.colors.primaryOnSurface} style={[{fontSize:15}]}>{title}</Label>: null;
108
110
  const titleText = title && React.getTextContent(title) || null;
109
111
  const titleItem = titleText && {text:titleText,icon,divider:true} || null;
@@ -120,22 +122,23 @@ export default function DatabaseStatisticContainer ({dashboardProps,onRefreshAll
120
122
  sessionName = {tableName+"-database-statistics"}
121
123
  {...props}
122
124
  {...dbStatistics}
123
- style = {[theme.styles.pr1,props.style]}
125
+ style = {[theme.styles.pr1,props.style,dbStatistics.style]}
124
126
  columns = {columns}
125
127
  ref = {datagridRef}
126
128
  progressBar = {isLoading?<View/>:<View style={[theme.styles.w100,theme.styles.alignItemsCenter,theme.styles.justifyContentCenter]}>{progressBar}</View>}
127
129
  tableName = {tableName}
128
130
  table = {table}
129
131
  fetchData = {(options)=>{
130
- return fetchData({...defaultObj(fetchDataProps),fields:fetchFields,table,tableName,fetch,Auth,...options});
132
+ return fetchData({...defaultObj(fetchDataProps),fields:fetchFields,table,tableName,...options});
131
133
  }}
132
- title = {({context})=>{
134
+ title = {({context,config:chartConfig})=>{
133
135
  if(!context || !context.state) return null;
134
136
  const {state} = context;
135
- const footers = context.getFooters && context.getFooters() || {};
137
+ //const footers = context.getFooters && context.getFooters() || {};
136
138
  const dataSize = context.getStateDataSize && context.getStateDataSize() || 0;
137
139
  const footersValues = context.getFooterValues && context.getFooterValues() || {};
138
- const y = defaultStr(state.chartConfig?.y);
140
+ const config = Object.assign({},chartConfig,(typeof context.getConfig =="function"? context.getConfig() : state.config));
141
+ const y = defaultStr(config.y);
139
142
  const footerValue = y && isObj(footersValues) && footersValues[y] || null;
140
143
  const format = defaultStr(isObj(footerValue) && isNonNullString(footerValue.format) && footerValue.format || undefined).toLowerCase();
141
144
  const aggregatorFunction = isNonNullString(state.aggregatorFunction)? state.aggregatorFunction : undefined;
@@ -89,4 +89,6 @@ const styles = StyleSheet.create({
89
89
  itemContainer : {
90
90
  minHeight : 80,
91
91
  },
92
- })
92
+ });
93
+
94
+ export {DatabaseStatistic};