aport-tools 4.4.44 → 4.4.46
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/forms/Input.d.ts +1 -1
- package/dist/index.esm.js +7 -6
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +7 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/forms/Input.d.ts
CHANGED
@@ -11,7 +11,7 @@ interface InputProps extends TextInputProps {
|
|
11
11
|
/**
|
12
12
|
* Optional first value if you want to set values with fetch or dont have empty inputs.
|
13
13
|
*/
|
14
|
-
firstValue?: string;
|
14
|
+
firstValue?: string | number;
|
15
15
|
/**
|
16
16
|
* The text label displayed above the input field.
|
17
17
|
*/
|
package/dist/index.esm.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
/*! aport-tools v4.4.
|
1
|
+
/*! aport-tools v4.4.46 | 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';
|
@@ -569,6 +569,7 @@ var Input = function Input(_a) {
|
|
569
569
|
if (isFirstRender.current) {
|
570
570
|
isFirstRender.current = false;
|
571
571
|
if (firstValue !== undefined) {
|
572
|
+
firstValue = firstValue.toString();
|
572
573
|
setInternalValue(firstValue);
|
573
574
|
setFormValue(name, firstValue, firstValue); // Pass firstValue here
|
574
575
|
} else {
|
@@ -671,7 +672,7 @@ var TextArea = function TextArea(_a) {
|
|
671
672
|
isFirstRender.current = false;
|
672
673
|
if (firstValue !== undefined) {
|
673
674
|
setInternalValue(firstValue);
|
674
|
-
setFormValue(name, firstValue);
|
675
|
+
setFormValue(name, firstValue, firstValue); // Pass firstValue here
|
675
676
|
} else {
|
676
677
|
setInternalValue(formValues[name] || "");
|
677
678
|
}
|
@@ -806,11 +807,11 @@ var InputList = function InputList(_a) {
|
|
806
807
|
useEffect(function () {
|
807
808
|
if (multi) {
|
808
809
|
setSelectedOptions(initialSelections);
|
809
|
-
setFormValue(name, initialSelections);
|
810
|
+
setFormValue(name, initialSelections, initialSelections);
|
810
811
|
} else {
|
811
812
|
var singleValue = initialSelections[0] || null;
|
812
813
|
setSelectedOptions(singleValue);
|
813
|
-
setFormValue(name, singleValue);
|
814
|
+
setFormValue(name, singleValue, singleValue);
|
814
815
|
}
|
815
816
|
}, [firstValue, multi, initialSelections]);
|
816
817
|
// Handle option selection
|
@@ -1071,7 +1072,7 @@ var InputCheck = function InputCheck(_a) {
|
|
1071
1072
|
});
|
1072
1073
|
});
|
1073
1074
|
setSelectedValues(initialSelectedValues);
|
1074
|
-
setFormValue(name, initialSelectedValues); // Update form context
|
1075
|
+
setFormValue(name, initialSelectedValues, initialSelectedValues); // Update form context
|
1075
1076
|
isFirstRender.current = false; // Prevent subsequent updates
|
1076
1077
|
}
|
1077
1078
|
}, [firstValue, name, options, setFormValue]);
|
@@ -1203,7 +1204,7 @@ var InputAttach = function InputAttach(_a) {
|
|
1203
1204
|
useEffect(function () {
|
1204
1205
|
if (!isInitialized.current) {
|
1205
1206
|
setSelectedFiles(firstValue);
|
1206
|
-
setFormValue(name, firstValue); //
|
1207
|
+
setFormValue(name, firstValue, firstValue); // Pass firstValue here
|
1207
1208
|
isInitialized.current = true;
|
1208
1209
|
}
|
1209
1210
|
}, [firstValue, name, setFormValue]);
|