Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
931 changes: 695 additions & 236 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ We're still in the early days - Many components are still being created and stab
- [x] Checkbox
- [x] Collapsible
- [x] Context Menu
- [ ] Date Picker
- [x] Date Picker
- [x] Dialog
- [x] Dropdown Menu
- [x] Hover Card
Expand Down
36 changes: 34 additions & 2 deletions preview/src/components/calendar/component.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use dioxus::prelude::*;
use dioxus_primitives::calendar::{
self, CalendarGridProps, CalendarHeaderProps, CalendarMonthTitleProps, CalendarNavigationProps,
CalendarProps, CalendarSelectMonthProps, CalendarSelectYearProps,
self, CalendarDayProps, CalendarGridProps, CalendarHeaderProps, CalendarMonthTitleProps,
CalendarNavigationProps, CalendarProps, CalendarSelectMonthProps, CalendarSelectYearProps,
RangeCalendarProps,
};

#[component]
Expand All @@ -21,6 +22,32 @@ pub fn Calendar(props: CalendarProps) -> Element {
first_day_of_week: props.first_day_of_week,
min_date: props.min_date,
max_date: props.max_date,
disabled_ranges: props.disabled_ranges,
attributes: props.attributes,
{props.children}
}
}
}
}

#[component]
pub fn RangeCalendar(props: RangeCalendarProps) -> Element {
rsx! {
document::Link { rel: "stylesheet", href: asset!("./style.css") }
div { class: "calendar",
calendar::RangeCalendar {
selected_range: props.selected_range,
on_range_change: props.on_range_change,
on_format_weekday: props.on_format_weekday,
on_format_month: props.on_format_month,
view_date: props.view_date,
today: props.today,
on_view_change: props.on_view_change,
disabled: props.disabled,
first_day_of_week: props.first_day_of_week,
min_date: props.min_date,
max_date: props.max_date,
disabled_ranges: props.disabled_ranges,
attributes: props.attributes,
{props.children}
}
Expand Down Expand Up @@ -104,3 +131,8 @@ pub fn CalendarGrid(props: CalendarGridProps) -> Element {
pub fn CalendarMonthTitle(props: CalendarMonthTitleProps) -> Element {
calendar::CalendarMonthTitle(props)
}

#[component]
pub fn CalendarDay(props: CalendarDayProps) -> Element {
calendar::CalendarDay(props)
}
Loading
Loading