Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,158 changes: 801 additions & 357 deletions Cargo.lock

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "patternfly-yew-quickstart"
version = "0.6.0"
authors = ["Jens Reimann <jreimann@redhat.com>"]
edition = "2021"
edition = "2024"
license = "Apache-2.0"
readme = "README.md"
description = "A quickstart project for using PatternFly with Yew"
Expand All @@ -14,17 +14,17 @@ chrono = { version = "0.4.30", default-features = false, features = ["wasmbind"]
gloo-utils = "0.2"
log = "0.4"
patternfly-yew = { version = "0.6.1", features = ["tree", "icons-fab"] }
popper-rs = { version = "0.3.2", features = ["yew", "debug"] }
popper-rs = { version = "0.4", features = ["yew", "debug"] }
serde_json = "1"
strum = { version = "0.26", features = ["derive"] }
strum = { version = "0.27", features = ["derive"] }
url = "2"
wasm-bindgen = "0.2"
wasm-bindgen-futures = "0.4"
wasm-logger = "0.2"
yew = { version = "0.21", features = ["csr"] }
yew-hooks = "0.3"
yew-more-hooks = { version = "0.3.3", features = ["yew-hooks"] }
yew-nested-router = "0.7.0"
yew = { version = "0.22", features = ["csr"] }
yew-hooks = "0.4"
yew-more-hooks = { version = "0.4", features = ["yew-hooks"] }
yew-nested-router = "0.8"

[dependencies.web-sys]
version = "0.3"
Expand Down
3 changes: 0 additions & 3 deletions rust-toolchain.toml

This file was deleted.

2 changes: 1 addition & 1 deletion src/app/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ use crate::layouts;
use crate::{icons::Icons, panic::Panic};
use patternfly_yew::prelude::*;
use yew::prelude::*;
use yew_nested_router::prelude::{Switch as RouterSwitch, *};
use yew_nested_router::Target;
use yew_nested_router::prelude::{Switch as RouterSwitch, *};

mod about;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
#[function_component(Example)]
#[component(Example)]
fn example() -> Html {
let available: Vec<Fruit> = vec![
"Apple",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
#[function_component(Example)]
#[component(Example)]
fn example() -> Html {
let available: Vec<Fruit> = vec![
"Apple",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
#[function_component(Example)]
#[component(Example)]
fn example() -> Html {
let available: Vec<Fruit> = vec![
"Apple",
Expand Down
13 changes: 10 additions & 3 deletions src/components/dual_list_selector/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use crate::{example, example::ExamplePage};
use patternfly_yew::prelude::*;
use yew::html::IntoPropValue;
use yew::prelude::*;

#[derive(Debug, Clone, PartialEq)]
Expand All @@ -17,13 +18,19 @@ impl Fruit {
}
}

impl ToHtml for Fruit {
fn to_html(&self) -> Html {
impl IntoPropValue<Html> for Fruit {
fn into_prop_value(self) -> Html {
html! { {self.name.clone() }}
}
}

#[function_component(DualListSelectorExample)]
impl IntoPropValue<Html> for &Fruit {
fn into_prop_value(self) -> Html {
html! { {self.name.clone() }}
}
}

#[component(DualListSelectorExample)]
pub fn view() -> Html {
let example1 = example! {"Basic" => "dual_list_selector.1.example"};
let example2 = example! {"Advanced" => "dual_list_selector.2.example"};
Expand Down
4 changes: 2 additions & 2 deletions src/components/label/label.1.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
let onclose = Callback::from(|_|{});

html!(
for Color::iter().map(|color|html!{
Color::iter().map(|color| html!{
<Flex>
<FlexItem><Label label={format!("{}", color)} color={color}/></FlexItem>
<FlexItem><Label label={format!("{} with icon", color)} color={color} icon={Icon::InfoCircle}/></FlexItem>
Expand All @@ -11,6 +11,6 @@
<FlexItem><Label label={format!("{} clickable", color)} color={color} href="#"/></FlexItem>
<FlexItem><Label label={format!("{} clickable, closable with icon", color)} color={color} icon={Icon::InfoCircle} href="#" onclose={onclose.clone()}/></FlexItem>
</Flex>
})
}).collect::<Html>()
)
}
4 changes: 2 additions & 2 deletions src/components/label/label.2.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
let onclose = Callback::from(|_|{});

html!(
for Color::iter().map(|color|html!{
Color::iter().map(|color| html!{
<Flex>
<FlexItem><Label outline=true label={format!("{}", color)} color={color}/></FlexItem>
<FlexItem><Label outline=true label={format!("{} with icon", color)} {color} icon={Icon::InfoCircle}/></FlexItem>
Expand All @@ -11,6 +11,6 @@
<FlexItem><Label outline=true label={format!("{} clickable", color)} {color} href="#"/></FlexItem>
<FlexItem><Label outline=true label={format!("{} clickable, closable with icon", color)} {color} icon={Icon::InfoCircle} href="#" onclose={onclose.clone()}/></FlexItem>
</Flex>
})
}).collect::<Html>()
)
}
2 changes: 1 addition & 1 deletion src/components/label/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use patternfly_yew::prelude::*;
use strum::IntoEnumIterator;
use yew::prelude::*;

#[function_component(LabelExample)]
#[component(LabelExample)]
pub fn label_example() -> Html {
let example1 = example!("Label" => "label.1.example");
let example2 = example!("Label (outline)" => "label.2.example");
Expand Down
4 changes: 2 additions & 2 deletions src/components/pagination/mod.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use crate::{example, example::ExamplePage};
use patternfly_yew::{
components::table::{
use_table_data, Cell, CellContext, MemoizedTableModel, Table, TableColumn,
TableEntryRenderer, TableHeader, UseTableData,
Cell, CellContext, MemoizedTableModel, Table, TableColumn, TableEntryRenderer, TableHeader,
UseTableData, use_table_data,
},
components::toolbar::{Toolbar, ToolbarContent},
prelude::*,
Expand Down
2 changes: 1 addition & 1 deletion src/components/search_input/search_input.6.example
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
})
};
html_nested!(
<MenuAction {onclick}>{ value }</MenuAction>
<MenuAction {onclick}>{ *value }</MenuAction>
)
})}
</Menu>
Expand Down
4 changes: 2 additions & 2 deletions src/components/table/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use crate::{example, example::ExamplePage};
use chrono::Utc;
use patternfly_yew::{
components::table::{
use_table_data, Cell, CellContext, ColumnWidth, MemoizedTableModel, Span, Table,
TableColumn, TableEntryRenderer, TableHeader, UseStateTableModel, UseTableData,
Cell, CellContext, ColumnWidth, MemoizedTableModel, Span, Table, TableColumn,
TableEntryRenderer, TableHeader, UseStateTableModel, UseTableData, use_table_data,
},
prelude::*,
};
Expand Down
Loading