Skip to content

Commit 30f61ff

Browse files
authored
Merge pull request #61 from kstep/leptos-0.7
Fixes tests and macros for leptos-0.7
2 parents 367a5ea + 9d772f4 commit 30f61ff

9 files changed

Lines changed: 17 additions & 17 deletions

File tree

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "leptos-struct-table"
3-
version = "0.13.0"
3+
version = "0.14.0"
44
edition = "2021"
55
authors = ["Marc-Stefan Cassola"]
66
categories = ["gui", "web-programming", "wasm"]
@@ -13,7 +13,7 @@ repository = "https://github.com/Synphonyte/leptos-struct-table"
1313

1414
[dependencies]
1515
leptos = { version = "0.7.0" }
16-
leptos-struct-table-macro = { version = "0.11.2" }
16+
leptos-struct-table-macro = { version = "0.12" }
1717
leptos-use = "0.15.0"
1818
rust_decimal = { version = "1.35", optional = true }
1919
chrono = { version = "0.4", optional = true }

examples/paginated_rest_datasource/src/models.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ impl Default for Authors {
3939
impl leptos_struct_table::CellValue for Authors {
4040
type RenderOptions = ();
4141

42-
fn render_value(self, _options: &Self::RenderOptions) -> impl IntoView {
42+
fn render_value(self, _options: Self::RenderOptions) -> impl IntoView {
4343
self.to_string()
4444
}
4545
}

examples/pagination/src/models.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ impl Default for Authors {
3333
impl leptos_struct_table::CellValue for Authors {
3434
type RenderOptions = ();
3535

36-
fn render_value(self, _options: &Self::RenderOptions) -> impl IntoView {
36+
fn render_value(self, _options: Self::RenderOptions) -> impl IntoView {
3737
self.to_string()
3838
}
3939
}

examples/selectable/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
mod tailwind;
22

3-
use chrono::NaiveDate;
3+
use ::chrono::NaiveDate;
44
use leptos::prelude::*;
55
use leptos_struct_table::*;
66
use tailwind::TailwindClassesPreset;

src/chrono.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use crate::*;
44
use ::chrono::{NaiveDate, NaiveDateTime, NaiveTime};
55
use leptos::prelude::*;
66

7-
#[derive(Default)]
7+
#[derive(Clone, Default)]
88
pub struct RenderChronoOptions {
99
/// Specifies a format string, See [`::chrono::format::strftime`] for more information.
1010
pub string: Option<String>,
@@ -19,7 +19,7 @@ macro_rules! chrono_cell_value_impl {
1919
impl CellValue<$ty> for $ty {
2020
type RenderOptions = RenderChronoOptions;
2121

22-
fn render_value(self, options: &Self::RenderOptions) -> impl IntoView {
22+
fn render_value(self, options: Self::RenderOptions) -> impl IntoView {
2323
if let Some(value) = options.string.as_ref() {
2424
self.format(&value).to_string()
2525
} else {

src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ pub struct TemperatureMeasurement {
290290
//! #[component]
291291
//! fn ImageTableCellRenderer<F>(
292292
//! class: String,
293-
//! #[prop(into)] value: MaybeSignal<String>,
293+
//! #[prop(into)] value: Signal<String>,
294294
//! on_change: F,
295295
//! index: usize,
296296
//! ) -> impl IntoView
@@ -315,7 +315,7 @@ pub struct TemperatureMeasurement {
315315
//! uses an `<input>`.
316316
//!
317317
//! ```
318-
//! # use leptos::prelude::*;
318+
//! # use leptos::{prelude::*, logging};
319319
//! # use leptos_struct_table::*;
320320
//! #
321321
//! #[derive(TableRow, Clone, Default, Debug)]
@@ -330,7 +330,7 @@ pub struct TemperatureMeasurement {
330330
//! #[component]
331331
//! fn InputCellRenderer<F>(
332332
//! class: String,
333-
//! #[prop(into)] value: MaybeSignal<String>,
333+
//! #[prop(into)] value: Signal<String>,
334334
//! on_change: F,
335335
//! index: usize,
336336
//! ) -> impl IntoView

src/rust_decimal.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pub struct DecimalNumberRenderOptions {
2222
/// ```
2323
impl CellValue<Decimal> for Decimal {
2424
type RenderOptions = DecimalNumberRenderOptions;
25-
fn render_value(self, options: &Self::RenderOptions) -> impl IntoView {
25+
fn render_value(self, options: Self::RenderOptions) -> impl IntoView {
2626
if let Some(value) = options.precision.as_ref() {
2727
format!("{:.value$}", self)
2828
} else {

src/time.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use ::time::format_description;
55
use ::time::{Date, OffsetDateTime, PrimitiveDateTime, Time};
66
use leptos::prelude::*;
77

8-
#[derive(Default)]
8+
#[derive(Clone, Default)]
99
pub struct RenderTimeOptions {
1010
/// Specifies a format string see [the time book](https://time-rs.github.io/book/api/format-description.html).
1111
pub string: Option<String>,
@@ -26,7 +26,7 @@ pub struct RenderTimeOptions {
2626
impl CellValue<Date> for Date {
2727
type RenderOptions = RenderTimeOptions;
2828

29-
fn render_value(self, options: &Self::RenderOptions) -> impl IntoView {
29+
fn render_value(self, options: Self::RenderOptions) -> impl IntoView {
3030
if let Some(value) = options.string.as_ref() {
3131
let format = format_description::parse(value)
3232
.expect("Unable to construct a format description given the format string");
@@ -52,7 +52,7 @@ impl CellValue<Date> for Date {
5252
impl CellValue<Time> for Time {
5353
type RenderOptions = RenderTimeOptions;
5454

55-
fn render_value(self, options: &Self::RenderOptions) -> impl IntoView {
55+
fn render_value(self, options: Self::RenderOptions) -> impl IntoView {
5656
if let Some(value) = options.string.as_ref() {
5757
let format = format_description::parse(value)
5858
.expect("Unable to construct a format description given the format string");
@@ -79,7 +79,7 @@ impl CellValue<Time> for Time {
7979
impl CellValue<PrimitiveDateTime> for PrimitiveDateTime {
8080
type RenderOptions = RenderTimeOptions;
8181

82-
fn render_value(self, options: &Self::RenderOptions) -> impl IntoView {
82+
fn render_value(self, options: Self::RenderOptions) -> impl IntoView {
8383
if let Some(value) = options.string.as_ref() {
8484
let format = format_description::parse(value)
8585
.expect("Unable to construct a format description given the format string");
@@ -106,7 +106,7 @@ impl CellValue<PrimitiveDateTime> for PrimitiveDateTime {
106106
impl CellValue<OffsetDateTime> for OffsetDateTime {
107107
type RenderOptions = RenderTimeOptions;
108108

109-
fn render_value(self, options: &Self::RenderOptions) -> impl IntoView {
109+
fn render_value(self, options: Self::RenderOptions) -> impl IntoView {
110110
if let Some(value) = options.string.as_ref() {
111111
let format = format_description::parse(value)
112112
.expect("Unable to construct a format description given the format string");

src/uuid.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use leptos::prelude::*;
1717
impl CellValue<Uuid> for Uuid {
1818
type RenderOptions = ();
1919

20-
fn render_value(self, _options: &Self::RenderOptions) -> impl IntoView {
20+
fn render_value(self, _options: Self::RenderOptions) -> impl IntoView {
2121
self.to_string()
2222
}
2323
}

0 commit comments

Comments
 (0)