From fb06227fd86a32e462d9fa06de5604f2f8ee175f Mon Sep 17 00:00:00 2001 From: kandrelczyk Date: Thu, 21 Dec 2023 06:35:15 +0100 Subject: [PATCH] Add class param to date picker (#56) Co-authored-by: Cristobal Andrada --- demo/src/pages/checkbox/mod.rs | 18 ++++++++++++------ demo/src/pages/date_picker/mod.rs | 6 ++++++ src/date_picker/mod.rs | 7 +++++-- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/demo/src/pages/checkbox/mod.rs b/demo/src/pages/checkbox/mod.rs index 957d91a..33ab84c 100644 --- a/demo/src/pages/checkbox/mod.rs +++ b/demo/src/pages/checkbox/mod.rs @@ -81,6 +81,12 @@ pub fn CheckboxPage() -> impl IntoView { "Checkbox's content." + + "class" + "MaybeSignal" + "Default::default()" + "Addtional classes for the checkbox element." +

"CheckboxGroup Props"

@@ -106,12 +112,6 @@ pub fn CheckboxPage() -> impl IntoView { "CheckboxGroup's content." - - "class" - "MaybeSignal" - "Default::default()" - "Addtional classes for the checkbox element." -

"CheckboxItem Props"

@@ -137,6 +137,12 @@ pub fn CheckboxPage() -> impl IntoView { "None" "Checkbox's label." + + "class" + "MaybeSignal" + "Default::default()" + "Addtional classes for the checkbox element." + diff --git a/demo/src/pages/date_picker/mod.rs b/demo/src/pages/date_picker/mod.rs index 0a7a3e7..086bb5b 100644 --- a/demo/src/pages/date_picker/mod.rs +++ b/demo/src/pages/date_picker/mod.rs @@ -51,6 +51,12 @@ pub fn DatePickerPage() -> impl IntoView { "Set the date picker value" + + "class" + "MaybeSignal" + "Default::default()" + "Addtional classes for the date picker element." + diff --git a/src/date_picker/mod.rs b/src/date_picker/mod.rs index e61fe90..3a61e66 100644 --- a/src/date_picker/mod.rs +++ b/src/date_picker/mod.rs @@ -12,7 +12,10 @@ use panel::{Panel, PanelRef}; pub use theme::DatePickerTheme; #[component] -pub fn DatePicker(#[prop(optional, into)] value: RwSignal>) -> impl IntoView { +pub fn DatePicker( + #[prop(optional, into)] value: RwSignal>, + #[prop(optional, into)] class: MaybeSignal, +) -> impl IntoView { mount_style("date-picker", include_str!("./date-picker.css")); let date_picker_ref = create_node_ref::(); let is_show_panel = create_rw_signal(false); @@ -70,7 +73,7 @@ pub fn DatePicker(#[prop(optional, into)] value: RwSignal>) -> view! {
- +