@chem-po/react-native 0.0.42 → 0.0.44
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/lib/commonjs/components/form/input/Editable.js +12 -14
- package/lib/commonjs/components/form/input/Editable.js.map +1 -1
- package/lib/commonjs/components/form/input/file/index.js +3 -2
- package/lib/commonjs/components/form/input/file/index.js.map +1 -1
- package/lib/commonjs/components/form/input/multipleSelect/index.js +7 -11
- package/lib/commonjs/components/form/input/multipleSelect/index.js.map +1 -1
- package/lib/commonjs/components/form/input/select/index.js +3 -6
- package/lib/commonjs/components/form/input/select/index.js.map +1 -1
- package/lib/commonjs/components/form/view/file.js +4 -2
- package/lib/commonjs/components/form/view/file.js.map +1 -1
- package/lib/commonjs/components/form/view/index.js +9 -3
- package/lib/commonjs/components/form/view/index.js.map +1 -1
- package/lib/commonjs/components/form/view/multipleSelect.js +7 -9
- package/lib/commonjs/components/form/view/multipleSelect.js.map +1 -1
- package/lib/commonjs/components/form/view/select.js +14 -11
- package/lib/commonjs/components/form/view/select.js.map +1 -1
- package/lib/module/components/form/input/Editable.js +12 -14
- package/lib/module/components/form/input/Editable.js.map +1 -1
- package/lib/module/components/form/input/file/index.js +3 -2
- package/lib/module/components/form/input/file/index.js.map +1 -1
- package/lib/module/components/form/input/multipleSelect/index.js +8 -12
- package/lib/module/components/form/input/multipleSelect/index.js.map +1 -1
- package/lib/module/components/form/input/select/index.js +4 -7
- package/lib/module/components/form/input/select/index.js.map +1 -1
- package/lib/module/components/form/view/file.js +4 -2
- package/lib/module/components/form/view/file.js.map +1 -1
- package/lib/module/components/form/view/index.js +9 -3
- package/lib/module/components/form/view/index.js.map +1 -1
- package/lib/module/components/form/view/multipleSelect.js +7 -9
- package/lib/module/components/form/view/multipleSelect.js.map +1 -1
- package/lib/module/components/form/view/select.js +13 -10
- package/lib/module/components/form/view/select.js.map +1 -1
- package/lib/typescript/components/form/input/Editable.d.ts +1 -1
- package/lib/typescript/components/form/input/Editable.d.ts.map +1 -1
- package/lib/typescript/components/form/input/file/index.d.ts +3 -2
- package/lib/typescript/components/form/input/file/index.d.ts.map +1 -1
- package/lib/typescript/components/form/input/multipleSelect/index.d.ts.map +1 -1
- package/lib/typescript/components/form/input/select/index.d.ts.map +1 -1
- package/lib/typescript/components/form/view/file.d.ts +3 -2
- package/lib/typescript/components/form/view/file.d.ts.map +1 -1
- package/lib/typescript/components/form/view/index.d.ts +3 -2
- package/lib/typescript/components/form/view/index.d.ts.map +1 -1
- package/lib/typescript/components/form/view/multipleSelect.d.ts +6 -3
- package/lib/typescript/components/form/view/multipleSelect.d.ts.map +1 -1
- package/lib/typescript/components/form/view/select.d.ts +10 -6
- package/lib/typescript/components/form/view/select.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/components/form/input/Editable.tsx +28 -25
- package/src/components/form/input/file/index.tsx +4 -2
- package/src/components/form/input/multipleSelect/index.tsx +5 -6
- package/src/components/form/input/select/index.tsx +7 -12
- package/src/components/form/view/file.tsx +5 -3
- package/src/components/form/view/index.tsx +17 -3
- package/src/components/form/view/multipleSelect.tsx +13 -11
- package/src/components/form/view/select.tsx +24 -16
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["displayField","usePlaceholderColor","React","useMemo","StyleSheet","View","Txt","useInputStyles","FileFieldView","MultipleSelectFieldView","SelectFieldView","inputViewStyles","styles","create","container","flexDirection","alignItems","DefaultFieldView","field","value","noLabel","style","size","sizeProp","inEditable","placeholder","text","containerStyles","formatted","format","_type","placeholderColor","hasValue","undefined","createElement","backgroundColor","label","color","FieldView"],"sourceRoot":"..\\..\\..\\..\\..\\src","sources":["components/form/view/index.tsx"],"mappings":"AAAA,SAASA,YAAY,QAAmB,eAAe;AACvD,SAA6BC,mBAAmB,QAAQ,gBAAgB;AACxE,OAAOC,KAAK,IAAIC,OAAO,QAAQ,OAAO;AACtC,
|
|
1
|
+
{"version":3,"names":["displayField","usePlaceholderColor","React","useMemo","StyleSheet","View","Txt","useInputStyles","FileFieldView","MultipleSelectFieldView","SelectFieldView","inputViewStyles","styles","create","container","flexDirection","alignItems","DefaultFieldView","field","value","noLabel","style","size","sizeProp","inEditable","textStyle","placeholder","text","containerStyles","formatted","format","_type","placeholderColor","hasValue","undefined","createElement","backgroundColor","label","color","FieldView"],"sourceRoot":"..\\..\\..\\..\\..\\src","sources":["components/form/view/index.tsx"],"mappings":"AAAA,SAASA,YAAY,QAAmB,eAAe;AACvD,SAA6BC,mBAAmB,QAAQ,gBAAgB;AACxE,OAAOC,KAAK,IAAIC,OAAO,QAAQ,OAAO;AACtC,SAAoBC,UAAU,EAAaC,IAAI,QAAmB,cAAc;AAChF,SAASC,GAAG,QAAQ,YAAY;AAChC,SAASC,cAAc,QAAQ,+BAA+B;AAC9D,SAASC,aAAa,QAAQ,QAAQ;AACtC,SAASC,uBAAuB,QAAQ,kBAAkB;AAC1D,SAASC,eAAe,QAAQ,UAAU;AAC1C,SAASC,eAAe,QAAQ,UAAU;AAE1C,MAAMC,MAAM,GAAGR,UAAU,CAACS,MAAM,CAAC;EAC/BC,SAAS,EAAE;IACTC,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE;EACd;AACF,CAAC,CAAC;AAEF,MAAMC,gBAAgB,GAAGA,CAAC;EACxBC,KAAK;EACLC,KAAK;EACLC,OAAO;EACPC,KAAK;EACLC,IAAI,EAAEC,QAAQ;EACdC,UAAU;EACVC;AASF,CAAC,KAAK;EACJ,MAAM;IAAEC;EAAY,CAAC,GAAGR,KAAK;EAE7B,MAAM;IAAES,IAAI;IAAEb,SAAS,EAAEc;EAAgB,CAAC,GAAGrB,cAAc,CAACiB,UAAU,EAAEN,KAAK,CAACI,IAAI,EAAEC,QAAQ,CAAC;EAC7F,MAAMM,SAAS,GAAG1B,OAAO,CAAC,MAAM;IAC9B,MAAM2B,MAAM,GAAG9B,YAAY,CAACkB,KAAK,CAACa,KAAK,CAAuB;IAC9D,IAAI,CAACD,MAAM,EAAE,OAAOX,KAAK;I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EA,OAAQ;QACjBE,IAAI,EAAEA,IAAK;QACXE,UAAU,EAAEA;MAAW,CACxB,CAAC;IAEN,KAAK,gBAAgB;MACnB,oBACEtB,KAAA,CAAAiC,aAAA,CAAC1B,uBAAuB;QACtBY,KAAK,EAAEA,KAAM;QACbH,KAAK,EAAEA,KAAM;QACbC,KAAK,EAAEA,KAAM;QACbM,SAAS,EAAEA,SAAU;QACrBL,OAAO,EAAEA,OAAQ;QACjBE,IAAI,EAAEA;MAAK,CACZ,CAAC;IAEN,KAAK,MAAM;MACT,oBACEpB,KAAA,CAAAiC,aAAA,CAAC3B,aAAa;QACZiB,SAAS,EAAEA,SAAU;QACrBJ,KAAK,EAAEA,KAAM;QACbH,KAAK,EAAEA,KAAM;QACbC,KAAK,EAAEA,KAAM;QACbC,OAAO,EAAEA,OAAQ;QACjBE,IAAI,EAAEA;MAAK,CACZ,CAAC;IAEN;MACE,oBACEpB,KAAA,CAAAiC,aAAA,CAAClB,gBAAgB;QACfI,KAAK,EAAEA,KAAM;QACbH,KAAK,EAAEA,KAAM;QACbC,KAAK,EAAEA,KAAM;QACbM,SAAS,EAAEA,SAAU;QACrBL,OAAO,EAAEA,OAAQ;QACjBE,IAAI,EAAEA,IAAK;QACXE,UAAU,EAAEA;MAAW,CACxB,CAAC;EAER;AACF,CAAC","ignoreList":[]}
|
|
@@ -33,7 +33,8 @@ export const MultipleSelectFieldView = ({
|
|
|
33
33
|
value,
|
|
34
34
|
noLabel,
|
|
35
35
|
size: sizeProp,
|
|
36
|
-
style
|
|
36
|
+
style,
|
|
37
|
+
textStyle
|
|
37
38
|
}) => {
|
|
38
39
|
const {
|
|
39
40
|
placeholder,
|
|
@@ -48,12 +49,6 @@ export const MultipleSelectFieldView = ({
|
|
|
48
49
|
container
|
|
49
50
|
} = useInputStyles(true, field.size, sizeProp);
|
|
50
51
|
const placeholderColor = usePlaceholderColor();
|
|
51
|
-
const selectedOptionStyle = useMemo(() => {
|
|
52
|
-
return {
|
|
53
|
-
paddingHorizontal: container.paddingHorizontal,
|
|
54
|
-
paddingVertical: container.paddingVertical
|
|
55
|
-
};
|
|
56
|
-
}, [container]);
|
|
57
52
|
const RenderOption = useMemo(() => customRender ?? DefaultRenderOption, [customRender]);
|
|
58
53
|
return /*#__PURE__*/React.createElement(View, {
|
|
59
54
|
style: [styles.container, style]
|
|
@@ -63,10 +58,13 @@ export const MultipleSelectFieldView = ({
|
|
|
63
58
|
style: styles.optionsContainer
|
|
64
59
|
}, selectedOptions.map(o => /*#__PURE__*/React.createElement(SelectedOptionContainer, {
|
|
65
60
|
key: o.value,
|
|
66
|
-
style:
|
|
61
|
+
style: [container, {
|
|
62
|
+
width: 'auto'
|
|
63
|
+
}]
|
|
67
64
|
}, /*#__PURE__*/React.createElement(RenderOption, {
|
|
68
65
|
option: o,
|
|
69
66
|
value: o.value,
|
|
67
|
+
textStyle: [text, textStyle],
|
|
70
68
|
colorMode: colorMode,
|
|
71
69
|
isSelected: true,
|
|
72
70
|
size: size
|
|
@@ -75,7 +73,7 @@ export const MultipleSelectFieldView = ({
|
|
|
75
73
|
}, /*#__PURE__*/React.createElement(Txt, {
|
|
76
74
|
style: [text, {
|
|
77
75
|
color: placeholderColor
|
|
78
|
-
}]
|
|
76
|
+
}, textStyle]
|
|
79
77
|
}, "None")));
|
|
80
78
|
};
|
|
81
79
|
//# sourceMappingURL=multipleSelect.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useColorMode","usePlaceholderColor","useMemo","React","StyleSheet","Text","View","Txt","useInputStyles","SelectedOptionContainer","DefaultRenderOption","styles","create","container","flexDirection","flexWrap","alignItems","maxWidth","backgroundColor","label","paddingRight","opacity","fontWeight","optionsContainer","padding","optionContainer","marginTop","marginHorizontal","MultipleSelectFieldView","field","value","noLabel","size","sizeProp","style","placeholder","renderOption","customRender","options","selectedOptions","filter","o","includes","colorMode","text","placeholderColor","
|
|
1
|
+
{"version":3,"names":["useColorMode","usePlaceholderColor","useMemo","React","StyleSheet","Text","View","Txt","useInputStyles","SelectedOptionContainer","DefaultRenderOption","styles","create","container","flexDirection","flexWrap","alignItems","maxWidth","backgroundColor","label","paddingRight","opacity","fontWeight","optionsContainer","padding","optionContainer","marginTop","marginHorizontal","MultipleSelectFieldView","field","value","noLabel","size","sizeProp","style","textStyle","placeholder","renderOption","customRender","options","selectedOptions","filter","o","includes","colorMode","text","placeholderColor","RenderOption","createElement","length","map","key","width","option","isSelected","color"],"sourceRoot":"..\\..\\..\\..\\..\\src","sources":["components/form/view/multipleSelect.tsx"],"mappings":"AACA,SAA8BA,YAAY,EAAEC,mBAAmB,QAAQ,gBAAgB;AACvF,SAASC,OAAO,QAAQ,OAAO;AAC/B,OAAOC,KAAK,IAAeC,UAAU,EAAEC,IAAI,EAAaC,IAAI,QAAmB,cAAc;AAC7F,SAASC,GAAG,QAAQ,gBAAgB;AACpC,SAASC,cAAc,QAAQ,+BAA+B;AAC9D,SAASC,uBAAuB,QAAQ,yBAAyB;AACjE,SAASC,mBAAmB,QAAQ,UAAU;AAE9C,MAAMC,MAAM,GAAGP,UAAU,CAACQ,MAAM,CAAC;EAC/BC,SAAS,EAAE;IACTC,aAAa,EAAE,KAAK;IACpBC,QAAQ,EAAE,MAAM;IAChBC,UAAU,EAAE,QAAQ;IACpBC,QAAQ,EAAE,MAAM;IAChBC,eAAe,EAAE;EACnB,CAAC;EACDC,KAAK,EAAE;IACLC,YAAY,EAAE,CAAC;IACfC,OAAO,EAAE,GAAG;IACZC,UAAU,EAAE;EACd,CAAC;EACDC,gBAAgB,EAAE;IAChBC,OAAO,EAAE,CAAC;IACVV,aAAa,EAAE,KAAK;IACpBC,QAAQ,EAAE;EACZ,CAAC;EACDU,eAAe,EAAE;IACfC,SAAS,EAAE,CAAC;IACZC,gBAAgB,EAAE;EACpB;AACF,CAAC,CAAC;AAOF,OAAO,MAAMC,uBAAuB,GAAGA,CAAsC;EAC3EC,KAAK;EACLC,KAAK;EACLC,OAAO;EACPC,IAAI,EAAEC,Q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AY;IACXM,MAAM,EAAEX,CAAE;IACVZ,KAAK,EAAEY,CAAC,CAACZ,KAAM;IACfK,SAAS,EAAE,CAACU,IAAI,EAAEV,SAAS,CAAE;IAC7BS,SAAS,EAAEA,SAAU;IACrBU,UAAU;IACVtB,IAAI,EAAEA;EAAK,CACZ,CACsB,CAC1B,CACG,CAAC,gBAEP7B,KAAA,CAAA6C,aAAA,CAAC1C,IAAI;IAAC4B,KAAK,EAAErB;EAAU,gBACrBV,KAAA,CAAA6C,aAAA,CAACzC,GAAG;IAAC2B,KAAK,EAAE,CAACW,IAAI,EAAE;MAAEU,KAAK,EAAET;IAAiB,CAAC,EAAEX,SAAS;EAAE,GAAC,MAAS,CACjE,CAEJ,CAAC;AAEX,CAAC","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useColorMode, usePlaceholderColor } from '@chem-po/react';
|
|
2
|
-
import React from 'react';
|
|
2
|
+
import React, { useMemo } from 'react';
|
|
3
3
|
import { StyleSheet, Text, View } from 'react-native';
|
|
4
4
|
import { Txt } from '../../text';
|
|
5
5
|
import { useInputStyles } from '../input/hooks/useInputStyles';
|
|
@@ -16,14 +16,14 @@ const styles = StyleSheet.create({
|
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
18
|
export const DefaultRenderOption = ({
|
|
19
|
-
option
|
|
19
|
+
option,
|
|
20
|
+
containerStyle,
|
|
21
|
+
textStyle
|
|
20
22
|
}) => {
|
|
21
23
|
return /*#__PURE__*/React.createElement(View, {
|
|
22
|
-
style:
|
|
23
|
-
padding: 6
|
|
24
|
-
}
|
|
24
|
+
style: containerStyle
|
|
25
25
|
}, /*#__PURE__*/React.createElement(Txt, {
|
|
26
|
-
style: inputViewStyles.value
|
|
26
|
+
style: [inputViewStyles.value, textStyle]
|
|
27
27
|
}, option.label));
|
|
28
28
|
};
|
|
29
29
|
export const SelectFieldView = ({
|
|
@@ -32,7 +32,8 @@ export const SelectFieldView = ({
|
|
|
32
32
|
noLabel,
|
|
33
33
|
style,
|
|
34
34
|
size: sizeProp,
|
|
35
|
-
inEditable
|
|
35
|
+
inEditable,
|
|
36
|
+
textStyle
|
|
36
37
|
}) => {
|
|
37
38
|
const {
|
|
38
39
|
placeholder,
|
|
@@ -46,16 +47,18 @@ export const SelectFieldView = ({
|
|
|
46
47
|
container
|
|
47
48
|
} = useInputStyles(inEditable, field.size, sizeProp);
|
|
48
49
|
const selectedOption = field.options.find(o => o.value === value);
|
|
49
|
-
const RenderOption = customRender ?? DefaultRenderOption;
|
|
50
|
+
const RenderOption = useMemo(() => customRender ?? DefaultRenderOption, [customRender]);
|
|
50
51
|
return /*#__PURE__*/React.createElement(View, {
|
|
51
52
|
style: [styles.container, style]
|
|
52
53
|
}, !noLabel && /*#__PURE__*/React.createElement(Text, {
|
|
53
54
|
style: [styles.label, text, {
|
|
54
55
|
color: placeholderColor
|
|
55
|
-
}]
|
|
56
|
+
}, textStyle]
|
|
56
57
|
}, placeholder), selectedOption ? /*#__PURE__*/React.createElement(RenderOption, {
|
|
57
58
|
value: selectedOption.value,
|
|
58
59
|
option: selectedOption,
|
|
60
|
+
containerStyle: container,
|
|
61
|
+
textStyle: [text, textStyle],
|
|
59
62
|
colorMode: colorMode,
|
|
60
63
|
isSelected: true,
|
|
61
64
|
size: size
|
|
@@ -64,7 +67,7 @@ export const SelectFieldView = ({
|
|
|
64
67
|
}, /*#__PURE__*/React.createElement(Txt, {
|
|
65
68
|
style: [text, {
|
|
66
69
|
color: placeholderColor
|
|
67
|
-
}]
|
|
70
|
+
}, textStyle]
|
|
68
71
|
}, "None")));
|
|
69
72
|
};
|
|
70
73
|
//# sourceMappingURL=select.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useColorMode","usePlaceholderColor","React","StyleSheet","Text","View","Txt","useInputStyles","inputViewStyles","styles","create","container","flexDirection","alignItems","backgroundColor","label","paddingRight","fontWeight","DefaultRenderOption","option","
|
|
1
|
+
{"version":3,"names":["useColorMode","usePlaceholderColor","React","useMemo","StyleSheet","Text","View","Txt","useInputStyles","inputViewStyles","styles","create","container","flexDirection","alignItems","backgroundColor","label","paddingRight","fontWeight","DefaultRenderOption","option","containerStyle","textStyle","createElement","style","value","SelectFieldView","field","noLabel","size","sizeProp","inEditable","placeholder","renderOption","customRender","colorMode","placeholderColor","text","selectedOption","options","find","o","RenderOption","color","isSelected"],"sourceRoot":"..\\..\\..\\..\\..\\src","sources":["components/form/view/select.tsx"],"mappings":"AACA,SAAsBA,YAAY,EAAEC,mBAAmB,QAAQ,gBAAgB;AAC/E,OAAOC,KAAK,IAAIC,OAAO,QAAQ,OAAO;AACtC,SAAoBC,UAAU,EAAEC,IAAI,EAAaC,IAAI,QAAmB,cAAc;AACtF,SAASC,GAAG,QAAQ,YAAY;AAChC,SAASC,cAAc,QAAQ,+BAA+B;AAC9D,SAASC,eAAe,QAAQ,UAAU;AAE1C,MAAMC,MAAM,GAAGN,UAAU,CAACO,MAAM,CAAC;EAC/BC,SAAS,EAAE;IACTC,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBC,eAAe,EAAE;EACnB,CAAC;EACDC,KAAK,EAAE;IACLC,YAAY,EAAE,EAAE;IAChBC,UAAU,EAAE;EACd;AACF,CAAC,CAAC;AAEF,OAAO,MAAMC,mBAAmB,GAAGA,CAAC;EAClCC,MAAM;EACNC,cAAc;EACdC;AAIF,CAAC,KAAK;EACJ,oBACEpB,KAAA,CAAAqB,aAAA,CAACjB,IAAI;IAACkB,KAAK,EAAEH;EAAe,gBAC1BnB,KAAA,CAAAqB,aAAA,CAAChB,GAAG;IAACiB,KAAK,EAAE,CAACf,eAAe,CAACgB,KAAK,EAAEH,SAAS;EAAE,GAAEF,MAAM,CAACJ,KAAW,CAC/D,CAAC;AAEX,CAAC;AAED,OAAO,MAAMU,eAAe,GAAGA,CAAwB;EACrDC,KAAK;EACLF,KAAK;EACLG,OAAO;EACPJ,KAAK;EACLK,IAAI,EAAEC,QAAQ;EAC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KAAA,CAAAqB,aAAA,CAAChB,GAAG;IAACiB,KAAK,EAAE,CAACa,IAAI,EAAE;MAAEM,KAAK,EAAEP;IAAiB,CAAC,EAAEd,SAAS;EAAE,GAAC,MAAS,CACjE,CAEJ,CAAC;AAEX,CAAC","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EditableProps, Field } from '@chem-po/react';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { TextStyle, ViewStyle } from 'react-native';
|
|
4
|
-
export declare const Editable: <T extends Field>({ value: initValue, field, onSubmit, storagePath, style, onEditClose, onEditOpen, containerStyle, size, CustomInput, CustomView, }: EditableProps<ViewStyle, TextStyle, T>) => React.JSX.Element;
|
|
4
|
+
export declare const Editable: <T extends Field>({ value: initValue, field, onSubmit, storagePath, style, onEditClose, onEditOpen, containerStyle, size, CustomInput, CustomView, inputStyle, }: EditableProps<ViewStyle, TextStyle, T>) => React.JSX.Element;
|
|
5
5
|
//# sourceMappingURL=Editable.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Editable.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/input/Editable.tsx"],"names":[],"mappings":"AACA,OAAO,EAEL,aAAa,EACb,KAAK,EAKN,MAAM,gBAAgB,CAAA;AAEvB,OAAO,KAAwD,MAAM,OAAO,CAAA;AAC5E,OAAO,EAAc,SAAS,EAAQ,SAAS,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"Editable.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/input/Editable.tsx"],"names":[],"mappings":"AACA,OAAO,EAEL,aAAa,EACb,KAAK,EAKN,MAAM,gBAAgB,CAAA;AAEvB,OAAO,KAAwD,MAAM,OAAO,CAAA;AAC5E,OAAO,EAAc,SAAS,EAAQ,SAAS,EAAE,MAAM,cAAc,CAAA;AAQrE,eAAO,MAAM,QAAQ,GAAI,CAAC,SAAS,KAAK,EAAE,gJAavC,aAAa,CAAC,SAAS,EAAE,SAAS,EAAE,CAAC,CAAC,sBAiIxC,CAAA"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { FileValue, ImageViewOptions, InputRef } from '@chem-po/core';
|
|
2
2
|
import { FileField } from '@chem-po/react';
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import { StyleProp, ViewStyle } from 'react-native';
|
|
4
|
+
import { StyleProp, TextStyle, ViewStyle } from 'react-native';
|
|
5
5
|
import { FieldProps } from '../../types';
|
|
6
|
-
export declare const FileView: ({ value, hasUpload, imageOptions, withFullView, nonImageContainerStyle, withDownload, onUploadPress, }: {
|
|
6
|
+
export declare const FileView: ({ value, hasUpload, imageOptions, withFullView, nonImageContainerStyle, withDownload, onUploadPress, textStyle, }: {
|
|
7
7
|
value?: FileValue | null;
|
|
8
8
|
hasUpload?: boolean;
|
|
9
9
|
imageOptions?: ImageViewOptions;
|
|
@@ -11,6 +11,7 @@ export declare const FileView: ({ value, hasUpload, imageOptions, withFullView,
|
|
|
11
11
|
nonImageContainerStyle?: StyleProp<ViewStyle>;
|
|
12
12
|
withDownload?: boolean;
|
|
13
13
|
onUploadPress?: () => void;
|
|
14
|
+
textStyle?: StyleProp<TextStyle>;
|
|
14
15
|
}) => React.JSX.Element;
|
|
15
16
|
export declare const FileComponent: React.ForwardRefExoticComponent<FieldProps<FileField> & React.RefAttributes<InputRef>>;
|
|
16
17
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/form/input/file/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,QAAQ,EAAkB,MAAM,eAAe,CAAA;AACrF,OAAO,EACL,SAAS,EAQV,MAAM,gBAAgB,CAAA;AAIvB,OAAO,KAAgE,MAAM,OAAO,CAAA;AACpF,OAAO,EAAY,SAAS,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/form/input/file/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,QAAQ,EAAkB,MAAM,eAAe,CAAA;AACrF,OAAO,EACL,SAAS,EAQV,MAAM,gBAAgB,CAAA;AAIvB,OAAO,KAAgE,MAAM,OAAO,CAAA;AACpF,OAAO,EAAY,SAAS,EAAoB,SAAS,EAAQ,SAAS,EAAE,MAAM,cAAc,CAAA;AAIhG,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AA+BxC,eAAO,MAAM,QAAQ,GAAI,mHAStB;IACD,KAAK,CAAC,EAAE,SAAS,GAAG,IAAI,CAAA;IACxB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,YAAY,CAAC,EAAE,gBAAgB,CAAA;IAC/B,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,sBAAsB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;IAC7C,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,aAAa,CAAC,EAAE,MAAM,IAAI,CAAA;IAC1B,SAAS,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;CACjC,sBAmFA,CAAA;AAED,eAAO,MAAM,aAAa,wFAyFzB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/form/input/multipleSelect/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAA2B,MAAM,eAAe,CAAA;AACjE,OAAO,EACL,mBAAmB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/form/input/multipleSelect/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAA2B,MAAM,eAAe,CAAA;AACjE,OAAO,EACL,mBAAmB,EAOpB,MAAM,gBAAgB,CAAA;AAEvB,OAAO,KAAK,EAAE,EAGZ,iBAAiB,EAIlB,MAAM,OAAO,CAAA;AACd,OAAO,EAAE,SAAS,EAAoB,SAAS,EAAE,MAAM,cAAc,CAAA;AAGrE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAIxC,eAAO,MAAM,uBAAuB,GAAI,sBAGrC,iBAAiB,CAAC;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;CAAE,CAAC,sBAQnE,CAAA;AAoJD,eAAO,MAAM,uBAAuB,kGAA0C,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/form/input/select/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAA2B,MAAM,eAAe,CAAA;AACjE,OAAO,EACL,WAAW,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/form/input/select/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAA2B,MAAM,eAAe,CAAA;AACjE,OAAO,EACL,WAAW,EAKZ,MAAM,gBAAgB,CAAA;AAEvB,OAAO,KAAgE,MAAM,OAAO,CAAA;AAIpF,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAwHxC,eAAO,MAAM,eAAe,0FAAkC,CAAA"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { InputSize } from '@chem-po/core';
|
|
2
2
|
import { FileField } from '@chem-po/react';
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import { ViewStyle } from 'react-native';
|
|
5
|
-
export declare const FileFieldView: ({ field, value, noLabel, style, size: sizeProp, }: {
|
|
4
|
+
import { StyleProp, TextStyle, ViewStyle } from 'react-native';
|
|
5
|
+
export declare const FileFieldView: ({ field, value, noLabel, style, size: sizeProp, textStyle, }: {
|
|
6
6
|
field: FileField;
|
|
7
7
|
value: any;
|
|
8
8
|
noLabel?: boolean;
|
|
9
9
|
style?: ViewStyle;
|
|
10
|
+
textStyle?: StyleProp<TextStyle>;
|
|
10
11
|
size?: InputSize;
|
|
11
12
|
}) => React.JSX.Element;
|
|
12
13
|
//# sourceMappingURL=file.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/view/file.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoB,SAAS,EAAE,MAAM,eAAe,CAAA;AAC3D,OAAO,EAAE,SAAS,EAAuB,MAAM,gBAAgB,CAAA;AAC/D,OAAO,KAAkB,MAAM,OAAO,CAAA;AACtC,OAAO,
|
|
1
|
+
{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/view/file.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoB,SAAS,EAAE,MAAM,eAAe,CAAA;AAC3D,OAAO,EAAE,SAAS,EAAuB,MAAM,gBAAgB,CAAA;AAC/D,OAAO,KAAkB,MAAM,OAAO,CAAA;AACtC,OAAO,EAAE,SAAS,EAAoB,SAAS,EAAQ,SAAS,EAAE,MAAM,cAAc,CAAA;AAmCtF,eAAO,MAAM,aAAa,GAAI,8DAO3B;IACD,KAAK,EAAE,SAAS,CAAA;IAChB,KAAK,EAAE,GAAG,CAAA;IACV,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,SAAS,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;IAChC,IAAI,CAAC,EAAE,SAAS,CAAA;CACjB,sBA2BA,CAAA"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { InputSize } from '@chem-po/core';
|
|
2
2
|
import { Field } from '@chem-po/react';
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import { ViewStyle } from 'react-native';
|
|
5
|
-
export declare const FieldView: ({ field, value, noLabel, style, size, inEditable, }: {
|
|
4
|
+
import { StyleProp, TextStyle, ViewStyle } from 'react-native';
|
|
5
|
+
export declare const FieldView: ({ field, value, noLabel, style, textStyle, size, inEditable, }: {
|
|
6
6
|
field: Field;
|
|
7
7
|
value?: any;
|
|
8
8
|
noLabel?: boolean;
|
|
9
9
|
style?: ViewStyle;
|
|
10
|
+
textStyle?: StyleProp<TextStyle>;
|
|
10
11
|
size?: InputSize;
|
|
11
12
|
inEditable?: boolean;
|
|
12
13
|
}) => React.JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/view/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgB,SAAS,EAAE,MAAM,eAAe,CAAA;AACvD,OAAO,EAAE,KAAK,EAAoC,MAAM,gBAAgB,CAAA;AACxE,OAAO,KAAkB,MAAM,OAAO,CAAA;AACtC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/view/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgB,SAAS,EAAE,MAAM,eAAe,CAAA;AACvD,OAAO,EAAE,KAAK,EAAoC,MAAM,gBAAgB,CAAA;AACxE,OAAO,KAAkB,MAAM,OAAO,CAAA;AACtC,OAAO,EAAE,SAAS,EAAc,SAAS,EAAQ,SAAS,EAAE,MAAM,cAAc,CAAA;AAwDhF,eAAO,MAAM,SAAS,GAAI,gEAQvB;IACD,KAAK,EAAE,KAAK,CAAA;IACZ,KAAK,CAAC,EAAE,GAAG,CAAA;IACX,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,SAAS,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;IAChC,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,sBAiDA,CAAA"}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import { InputSize } from '@chem-po/core';
|
|
1
|
+
import { BaseSelectOption, InputSize } from '@chem-po/core';
|
|
2
2
|
import { MultipleSelectField } from '@chem-po/react';
|
|
3
|
-
import { ViewStyle } from 'react-native';
|
|
4
|
-
|
|
3
|
+
import { StyleProp, TextStyle, ViewStyle } from 'react-native';
|
|
4
|
+
type NativeMultipleSelectField<Value extends any[] = string[], Option extends BaseSelectOption<Value[number]> = BaseSelectOption<Value[number]>> = MultipleSelectField<Value, Option>;
|
|
5
|
+
export declare const MultipleSelectFieldView: <F extends NativeMultipleSelectField>({ field, value, noLabel, size: sizeProp, style, textStyle, }: {
|
|
5
6
|
field: F;
|
|
6
7
|
value?: F["defaultValue"];
|
|
7
8
|
noLabel?: boolean;
|
|
9
|
+
textStyle?: StyleProp<TextStyle>;
|
|
8
10
|
size?: InputSize;
|
|
9
11
|
style?: ViewStyle;
|
|
10
12
|
}) => any;
|
|
13
|
+
export {};
|
|
11
14
|
//# sourceMappingURL=multipleSelect.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multipleSelect.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/view/multipleSelect.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"multipleSelect.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/view/multipleSelect.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC3D,OAAO,EAAE,mBAAmB,EAAqC,MAAM,gBAAgB,CAAA;AAEvF,OAAc,EAAE,SAAS,EAAoB,SAAS,EAAQ,SAAS,EAAE,MAAM,cAAc,CAAA;AA8B7F,KAAK,yBAAyB,CAC5B,KAAK,SAAS,GAAG,EAAE,GAAG,MAAM,EAAE,EAC9B,MAAM,SAAS,gBAAgB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,gBAAgB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAC9E,mBAAmB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA;AAEtC,eAAO,MAAM,uBAAuB,GAAI,CAAC,SAAS,yBAAyB,EAAE,8DAO1E;IACD,KAAK,EAAE,CAAC,CAAA;IACR,KAAK,CAAC,EAAE,CAAC,CAAC,cAAc,CAAC,CAAA;IACzB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,SAAS,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;IAChC,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,KAAK,CAAC,EAAE,SAAS,CAAA;CAClB,QAgCA,CAAA"}
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { InputSize, RenderSelectOptionProps } from '@chem-po/core';
|
|
2
2
|
import { SelectField } from '@chem-po/react';
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import { ViewStyle } from 'react-native';
|
|
5
|
-
export declare const DefaultRenderOption:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
import { StyleProp, TextStyle, ViewStyle } from 'react-native';
|
|
5
|
+
export declare const DefaultRenderOption: ({ option, containerStyle, textStyle, }: RenderSelectOptionProps & {
|
|
6
|
+
containerStyle?: StyleProp<ViewStyle>;
|
|
7
|
+
textStyle?: StyleProp<TextStyle>;
|
|
8
|
+
}) => React.JSX.Element;
|
|
9
|
+
export declare const SelectFieldView: <F extends SelectField>({ field, value, noLabel, style, size: sizeProp, inEditable, textStyle, }: {
|
|
10
|
+
field: F;
|
|
11
|
+
value: F["defaultValue"];
|
|
9
12
|
noLabel?: boolean;
|
|
10
13
|
style?: ViewStyle;
|
|
14
|
+
textStyle?: StyleProp<TextStyle>;
|
|
11
15
|
size?: InputSize;
|
|
12
16
|
inEditable?: boolean;
|
|
13
17
|
}) => React.JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/view/select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/view/select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAA;AAClE,OAAO,EAAE,WAAW,EAAqC,MAAM,gBAAgB,CAAA;AAC/E,OAAO,KAAkB,MAAM,OAAO,CAAA;AACtC,OAAO,EAAE,SAAS,EAAoB,SAAS,EAAQ,SAAS,EAAE,MAAM,cAAc,CAAA;AAiBtF,eAAO,MAAM,mBAAmB,GAAI,wCAIjC,uBAAuB,GAAG;IAC3B,cAAc,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;IACrC,SAAS,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;CACjC,sBAMA,CAAA;AAED,eAAO,MAAM,eAAe,GAAI,CAAC,SAAS,WAAW,EAAE,0EAQpD;IACD,KAAK,EAAE,CAAC,CAAA;IACR,KAAK,EAAE,CAAC,CAAC,cAAc,CAAC,CAAA;IACxB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,SAAS,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;IAChC,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,sBA+BA,CAAA"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@chem-po/react-native",
|
|
3
3
|
"author": "Elan Canfield",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "0.0.
|
|
5
|
+
"version": "0.0.44",
|
|
6
6
|
"main": "lib/commonjs/index.js",
|
|
7
7
|
"types": "lib/typescript/index.d.ts",
|
|
8
8
|
"source": "src/index.ts",
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
"react-native-svg": "15.12.1",
|
|
54
54
|
"react-native-worklets": "0.5.1",
|
|
55
55
|
"zustand": "^4.3.3",
|
|
56
|
-
"@chem-po/core": "0.0.
|
|
57
|
-
"@chem-po/react": "0.0.
|
|
56
|
+
"@chem-po/core": "0.0.44",
|
|
57
|
+
"@chem-po/react": "0.0.44"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@babel/core": "^7.26.0",
|
|
@@ -13,7 +13,6 @@ import React, { ForwardedRef, useCallback, useEffect, useMemo } from 'react'
|
|
|
13
13
|
import { StyleSheet, TextStyle, View, ViewStyle } from 'react-native'
|
|
14
14
|
import { Pressable } from 'react-native-gesture-handler'
|
|
15
15
|
import { CustomInputProps } from '../../../types/forms'
|
|
16
|
-
import { CollapseHorizontal } from '../../layout/CollapseHorizontal'
|
|
17
16
|
import { LoadingOverlay } from '../../loading/LoadingOverlay'
|
|
18
17
|
import { UploadProgress } from '../UploadProgress'
|
|
19
18
|
import { FieldView } from '../view'
|
|
@@ -31,6 +30,7 @@ export const Editable = <T extends Field>({
|
|
|
31
30
|
size,
|
|
32
31
|
CustomInput,
|
|
33
32
|
CustomView,
|
|
33
|
+
inputStyle,
|
|
34
34
|
}: EditableProps<ViewStyle, TextStyle, T>) => {
|
|
35
35
|
const {
|
|
36
36
|
inputRef,
|
|
@@ -80,9 +80,9 @@ export const Editable = <T extends Field>({
|
|
|
80
80
|
return <CustomInput {...props} ref={ref} />
|
|
81
81
|
}
|
|
82
82
|
if (!field) throw new Error('Editable component must have a field OR a CustomInput')
|
|
83
|
-
return <StandaloneInput ref={ref} field={field} {...props} />
|
|
83
|
+
return <StandaloneInput ref={ref} field={field} inputStyle={inputStyle} {...props} />
|
|
84
84
|
},
|
|
85
|
-
[CustomInput, field],
|
|
85
|
+
[CustomInput, field, inputStyle],
|
|
86
86
|
)
|
|
87
87
|
|
|
88
88
|
const RenderView = useCallback(
|
|
@@ -91,9 +91,9 @@ export const Editable = <T extends Field>({
|
|
|
91
91
|
return <CustomView {...props} />
|
|
92
92
|
}
|
|
93
93
|
if (!field) throw new Error('Editable component must have a field OR a CustomView')
|
|
94
|
-
return <FieldView field={field} {...props} />
|
|
94
|
+
return <FieldView textStyle={inputStyle} field={field} {...props} />
|
|
95
95
|
},
|
|
96
|
-
[CustomView, field],
|
|
96
|
+
[CustomView, field, inputStyle],
|
|
97
97
|
)
|
|
98
98
|
|
|
99
99
|
return (
|
|
@@ -122,7 +122,7 @@ export const Editable = <T extends Field>({
|
|
|
122
122
|
</View>
|
|
123
123
|
{!alwaysEditing && (
|
|
124
124
|
<View style={styles.buttonsContainer}>
|
|
125
|
-
|
|
125
|
+
{isEditing ? null : (
|
|
126
126
|
<Pressable
|
|
127
127
|
onPress={() => {
|
|
128
128
|
handleEditOpen()
|
|
@@ -132,25 +132,27 @@ export const Editable = <T extends Field>({
|
|
|
132
132
|
onPressOut={() => setEditHovered(false)}>
|
|
133
133
|
<Ionicons name="create-outline" size={20} color={iconColor} />
|
|
134
134
|
</Pressable>
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
135
|
+
)}
|
|
136
|
+
{isEditing ? (
|
|
137
|
+
<>
|
|
138
|
+
<Pressable
|
|
139
|
+
onPress={() => {
|
|
140
|
+
handleEditClose()
|
|
141
|
+
}}
|
|
142
|
+
style={styles.submitButton}
|
|
143
|
+
onPressIn={() => setEditHovered(true)}
|
|
144
|
+
onPressOut={() => setEditHovered(false)}>
|
|
145
|
+
<Ionicons name="close" size={20} color={iconColor} />
|
|
146
|
+
</Pressable>
|
|
147
|
+
<Pressable
|
|
148
|
+
style={[styles.submitButton, { backgroundColor: submitColor }]}
|
|
149
|
+
onPress={() => {
|
|
150
|
+
submit()
|
|
151
|
+
}}>
|
|
152
|
+
<Ionicons name="checkmark" size={20} color="#fff" />
|
|
153
|
+
</Pressable>
|
|
154
|
+
</>
|
|
155
|
+
) : null}
|
|
154
156
|
</View>
|
|
155
157
|
)}
|
|
156
158
|
<LoadingOverlay loading={isLoading} />
|
|
@@ -169,6 +171,7 @@ const styles = StyleSheet.create({
|
|
|
169
171
|
flexDirection: 'row',
|
|
170
172
|
justifyContent: 'center',
|
|
171
173
|
paddingTop: 6,
|
|
174
|
+
gap: 10,
|
|
172
175
|
},
|
|
173
176
|
contentContainer: {
|
|
174
177
|
flexDirection: 'row',
|
|
@@ -13,7 +13,7 @@ import { Ionicons } from '@expo/vector-icons'
|
|
|
13
13
|
import * as DocumentPicker from 'expo-document-picker'
|
|
14
14
|
import * as ImagePicker from 'expo-image-picker'
|
|
15
15
|
import React, { forwardRef, useCallback, useImperativeHandle, useMemo } from 'react'
|
|
16
|
-
import { Platform, StyleProp, StyleSheet, Text, View, ViewStyle } from 'react-native'
|
|
16
|
+
import { Platform, StyleProp, StyleSheet, Text, TextStyle, View, ViewStyle } from 'react-native'
|
|
17
17
|
import { Pressable } from 'react-native-gesture-handler'
|
|
18
18
|
import { downloadFile } from '../../../../utils/downloadFile'
|
|
19
19
|
import { LoadingImage } from '../../../loading/LoadingImage'
|
|
@@ -56,6 +56,7 @@ export const FileView = ({
|
|
|
56
56
|
nonImageContainerStyle,
|
|
57
57
|
withDownload,
|
|
58
58
|
onUploadPress,
|
|
59
|
+
textStyle,
|
|
59
60
|
}: {
|
|
60
61
|
value?: FileValue | null
|
|
61
62
|
hasUpload?: boolean
|
|
@@ -64,6 +65,7 @@ export const FileView = ({
|
|
|
64
65
|
nonImageContainerStyle?: StyleProp<ViewStyle>
|
|
65
66
|
withDownload?: boolean
|
|
66
67
|
onUploadPress?: () => void
|
|
68
|
+
textStyle?: StyleProp<TextStyle>
|
|
67
69
|
}) => {
|
|
68
70
|
const { storagePath, dataUrl } = value ?? {}
|
|
69
71
|
const missingFile = !dataUrl && !storagePath
|
|
@@ -131,7 +133,7 @@ export const FileView = ({
|
|
|
131
133
|
<Ionicons name="document" size={24} color={iconColor} />
|
|
132
134
|
</View>
|
|
133
135
|
<View style={styles.filenameContainer}>
|
|
134
|
-
<Text numberOfLines={1} style={[styles.filename, { color: fileNameColor }]}>
|
|
136
|
+
<Text numberOfLines={1} style={[styles.filename, { color: fileNameColor }, textStyle]}>
|
|
135
137
|
{value.filename}
|
|
136
138
|
</Text>
|
|
137
139
|
</View>
|
|
@@ -4,7 +4,6 @@ import {
|
|
|
4
4
|
useBackgroundColor,
|
|
5
5
|
useBorderColor,
|
|
6
6
|
useColorMode,
|
|
7
|
-
useColorModeValue,
|
|
8
7
|
useIconColor,
|
|
9
8
|
usePlaceholderColor,
|
|
10
9
|
useTextColor,
|
|
@@ -58,7 +57,7 @@ const BaseMultipleSelectComponent = <T extends MultipleSelectField>(
|
|
|
58
57
|
const placeholderColor = usePlaceholderColor()
|
|
59
58
|
const menuBg = useBackgroundColor(100)
|
|
60
59
|
const inputBg = useBackgroundColor(50)
|
|
61
|
-
const selectedOptionBg =
|
|
60
|
+
const selectedOptionBg = useBackgroundColor(50)
|
|
62
61
|
const borderColor = useBorderColor()
|
|
63
62
|
|
|
64
63
|
useImperativeHandle(ref, () => ({
|
|
@@ -86,7 +85,7 @@ const BaseMultipleSelectComponent = <T extends MultipleSelectField>(
|
|
|
86
85
|
return RenderOption(props)
|
|
87
86
|
}
|
|
88
87
|
return (
|
|
89
|
-
<View style={{
|
|
88
|
+
<View style={[container, { width: 'auto' }]}>
|
|
90
89
|
<Txt style={[text]}>{props.option.label}</Txt>
|
|
91
90
|
</View>
|
|
92
91
|
)
|
|
@@ -100,11 +99,11 @@ const BaseMultipleSelectComponent = <T extends MultipleSelectField>(
|
|
|
100
99
|
<View style={[styles.wrapper]}>
|
|
101
100
|
<MultiSelect
|
|
102
101
|
ref={inputRef}
|
|
103
|
-
style={
|
|
102
|
+
style={container}
|
|
104
103
|
placeholderStyle={[text, { color: value?.length ? textColor : placeholderColor }]}
|
|
105
104
|
containerStyle={{
|
|
106
105
|
backgroundColor: menuBg,
|
|
107
|
-
boxShadow: `0 0
|
|
106
|
+
boxShadow: `0 0 10px #00000066`,
|
|
108
107
|
borderWidth: 0,
|
|
109
108
|
}}
|
|
110
109
|
inputSearchStyle={[styles.inputSearch, text, { backgroundColor: inputBg, borderWidth: 0 }]}
|
|
@@ -133,7 +132,7 @@ const BaseMultipleSelectComponent = <T extends MultipleSelectField>(
|
|
|
133
132
|
renderItem={(item, selected) => (
|
|
134
133
|
<View
|
|
135
134
|
style={{
|
|
136
|
-
backgroundColor: selected ? selectedOptionBg :
|
|
135
|
+
backgroundColor: selected ? selectedOptionBg : menuBg,
|
|
137
136
|
paddingVertical: 8,
|
|
138
137
|
paddingHorizontal: 12,
|
|
139
138
|
flexDirection: 'row',
|
|
@@ -2,7 +2,6 @@ import { InputRef, RenderSelectOptionProps } from '@chem-po/core'
|
|
|
2
2
|
import {
|
|
3
3
|
SelectField,
|
|
4
4
|
useBackgroundColor,
|
|
5
|
-
useBorderColor,
|
|
6
5
|
useColorMode,
|
|
7
6
|
useIconColor,
|
|
8
7
|
usePlaceholderColor,
|
|
@@ -33,14 +32,11 @@ const BaseSelectComponent = <T extends SelectField>(
|
|
|
33
32
|
const colorMode = useColorMode()
|
|
34
33
|
|
|
35
34
|
const inputRef = useRef<IDropdownRef>(null)
|
|
36
|
-
const {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
clearButtonSize,
|
|
42
|
-
buttonContainer,
|
|
43
|
-
} = useInputStyles(inEditable, field.size, formSize)
|
|
35
|
+
const { container, iconSize, text, size, clearButtonSize, buttonContainer } = useInputStyles(
|
|
36
|
+
inEditable,
|
|
37
|
+
field.size,
|
|
38
|
+
formSize,
|
|
39
|
+
)
|
|
44
40
|
|
|
45
41
|
useImperativeHandle(ref, () => ({
|
|
46
42
|
focus: () => {
|
|
@@ -64,19 +60,18 @@ const BaseSelectComponent = <T extends SelectField>(
|
|
|
64
60
|
const placeholderColor = usePlaceholderColor()
|
|
65
61
|
const menuBg = useBackgroundColor(100)
|
|
66
62
|
const selectedOptionBg = useBackgroundColor(50)
|
|
67
|
-
const borderColor = useBorderColor()
|
|
68
63
|
|
|
69
64
|
return (
|
|
70
65
|
<View style={styles.wrapper}>
|
|
71
66
|
<Dropdown
|
|
72
67
|
ref={inputRef}
|
|
73
|
-
style={
|
|
68
|
+
style={container}
|
|
74
69
|
placeholderStyle={[text, { color: placeholderColor }]}
|
|
75
70
|
containerStyle={{
|
|
76
71
|
backgroundColor: menuBg,
|
|
77
72
|
borderWidth: 0,
|
|
78
73
|
borderColor: 'transparent',
|
|
79
|
-
boxShadow: `0 0 10px
|
|
74
|
+
boxShadow: `0 0 10px #00000066`,
|
|
80
75
|
}}
|
|
81
76
|
selectedTextStyle={text}
|
|
82
77
|
inputSearchStyle={[
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ImageViewOptions, InputSize } from '@chem-po/core'
|
|
2
2
|
import { FileField, usePlaceholderColor } from '@chem-po/react'
|
|
3
3
|
import React, { useMemo } from 'react'
|
|
4
|
-
import { StyleSheet, Text, View, ViewStyle } from 'react-native'
|
|
4
|
+
import { StyleProp, StyleSheet, Text, TextStyle, View, ViewStyle } from 'react-native'
|
|
5
5
|
import { Txt } from '../../text/Txt'
|
|
6
6
|
import { FileView } from '../input/file'
|
|
7
7
|
import { useInputStyles } from '../input/hooks/useInputStyles'
|
|
@@ -42,11 +42,13 @@ export const FileFieldView = ({
|
|
|
42
42
|
noLabel,
|
|
43
43
|
style,
|
|
44
44
|
size: sizeProp,
|
|
45
|
+
textStyle,
|
|
45
46
|
}: {
|
|
46
47
|
field: FileField
|
|
47
48
|
value: any
|
|
48
49
|
noLabel?: boolean
|
|
49
50
|
style?: ViewStyle
|
|
51
|
+
textStyle?: StyleProp<TextStyle>
|
|
50
52
|
size?: InputSize
|
|
51
53
|
}) => {
|
|
52
54
|
const { imageOptions, placeholder, size } = field
|
|
@@ -66,11 +68,11 @@ export const FileFieldView = ({
|
|
|
66
68
|
{!noLabel && <Text style={styles.label}>{placeholder}</Text>}
|
|
67
69
|
{value ? (
|
|
68
70
|
<View style={styles.fileContainer}>
|
|
69
|
-
<FileView imageOptions={options} value={value} />
|
|
71
|
+
<FileView textStyle={textStyle} imageOptions={options} value={value} />
|
|
70
72
|
</View>
|
|
71
73
|
) : (
|
|
72
74
|
<View style={container}>
|
|
73
|
-
<Txt style={[text, { color: placeholderColor }]}>None</Txt>
|
|
75
|
+
<Txt style={[text, { color: placeholderColor }, textStyle]}>None</Txt>
|
|
74
76
|
</View>
|
|
75
77
|
)}
|
|
76
78
|
</View>
|