1 | import PropTypes from 'prop-types';
|
2 | import React, { FocusEvent, SyntheticEvent } from 'react';
|
3 | import { Localizer } from './Localization';
|
4 | export interface NumberPickerInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'value'> {
|
5 | value: number | null | undefined;
|
6 | editing?: boolean;
|
7 | placeholder?: string;
|
8 | innerRef?: React.Ref<HTMLInputElement>;
|
9 | localizer: Localizer;
|
10 | parse?: (str: string, localizer: Localizer) => number;
|
11 | min?: number;
|
12 | max?: number;
|
13 | disabled?: boolean;
|
14 | readOnly?: boolean;
|
15 | onChange: (number: number | null | undefined, event: SyntheticEvent<HTMLInputElement>) => void;
|
16 | }
|
17 | interface NumberPickerInputState {
|
18 | stringValue?: string;
|
19 | lastValueFromProps?: string;
|
20 | }
|
21 | interface NumberPickerInputSnapshot {
|
22 | reselectText?: boolean;
|
23 | }
|
24 | declare class NumberPickerInput extends React.Component<NumberPickerInputProps, NumberPickerInputState, NumberPickerInputSnapshot> {
|
25 | static defaultProps: {
|
26 | value: null;
|
27 | editing: boolean;
|
28 | };
|
29 | static propTypes: {
|
30 | value: PropTypes.Requireable<number>;
|
31 | editing: PropTypes.Requireable<boolean>;
|
32 | placeholder: PropTypes.Requireable<string>;
|
33 | localizer: PropTypes.Validator<object>;
|
34 | parse: PropTypes.Requireable<(...args: any[]) => any>;
|
35 | min: PropTypes.Requireable<number>;
|
36 | max: PropTypes.Requireable<number>;
|
37 | disabled: PropTypes.Validator<boolean> & {
|
38 | acceptsArray: PropTypes.Validator<any>;
|
39 | };
|
40 | readOnly: PropTypes.Validator<boolean> & {
|
41 | acceptsArray: PropTypes.Validator<any>;
|
42 | };
|
43 | onChange: PropTypes.Validator<(...args: any[]) => any>;
|
44 | };
|
45 | state: NumberPickerInputState;
|
46 | getSnapshotBeforeUpdate({ editing, }: NumberPickerInputProps): NumberPickerInputSnapshot;
|
47 | static getDerivedStateFromProps(nextProps: NumberPickerInputProps, prevState: NumberPickerInputState): {
|
48 | stringValue: string;
|
49 | lastValueFromProps: string;
|
50 | } | null;
|
51 | componentDidUpdate(_: NumberPickerInputProps, __: NumberPickerInputState, { reselectText }: NumberPickerInputSnapshot): void;
|
52 | setStringValue(stringValue: string): void;
|
53 | handleBlur: (event: FocusEvent<HTMLInputElement>) => void;
|
54 | handleChange: (event: React.FormEvent<HTMLInputElement>) => void;
|
55 | isIntermediateValue(num: number | undefined | null, str: string): boolean;
|
56 | isSelectingAllText(): boolean;
|
57 | parseNumber(strVal: string): number | undefined | null;
|
58 | render(): JSX.Element;
|
59 | }
|
60 | export default NumberPickerInput;
|
61 |
|
\ | No newline at end of file |