feat: upgrade leptos

This commit is contained in:
luoxiao 2023-10-02 17:04:03 +08:00
parent a76079202e
commit 625feffe51
9 changed files with 17 additions and 14 deletions

View file

@ -13,10 +13,10 @@ license = "MIT"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
leptos = { version = "0.5.0-rc2", features = ["csr"] } leptos = { version = "0.5.0", features = ["csr"] }
stylers = "0.3.2" stylers = "0.3.2"
web-sys = { version = "0.3.62", features = ["DomRect"] } web-sys = { version = "0.3.62", features = ["DomRect"] }
leptos_dom = { version = "0.5.0-rc2" } leptos_dom = { version = "0.5.0" }
wasm-bindgen = "0.2.85" wasm-bindgen = "0.2.85"
icondata = { version = "0.0.7", features = [ icondata = { version = "0.0.7", features = [
"AiCloseOutlined", "AiCloseOutlined",

View file

@ -6,13 +6,13 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
leptos = { version = "0.5.0-rc2", features = ["csr"] } leptos = { version = "0.5.0", features = ["csr"] }
melt-ui = { path = "../" } melt-ui = { path = "../" }
icondata = { version = "0.0.7", features = [ icondata = { version = "0.0.7", features = [
"AiCloseOutlined", "AiCloseOutlined",
"AiCheckOutlined", "AiCheckOutlined",
] } ] }
leptos_router = { version = "0.5.0-rc2", features = ["csr"] } leptos_router = { version = "0.5.0", features = ["csr"] }
indoc = "2.0.1" indoc = "2.0.1"
regex = "1.8.2" regex = "1.8.2"
leptos_devtools = "0.0.1" leptos_devtools = "0.0.1"

View file

@ -86,10 +86,10 @@ pub fn Button(
class=("melt-button--round", move || round.get()) class=("melt-button--round", move || round.get())
style=move || format!("{}{}", css_vars.get(), style.get()) style=move || format!("{}{}", css_vars.get(), style.get())
> >
<OptionComp value=icon bind:icon> <OptionComp value=icon let:icon>
<Icon icon=icon style=icon_style/> <Icon icon=icon style=icon_style/>
</OptionComp> </OptionComp>
<OptionComp value=children bind:children> <OptionComp value=children let:children>
{ children() } { children() }
</OptionComp> </OptionComp>
</button> </button>

View file

@ -43,14 +43,14 @@ pub fn Card(
<Then slot> <Then slot>
<div class="melt-card__header"> <div class="melt-card__header">
<div class="melt-card__header-content"> <div class="melt-card__header-content">
<OptionComp value=header.clone() bind:header> <OptionComp value=header.clone() let:header>
<Fallback slot> <Fallback slot>
{ title.get() } { title.get() }
</Fallback> </Fallback>
{ (header.children)() } { (header.children)() }
</OptionComp> </OptionComp>
</div> </div>
<OptionComp value=header_extra.clone() bind:header_extra> <OptionComp value=header_extra.clone() let:header_extra>
<div class="melt-card__header-extra"> <div class="melt-card__header-extra">
{ (header_extra.children)() } { (header_extra.children)() }
</div> </div>
@ -61,7 +61,7 @@ pub fn Card(
<div class="melt-card__content"> <div class="melt-card__content">
{ children() } { children() }
</div> </div>
<OptionComp value=card_footer bind:footer> <OptionComp value=card_footer let:footer>
<If cond=footer.if_ > <If cond=footer.if_ >
<Then slot> <Then slot>
<div class="melt-card__footer"> <div class="melt-card__footer">

View file

@ -22,7 +22,10 @@ pub fn MenuItem(
css_vars.push_str(&format!("--font-color-active: {font_color};")); css_vars.push_str(&format!("--font-color-active: {font_color};"));
css_vars.push_str(&format!("--font-color: {};", theme.menu.color)); css_vars.push_str(&format!("--font-color: {};", theme.menu.color));
css_vars.push_str(&format!("--bg-color: {font_color}1a;")); css_vars.push_str(&format!("--bg-color: {font_color}1a;"));
css_vars.push_str(&format!("--bg-color-hover: {};", theme.menu.item_color_hover)); css_vars.push_str(&format!(
"--bg-color-hover: {};",
theme.menu.item_color_hover
));
css_vars css_vars
}); });
view! { class=class_name, view! { class=class_name,

View file

@ -29,7 +29,7 @@ pub fn TabbarItem(
view! { class=class_name, view! { class=class_name,
<div class="melt-tabbar-item" class=("melt-tabbar-item--selected", move || tabbar.get().value == name.get()) on:click=onclick_select style=move || css_vars.get()> <div class="melt-tabbar-item" class=("melt-tabbar-item--selected", move || tabbar.get().value == name.get()) on:click=onclick_select style=move || css_vars.get()>
<OptionComp value=icon bind:icon> <OptionComp value=icon let:icon>
<Icon icon=icon width="22px" height="22px" class="melt-tabbar-item__icon"/> <Icon icon=icon width="22px" height="22px" class="melt-tabbar-item__icon"/>
</OptionComp> </OptionComp>
<div class="melt-tabbar-item__content"> <div class="melt-tabbar-item__content">

View file

@ -39,7 +39,7 @@ pub fn Modal(
</CardHeaderExtra> </CardHeaderExtra>
{ children() } { children() }
<CardFooter slot if_=modal_footer.is_some()> <CardFooter slot if_=modal_footer.is_some()>
<OptionComp value=modal_footer.as_ref() bind:footer> <OptionComp value=modal_footer.as_ref() let:footer>
{ (footer.children)() } { (footer.children)() }
</OptionComp> </OptionComp>
</CardFooter> </CardFooter>

View file

@ -90,7 +90,7 @@ where
<For <For
each=move || options.get() each=move || options.get()
key=move |item| item.value.clone() key=move |item| item.value.clone()
view=move | item| { children=move | item| {
let item = store_value( item); let item = store_value( item);
let onclick = move |_| { let onclick = move |_| {
let SelectOption { value: item_value, label: _ } = item.get_value(); let SelectOption { value: item_value, label: _ } = item.get_value();

View file

@ -36,7 +36,7 @@ pub fn Tabs(active_key: RwSignal<&'static str>, children: Children) -> impl Into
view! { class=class_name, view! { class=class_name,
<div class="melt-tabs" style=move || css_vars.get()> <div class="melt-tabs" style=move || css_vars.get()>
<div class="melt-tabs__label-list" ref=label_list_ref> <div class="melt-tabs__label-list" ref=label_list_ref>
<For each=move || tab_options_vec.get() key=move |v| v.key.clone() view=move | options| { <For each=move || tab_options_vec.get() key=move |v| v.key.clone() children=move | options| {
let label_ref = create_node_ref::<html::Span>(); let label_ref = create_node_ref::<html::Span>();
create_effect( move |_| { create_effect( move |_| {
let Some(label) = label_ref.get() else { let Some(label) = label_ref.get() else {