-
-
Notifications
You must be signed in to change notification settings - Fork 46.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: fix RangePicker value and onChange definition (#20015)
- Loading branch information
Showing
3 changed files
with
15 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,17 +23,17 @@ export interface PickerProps { | |
getCalendarContainer?: (triggerNode: Element) => HTMLElement; | ||
open?: boolean; | ||
onOpenChange?: (status: boolean) => void; | ||
disabledDate?: (current: moment.Moment | undefined) => boolean; | ||
disabledDate?: (current: moment.Moment | null) => boolean; | ||
dateRender?: (current: moment.Moment, today: moment.Moment) => React.ReactNode; | ||
autoFocus?: boolean; | ||
onFocus?: React.FocusEventHandler; | ||
onBlur?: (e: React.SyntheticEvent) => void; | ||
} | ||
|
||
export interface SinglePickerProps { | ||
value?: moment.Moment; | ||
defaultValue?: moment.Moment; | ||
defaultPickerValue?: moment.Moment; | ||
value?: moment.Moment | null; | ||
defaultValue?: moment.Moment | null; | ||
defaultPickerValue?: moment.Moment | null; | ||
placeholder?: string; | ||
renderExtraFooter?: (mode: DatePickerMode) => React.ReactNode; | ||
onChange?: (date: moment.Moment | null, dateString: string) => void; | ||
|
@@ -46,16 +46,16 @@ export interface DatePickerProps extends PickerProps, SinglePickerProps { | |
showTime?: TimePickerProps | boolean; | ||
showToday?: boolean; | ||
open?: boolean; | ||
disabledTime?: ( | ||
current: moment.Moment | undefined, | ||
disabledTime: ( | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
afc163
Member
|
||
current?: moment.Moment | null, | ||
) => { | ||
disabledHours?: () => number[]; | ||
disabledMinutes?: () => number[]; | ||
disabledSeconds?: () => number[]; | ||
}; | ||
onOpenChange?: (status: boolean) => void; | ||
onPanelChange?: (value: moment.Moment | undefined, mode: DatePickerMode) => void; | ||
onOk?: (selectedTime: moment.Moment) => void; | ||
onPanelChange?: (value: moment.Moment | null, mode: DatePickerMode) => void; | ||
onOk?: (selectedTime: moment.Moment | null) => void; | ||
mode?: DatePickerMode; | ||
} | ||
|
||
|
@@ -65,9 +65,12 @@ export interface MonthPickerProps extends PickerProps, SinglePickerProps { | |
|
||
export type RangePickerValue = | ||
| undefined[] | ||
| null[] | ||
| [moment.Moment] | ||
| [undefined, moment.Moment] | ||
| [moment.Moment, undefined] | ||
| [null, moment.Moment] | ||
| [moment.Moment, null] | ||
| [moment.Moment, moment.Moment]; | ||
export type RangePickerPresetRange = RangePickerValue | (() => RangePickerValue); | ||
|
||
|
@@ -90,7 +93,7 @@ export interface RangePickerProps extends PickerProps { | |
mode?: string | string[]; | ||
separator?: React.ReactNode; | ||
disabledTime?: ( | ||
current: moment.Moment | undefined, | ||
current: RangePickerValue, | ||
type: string, | ||
) => { | ||
disabledHours?: () => number[]; | ||
|
@chj-damon disabledTime should be optional ?
disabledTime: -> disabledTime?: