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/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! aport-tools v4.4.44 | ISC */
1
+ /*! aport-tools v4.4.46 | ISC */
2
2
  'use strict';
3
3
 
4
4
  var React = require('react');
@@ -590,6 +590,7 @@ var Input = function Input(_a) {
590
590
  if (isFirstRender.current) {
591
591
  isFirstRender.current = false;
592
592
  if (firstValue !== undefined) {
593
+ firstValue = firstValue.toString();
593
594
  setInternalValue(firstValue);
594
595
  setFormValue(name, firstValue, firstValue); // Pass firstValue here
595
596
  } else {
@@ -692,7 +693,7 @@ var TextArea = function TextArea(_a) {
692
693
  isFirstRender.current = false;
693
694
  if (firstValue !== undefined) {
694
695
  setInternalValue(firstValue);
695
- setFormValue(name, firstValue);
696
+ setFormValue(name, firstValue, firstValue); // Pass firstValue here
696
697
  } else {
697
698
  setInternalValue(formValues[name] || "");
698
699
  }
@@ -827,11 +828,11 @@ var InputList = function InputList(_a) {
827
828
  React.useEffect(function () {
828
829
  if (multi) {
829
830
  setSelectedOptions(initialSelections);
830
- setFormValue(name, initialSelections);
831
+ setFormValue(name, initialSelections, initialSelections);
831
832
  } else {
832
833
  var singleValue = initialSelections[0] || null;
833
834
  setSelectedOptions(singleValue);
834
- setFormValue(name, singleValue);
835
+ setFormValue(name, singleValue, singleValue);
835
836
  }
836
837
  }, [firstValue, multi, initialSelections]);
837
838
  // Handle option selection
@@ -1092,7 +1093,7 @@ var InputCheck = function InputCheck(_a) {
1092
1093
  });
1093
1094
  });
1094
1095
  setSelectedValues(initialSelectedValues);
1095
- setFormValue(name, initialSelectedValues); // Update form context
1096
+ setFormValue(name, initialSelectedValues, initialSelectedValues); // Update form context
1096
1097
  isFirstRender.current = false; // Prevent subsequent updates
1097
1098
  }
1098
1099
  }, [firstValue, name, options, setFormValue]);
@@ -1224,7 +1225,7 @@ var InputAttach = function InputAttach(_a) {
1224
1225
  React.useEffect(function () {
1225
1226
  if (!isInitialized.current) {
1226
1227
  setSelectedFiles(firstValue);
1227
- setFormValue(name, firstValue); // Update form context
1228
+ setFormValue(name, firstValue, firstValue); // Pass firstValue here
1228
1229
  isInitialized.current = true;
1229
1230
  }
1230
1231
  }, [firstValue, name, setFormValue]);