Migration of jsx files to tsx 2 (#850)

This is to continue the work of migrating all the jsx files into tsx
files.
The MO is basically described here: #848.

About 7 files to go...
This commit is contained in:
Harel M
2023-12-22 23:32:25 +02:00
committed by GitHub
parent fa182e66fa
commit 974dd7bfd9
57 changed files with 827 additions and 827 deletions

View File

@@ -3,17 +3,17 @@ import InputString from './InputString'
import InputNumber from './InputNumber'
export type FieldArrayProps = {
value: string[] | number[]
value: (string | number | undefined)[]
type?: string
length?: number
default?: string[] | number[]
onChange?(...args: unknown[]): unknown
default?: (string | number | undefined)[]
onChange?(value: (string | number | undefined)[] | undefined): unknown
'aria-label'?: string
label?: string
};
type FieldArrayState = {
value: string[] | number[]
value: (string | number | undefined)[]
initialPropsValue: unknown[]
}
@@ -59,7 +59,7 @@ export default class FieldArray extends React.Component<FieldArrayProps, FieldAr
});
}
changeValue(idx: number, newValue: string) {
changeValue(idx: number, newValue: string | number | undefined) {
const value = this.state.value.slice(0);
value[idx] = newValue;
@@ -93,7 +93,7 @@ export default class FieldArray extends React.Component<FieldArrayProps, FieldAr
default={containsValues || !this.props.default ? undefined : this.props.default[i] as number}
value={value[i] as number}
required={containsValues ? true : false}
onChange={this.changeValue.bind(this, i)}
onChange={(v) => this.changeValue(i, v)}
aria-label={this.props['aria-label'] || this.props.label}
/>
} else {