aport-tools 4.4.47 → 4.4.50
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/dist/index.esm.js +10 -6
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +10 -6
- 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.4.
|
1
|
+
/*! aport-tools v4.4.50 | ISC */
|
2
2
|
'use strict';
|
3
3
|
|
4
4
|
var React = require('react');
|
@@ -826,15 +826,19 @@ var InputList = function InputList(_a) {
|
|
826
826
|
setSelectedOptions = _l[1];
|
827
827
|
// Update form value when firstValue changes
|
828
828
|
React.useEffect(function () {
|
829
|
+
if (!firstValue || firstValue.length === 0) return;
|
830
|
+
var matchedSelections = options.filter(function (opt) {
|
831
|
+
return firstValue.includes(opt.value);
|
832
|
+
});
|
829
833
|
if (multi) {
|
830
|
-
setSelectedOptions(
|
831
|
-
setFormValue(name,
|
834
|
+
setSelectedOptions(matchedSelections);
|
835
|
+
setFormValue(name, matchedSelections, matchedSelections);
|
832
836
|
} else {
|
833
|
-
var singleValue =
|
837
|
+
var singleValue = matchedSelections[0] || null;
|
834
838
|
setSelectedOptions(singleValue);
|
835
839
|
setFormValue(name, singleValue, singleValue);
|
836
840
|
}
|
837
|
-
}, [firstValue, multi
|
841
|
+
}, [firstValue, multi]);
|
838
842
|
// Handle option selection
|
839
843
|
var handleSelectOption = function handleSelectOption(option) {
|
840
844
|
var updatedSelections;
|
@@ -1449,7 +1453,6 @@ var Button = function Button(_a) {
|
|
1449
1453
|
onPress = _a.onPress;
|
1450
1454
|
var theme = React.useContext(aportThemes.ThemeContext).theme;
|
1451
1455
|
var colors = theme.colors;
|
1452
|
-
useFormContext().handleSubmit;
|
1453
1456
|
var computedStyles = React.useMemo(function () {
|
1454
1457
|
return reactNative.StyleSheet.flatten([styles.button, typeStyles(type, disabled, colors), rounded && {
|
1455
1458
|
borderRadius: borderRadius
|
@@ -1474,6 +1477,7 @@ var Button = function Button(_a) {
|
|
1474
1477
|
}();
|
1475
1478
|
var handlePress = function handlePress() {
|
1476
1479
|
if (type === 'submit' && (formContext === null || formContext === void 0 ? void 0 : formContext.handleSubmit)) {
|
1480
|
+
console.log("Its submit type");
|
1477
1481
|
formContext.handleSubmit();
|
1478
1482
|
} else if (onPress) {
|
1479
1483
|
onPress();
|