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.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
/*! aport-tools v4.3.
|
1
|
+
/*! aport-tools v4.3.4 | ISC */
|
2
2
|
'use strict';
|
3
3
|
|
4
4
|
var React = require('react');
|
@@ -407,13 +407,12 @@ var TextArea = function TextArea(_a) {
|
|
407
407
|
style: [styles$6.textArea, style, {
|
408
408
|
backgroundColor: colors.body.hex,
|
409
409
|
color: colors.text.hex,
|
410
|
-
borderColor: colors.
|
410
|
+
borderColor: formErrors[name] ? colors.error.hex : "#CCC"
|
411
411
|
}],
|
412
412
|
value: formValues[name] || '',
|
413
413
|
onChangeText: handleChange,
|
414
414
|
placeholder: label,
|
415
|
-
placeholderTextColor:
|
416
|
-
,
|
415
|
+
placeholderTextColor: colors.placeHolder.hex,
|
417
416
|
multiline: true,
|
418
417
|
numberOfLines: 4,
|
419
418
|
textAlignVertical: "top"
|
@@ -492,7 +491,8 @@ var InputList = function InputList(_a) {
|
|
492
491
|
onChange = _a.onChange;
|
493
492
|
var _h = useFormContext(),
|
494
493
|
formValues = _h.formValues,
|
495
|
-
setFormValue = _h.setFormValue
|
494
|
+
setFormValue = _h.setFormValue,
|
495
|
+
formErrors = _h.errors;
|
496
496
|
var _j = React.useState(false),
|
497
497
|
isDropdownVisible = _j[0],
|
498
498
|
setIsDropdownVisible = _j[1];
|
@@ -569,14 +569,18 @@ var InputList = function InputList(_a) {
|
|
569
569
|
marginBottom: 4
|
570
570
|
}
|
571
571
|
}, name), /*#__PURE__*/React.createElement(reactNative.TouchableOpacity, {
|
572
|
-
style: styles$4.inputContainer,
|
572
|
+
style: [styles$4.inputContainer, {
|
573
|
+
borderColor: formErrors[name] ? colors.error.hex : "#CCC"
|
574
|
+
}],
|
573
575
|
onPress: toggleDropdown,
|
574
576
|
disabled: disabled
|
575
577
|
}, /*#__PURE__*/React.createElement(reactNative.Text, {
|
576
578
|
style: {
|
577
579
|
color: colors.text.hex
|
578
580
|
}
|
579
|
-
}, renderSelectedText())), /*#__PURE__*/React.createElement(
|
581
|
+
}, renderSelectedText())), formErrors[name] && formErrors[name].length > 0 && (/*#__PURE__*/React.createElement(ErrorList, {
|
582
|
+
errors: formErrors[name]
|
583
|
+
})), /*#__PURE__*/React.createElement(reactNative.Modal, {
|
580
584
|
visible: isDropdownVisible,
|
581
585
|
transparent: true,
|
582
586
|
animationType: "fade"
|
@@ -625,11 +629,12 @@ var InputList = function InputList(_a) {
|
|
625
629
|
}))));
|
626
630
|
};
|
627
631
|
var styles$4 = reactNative.StyleSheet.create({
|
628
|
-
container: {
|
632
|
+
container: {
|
633
|
+
marginVertical: 10
|
634
|
+
},
|
629
635
|
inputContainer: {
|
630
636
|
padding: 12,
|
631
637
|
borderWidth: 1,
|
632
|
-
borderColor: '#ccc',
|
633
638
|
borderRadius: 5
|
634
639
|
},
|
635
640
|
dropdownContainer: {
|
@@ -854,9 +859,8 @@ var InputAttach = function InputAttach(_a) {
|
|
854
859
|
_e = _a.placeholder,
|
855
860
|
placeholder = _e === void 0 ? "Upload an image" : _e;
|
856
861
|
var _f = useFormContext(),
|
857
|
-
setFormValue = _f.setFormValue
|
858
|
-
_f.
|
859
|
-
var errors = _f.errors;
|
862
|
+
setFormValue = _f.setFormValue,
|
863
|
+
formErrors = _f.errors;
|
860
864
|
var _g = React.useState([]),
|
861
865
|
selectedFiles = _g[0],
|
862
866
|
setSelectedFiles = _g[1];
|
@@ -877,7 +881,9 @@ var InputAttach = function InputAttach(_a) {
|
|
877
881
|
return [2 /*return*/];
|
878
882
|
}
|
879
883
|
return [4 /*yield*/, ImagePicker__namespace.launchImageLibraryAsync({
|
880
|
-
mediaTypes:
|
884
|
+
mediaTypes: ["images"],
|
885
|
+
// Updated usage
|
886
|
+
allowsEditing: true,
|
881
887
|
allowsMultipleSelection: amount > 1,
|
882
888
|
quality: 1
|
883
889
|
})];
|
@@ -952,25 +958,24 @@ var InputAttach = function InputAttach(_a) {
|
|
952
958
|
}), selectedFiles.length < amount && (/*#__PURE__*/React.createElement(reactNative.TouchableOpacity, {
|
953
959
|
onPress: pickImage,
|
954
960
|
style: [styles$1.addButton, {
|
955
|
-
backgroundColor: colors.body.hex
|
961
|
+
backgroundColor: colors.body.hex,
|
962
|
+
borderColor: formErrors[name] && colors.error.hex
|
956
963
|
}],
|
957
964
|
disabled: disabled
|
958
965
|
}, /*#__PURE__*/React.createElement(Text, {
|
959
966
|
style: [styles$1.addButtonText, {
|
960
967
|
color: colors.placeHolder.hex
|
961
968
|
}]
|
962
|
-
}, "+")))),
|
963
|
-
|
964
|
-
|
965
|
-
}]
|
966
|
-
}, errors[name].join(", ")));
|
969
|
+
}, "+")))), formErrors[name] && formErrors[name].length > 0 && (/*#__PURE__*/React.createElement(ErrorList, {
|
970
|
+
errors: formErrors[name]
|
971
|
+
})), " ");
|
967
972
|
};
|
968
973
|
var styles$1 = reactNative.StyleSheet.create({
|
969
974
|
container: {
|
970
975
|
marginVertical: 10
|
971
976
|
},
|
972
977
|
label: {
|
973
|
-
|
978
|
+
marginTop: 5
|
974
979
|
},
|
975
980
|
fileContainer: {
|
976
981
|
flexDirection: "row",
|