react-tailwindcss-datepicker
Advanced tools
Comparing version 1.5.1 to 1.6.0
import React from "react"; | ||
import { DateValueType, DateType, DateRangeType, ClassNamesTypeProp, ClassNameParam } from "../types"; | ||
interface Props { | ||
primaryColor?: string; | ||
value: DateValueType; | ||
onChange: (value: DateValueType, e?: HTMLInputElement | null | undefined) => void; | ||
useRange?: boolean; | ||
showFooter?: boolean; | ||
showShortcuts?: boolean; | ||
configs?: { | ||
shortcuts?: { | ||
today?: string; | ||
yesterday?: string; | ||
past?: (period: number) => string; | ||
currentMonth?: string; | ||
pastMonth?: string; | ||
} | null; | ||
footer?: { | ||
cancel?: string; | ||
apply?: string; | ||
} | null; | ||
} | null; | ||
asSingle?: boolean; | ||
placeholder?: string; | ||
separator?: string; | ||
startFrom?: Date | null; | ||
i18n?: string; | ||
disabled?: boolean; | ||
classNames?: ClassNamesTypeProp | undefined; | ||
inputClassName?: ((args?: ClassNameParam) => string) | string | null; | ||
toggleClassName?: string | null; | ||
toggleIcon?: ((open: ClassNameParam) => React.ReactNode) | undefined; | ||
inputId?: string; | ||
inputName?: string; | ||
containerClassName?: ((args?: ClassNameParam) => string) | string | null; | ||
displayFormat?: string; | ||
readOnly?: boolean; | ||
minDate?: DateType | null; | ||
maxDate?: DateType | null; | ||
disabledDates?: DateRangeType[] | null; | ||
startWeekOn?: string | null; | ||
} | ||
declare const Datepicker: React.FC<Props>; | ||
import { DatepickerType } from "../types"; | ||
declare const Datepicker: React.FC<DatepickerType>; | ||
export default Datepicker; |
import dayjs from "dayjs"; | ||
import React from "react"; | ||
import { Configs, Period, DateValueType, DateType, DateRangeType, ClassNamesTypeProp, ClassNameParam } from "../types"; | ||
import { Configs, Period, DateValueType, DateType, DateRangeType, ClassNamesTypeProp, PopoverDirectionType } from "../types"; | ||
interface DatepickerStore { | ||
@@ -8,3 +8,3 @@ input?: React.RefObject<HTMLInputElement>; | ||
primaryColor: string; | ||
configs?: Configs | null; | ||
configs?: Configs; | ||
calendarContainer: React.RefObject<HTMLDivElement> | null; | ||
@@ -27,5 +27,5 @@ arrowContainer: React.RefObject<HTMLDivElement> | null; | ||
disabled?: boolean; | ||
inputClassName?: ((args?: ClassNameParam) => string) | string | null; | ||
containerClassName?: ((args?: ClassNameParam) => string) | string | null; | ||
toggleClassName?: ((args?: ClassNameParam) => string) | string | null; | ||
inputClassName?: ((className: string) => string) | string | null; | ||
containerClassName?: ((className: string) => string) | string | null; | ||
toggleClassName?: ((className: string) => string) | string | null; | ||
toggleIcon?: (open: boolean) => React.ReactNode; | ||
@@ -40,5 +40,6 @@ readOnly?: boolean; | ||
inputName?: string; | ||
classNames?: ClassNamesTypeProp | undefined; | ||
classNames?: ClassNamesTypeProp; | ||
popoverDirection?: PopoverDirectionType; | ||
} | ||
declare const DatepickerContext: React.Context<DatepickerStore>; | ||
export default DatepickerContext; |
@@ -0,1 +1,2 @@ | ||
import React from "react"; | ||
export interface Period { | ||
@@ -12,7 +13,9 @@ start: string | null; | ||
pastMonth?: string; | ||
} | null; | ||
} & { | ||
[key: string]: ShortcutsItem; | ||
}; | ||
footer?: { | ||
cancel?: string; | ||
apply?: string; | ||
} | null; | ||
}; | ||
} | ||
@@ -39,2 +42,34 @@ export interface ShortcutsItem { | ||
}; | ||
export type ClassNameParam = ClassNameParam[] | string | number | boolean | undefined; | ||
export declare enum PopoverDirectionType { | ||
up = "up", | ||
down = "down" | ||
} | ||
export interface DatepickerType { | ||
primaryColor?: string; | ||
value: DateValueType; | ||
onChange: (value: DateValueType, e?: HTMLInputElement | null | undefined) => void; | ||
useRange?: boolean; | ||
showFooter?: boolean; | ||
showShortcuts?: boolean; | ||
configs?: Configs; | ||
asSingle?: boolean; | ||
placeholder?: string; | ||
separator?: string; | ||
startFrom?: Date | null; | ||
i18n?: string; | ||
disabled?: boolean; | ||
classNames?: ClassNamesTypeProp | undefined; | ||
containerClassName?: ((className: string) => string) | string | null; | ||
inputClassName?: ((className: string) => string) | string | null; | ||
toggleClassName?: ((className: string) => string) | string | null; | ||
toggleIcon?: (open: boolean) => React.ReactNode; | ||
inputId?: string; | ||
inputName?: string; | ||
displayFormat?: string; | ||
readOnly?: boolean; | ||
minDate?: DateType | null; | ||
maxDate?: DateType | null; | ||
disabledDates?: DateRangeType[] | null; | ||
startWeekOn?: string | null; | ||
popoverDirection?: PopoverDirectionType; | ||
} |
{ | ||
"name": "react-tailwindcss-datepicker", | ||
"version": "1.5.1", | ||
"version": "1.6.0", | ||
"description": "A modern React Datepicker using Tailwind CSS 3", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.cjs.js", |
@@ -37,3 +37,3 @@ # React Tailwindcss Datepicker | ||
- ✅ Minimum Date and Maximum Date | ||
- ⬜ Custom shortcuts | ||
- ✅ Custom shortcuts | ||
@@ -40,0 +40,0 @@ ## Documentation |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
1721957
9092
3
45372