react-date-picker
Advanced tools
Comparing version 10.0.0 to 10.0.1
/// <reference types="react" /> | ||
import PropTypes from 'prop-types'; | ||
import { isMaxDate, isMinDate } from './shared/propTypes'; | ||
import type { Detail } from './shared/types'; | ||
import type { Detail, LooseValuePiece, Value } from './shared/types'; | ||
type DateInputProps = { | ||
@@ -21,7 +21,7 @@ autoFocus?: boolean; | ||
nativeInputAriaLabel?: string; | ||
onChange?: (value: Date | null | (Date | null)[], shouldCloseCalendar: boolean) => void; | ||
onChange?: (value: Value, shouldCloseCalendar: boolean) => void; | ||
required?: boolean; | ||
returnValue?: 'start' | 'end' | 'range'; | ||
showLeadingZeros?: boolean; | ||
value?: string | Date | null; | ||
value?: LooseValuePiece; | ||
yearAriaLabel?: string; | ||
@@ -28,0 +28,0 @@ yearPlaceholder?: string; |
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import Calendar from 'react-calendar'; | ||
import { isMaxDate, isMinDate } from './shared/propTypes'; | ||
import type { ClassName, Detail, LooseValue } from './shared/types'; | ||
import type { ClassName, Detail, LooseValue, Value } from './shared/types'; | ||
type Icon = React.ReactElement | string; | ||
@@ -34,6 +35,6 @@ type IconOrRenderFunction = Icon | React.ComponentType | React.ReactElement; | ||
onCalendarOpen?: () => void; | ||
onChange?: (value: Date | null | (Date | null)[]) => void; | ||
onChange?: (value: Value) => void; | ||
onFocus?: (event: React.FocusEvent<HTMLDivElement>) => void; | ||
openCalendarOnFocus?: boolean; | ||
portalContainer?: HTMLElement; | ||
portalContainer?: HTMLElement | null; | ||
required?: boolean; | ||
@@ -45,3 +46,3 @@ returnValue?: 'start' | 'end' | 'range'; | ||
yearPlaceholder?: string; | ||
}; | ||
} & Omit<React.ComponentPropsWithoutRef<typeof Calendar>, 'className' | 'maxDetail' | 'minDetail' | 'onChange'>; | ||
declare function DatePicker(props: DatePickerProps): JSX.Element; | ||
@@ -48,0 +49,0 @@ declare namespace DatePicker { |
export type ClassName = string | null | undefined | (string | null | undefined)[]; | ||
export type Detail = 'century' | 'decade' | 'year' | 'month'; | ||
export type LooseValue = string | Date | null | (string | Date | null)[]; | ||
export type LooseValuePiece = string | Date | null; | ||
export type LooseValue = LooseValuePiece | [LooseValuePiece, LooseValuePiece]; | ||
export type RangeType = 'century' | 'decade' | 'year' | 'month' | 'day'; | ||
type ValuePiece = Date | null; | ||
export type Value = ValuePiece | [ValuePiece, ValuePiece]; | ||
export {}; |
/// <reference types="react" /> | ||
import PropTypes from 'prop-types'; | ||
import { isMaxDate, isMinDate } from './shared/propTypes'; | ||
import type { Detail } from './shared/types'; | ||
import type { Detail, LooseValuePiece, Value } from './shared/types'; | ||
type DateInputProps = { | ||
@@ -21,7 +21,7 @@ autoFocus?: boolean; | ||
nativeInputAriaLabel?: string; | ||
onChange?: (value: Date | null | (Date | null)[], shouldCloseCalendar: boolean) => void; | ||
onChange?: (value: Value, shouldCloseCalendar: boolean) => void; | ||
required?: boolean; | ||
returnValue?: 'start' | 'end' | 'range'; | ||
showLeadingZeros?: boolean; | ||
value?: string | Date | null; | ||
value?: LooseValuePiece; | ||
yearAriaLabel?: string; | ||
@@ -28,0 +28,0 @@ yearPlaceholder?: string; |
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import Calendar from 'react-calendar'; | ||
import { isMaxDate, isMinDate } from './shared/propTypes'; | ||
import type { ClassName, Detail, LooseValue } from './shared/types'; | ||
import type { ClassName, Detail, LooseValue, Value } from './shared/types'; | ||
type Icon = React.ReactElement | string; | ||
@@ -34,6 +35,6 @@ type IconOrRenderFunction = Icon | React.ComponentType | React.ReactElement; | ||
onCalendarOpen?: () => void; | ||
onChange?: (value: Date | null | (Date | null)[]) => void; | ||
onChange?: (value: Value) => void; | ||
onFocus?: (event: React.FocusEvent<HTMLDivElement>) => void; | ||
openCalendarOnFocus?: boolean; | ||
portalContainer?: HTMLElement; | ||
portalContainer?: HTMLElement | null; | ||
required?: boolean; | ||
@@ -45,3 +46,3 @@ returnValue?: 'start' | 'end' | 'range'; | ||
yearPlaceholder?: string; | ||
}; | ||
} & Omit<React.ComponentPropsWithoutRef<typeof Calendar>, 'className' | 'maxDetail' | 'minDetail' | 'onChange'>; | ||
declare function DatePicker(props: DatePickerProps): JSX.Element; | ||
@@ -48,0 +49,0 @@ declare namespace DatePicker { |
export type ClassName = string | null | undefined | (string | null | undefined)[]; | ||
export type Detail = 'century' | 'decade' | 'year' | 'month'; | ||
export type LooseValue = string | Date | null | (string | Date | null)[]; | ||
export type LooseValuePiece = string | Date | null; | ||
export type LooseValue = LooseValuePiece | [LooseValuePiece, LooseValuePiece]; | ||
export type RangeType = 'century' | 'decade' | 'year' | 'month' | 'day'; | ||
type ValuePiece = Date | null; | ||
export type Value = ValuePiece | [ValuePiece, ValuePiece]; | ||
export {}; |
{ | ||
"name": "react-date-picker", | ||
"version": "10.0.0", | ||
"version": "10.0.1", | ||
"description": "A date picker for your React app.", | ||
@@ -43,3 +43,3 @@ "main": "dist/cjs/index.js", | ||
"prop-types": "^15.6.0", | ||
"react-calendar": "^4.2.0", | ||
"react-calendar": "^4.2.1", | ||
"react-fit": "^1.5.1", | ||
@@ -46,0 +46,0 @@ "update-input-width": "^1.3.1" |
@@ -5,4 +5,10 @@ export type ClassName = string | null | undefined | (string | null | undefined)[]; | ||
export type LooseValue = string | Date | null | (string | Date | null)[]; | ||
export type LooseValuePiece = string | Date | null; | ||
export type LooseValue = LooseValuePiece | [LooseValuePiece, LooseValuePiece]; | ||
export type RangeType = 'century' | 'decade' | 'year' | 'month' | 'day'; | ||
type ValuePiece = Date | null; | ||
export type Value = ValuePiece | [ValuePiece, ValuePiece]; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
309677
6912
Updatedreact-calendar@^4.2.1