Skip to content

Commit

Permalink
[@mantine/dates] Remove obsolette props from Calendar and DatePicker …
Browse files Browse the repository at this point in the history
…components (#2648, #2714)
  • Loading branch information
rtivital committed Oct 18, 2022
1 parent 5ffaf87 commit 4964c00
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 4 deletions.
5 changes: 4 additions & 1 deletion src/mantine-dates/src/components/Calendar/Calendar.tsx
Expand Up @@ -4,7 +4,10 @@ import { CalendarBase, CalendarBaseProps } from '../CalendarBase/CalendarBase';
import { isSameDate } from '../../utils';

export interface CalendarProps<Multiple extends boolean = false>
extends Omit<CalendarBaseProps, 'value' | 'onChange'> {
extends Omit<
CalendarBaseProps,
'value' | 'onChange' | 'isDateInRange' | 'isDateFirstInRange' | 'isDateLastInRange'
> {
multiple?: Multiple;
value?: Multiple extends true ? Date[] : Date | null;
onChange?(value: Multiple extends true ? Date[] : Date | null): void;
Expand Down
13 changes: 12 additions & 1 deletion src/mantine-dates/src/components/DatePicker/DatePicker.tsx
Expand Up @@ -9,7 +9,18 @@ import { DatePickerBase, DatePickerBaseSharedProps } from '../DatePickerBase/Dat

export interface DatePickerProps
extends Omit<DatePickerBaseSharedProps, 'onChange'>,
Omit<CalendarSharedProps, 'size' | 'classNames' | 'styles' | 'onMonthChange' | 'onChange'> {
Omit<
CalendarSharedProps,
| 'size'
| 'classNames'
| 'styles'
| 'onMonthChange'
| 'onChange'
| 'isDateInRange'
| 'isDateFirstInRange'
| 'isDateLastInRange'
| 'month'
> {
/** Selected date, required with controlled input */
value?: Date | null;

Expand Down
Expand Up @@ -13,7 +13,18 @@ export interface DateRangePickerProps
extends Omit<DatePickerBaseSharedProps, 'value' | 'onChange' | 'fixOnBlur'>,
Omit<
CalendarSharedProps,
'size' | 'styles' | 'classNames' | 'value' | 'onChange' | 'onMonthChange'
| 'size'
| 'styles'
| 'classNames'
| 'value'
| 'onChange'
| 'onMonthChange'
| 'onMonthChange'
| 'onChange'
| 'isDateInRange'
| 'isDateFirstInRange'
| 'isDateLastInRange'
| 'month'
> {
/** Selected date, required with controlled input */
value?: DateRangePickerValue;
Expand Down
Expand Up @@ -5,7 +5,11 @@ import { isSameDate } from '../../utils';
import { DayModifiers } from '../Month';
import { CalendarBase, CalendarBaseProps } from '../CalendarBase/CalendarBase';

export interface RangeCalendarProps extends Omit<CalendarBaseProps, 'value' | 'onChange'> {
export interface RangeCalendarProps
extends Omit<
CalendarBaseProps,
'value' | 'onChange' | 'isDateInRange' | 'isDateFirstInRange' | 'isDateLastInRange'
> {
/** Selected dates */
value: [Date | null, Date | null];

Expand Down

0 comments on commit 4964c00

Please sign in to comment.