(props: DatePickerProps)
| 133 | /// - `data-disabled`: Indicates if the DatePicker is disabled. Possible values are `true` or `false`. |
| 134 | #[component] |
| 135 | pub fn DatePicker(props: DatePickerProps) -> Element { |
| 136 | let open = use_signal(|| false); |
| 137 | let focus = use_collection_provider(props.roving_loop); |
| 138 | let available_ranges = use_memo(move || AvailableRanges::new(&props.disabled_ranges.read())); |
| 139 | |
| 140 | // Create context provider for child components |
| 141 | use_context_provider(|| BaseDatePickerContext { |
| 142 | open, |
| 143 | read_only: props.read_only, |
| 144 | disabled: props.disabled, |
| 145 | focus, |
| 146 | enabled_date_range: DateRange::new(props.min_date, props.max_date), |
| 147 | available_ranges, |
| 148 | }); |
| 149 | |
| 150 | use_context_provider(|| DatePickerContext { |
| 151 | on_value_change: props.on_value_change, |
| 152 | selected_date: props.selected_date, |
| 153 | }); |
| 154 | |
| 155 | rsx! { |
| 156 | div { |
| 157 | role: "group", |
| 158 | aria_label: "Date", |
| 159 | "data-disabled": (props.disabled)(), |
| 160 | ..props.attributes, |
| 161 | {props.children} |
| 162 | } |
| 163 | } |
| 164 | } |
| 165 | |
| 166 | /// The context provided by the [`DateRangePicker`] component to its children. |
| 167 | #[derive(Copy, Clone)] |
nothing calls this directly
no test coverage detected