@fto-consult/expo-ui 8.12.1 → 8.12.3
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
@@ -2,7 +2,6 @@ import React,{forwardRef,useRef,useEffect} from "$react";
|
|
2
2
|
import {uniqid,defaultStr} from "$cutils";
|
3
3
|
import JsBarcode from "jsbarcode";
|
4
4
|
import {jsbarcodePropTypes } from "./utils";
|
5
|
-
import View from "$ecomponents/View";
|
6
5
|
|
7
6
|
///@see : https://lindell.me/JsBarcode/
|
8
7
|
const BarcodeGeneratorComponent = forwardRef(({value,as:asTag,format,id,errorText,testID,onReady,text,flat,width,height,displayValue,fontOptions,font,textAlign,textPosition,textMargin,fontSize,background,lineColor,margin,marginTop,marginBottom,marginLeft,marginRight,valid},ref)=>{
|
@@ -18,7 +18,7 @@ const BarcodeGeneratorComponent = forwardRef(({width,height,lineColor,errorText,
|
|
18
18
|
if(typeof onReady =='function'){
|
19
19
|
onReady();
|
20
20
|
}
|
21
|
-
},[width,height,lineColor,bars,value,format,id,testID,text,flat,displayValue,fontOptions,font,textAlign,textPosition,textMargin,fontSize,
|
21
|
+
},[width,height,lineColor,bars,value,format,id,testID,text,flat,displayValue,fontOptions,font,textAlign,textPosition,textMargin,fontSize,background,margin,marginTop,marginBottom,marginLeft,marginRight])
|
22
22
|
containerProps = Object.assign({},containerProps);
|
23
23
|
return <View ref = {ref} id={id} testID={testID+"_Container"} {...containerProps} style={[{alignSelf:"center"},theme.Colors.isValid(background) && {backgroundColor:background},containerProps.style]}>
|
24
24
|
{!error && displayChildOnTop ? chilren : null}
|
@@ -28,6 +28,7 @@ const BarcodeGenerator = forwardRef(({
|
|
28
28
|
dataURLOptions,
|
29
29
|
id,
|
30
30
|
onReady,
|
31
|
+
displayValue,
|
31
32
|
...rest
|
32
33
|
},ref) => {
|
33
34
|
dataURLOptions = defaultObj(dataURLOptions);
|
@@ -132,6 +133,7 @@ const BarcodeGenerator = forwardRef(({
|
|
132
133
|
return (<Generator
|
133
134
|
{...rest}
|
134
135
|
as={as}
|
136
|
+
displayValue = {typeof displayValue =='boolean'? displayValue : typeof displayValue !=='undefined'? !!displayValue : true}
|
135
137
|
errorText = {error ? <Label style={{textAlign:'center'}} error fontSize={15} textBold>
|
136
138
|
{error?.toString()}
|
137
139
|
</Label>: null}
|
@@ -168,4 +170,6 @@ BarcodeGenerator.propTypes = {
|
|
168
170
|
autoConvertToDataURL : PropTypes.bool,//si la valeur sera auto converti en url lorsque le composant sera monté
|
169
171
|
};
|
170
172
|
|
171
|
-
export default BarcodeGenerator;
|
173
|
+
export default BarcodeGenerator;
|
174
|
+
|
175
|
+
BarcodeGenerator.displayName = "BarcodeGeneratorComponent";
|
@@ -15,7 +15,10 @@ export const jsbarcodePropTypes = {
|
|
15
15
|
width : PropTypes.number, //The width option is the width of a single bar., default : 2
|
16
16
|
height : PropTypes.number,//The height of the barcode., default 100,
|
17
17
|
text : PropTypes.string, //Overide the text that is diplayed
|
18
|
-
displayValue : PropTypes.
|
18
|
+
displayValue : PropTypes.oneOfType([
|
19
|
+
PropTypes.bool,
|
20
|
+
PropTypes.number,
|
21
|
+
]),
|
19
22
|
fontOptions : PropTypes.string,//With fontOptions you can add bold or italic text to the barcode.
|
20
23
|
font : PropTypes.string,
|
21
24
|
textAlign : PropTypes.oneOf(["center","left","right"]), //Set the horizontal alignment of the text. Can be left / center / right.
|