11use dioxus:: prelude:: * ;
22use dioxus_primitives:: calendar:: {
3- self , CalendarGridProps , CalendarHeaderProps , CalendarMonthTitleProps , CalendarNavigationProps ,
4- CalendarProps , CalendarSelectMonthProps , CalendarSelectYearProps ,
3+ self , CalendarDayProps , CalendarGridProps , CalendarHeaderProps , CalendarMonthTitleProps ,
4+ CalendarNavigationProps , CalendarProps , CalendarSelectMonthProps , CalendarSelectYearProps ,
5+ RangeCalendarProps ,
56} ;
67
78#[ component]
@@ -28,6 +29,30 @@ pub fn Calendar(props: CalendarProps) -> Element {
2829 }
2930}
3031
32+ #[ component]
33+ pub fn RangeCalendar ( props : RangeCalendarProps ) -> Element {
34+ rsx ! {
35+ document:: Link { rel: "stylesheet" , href: asset!( "./style.css" ) }
36+ div { class: "calendar" ,
37+ calendar:: RangeCalendar {
38+ selected_range: props. selected_range,
39+ on_range_change: props. on_range_change,
40+ on_format_weekday: props. on_format_weekday,
41+ on_format_month: props. on_format_month,
42+ view_date: props. view_date,
43+ today: props. today,
44+ on_view_change: props. on_view_change,
45+ disabled: props. disabled,
46+ first_day_of_week: props. first_day_of_week,
47+ min_date: props. min_date,
48+ max_date: props. max_date,
49+ attributes: props. attributes,
50+ { props. children}
51+ }
52+ }
53+ }
54+ }
55+
3156#[ component]
3257pub fn CalendarHeader ( props : CalendarHeaderProps ) -> Element {
3358 rsx ! {
@@ -104,3 +129,8 @@ pub fn CalendarGrid(props: CalendarGridProps) -> Element {
104129pub fn CalendarMonthTitle ( props : CalendarMonthTitleProps ) -> Element {
105130 calendar:: CalendarMonthTitle ( props)
106131}
132+
133+ #[ component]
134+ pub fn RangeCalendarDay ( props : CalendarDayProps ) -> Element {
135+ calendar:: RangeCalendarDay ( props)
136+ }
0 commit comments