@flywire/react-headlessui
Advanced tools
Comparing version 0.0.13 to 0.0.14-1
@@ -76,5 +76,4 @@ "use strict"; | ||
setValue((value) => { | ||
const _value = value === NO_VALUE ? value : format(value); | ||
onValueBlur === null || onValueBlur === void 0 ? void 0 : onValueBlur(parse(_value)); | ||
return _value; | ||
onValueBlur === null || onValueBlur === void 0 ? void 0 : onValueBlur(parse(value)); | ||
return value; | ||
}); | ||
@@ -95,7 +94,9 @@ } | ||
function parse(value) { | ||
return hasCustomFormatter | ||
? (0, utils_1.toNumber)(value.toString(), { | ||
const _value = value === NO_VALUE ? value : format(value); | ||
if (hasCustomFormatter) { | ||
return (0, utils_1.toNumber)(_value, { | ||
decimal: decimalMark, | ||
}) | ||
: (0, utils_1.parseNumber)(value); | ||
}); | ||
} | ||
return (0, utils_1.parseNumber)(_value); | ||
} | ||
@@ -102,0 +103,0 @@ (0, react_1.useEffect)(() => setValue(initialValue === NO_VALUE ? NO_VALUE : format(initialValue)), [initialValue, decimals]); |
@@ -51,5 +51,4 @@ import { useEffect, useState, } from 'react'; | ||
setValue((value) => { | ||
const _value = value === NO_VALUE ? value : format(value); | ||
onValueBlur === null || onValueBlur === void 0 ? void 0 : onValueBlur(parse(_value)); | ||
return _value; | ||
onValueBlur === null || onValueBlur === void 0 ? void 0 : onValueBlur(parse(value)); | ||
return value; | ||
}); | ||
@@ -70,7 +69,9 @@ } | ||
function parse(value) { | ||
return hasCustomFormatter | ||
? toNumber(value.toString(), { | ||
const _value = value === NO_VALUE ? value : format(value); | ||
if (hasCustomFormatter) { | ||
return toNumber(_value, { | ||
decimal: decimalMark, | ||
}) | ||
: parseNumber(value); | ||
}); | ||
} | ||
return parseNumber(_value); | ||
} | ||
@@ -77,0 +78,0 @@ useEffect(() => setValue(initialValue === NO_VALUE ? NO_VALUE : format(initialValue)), [initialValue, decimals]); |
@@ -85,5 +85,4 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
setValue((value) => { | ||
const _value = value === NO_VALUE ? value : format(value); | ||
onValueBlur === null || onValueBlur === void 0 ? void 0 : onValueBlur(parse(_value)); | ||
return _value; | ||
onValueBlur === null || onValueBlur === void 0 ? void 0 : onValueBlur(parse(value)); | ||
return value; | ||
}); | ||
@@ -104,7 +103,9 @@ } | ||
function parse(value) { | ||
return hasCustomFormatter | ||
? (0, utils_1.toNumber)(value.toString(), { | ||
const _value = value === NO_VALUE ? value : format(value); | ||
if (hasCustomFormatter) { | ||
return (0, utils_1.toNumber)(_value, { | ||
decimal: decimalMark, | ||
}) | ||
: (0, utils_1.parseNumber)(value); | ||
}); | ||
} | ||
return (0, utils_1.parseNumber)(_value); | ||
} | ||
@@ -111,0 +112,0 @@ (0, react_1.useEffect)(() => setValue(initialValue === NO_VALUE ? NO_VALUE : format(initialValue)), [initialValue, decimals]); |
{ | ||
"name": "@flywire/react-headlessui", | ||
"version": "0.0.13", | ||
"version": "0.0.14-1", | ||
"description": "Headless UI components", | ||
@@ -5,0 +5,0 @@ "main": "./dist/umd/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
321975
5218