aport-tools 4.3.2 → 4.3.4
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.esm.js +25 -20
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +25 -20
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
/*! aport-tools v4.3.
|
1
|
+
/*! aport-tools v4.3.4 | ISC */
|
2
2
|
import React, { useContext, useState, createContext, useCallback, useMemo } from 'react';
|
3
3
|
import { StyleSheet, Text as Text$1, View, TextInput, TouchableOpacity, Modal, Pressable, FlatList, Keyboard, Platform, Image, Alert, ActivityIndicator } from 'react-native';
|
4
4
|
import { ThemeContext } from 'aport-themes';
|
@@ -386,13 +386,12 @@ var TextArea = function TextArea(_a) {
|
|
386
386
|
style: [styles$6.textArea, style, {
|
387
387
|
backgroundColor: colors.body.hex,
|
388
388
|
color: colors.text.hex,
|
389
|
-
borderColor: colors.
|
389
|
+
borderColor: formErrors[name] ? colors.error.hex : "#CCC"
|
390
390
|
}],
|
391
391
|
value: formValues[name] || '',
|
392
392
|
onChangeText: handleChange,
|
393
393
|
placeholder: label,
|
394
|
-
placeholderTextColor:
|
395
|
-
,
|
394
|
+
placeholderTextColor: colors.placeHolder.hex,
|
396
395
|
multiline: true,
|
397
396
|
numberOfLines: 4,
|
398
397
|
textAlignVertical: "top"
|
@@ -471,7 +470,8 @@ var InputList = function InputList(_a) {
|
|
471
470
|
onChange = _a.onChange;
|
472
471
|
var _h = useFormContext(),
|
473
472
|
formValues = _h.formValues,
|
474
|
-
setFormValue = _h.setFormValue
|
473
|
+
setFormValue = _h.setFormValue,
|
474
|
+
formErrors = _h.errors;
|
475
475
|
var _j = useState(false),
|
476
476
|
isDropdownVisible = _j[0],
|
477
477
|
setIsDropdownVisible = _j[1];
|
@@ -548,14 +548,18 @@ var InputList = function InputList(_a) {
|
|
548
548
|
marginBottom: 4
|
549
549
|
}
|
550
550
|
}, name), /*#__PURE__*/React.createElement(TouchableOpacity, {
|
551
|
-
style: styles$4.inputContainer,
|
551
|
+
style: [styles$4.inputContainer, {
|
552
|
+
borderColor: formErrors[name] ? colors.error.hex : "#CCC"
|
553
|
+
}],
|
552
554
|
onPress: toggleDropdown,
|
553
555
|
disabled: disabled
|
554
556
|
}, /*#__PURE__*/React.createElement(Text$1, {
|
555
557
|
style: {
|
556
558
|
color: colors.text.hex
|
557
559
|
}
|
558
|
-
}, renderSelectedText())), /*#__PURE__*/React.createElement(
|
560
|
+
}, renderSelectedText())), formErrors[name] && formErrors[name].length > 0 && (/*#__PURE__*/React.createElement(ErrorList, {
|
561
|
+
errors: formErrors[name]
|
562
|
+
})), /*#__PURE__*/React.createElement(Modal, {
|
559
563
|
visible: isDropdownVisible,
|
560
564
|
transparent: true,
|
561
565
|
animationType: "fade"
|
@@ -604,11 +608,12 @@ var InputList = function InputList(_a) {
|
|
604
608
|
}))));
|
605
609
|
};
|
606
610
|
var styles$4 = StyleSheet.create({
|
607
|
-
container: {
|
611
|
+
container: {
|
612
|
+
marginVertical: 10
|
613
|
+
},
|
608
614
|
inputContainer: {
|
609
615
|
padding: 12,
|
610
616
|
borderWidth: 1,
|
611
|
-
borderColor: '#ccc',
|
612
617
|
borderRadius: 5
|
613
618
|
},
|
614
619
|
dropdownContainer: {
|
@@ -833,9 +838,8 @@ var InputAttach = function InputAttach(_a) {
|
|
833
838
|
_e = _a.placeholder,
|
834
839
|
placeholder = _e === void 0 ? "Upload an image" : _e;
|
835
840
|
var _f = useFormContext(),
|
836
|
-
setFormValue = _f.setFormValue
|
837
|
-
_f.
|
838
|
-
var errors = _f.errors;
|
841
|
+
setFormValue = _f.setFormValue,
|
842
|
+
formErrors = _f.errors;
|
839
843
|
var _g = useState([]),
|
840
844
|
selectedFiles = _g[0],
|
841
845
|
setSelectedFiles = _g[1];
|
@@ -856,7 +860,9 @@ var InputAttach = function InputAttach(_a) {
|
|
856
860
|
return [2 /*return*/];
|
857
861
|
}
|
858
862
|
return [4 /*yield*/, ImagePicker.launchImageLibraryAsync({
|
859
|
-
mediaTypes:
|
863
|
+
mediaTypes: ["images"],
|
864
|
+
// Updated usage
|
865
|
+
allowsEditing: true,
|
860
866
|
allowsMultipleSelection: amount > 1,
|
861
867
|
quality: 1
|
862
868
|
})];
|
@@ -931,25 +937,24 @@ var InputAttach = function InputAttach(_a) {
|
|
931
937
|
}), selectedFiles.length < amount && (/*#__PURE__*/React.createElement(TouchableOpacity, {
|
932
938
|
onPress: pickImage,
|
933
939
|
style: [styles$1.addButton, {
|
934
|
-
backgroundColor: colors.body.hex
|
940
|
+
backgroundColor: colors.body.hex,
|
941
|
+
borderColor: formErrors[name] && colors.error.hex
|
935
942
|
}],
|
936
943
|
disabled: disabled
|
937
944
|
}, /*#__PURE__*/React.createElement(Text, {
|
938
945
|
style: [styles$1.addButtonText, {
|
939
946
|
color: colors.placeHolder.hex
|
940
947
|
}]
|
941
|
-
}, "+")))),
|
942
|
-
|
943
|
-
|
944
|
-
}]
|
945
|
-
}, errors[name].join(", ")));
|
948
|
+
}, "+")))), formErrors[name] && formErrors[name].length > 0 && (/*#__PURE__*/React.createElement(ErrorList, {
|
949
|
+
errors: formErrors[name]
|
950
|
+
})), " ");
|
946
951
|
};
|
947
952
|
var styles$1 = StyleSheet.create({
|
948
953
|
container: {
|
949
954
|
marginVertical: 10
|
950
955
|
},
|
951
956
|
label: {
|
952
|
-
|
957
|
+
marginTop: 5
|
953
958
|
},
|
954
959
|
fileContainer: {
|
955
960
|
flexDirection: "row",
|