From 1720cf32a829341eae19261815e538827ba8291c Mon Sep 17 00:00:00 2001 From: Redrigz Date: Sat, 25 Jan 2020 16:47:55 +0100 Subject: [PATCH 1/4] Update TimePicker.jsx --- src/TimePicker.jsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/TimePicker.jsx b/src/TimePicker.jsx index 3cb29ed9..e0b50b56 100644 --- a/src/TimePicker.jsx +++ b/src/TimePicker.jsx @@ -37,6 +37,7 @@ class Picker extends Component { onAmPmChange: noop, onOpen: noop, onClose: noop, + onUserInputChange:noop, onFocus: noop, onBlur: noop, addon: noop, @@ -153,6 +154,7 @@ class Picker extends Component { minuteStep, secondStep, clearIcon, + onUserInputChange, } = this.props; const { value } = this.state; return ( @@ -183,6 +185,7 @@ class Picker extends Component { focusOnOpen={focusOnOpen} onKeyDown={onKeyDown} clearIcon={clearIcon} + onUserInputChange={onUserInputChange} /> ); } From f94d4cebd6d30bafdd4485e590709170acdbf612 Mon Sep 17 00:00:00 2001 From: Redrigz Date: Sat, 25 Jan 2020 16:49:11 +0100 Subject: [PATCH 2/4] Update Panel.jsx --- src/Panel.jsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Panel.jsx b/src/Panel.jsx index 2444b382..4e6ca478 100644 --- a/src/Panel.jsx +++ b/src/Panel.jsx @@ -42,6 +42,7 @@ class Panel extends Component { onKeyDown: noop, onAmPmChange: noop, inputReadOnly: false, + onUserInputChange:noop, }; state = {}; @@ -121,6 +122,7 @@ class Panel extends Component { secondStep, inputReadOnly, clearIcon, + onUserInputChange, } = this.props; const { value, currentSelectPanel } = this.state; const disabledHourOptions = this.disabledHours(); @@ -172,6 +174,7 @@ class Panel extends Component { onKeyDown={onKeyDown} inputReadOnly={inputReadOnly} clearIcon={clearIcon} + onUserInputChange={onUserInputChange} /> Date: Sat, 25 Jan 2020 16:54:01 +0100 Subject: [PATCH 3/4] Update Header.jsx --- src/Header.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Header.jsx b/src/Header.jsx index 4932382b..2b1ba70f 100644 --- a/src/Header.jsx +++ b/src/Header.jsx @@ -61,6 +61,7 @@ class Header extends Component { disabledMinutes, disabledSeconds, onChange, + onUserInputChange, } = this.props; if (str) { @@ -70,7 +71,8 @@ class Header extends Component { if (!parsed.isValid()) { this.setState({ invalid: true, - }); + }); + onUserInputChange(str) return; } value From e47de66b8100cc8578da235bbbb9c1e739189e2f Mon Sep 17 00:00:00 2001 From: Redrigz Date: Sat, 25 Jan 2020 17:18:37 +0100 Subject: [PATCH 4/4] Delete index.d.ts --- index.d.ts | 56 ------------------------------------------------------ 1 file changed, 56 deletions(-) delete mode 100644 index.d.ts diff --git a/index.d.ts b/index.d.ts deleted file mode 100644 index 61732dd1..00000000 --- a/index.d.ts +++ /dev/null @@ -1,56 +0,0 @@ -declare module "rc-time-picker" { - import { Moment } from "moment"; - import * as React from "react"; - - type TimePickerProps = { - prefixCls?: string; - clearText?: string; - disabled?: boolean; - allowEmpty?: boolean; - open?: boolean; - defaultValue?: Moment; - defaultOpenValue?: Moment; - value?: Moment; - placeholder?: string; - className?: string; - inputClassName?: string; - id?: string; - popupClassName?: string; - popupStyle?: any; - showHour?: boolean; - showMinute?: boolean; - showSecond?: boolean; - format?: string; - disabledHours?: () => number[]; - disabledMinutes?: (hour: number) => number[]; - disabledSeconds?: (hour: number, minute: number) => number[]; - use12Hours?: boolean; - hideDisabledOptions?: boolean; - onChange?: (newValue: Moment | null) => void; - onAmPmChange?: (ampm: 'PM' | 'AM') => void; - addon?: (instance: typeof Panel) => React.ReactNode; - placement?: string; - transitionName?: string; - name?: string; - autoComplete?: string; - onFocus: (event: React.FocusEvent) => void; - onBlur: (event: React.FocusEvent) => void; - autoFocus?: boolean; - onOpen?: (newState: { open: true }) => void; - onClose?: (newState: { open: false }) => void; - hourStep?: number; - minuteStep?: number; - secondStep?: number; - focusOnOpen?: boolean; - inputReadOnly?: boolean; - inputIcon?: React.ReactNode; - clearIcon?: React.ReactNode; - }; - export default class TimePicker extends React.Component { - focus(): void; - blur(): void; - } - class Panel extends React.Component { - close(): void; - } -}