@@ -19,13 +19,15 @@ type Props = {
1919 field : keyof EmployeeCategory ,
2020 isInteger : boolean ,
2121 ) => ( e : React . ChangeEvent < HTMLInputElement > ) => void ;
22+ onDecimalBlur : ( index : number , field : keyof EmployeeCategory ) => ( ) => void ;
2223 disabled ?: boolean ;
2324} ;
2425
2526export function CategoryDataTable ( {
2627 category : cat ,
2728 categoryIndex : catIndex ,
2829 onPositiveNumberChange : pos ,
30+ onDecimalBlur : blur ,
2931 disabled = false ,
3032} : Props ) {
3133 const annualTotalWomen = computeTotal (
@@ -141,6 +143,7 @@ export function CategoryDataTable({
141143 disabled = { disabled }
142144 id = { id ( "annual-base-women" ) }
143145 inputMode = "decimal"
146+ onBlur = { blur ( catIndex , "annualBaseWomen" ) }
144147 onChange = { pos ( catIndex , "annualBaseWomen" , false ) }
145148 type = "text"
146149 value = { displayInputDecimal ( cat . annualBaseWomen ) }
@@ -156,6 +159,7 @@ export function CategoryDataTable({
156159 disabled = { disabled }
157160 id = { id ( "annual-base-men" ) }
158161 inputMode = "decimal"
162+ onBlur = { blur ( catIndex , "annualBaseMen" ) }
159163 onChange = { pos ( catIndex , "annualBaseMen" , false ) }
160164 type = "text"
161165 value = { displayInputDecimal ( cat . annualBaseMen ) }
@@ -183,6 +187,7 @@ export function CategoryDataTable({
183187 disabled = { disabled }
184188 id = { id ( "annual-variable-women" ) }
185189 inputMode = "decimal"
190+ onBlur = { blur ( catIndex , "annualVariableWomen" ) }
186191 onChange = { pos ( catIndex , "annualVariableWomen" , false ) }
187192 type = "text"
188193 value = { displayInputDecimal ( cat . annualVariableWomen ) }
@@ -198,6 +203,7 @@ export function CategoryDataTable({
198203 disabled = { disabled }
199204 id = { id ( "annual-variable-men" ) }
200205 inputMode = "decimal"
206+ onBlur = { blur ( catIndex , "annualVariableMen" ) }
201207 onChange = { pos ( catIndex , "annualVariableMen" , false ) }
202208 type = "text"
203209 value = { displayInputDecimal ( cat . annualVariableMen ) }
@@ -242,6 +248,7 @@ export function CategoryDataTable({
242248 disabled = { disabled }
243249 id = { id ( "hourly-base-women" ) }
244250 inputMode = "decimal"
251+ onBlur = { blur ( catIndex , "hourlyBaseWomen" ) }
245252 onChange = { pos ( catIndex , "hourlyBaseWomen" , false ) }
246253 type = "text"
247254 value = { displayInputDecimal ( cat . hourlyBaseWomen ) }
@@ -257,6 +264,7 @@ export function CategoryDataTable({
257264 disabled = { disabled }
258265 id = { id ( "hourly-base-men" ) }
259266 inputMode = "decimal"
267+ onBlur = { blur ( catIndex , "hourlyBaseMen" ) }
260268 onChange = { pos ( catIndex , "hourlyBaseMen" , false ) }
261269 type = "text"
262270 value = { displayInputDecimal ( cat . hourlyBaseMen ) }
@@ -284,6 +292,7 @@ export function CategoryDataTable({
284292 disabled = { disabled }
285293 id = { id ( "hourly-variable-women" ) }
286294 inputMode = "decimal"
295+ onBlur = { blur ( catIndex , "hourlyVariableWomen" ) }
287296 onChange = { pos ( catIndex , "hourlyVariableWomen" , false ) }
288297 type = "text"
289298 value = { displayInputDecimal ( cat . hourlyVariableWomen ) }
@@ -299,6 +308,7 @@ export function CategoryDataTable({
299308 disabled = { disabled }
300309 id = { id ( "hourly-variable-men" ) }
301310 inputMode = "decimal"
311+ onBlur = { blur ( catIndex , "hourlyVariableMen" ) }
302312 onChange = { pos ( catIndex , "hourlyVariableMen" , false ) }
303313 type = "text"
304314 value = { displayInputDecimal ( cat . hourlyVariableMen ) }
0 commit comments