nitro-web 0.3.22 → 0.3.24
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.
|
@@ -107,7 +107,9 @@ export function FieldCurrency({
|
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
function onChange(source: 'event' | 'prop', floatValue?: number) {
|
|
110
|
-
|
|
110
|
+
// Prop changes came from the page, so pushing them back would loop
|
|
111
|
+
if (source === 'prop') return
|
|
112
|
+
setDontFix(true)
|
|
111
113
|
if (onChangeProp) onChangeProp({ target: { name: props.name, value: to('cents', floatValue, settings) }})
|
|
112
114
|
else setInternalValue(to('cents', floatValue, settings))
|
|
113
115
|
}
|
|
@@ -127,9 +129,9 @@ export function FieldCurrency({
|
|
|
127
129
|
thousandSeparator={settings.thousandSeparator}
|
|
128
130
|
decimalScale={settings.maxDecimals}
|
|
129
131
|
onValueChange={({ floatValue }, e) => onChange(e.source, floatValue)}
|
|
130
|
-
onBlur={() => { setLastBlurred(Date.now())}}
|
|
132
|
+
onBlur={() => { setDontFix(false); setLastBlurred(Date.now()) }}
|
|
131
133
|
placeholder={props.placeholder || '0.00'}
|
|
132
|
-
value={inputValue}
|
|
134
|
+
value={inputValue ?? ''}
|
|
133
135
|
suffix={settings.suffix}
|
|
134
136
|
style={{ textIndent: `${prefixWidth}px` }}
|
|
135
137
|
type="text"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nitro-web",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.24",
|
|
4
4
|
"repository": "github:boycce/nitro-web",
|
|
5
5
|
"homepage": "https://boycce.github.io/nitro-web/",
|
|
6
6
|
"description": "Nitro is a battle-tested, modular base project to turbocharge your projects, styled using Tailwind 🚀",
|