aport-tools 4.3.1 → 4.3.3
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/forms/InputCheck.d.ts +1 -1
- package/dist/index.esm.js +22 -17
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +22 -17
- 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.3 | 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: {
|
@@ -782,7 +787,7 @@ var InputCheck = function InputCheck(_a) {
|
|
782
787
|
return /*#__PURE__*/React.createElement(Card, {
|
783
788
|
pressable: true,
|
784
789
|
onPress: function onPress() {
|
785
|
-
return handleSelect(item.id, item.value);
|
790
|
+
return handleSelect(item.id.toString(), item.value);
|
786
791
|
},
|
787
792
|
style: [styles$2.card, isSelected && {
|
788
793
|
backgroundColor: colors.primary.hex
|
@@ -797,8 +802,7 @@ var InputCheck = function InputCheck(_a) {
|
|
797
802
|
})), /*#__PURE__*/React.createElement(Text, {
|
798
803
|
style: [styles$2.label, {
|
799
804
|
color: isSelected ? colors.textButton.hex : colors.text.hex
|
800
|
-
}
|
801
|
-
]
|
805
|
+
}]
|
802
806
|
}, item.label));
|
803
807
|
};
|
804
808
|
return /*#__PURE__*/React.createElement(reactNative.FlatList, {
|
@@ -855,9 +859,8 @@ var InputAttach = function InputAttach(_a) {
|
|
855
859
|
_e = _a.placeholder,
|
856
860
|
placeholder = _e === void 0 ? "Upload an image" : _e;
|
857
861
|
var _f = useFormContext(),
|
858
|
-
setFormValue = _f.setFormValue
|
859
|
-
_f.
|
860
|
-
var errors = _f.errors;
|
862
|
+
setFormValue = _f.setFormValue,
|
863
|
+
errors = _f.errors;
|
861
864
|
var _g = React.useState([]),
|
862
865
|
selectedFiles = _g[0],
|
863
866
|
setSelectedFiles = _g[1];
|
@@ -878,7 +881,9 @@ var InputAttach = function InputAttach(_a) {
|
|
878
881
|
return [2 /*return*/];
|
879
882
|
}
|
880
883
|
return [4 /*yield*/, ImagePicker__namespace.launchImageLibraryAsync({
|
881
|
-
mediaTypes:
|
884
|
+
mediaTypes: ["images"],
|
885
|
+
// Updated usage
|
886
|
+
allowsEditing: true,
|
882
887
|
allowsMultipleSelection: amount > 1,
|
883
888
|
quality: 1
|
884
889
|
})];
|
@@ -971,7 +976,7 @@ var styles$1 = reactNative.StyleSheet.create({
|
|
971
976
|
marginVertical: 10
|
972
977
|
},
|
973
978
|
label: {
|
974
|
-
|
979
|
+
marginTop: 5
|
975
980
|
},
|
976
981
|
fileContainer: {
|
977
982
|
flexDirection: "row",
|