mirror of
https://github.com/yewprint/yewprint
synced 2025-02-16 12:08:25 +00:00
parent
008d7e341b
commit
f6c6a54256
5 changed files with 15 additions and 13 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
@ -808,7 +808,6 @@ dependencies = [
|
|||
name = "yewprint-doc"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"boolinator",
|
||||
"syntect",
|
||||
"wasm-bindgen",
|
||||
"web-sys",
|
||||
|
|
|
@ -15,9 +15,6 @@ yew = { git = "https://github.com/yewstack/yew.git", rev = "db3170f629f" }
|
|||
web-sys = { version = "0.3", features = ["Window", "MediaQueryList"] }
|
||||
yewprint = { path = "../yewprint" }
|
||||
yew-router = { git = "https://github.com/yewstack/yew.git", rev = "db3170f629f" }
|
||||
# NOTE: this dependency needs to be removed when the feature bool_to_option lands in stable
|
||||
# https://github.com/rust-lang/rust/issues/64260
|
||||
boolinator = "2.4.0"
|
||||
|
||||
[build-dependencies]
|
||||
syntect = "4.4.0"
|
||||
|
|
|
@ -17,7 +17,6 @@ use crate::tabs::*;
|
|||
use crate::tag::*;
|
||||
use crate::text::*;
|
||||
use crate::tree::*;
|
||||
use boolinator::Boolinator;
|
||||
use yew::prelude::*;
|
||||
use yew_router::{
|
||||
agent::{RouteAgentDispatcher, RouteRequest},
|
||||
|
@ -85,7 +84,7 @@ impl Component for App {
|
|||
};
|
||||
|
||||
html! {
|
||||
<div class=classes!("docs-root", self.dark_theme.as_some("bp3-dark"))>
|
||||
<div class=classes!("docs-root", self.dark_theme.then(|| "bp3-dark"))>
|
||||
<div class=classes!("docs-app")>
|
||||
<div class=classes!("docs-nav-wrapper")>
|
||||
<div class=classes!("docs-nav")>
|
||||
|
|
|
@ -19,7 +19,7 @@ impl Component for SpinnerDoc {
|
|||
callback: link.callback(|x| x),
|
||||
state: ExampleProps {
|
||||
intent: None,
|
||||
size: 10,
|
||||
size: 50,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
@ -84,9 +84,17 @@ crate::build_example_prop_component! {
|
|||
/>
|
||||
<p>{"Select Size:"}</p>
|
||||
<HtmlSelect<u32>
|
||||
value=self.props.size
|
||||
options={vec![
|
||||
(10, "Very Small".to_string()),
|
||||
(20, "Small".to_string()),
|
||||
(30, "Small +10".to_string()),
|
||||
(40, "Standard -10".to_string()),
|
||||
(50, "Standard".to_string()),
|
||||
(60, "Standard +10".to_string()),
|
||||
(70, "Not really Standard".to_string()),
|
||||
(80, "Not really Large".to_string()),
|
||||
(90, "Large -10".to_string()),
|
||||
(100, "Large".to_string()),
|
||||
]}
|
||||
onchange=self.update_props(|props, size| ExampleProps {
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
use boolinator::Boolinator;
|
||||
use yew::prelude::*;
|
||||
use yewprint::{IconName, Intent, Tag};
|
||||
|
||||
|
@ -72,22 +71,22 @@ impl Component for Example {
|
|||
.map(|label| {
|
||||
let remove = {
|
||||
let label = label.clone();
|
||||
self.props.removable.as_some(
|
||||
self.props.removable.then(|| {
|
||||
self.link
|
||||
.callback(move |_| ExampleMsg::Remove(label.clone())),
|
||||
)
|
||||
.callback(move |_| ExampleMsg::Remove(label.clone()))
|
||||
})
|
||||
};
|
||||
html! {
|
||||
<Tag
|
||||
active=self.props.active
|
||||
fill=self.props.fill
|
||||
icon=self.props.icon.as_some(IconName::Print)
|
||||
icon=self.props.icon.then(|| IconName::Print)
|
||||
intent=self.props.intent
|
||||
interactive=self.props.interactive
|
||||
large=self.props.large
|
||||
minimal=self.props.minimal
|
||||
multiline=self.props.multiline
|
||||
right_icon=self.props.right_icon.as_some(IconName::Star)
|
||||
right_icon=self.props.right_icon.then(|| IconName::Star)
|
||||
round=self.props.round
|
||||
onremove=remove
|
||||
onclick=self.link.callback(|_| ExampleMsg::Click)
|
||||
|
|
Loading…
Add table
Reference in a new issue