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 CHANGED
@@ -1,4 +1,4 @@
1
- /*! aport-tools v4.4.47 | ISC */
1
+ /*! aport-tools v4.4.50 | ISC */
2
2
  import React, { useContext, useState, createContext, useRef, useEffect, useMemo, useCallback } from 'react';
3
3
  import { StyleSheet, Text as Text$1, Animated, View, TouchableOpacity, Image, TextInput, Modal, Pressable, FlatList, Keyboard, Platform, Alert, ActivityIndicator } from 'react-native';
4
4
  import { ThemeContext } from 'aport-themes';
@@ -805,15 +805,19 @@ var InputList = function InputList(_a) {
805
805
  setSelectedOptions = _l[1];
806
806
  // Update form value when firstValue changes
807
807
  useEffect(function () {
808
+ if (!firstValue || firstValue.length === 0) return;
809
+ var matchedSelections = options.filter(function (opt) {
810
+ return firstValue.includes(opt.value);
811
+ });
808
812
  if (multi) {
809
- setSelectedOptions(initialSelections);
810
- setFormValue(name, initialSelections, initialSelections);
813
+ setSelectedOptions(matchedSelections);
814
+ setFormValue(name, matchedSelections, matchedSelections);
811
815
  } else {
812
- var singleValue = initialSelections[0] || null;
816
+ var singleValue = matchedSelections[0] || null;
813
817
  setSelectedOptions(singleValue);
814
818
  setFormValue(name, singleValue, singleValue);
815
819
  }
816
- }, [firstValue, multi, initialSelections]);
820
+ }, [firstValue, multi]);
817
821
  // Handle option selection
818
822
  var handleSelectOption = function handleSelectOption(option) {
819
823
  var updatedSelections;
@@ -1428,7 +1432,6 @@ var Button = function Button(_a) {
1428
1432
  onPress = _a.onPress;
1429
1433
  var theme = useContext(ThemeContext).theme;
1430
1434
  var colors = theme.colors;
1431
- useFormContext().handleSubmit;
1432
1435
  var computedStyles = useMemo(function () {
1433
1436
  return StyleSheet.flatten([styles.button, typeStyles(type, disabled, colors), rounded && {
1434
1437
  borderRadius: borderRadius
@@ -1453,6 +1456,7 @@ var Button = function Button(_a) {
1453
1456
  }();
1454
1457
  var handlePress = function handlePress() {
1455
1458
  if (type === 'submit' && (formContext === null || formContext === void 0 ? void 0 : formContext.handleSubmit)) {
1459
+ console.log("Its submit type");
1456
1460
  formContext.handleSubmit();
1457
1461
  } else if (onPress) {
1458
1462
  onPress();