feat: remove re-export of chrono

This commit is contained in:
luoxiao 2024-02-07 22:38:02 +08:00 committed by luoxiaozero
parent 60eb4dbb56
commit 6697225ded
13 changed files with 22 additions and 26 deletions

View file

@ -10,11 +10,12 @@ edition = "2021"
leptos = { version = "0.6.5" }
leptos_meta = { version = "0.6.5" }
leptos_router = { version = "0.6.5" }
leptos_devtools = { version = "0.0.1", optional = true}
leptos_devtools = { version = "0.0.1", optional = true }
thaw = { path = "../thaw" }
demo_markdown = { path = "../demo_markdown" }
icondata = "0.3.0"
palette = "0.7.4"
chrono = "0.4.33"
[features]
default = ["csr"]

View file

@ -1,7 +1,7 @@
# Calendar
```rust demo
use thaw::chrono::prelude::*;
use chrono::prelude::*;
let value = create_rw_signal(Some(Local::now().date_naive()));
view! {

View file

@ -1,7 +1,7 @@
# Date Picker
```rust demo
use thaw::chrono::prelude::*;
use chrono::prelude::*;
let value = create_rw_signal(Some(Local::now().date_naive()));
view! {

View file

@ -1,7 +1,7 @@
# Time Picker
```rust demo
use thaw::chrono::prelude::*;
use chrono::prelude::*;
let value = create_rw_signal(Some(Local::now().time()));

View file

@ -1,15 +1,16 @@
mod theme;
pub use theme::CalendarTheme;
use crate::{
chrono::{Datelike, Days, Local, NaiveDate},
use_theme,
utils::{class_list::class_list, mount_style, Model, OptionalProp},
Button, ButtonGroup, ButtonVariant, Theme,
};
use chrono::{Datelike, Days, Local, NaiveDate};
use chrono::{Month, Months};
use leptos::*;
use std::ops::Deref;
pub use theme::CalendarTheme;
#[component]
pub fn Calendar(

View file

@ -1,15 +1,16 @@
mod panel;
mod theme;
pub use theme::DatePickerTheme;
use crate::{
chrono::NaiveDate,
components::{Binder, Follower, FollowerPlacement},
utils::{mount_style, now_date, ComponentRef, Model, OptionalProp},
Icon, Input, InputSuffix, SignalWatch,
};
use chrono::NaiveDate;
use leptos::*;
use panel::{Panel, PanelRef};
pub use theme::DatePickerTheme;
#[component]
pub fn DatePicker(

View file

@ -1,9 +1,6 @@
use super::PanelVariant;
use crate::{
chrono::{Datelike, Days, Month, Months, NaiveDate},
utils::now_date,
Button, ButtonSize, ButtonVariant, CalendarItemDate,
};
use crate::{utils::now_date, Button, ButtonSize, ButtonVariant, CalendarItemDate};
use chrono::{Datelike, Days, Month, Months, NaiveDate};
use leptos::*;
use std::ops::Deref;

View file

@ -3,11 +3,11 @@ mod month_panel;
mod year_panel;
use crate::{
chrono::NaiveDate,
use_theme,
utils::{now_date, ComponentRef},
Theme,
};
use chrono::NaiveDate;
use date_panel::DatePanel;
use leptos::*;
use month_panel::MonthPanel;

View file

@ -1,8 +1,6 @@
use super::PanelVariant;
use crate::{
chrono::{Datelike, Month, Months, NaiveDate},
Button, ButtonSize, ButtonVariant,
};
use crate::{Button, ButtonSize, ButtonVariant};
use chrono::{Datelike, Month, Months, NaiveDate};
use leptos::*;
#[component]

View file

@ -1,8 +1,6 @@
use super::PanelVariant;
use crate::{
chrono::{Datelike, NaiveDate},
Button, ButtonSize, ButtonVariant,
};
use crate::{Button, ButtonSize, ButtonVariant};
use chrono::{Datelike, NaiveDate};
use leptos::*;
const MAX_YEAR: i32 = (i32::MAX >> 13) / 10 - 1;

View file

@ -53,7 +53,6 @@ pub use button::*;
pub use calendar::*;
pub use card::*;
pub use checkbox::*;
pub use chrono;
pub use code::*;
pub use collapse::*;
pub use color_picker::*;

View file

@ -1,14 +1,15 @@
mod theme;
pub use theme::TimePickerTheme;
use crate::{
chrono::{Local, NaiveTime, Timelike},
components::{Binder, Follower, FollowerPlacement},
use_theme,
utils::{mount_style, ComponentRef, Model, OptionalProp},
Button, ButtonSize, ButtonVariant, Icon, Input, InputSuffix, SignalWatch, Theme,
};
use chrono::{Local, NaiveTime, Timelike};
use leptos::*;
pub use theme::TimePickerTheme;
#[component]
pub fn TimePicker(

View file

@ -1,4 +1,4 @@
use crate::chrono::{Local, NaiveDate};
use chrono::{Local, NaiveDate};
pub fn now_date() -> NaiveDate {
Local::now().date_naive()