@steroidsjs/core 2.2.96 → 2.2.98
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/hooks/useFetch.js
CHANGED
|
@@ -102,7 +102,7 @@ function useFetch(rawConfig) {
|
|
|
102
102
|
var _a = react_1.useState(exports.normalizeConfig(rawConfig)), config = _a[0], setConfig = _a[1];
|
|
103
103
|
// Update config in state on raw config updated
|
|
104
104
|
react_use_1.useUpdateEffect(function () {
|
|
105
|
-
setConfig(rawConfig);
|
|
105
|
+
setConfig(exports.normalizeConfig(rawConfig));
|
|
106
106
|
}, [rawConfig]);
|
|
107
107
|
// Get preloaded data
|
|
108
108
|
var configId = exports.getConfigId(config);
|
package/package.json
CHANGED
|
@@ -41,9 +41,12 @@ function useDateInputState(props) {
|
|
|
41
41
|
var onDisplayValueChange = react_1.useCallback(function (value) {
|
|
42
42
|
value = value.replace(/[^0-9:. ]/g, '');
|
|
43
43
|
setDisplayValue(value);
|
|
44
|
-
var
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
var newValue = value;
|
|
45
|
+
if (value !== null) {
|
|
46
|
+
var parsedValue = calendar_1.convertDate(value, props.displayFormat, props.valueFormat, props.useUTC, props.dateInUTC);
|
|
47
|
+
newValue = parsedValue || !value ? parsedValue : false;
|
|
48
|
+
}
|
|
49
|
+
if (newValue !== false && newValue !== props.input.value) {
|
|
47
50
|
props.input.onChange.call(null, newValue);
|
|
48
51
|
if (props.onChange) {
|
|
49
52
|
props.onChange.call(null, value);
|