Skip to content

Commit

Permalink
small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
maccesch committed Jan 5, 2025
1 parent e91f08b commit 3fa1a38
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "leptos-struct-table-macro"
version = "0.13.0"
version = "0.13.0-beta1"
edition = "2021"
authors = ["Marc-Stefan Cassola"]
description = "Macros for the leptos-struct-table crate."
Expand Down
18 changes: 13 additions & 5 deletions src/table_row.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ fn get_default_option_renderer(
return match get_inner_type(last_segment, "Option") {
Ok(inner_type_ident) => {
let value_prop = quote! {
value=Signal::derive(move || value.get().expect("Just checked above that it's not None"))
value=leptos::prelude::Signal::derive(move || value.get().expect("Just checked above that it's not None"))
};

let none_value = field.none_value.clone().unwrap_or_default();
Expand All @@ -91,9 +91,11 @@ fn get_default_option_renderer(

quote! {
{
let value = Signal::derive(move || { row.read().#getter });
use leptos::prelude::Read;

let value = leptos::prelude::Signal::derive(move || { row.read().#getter });

leptos::view! {
leptos::prelude::view! {
<leptos::control_flow::Show
when={
move || { value.read().is_some() }
Expand All @@ -102,7 +104,7 @@ fn get_default_option_renderer(
type DefaultMarker = ();
leptos::view! {
<leptos_struct_table::DefaultTableCellRenderer<_, String, DefaultMarker>
value=Signal::stored(#none_value.to_string())
value=leptos::prelude::Signal::stored(#none_value.to_string())
options={()}
#class_prop #index_prop row=row
/>
Expand Down Expand Up @@ -245,7 +247,13 @@ fn get_renderer_for_field(name: &Ident, field: &TableRowField, index: usize) ->
let class = field.cell_class();
let class_prop = quote! { class=class_provider.cell( # class) };

let value_prop = quote! { value={ Signal::derive(move || row.read().#getter) } };
let value_prop = quote! {
value={
use leptos::prelude::Read;

leptos::prelude::Signal::derive(move || row.read().#getter)
}
};

if let Some(renderer) = &field.renderer {
let ident = renderer.as_ident();
Expand Down

0 comments on commit 3fa1a38

Please sign in to comment.