@flywire/react-headlessui
Advanced tools
Comparing version 0.0.14-1 to 0.0.14-2
@@ -72,8 +72,9 @@ "use strict"; | ||
setValue(evt.target.value); | ||
onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(parse(evt.target.value)); | ||
onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(parse(format(evt.target.value))); | ||
} | ||
function handleInputBlur() { | ||
setValue((value) => { | ||
onValueBlur === null || onValueBlur === void 0 ? void 0 : onValueBlur(parse(value)); | ||
return value; | ||
const _value = value === NO_VALUE ? value : format(value); | ||
onValueBlur === null || onValueBlur === void 0 ? void 0 : onValueBlur(parse(_value)); | ||
return _value; | ||
}); | ||
@@ -94,9 +95,7 @@ } | ||
function parse(value) { | ||
const _value = value === NO_VALUE ? value : format(value); | ||
if (hasCustomFormatter) { | ||
return (0, utils_1.toNumber)(_value, { | ||
return hasCustomFormatter | ||
? (0, utils_1.toNumber)(value.toString(), { | ||
decimal: decimalMark, | ||
}); | ||
} | ||
return (0, utils_1.parseNumber)(_value); | ||
}) | ||
: (0, utils_1.parseNumber)(value); | ||
} | ||
@@ -103,0 +102,0 @@ (0, react_1.useEffect)(() => setValue(initialValue === NO_VALUE ? NO_VALUE : format(initialValue)), [initialValue, decimals]); |
@@ -47,8 +47,9 @@ import { useEffect, useState, } from 'react'; | ||
setValue(evt.target.value); | ||
onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(parse(evt.target.value)); | ||
onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(parse(format(evt.target.value))); | ||
} | ||
function handleInputBlur() { | ||
setValue((value) => { | ||
onValueBlur === null || onValueBlur === void 0 ? void 0 : onValueBlur(parse(value)); | ||
return value; | ||
const _value = value === NO_VALUE ? value : format(value); | ||
onValueBlur === null || onValueBlur === void 0 ? void 0 : onValueBlur(parse(_value)); | ||
return _value; | ||
}); | ||
@@ -69,9 +70,7 @@ } | ||
function parse(value) { | ||
const _value = value === NO_VALUE ? value : format(value); | ||
if (hasCustomFormatter) { | ||
return toNumber(_value, { | ||
return hasCustomFormatter | ||
? toNumber(value.toString(), { | ||
decimal: decimalMark, | ||
}); | ||
} | ||
return parseNumber(_value); | ||
}) | ||
: parseNumber(value); | ||
} | ||
@@ -78,0 +77,0 @@ useEffect(() => setValue(initialValue === NO_VALUE ? NO_VALUE : format(initialValue)), [initialValue, decimals]); |
@@ -81,8 +81,9 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
setValue(evt.target.value); | ||
onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(parse(evt.target.value)); | ||
onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(parse(format(evt.target.value))); | ||
} | ||
function handleInputBlur() { | ||
setValue((value) => { | ||
onValueBlur === null || onValueBlur === void 0 ? void 0 : onValueBlur(parse(value)); | ||
return value; | ||
const _value = value === NO_VALUE ? value : format(value); | ||
onValueBlur === null || onValueBlur === void 0 ? void 0 : onValueBlur(parse(_value)); | ||
return _value; | ||
}); | ||
@@ -103,9 +104,7 @@ } | ||
function parse(value) { | ||
const _value = value === NO_VALUE ? value : format(value); | ||
if (hasCustomFormatter) { | ||
return (0, utils_1.toNumber)(_value, { | ||
return hasCustomFormatter | ||
? (0, utils_1.toNumber)(value.toString(), { | ||
decimal: decimalMark, | ||
}); | ||
} | ||
return (0, utils_1.parseNumber)(_value); | ||
}) | ||
: (0, utils_1.parseNumber)(value); | ||
} | ||
@@ -112,0 +111,0 @@ (0, react_1.useEffect)(() => setValue(initialValue === NO_VALUE ? NO_VALUE : format(initialValue)), [initialValue, decimals]); |
{ | ||
"name": "@flywire/react-headlessui", | ||
"version": "0.0.14-1", | ||
"version": "0.0.14-2", | ||
"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
321989
5215