Skip to content

Commit

Permalink
📝 Implement Serialize and Deserialize for all the components' pro…
Browse files Browse the repository at this point in the history
…perties.
  • Loading branch information
langyo committed Nov 16, 2024
1 parent 7f1e540 commit 9c055f2
Show file tree
Hide file tree
Showing 86 changed files with 360 additions and 97 deletions.
5 changes: 4 additions & 1 deletion packages/components/src/container/layout/aside.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
use serde::{Deserialize, Serialize};

use stylist::yew::styled_component;
use yew::prelude::*;

#[derive(Properties, Debug, PartialEq)]
#[derive(Properties, Debug, PartialEq, Serialize, Deserialize)]
pub struct Props {
#[prop_or(256)]
pub width: u32,

#[prop_or_default]
#[serde(skip)]
pub children: Children,
}

Expand Down
5 changes: 4 additions & 1 deletion packages/components/src/container/layout/container.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};

use stylist::yew::styled_component;
use yew::{html::ChildrenRenderer, prelude::*, virtual_dom::VChild};

Expand Down Expand Up @@ -25,9 +27,10 @@ impl Into<Html> for ContainerLayoutVariant {
}
}

#[derive(Properties, Debug, PartialEq)]
#[derive(Properties, Debug, PartialEq, Serialize, Deserialize)]
pub struct Props {
#[prop_or_default]
#[serde(skip)]
pub children: ChildrenRenderer<ContainerLayoutVariant>,
}

Expand Down
5 changes: 4 additions & 1 deletion packages/components/src/container/layout/footer.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
use serde::{Deserialize, Serialize};

use stylist::yew::styled_component;
use yew::prelude::*;

#[derive(Properties, Debug, PartialEq)]
#[derive(Properties, Debug, PartialEq, Serialize, Deserialize)]
pub struct Props {
#[prop_or_default]
#[serde(skip)]
pub children: Children,
}

Expand Down
5 changes: 4 additions & 1 deletion packages/components/src/container/layout/header.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
use serde::{Deserialize, Serialize};

use stylist::yew::styled_component;
use yew::prelude::*;

#[derive(Properties, Debug, PartialEq)]
#[derive(Properties, Debug, PartialEq, Serialize, Deserialize)]
pub struct Props {
#[prop_or_default]
#[serde(skip)]
pub children: Children,
}

Expand Down
5 changes: 4 additions & 1 deletion packages/components/src/container/layout/main.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
use serde::{Deserialize, Serialize};

use stylist::yew::styled_component;
use yew::prelude::*;

#[derive(Properties, Debug, PartialEq)]
#[derive(Properties, Debug, PartialEq, Serialize, Deserialize)]
pub struct Props {
#[prop_or_default]
#[serde(skip)]
pub children: Children,
}

Expand Down
5 changes: 4 additions & 1 deletion packages/components/src/container/place/column.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
use serde::{Deserialize, Serialize};

use stylist::yew::styled_component;
use yew::prelude::*;

#[derive(Properties, Debug, PartialEq)]
#[derive(Properties, Debug, PartialEq, Serialize, Deserialize)]
pub struct Props {
#[prop_or_default]
#[serde(skip)]
pub children: Children,
}

Expand Down
5 changes: 4 additions & 1 deletion packages/components/src/container/place/grid.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
use serde::{Deserialize, Serialize};

use stylist::yew::styled_component;
use yew::prelude::*;

#[derive(Properties, Debug, PartialEq)]
#[derive(Properties, Debug, PartialEq, Serialize, Deserialize)]
pub struct Props {
#[prop_or_default]
#[serde(skip)]
pub children: Children,
}

Expand Down
5 changes: 4 additions & 1 deletion packages/components/src/container/place/row.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
use serde::{Deserialize, Serialize};

use stylist::yew::styled_component;
use yew::prelude::*;

#[derive(Properties, Debug, PartialEq)]
#[derive(Properties, Debug, PartialEq, Serialize, Deserialize)]
pub struct Props {
#[prop_or_default]
#[serde(skip)]
pub children: Children,
}

Expand Down
5 changes: 4 additions & 1 deletion packages/components/src/container/place/skeleton.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
use serde::{Deserialize, Serialize};

use stylist::yew::styled_component;
use yew::prelude::*;

#[derive(Properties, Debug, PartialEq)]
#[derive(Properties, Debug, PartialEq, Serialize, Deserialize)]
pub struct Props {
#[prop_or_default]
#[serde(skip)]
pub children: Children,
}

Expand Down
5 changes: 4 additions & 1 deletion packages/components/src/container/place/space.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
use serde::{Deserialize, Serialize};

use stylist::yew::styled_component;
use yew::prelude::*;

#[derive(Properties, Debug, PartialEq)]
#[derive(Properties, Debug, PartialEq, Serialize, Deserialize)]
pub struct Props {
#[prop_or_default]
#[serde(skip)]
pub children: Children,
}

Expand Down
5 changes: 4 additions & 1 deletion packages/components/src/container/system/anchor.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
use serde::{Deserialize, Serialize};

use stylist::yew::styled_component;
use yew::prelude::*;

#[derive(Properties, Debug, PartialEq)]
#[derive(Properties, Debug, PartialEq, Serialize, Deserialize)]
pub struct Props {
#[prop_or_default]
#[serde(skip)]
pub children: Children,
}

Expand Down
5 changes: 4 additions & 1 deletion packages/components/src/container/system/breakpoint.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
use serde::{Deserialize, Serialize};

use stylist::yew::styled_component;
use yew::prelude::*;

#[derive(Properties, Debug, PartialEq)]
#[derive(Properties, Debug, PartialEq, Serialize, Deserialize)]
pub struct Props {
#[prop_or_default]
#[serde(skip)]
pub children: Children,
}

Expand Down
5 changes: 4 additions & 1 deletion packages/components/src/container/system/cursor.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
use serde::{Deserialize, Serialize};

use stylist::yew::styled_component;
use yew::prelude::*;

#[derive(Properties, Debug, PartialEq)]
#[derive(Properties, Debug, PartialEq, Serialize, Deserialize)]
pub struct Props {
#[prop_or_default]
#[serde(skip)]
pub children: Children,
}

Expand Down
5 changes: 4 additions & 1 deletion packages/components/src/container/system/draggable.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
use serde::{Deserialize, Serialize};

use stylist::yew::styled_component;
use yew::prelude::*;

#[derive(Properties, Debug, PartialEq)]
#[derive(Properties, Debug, PartialEq, Serialize, Deserialize)]
pub struct Props {
#[prop_or_default]
#[serde(skip)]
pub children: Children,
}

Expand Down
5 changes: 4 additions & 1 deletion packages/components/src/container/system/flex.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
use serde::{Deserialize, Serialize};

use stylist::yew::styled_component;
use yew::prelude::*;

#[derive(Properties, Debug, PartialEq)]
#[derive(Properties, Debug, PartialEq, Serialize, Deserialize)]
pub struct Props {
#[prop_or_default]
#[serde(skip)]
pub children: Children,
}

Expand Down
5 changes: 4 additions & 1 deletion packages/components/src/container/system/modal.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
use serde::{Deserialize, Serialize};

use stylist::yew::styled_component;
use yew::prelude::*;

#[derive(Properties, Debug, PartialEq)]
#[derive(Properties, Debug, PartialEq, Serialize, Deserialize)]
pub struct Props {
#[prop_or_default]
#[serde(skip)]
pub children: Children,
}

Expand Down
5 changes: 4 additions & 1 deletion packages/components/src/container/system/resizable.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
use serde::{Deserialize, Serialize};

use stylist::yew::styled_component;
use yew::prelude::*;

#[derive(Properties, Debug, PartialEq)]
#[derive(Properties, Debug, PartialEq, Serialize, Deserialize)]
pub struct Props {
#[prop_or_default]
#[serde(skip)]
pub children: Children,
}

Expand Down
5 changes: 4 additions & 1 deletion packages/components/src/container/system/scrollable.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
use serde::{Deserialize, Serialize};

use stylist::yew::styled_component;
use yew::prelude::*;

#[derive(Properties, Debug, PartialEq)]
#[derive(Properties, Debug, PartialEq, Serialize, Deserialize)]
pub struct Props {
#[prop_or_default]
#[serde(skip)]
pub children: Children,
}

Expand Down
5 changes: 4 additions & 1 deletion packages/components/src/data/block/card.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
use serde::{Deserialize, Serialize};

use stylist::yew::styled_component;
use yew::prelude::*;

#[derive(Properties, Debug, PartialEq)]
#[derive(Properties, Debug, PartialEq, Serialize, Deserialize)]
pub struct Props {
#[prop_or_default]
#[serde(skip)]
pub children: Children,
}

Expand Down
5 changes: 4 additions & 1 deletion packages/components/src/data/block/carousel.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
use serde::{Deserialize, Serialize};

use stylist::yew::styled_component;
use yew::prelude::*;

#[derive(Properties, Debug, PartialEq)]
#[derive(Properties, Debug, PartialEq, Serialize, Deserialize)]
pub struct Props {
#[prop_or_default]
#[serde(skip)]
pub children: Children,
}

Expand Down
5 changes: 4 additions & 1 deletion packages/components/src/data/block/list/item.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
use serde::{Deserialize, Serialize};

use stylist::yew::styled_component;
use yew::prelude::*;

#[derive(Properties, Debug, PartialEq)]
#[derive(Properties, Debug, PartialEq, Serialize, Deserialize)]
pub struct Props {
#[prop_or_default]
#[serde(skip)]
pub children: Children,
}

Expand Down
5 changes: 4 additions & 1 deletion packages/components/src/data/block/list/mod.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
pub mod item;

use serde::{Deserialize, Serialize};

use stylist::yew::styled_component;
use yew::prelude::*;

#[derive(Properties, Debug, PartialEq)]
#[derive(Properties, Debug, PartialEq, Serialize, Deserialize)]
pub struct Props {
#[prop_or_default]
#[serde(skip)]
pub children: Children,
}

Expand Down
5 changes: 4 additions & 1 deletion packages/components/src/data/block/masonry.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
use serde::{Deserialize, Serialize};

use stylist::yew::styled_component;
use yew::prelude::*;

#[derive(Properties, Debug, PartialEq)]
#[derive(Properties, Debug, PartialEq, Serialize, Deserialize)]
pub struct Props {
#[prop_or_default]
#[serde(skip)]
pub children: Children,
}

Expand Down
5 changes: 4 additions & 1 deletion packages/components/src/data/block/paper.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
use serde::{Deserialize, Serialize};

use stylist::yew::styled_component;
use yew::prelude::*;

#[derive(Properties, Debug, PartialEq)]
#[derive(Properties, Debug, PartialEq, Serialize, Deserialize)]
pub struct Props {
#[prop_or_default]
#[serde(skip)]
pub children: Children,
}

Expand Down
5 changes: 4 additions & 1 deletion packages/components/src/data/block/progress/circular.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
use serde::{Deserialize, Serialize};

use stylist::yew::styled_component;
use yew::prelude::*;

#[derive(Properties, Debug, PartialEq)]
#[derive(Properties, Debug, PartialEq, Serialize, Deserialize)]
pub struct Props {
#[prop_or_default]
#[serde(skip)]
pub children: Children,
}

Expand Down
5 changes: 4 additions & 1 deletion packages/components/src/data/block/progress/linear.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
use serde::{Deserialize, Serialize};

use stylist::yew::styled_component;
use yew::prelude::*;

#[derive(Properties, Debug, PartialEq)]
#[derive(Properties, Debug, PartialEq, Serialize, Deserialize)]
pub struct Props {
#[prop_or_default]
#[serde(skip)]
pub children: Children,
}

Expand Down
5 changes: 4 additions & 1 deletion packages/components/src/data/block/summary.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
use serde::{Deserialize, Serialize};

use stylist::yew::styled_component;
use yew::prelude::*;

#[derive(Properties, Debug, PartialEq)]
#[derive(Properties, Debug, PartialEq, Serialize, Deserialize)]
pub struct Props {
#[prop_or_default]
#[serde(skip)]
pub children: Children,
}

Expand Down
Loading

0 comments on commit 9c055f2

Please sign in to comment.