Skip to content

Commit 14e50e1

Browse files
feat: use patternfly-yew v0.7 with yew 0.22 base
1 parent 8ee71b9 commit 14e50e1

11 files changed

Lines changed: 257 additions & 57 deletions

File tree

Cargo.lock

Lines changed: 232 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@ chrono = { version = "0.4.30", default-features = false, features = ["wasmbind"]
1414
gloo-utils = "0.2"
1515
log = "0.4"
1616
patternfly-yew = { version = "0.6.1", features = ["tree", "icons-fab"] }
17-
popper-rs = { version = "0.3.2", features = ["yew", "debug"] }
17+
popper-rs = { version = "0.4", features = ["yew", "debug"] }
1818
serde_json = "1"
19-
strum = { version = "0.26", features = ["derive"] }
19+
strum = { version = "0.27", features = ["derive"] }
2020
url = "2"
2121
wasm-bindgen = "0.2"
2222
wasm-bindgen-futures = "0.4"
2323
wasm-logger = "0.2"
24-
yew = { version = "0.21", features = ["csr"] }
25-
yew-hooks = "0.3"
26-
yew-more-hooks = { version = "0.3.3", features = ["yew-hooks"] }
27-
yew-nested-router = "0.7.0"
24+
yew = { version = "0.22", features = ["csr"] }
25+
yew-hooks = "0.4"
26+
yew-more-hooks = { version = "0.4", features = ["yew-hooks"] }
27+
yew-nested-router = "0.8"
2828

2929
[dependencies.web-sys]
3030
version = "0.3"

rust-toolchain.toml

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/components/dual_list_selector/dual_list_selector.1.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
#[function_component(Example)]
2+
#[component(Example)]
33
fn example() -> Html {
44
let available: Vec<Fruit> = vec![
55
"Apple",

src/components/dual_list_selector/dual_list_selector.2.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
#[function_component(Example)]
2+
#[component(Example)]
33
fn example() -> Html {
44
let available: Vec<Fruit> = vec![
55
"Apple",

src/components/dual_list_selector/dual_list_selector.3.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
#[function_component(Example)]
2+
#[component(Example)]
33
fn example() -> Html {
44
let available: Vec<Fruit> = vec![
55
"Apple",

src/components/dual_list_selector/mod.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use crate::{example, example::ExamplePage};
22
use patternfly_yew::prelude::*;
3+
use yew::html::IntoPropValue;
34
use yew::prelude::*;
45

56
#[derive(Debug, Clone, PartialEq)]
@@ -17,13 +18,19 @@ impl Fruit {
1718
}
1819
}
1920

20-
impl ToHtml for Fruit {
21-
fn to_html(&self) -> Html {
21+
impl IntoPropValue<Html> for Fruit {
22+
fn into_prop_value(self) -> Html {
2223
html! { {self.name.clone() }}
2324
}
2425
}
2526

26-
#[function_component(DualListSelectorExample)]
27+
impl IntoPropValue<Html> for &Fruit {
28+
fn into_prop_value(self) -> Html {
29+
html! { {self.name.clone() }}
30+
}
31+
}
32+
33+
#[component(DualListSelectorExample)]
2734
pub fn view() -> Html {
2835
let example1 = example! {"Basic" => "dual_list_selector.1.example"};
2936
let example2 = example! {"Advanced" => "dual_list_selector.2.example"};

src/components/label/label.1.example

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
let onclose = Callback::from(|_|{});
33

44
html!(
5-
for Color::iter().map(|color|html!{
5+
Color::iter().map(|color| html!{
66
<Flex>
77
<FlexItem><Label label={format!("{}", color)} color={color}/></FlexItem>
88
<FlexItem><Label label={format!("{} with icon", color)} color={color} icon={Icon::InfoCircle}/></FlexItem>
@@ -11,6 +11,6 @@
1111
<FlexItem><Label label={format!("{} clickable", color)} color={color} href="#"/></FlexItem>
1212
<FlexItem><Label label={format!("{} clickable, closable with icon", color)} color={color} icon={Icon::InfoCircle} href="#" onclose={onclose.clone()}/></FlexItem>
1313
</Flex>
14-
})
14+
}).collect::<Html>()
1515
)
1616
}

src/components/label/label.2.example

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
let onclose = Callback::from(|_|{});
33

44
html!(
5-
for Color::iter().map(|color|html!{
5+
Color::iter().map(|color| html!{
66
<Flex>
77
<FlexItem><Label outline=true label={format!("{}", color)} color={color}/></FlexItem>
88
<FlexItem><Label outline=true label={format!("{} with icon", color)} {color} icon={Icon::InfoCircle}/></FlexItem>
@@ -11,6 +11,6 @@
1111
<FlexItem><Label outline=true label={format!("{} clickable", color)} {color} href="#"/></FlexItem>
1212
<FlexItem><Label outline=true label={format!("{} clickable, closable with icon", color)} {color} icon={Icon::InfoCircle} href="#" onclose={onclose.clone()}/></FlexItem>
1313
</Flex>
14-
})
14+
}).collect::<Html>()
1515
)
1616
}

src/components/label/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use patternfly_yew::prelude::*;
33
use strum::IntoEnumIterator;
44
use yew::prelude::*;
55

6-
#[function_component(LabelExample)]
6+
#[component(LabelExample)]
77
pub fn label_example() -> Html {
88
let example1 = example!("Label" => "label.1.example");
99
let example2 = example!("Label (outline)" => "label.2.example");

0 commit comments

Comments
 (0)