@fto-consult/expo-ui 8.8.3 → 8.9.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": "8.8.3",
3
+ "version": "8.9.0",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "scripts": {
6
6
  "clear-npx-cache": "npx clear-npx-cache",
@@ -23,7 +23,7 @@ const fontOptionsKeys = ["bold","italic","bold italic"];
23
23
  const alignments = ["left","center","right"];
24
24
 
25
25
  const BarcodeDesigner = forwardRef(({
26
- format,testID,onReady,text,value,flat,width,height,displayValue,fontOptions,font,textAlign,textPosition,textMargin,fontSize,background,lineColor,margin,marginTop,marginBottom,marginLeft,marginRight,
26
+ format,testID,onReady,text,value,flat,onChange,width,height,displayValue,fontOptions,font,textAlign,textPosition,textMargin,fontSize,background,lineColor,margin,marginTop,marginBottom,marginLeft,marginRight,
27
27
  sessionName,
28
28
  ...rest
29
29
  },ref)=>{
@@ -55,17 +55,16 @@ const BarcodeDesigner = forwardRef(({
55
55
  if(sessionName){
56
56
  session.set(sKey,state);
57
57
  }
58
+ if(typeof onChange =='function'){
59
+ onChange({data:state,state,setState});
60
+ }
58
61
  },[state]);
59
62
  const isMobile = Dimensions.isMobileMedia(),isTablet= Dimensions.isTabletMedia(),isDesktop= Dimensions.isDesktopMedia();
60
63
  const cellProps = {}
61
64
  const inputProps = {mode:"flat",style:{width:"100%"},containerProps:{style:[]}}
62
65
  return <Surface {...rest} testID={testID} style={[theme.styles.w100,theme.styles.p2,rest.style]}>
63
66
  <View testID={testID+"SurfaceContent"} style={[isMobile || isTablet && {flexDirection:"column"},{justifyContent:"flex-start",alignItems:"flex-start"},isDesktop && {flexDirection:"row"}]}>
64
- <View elevation={isDesktop?5:0} testID={`${testID}_SettingsContainer`} style={[{paddingHorizontal:5},isDesktop? {width:400,marginRight:10,borderRightColor:theme.colors.divider,borderRightWidth:1}:{width:"100%"}]}>
65
- {false && isDesktop ? <View testID={`${testID}_DesignerOptions`} style={[theme.styles.w100]}>
66
- <Label primary textBold fontSize={15} children={"Options du Designer"}/>
67
- <Divider style={[theme.styles.w100,{marginTop:5}]}/>
68
- </View>:null}
67
+ <View elevation={isDesktop?5:0} testID={`${testID}_SettingsContainer`} style={[{paddingHorizontal:5},isDesktop? {width:400,marginRight:10,paddingBottom:20,borderRightColor:theme.colors.divider,borderRightWidth:1}:{width:"100%"}]}>
69
68
  <Expandable defaultExpanded title={<Label primary textBold fontSize={15} children={"Options du Designer"}/>}>
70
69
  <View {...cellProps}>
71
70
  <TextField
@@ -73,9 +72,7 @@ const BarcodeDesigner = forwardRef(({
73
72
  label = {"Valeur de test"}
74
73
  defaultValue = {value}
75
74
  onChange = {({value})=>{
76
- if(value){
77
- setState({...state,value});
78
- }
75
+ setState({...state,value});
79
76
  }}
80
77
  />
81
78
  </View>
@@ -97,7 +94,7 @@ const BarcodeDesigner = forwardRef(({
97
94
  <View {...cellProps}>
98
95
  <TextField
99
96
  {...inputProps}
100
- label = {"Hauteur de la barre"}
97
+ label = {"Hauteur des barres"}
101
98
  type ="number"
102
99
  defaultValue = {state.height}
103
100
  onChange = {({value})=>{
@@ -109,7 +106,7 @@ const BarcodeDesigner = forwardRef(({
109
106
  <TextField
110
107
  {...inputProps}
111
108
  type ="number"
112
- label = {"Longueur de la barre"}
109
+ label = {"Longueur des barres"}
113
110
  defaultValue = {state.width}
114
111
  onChange = {({value})=>{
115
112
  setState({...state,width:value});
@@ -270,6 +267,7 @@ export const barcodeSetingsFields = {
270
267
  marginBottom : PropTypes.number,
271
268
  marginLeft : PropTypes.number,
272
269
  marginRight : PropTypes.number,
270
+ onChange : PropTypes.func,
273
271
  }
274
272
 
275
273
  BarcodeDesigner.displayName = "BarcodeDesigner";