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 = { version = "0.6.5" }
leptos_meta = { version = "0.6.5" } leptos_meta = { version = "0.6.5" }
leptos_router = { 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" } thaw = { path = "../thaw" }
demo_markdown = { path = "../demo_markdown" } demo_markdown = { path = "../demo_markdown" }
icondata = "0.3.0" icondata = "0.3.0"
palette = "0.7.4" palette = "0.7.4"
chrono = "0.4.33"
[features] [features]
default = ["csr"] default = ["csr"]

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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