aport-tools 4.4.32 → 4.4.33
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 +6 -8
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +6 -8
- 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.33 | ISC */
|
2
2
|
'use strict';
|
3
3
|
|
4
4
|
var React = require('react');
|
@@ -592,16 +592,14 @@ var Input = function Input(_a) {
|
|
592
592
|
var isFirstRender = React.useRef(true); // Track the first render
|
593
593
|
// Initialize the internal value when `firstValue` changes or on first render
|
594
594
|
React.useEffect(function () {
|
595
|
+
var _a;
|
595
596
|
if (isFirstRender.current) {
|
596
597
|
isFirstRender.current = false;
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
} else {
|
601
|
-
setInternalValue(formValues[name] || "");
|
602
|
-
}
|
598
|
+
var initialValue = (_a = firstValue !== null && firstValue !== void 0 ? firstValue : formValues[name]) !== null && _a !== void 0 ? _a : ""; // Priority: firstValue > formValues[name] > ""
|
599
|
+
setInternalValue(initialValue);
|
600
|
+
setFormValue(name, initialValue, firstValue); // Initialize the form value globally
|
603
601
|
}
|
604
|
-
}, [firstValue]);
|
602
|
+
}, [firstValue, formValues, name, setFormValue]);
|
605
603
|
/**
|
606
604
|
* Handles text changes in the input field, applying formatting based on the inputType.
|
607
605
|
*
|