File tree Expand file tree Collapse file tree 3 files changed +11
-8
lines changed Expand file tree Collapse file tree 3 files changed +11
-8
lines changed Original file line number Diff line number Diff line change 7272 "dependencies" : {
7373 "@babel/runtime" : " ^7.18.6" ,
7474 "prop-types" : " ^15.0.0" ,
75- "redux-form-normalize-on-blur" : " ^1.1.1 "
75+ "redux-form-normalize-on-blur" : " ^1.1.2 "
7676 },
7777 "main" : " dist/index.js" ,
7878 "types" : " dist/index.d.ts" ,
Original file line number Diff line number Diff line change @@ -10,14 +10,15 @@ type AdditionalProps = {
1010 input : { onKeyDown ?: React . KeyboardEventHandler < any > }
1111}
1212
13- type InputProps = BaseFieldProps < AdditionalProps > & {
13+ // eslint-disable-next-line @typescript-eslint/ban-types
14+ type BaseNumericFieldProps < P = { } > = BaseFieldProps < P & AdditionalProps > & {
1415 normalizeOnBlur ?: any
1516 normalizeNumber ?: NumberNormalizer
1617}
1718
1819export default function createNumericField (
1920 Field : React . ComponentType < BaseFieldProps < AdditionalProps > >
20- ) : React . ComponentType < InputProps > {
21+ ) {
2122 function defaultNormalize (
2223 value ?: ( string | number ) | null
2324 ) : ( string | number ) | null | undefined {
@@ -27,7 +28,9 @@ export default function createNumericField(
2728 return Number . isFinite ( parsed ) ? parsed : value . trim ( )
2829 }
2930
30- return class NumericField extends React . Component < InputProps > {
31+ return class NumericField <
32+ P extends BaseNumericFieldProps = BaseNumericFieldProps
33+ > extends React . Component < P > {
3134 normalizeOnBlur = ( value : any ) : any => {
3235 const { normalizeOnBlur } = this . props
3336 const normalizeNumber = this . props . normalizeNumber || defaultNormalize
You can’t perform that action at this time.
0 commit comments