mirror of
https://github.com/adoyle0/thaw.git
synced 2025-01-22 22:09:22 -05:00
feat: adding parameter comments
This commit is contained in:
parent
1a001d5834
commit
e632665005
11 changed files with 23 additions and 0 deletions
|
@ -6,7 +6,9 @@ use thaw_utils::{class_list, StoredMaybeSignal};
|
|||
#[component]
|
||||
pub fn AnchorLink(
|
||||
#[prop(optional, into)] class: MaybeProp<String>,
|
||||
/// The content of link.
|
||||
#[prop(into)] title: MaybeSignal<String>,
|
||||
/// The target of link.
|
||||
#[prop(into)] href: String,
|
||||
#[prop(optional)] children: Option<Children>,
|
||||
) -> impl IntoView {
|
||||
|
|
|
@ -10,6 +10,8 @@ use web_sys::{DomRect, Element};
|
|||
#[component]
|
||||
pub fn Anchor(
|
||||
#[prop(optional, into)] class: MaybeProp<String>,
|
||||
/// The element or selector used to calc offset of link elements.
|
||||
/// If you are not scrolling the entire document but only a part of it, you may need to set this.
|
||||
#[prop(into, optional)] offset_target: Option<OffsetTarget>,
|
||||
children: Children,
|
||||
) -> impl IntoView {
|
||||
|
|
|
@ -9,8 +9,11 @@ use thaw_utils::{
|
|||
#[component]
|
||||
pub fn BackTop(
|
||||
#[prop(optional, into)] class: MaybeProp<String>,
|
||||
/// The width of BackTop from the right side of the page.
|
||||
#[prop(default=40.into(), into)] right: MaybeSignal<i32>,
|
||||
/// The height of BackTop from the bottom of the page.
|
||||
#[prop(default=40.into(), into)] bottom: MaybeSignal<i32>,
|
||||
/// BackTop's trigger scroll top.
|
||||
#[prop(default=180.into(), into)] visibility_height: MaybeSignal<i32>,
|
||||
#[prop(optional)] children: Option<Children>,
|
||||
) -> impl IntoView {
|
||||
|
|
|
@ -32,6 +32,7 @@ pub fn BreadcrumbItem(
|
|||
#[component]
|
||||
pub fn BreadcrumbButton(
|
||||
#[prop(optional, into)] class: MaybeProp<String>,
|
||||
/// Defines current sate of BreadcrumbButton.
|
||||
#[prop(optional, into)] current: MaybeSignal<bool>,
|
||||
children: Children,
|
||||
) -> impl IntoView {
|
||||
|
|
|
@ -4,6 +4,7 @@ use thaw_utils::{class_list, mount_style};
|
|||
#[component]
|
||||
pub fn ButtonGroup(
|
||||
#[prop(optional, into)] class: MaybeProp<String>,
|
||||
/// Directions of buttons in the group.
|
||||
#[prop(optional)] vertical: bool,
|
||||
children: Children,
|
||||
) -> impl IntoView {
|
||||
|
|
|
@ -65,12 +65,18 @@ impl ButtonSize {
|
|||
#[component]
|
||||
pub fn Button(
|
||||
#[prop(optional, into)] class: MaybeProp<String>,
|
||||
/// A button can have its content and borders styled for greater emphasis or to be subtle.
|
||||
#[prop(optional, into)] appearance: MaybeSignal<ButtonAppearance>,
|
||||
/// A button can be rounded, circular, or square.
|
||||
#[prop(optional, into)] shape: MaybeSignal<ButtonShape>,
|
||||
/// A button supports different sizes.
|
||||
#[prop(optional, into)] size: MaybeSignal<ButtonSize>,
|
||||
/// Whether the button is displayed as block.
|
||||
#[prop(optional, into)] block: MaybeSignal<bool>,
|
||||
#[prop(optional, into)] icon: OptionalMaybeSignal<icondata_core::Icon>,
|
||||
/// Whether the button is disabled.
|
||||
#[prop(optional, into)] disabled: MaybeSignal<bool>,
|
||||
/// When set, allows the button to be focusable even when it has been disabled.
|
||||
#[prop(optional, into)] disabled_focusable: MaybeSignal<bool>,
|
||||
#[prop(optional, into)] on_click: Option<BoxOneCallback<ev::MouseEvent>>,
|
||||
#[prop(optional)] children: Option<Children>,
|
||||
|
|
|
@ -7,6 +7,7 @@ use thaw_utils::{class_list, mount_style, OptionModel};
|
|||
#[component]
|
||||
pub fn Calendar(
|
||||
#[prop(optional, into)] class: MaybeProp<String>,
|
||||
/// Default selected date.
|
||||
#[prop(optional, into)] value: OptionModel<NaiveDate>,
|
||||
) -> impl IntoView {
|
||||
mount_style("calendar", include_str!("./calendar.css"));
|
||||
|
|
|
@ -8,9 +8,12 @@ use thaw_utils::{class_list, mount_style, Model};
|
|||
|
||||
#[component]
|
||||
pub fn Checkbox(
|
||||
/// The controlled value for the checkbox.
|
||||
#[prop(optional, into)] checked: Model<bool>,
|
||||
#[prop(optional, into)] class: MaybeProp<String>,
|
||||
/// The value of the checkbox to be used in a checkbox group.
|
||||
#[prop(optional, into)] value: Option<String>,
|
||||
/// The Checkbox's label.
|
||||
#[prop(optional, into)] label: MaybeProp<String>,
|
||||
) -> impl IntoView {
|
||||
mount_style("checkbox", include_str!("./checkbox.css"));
|
||||
|
|
|
@ -10,6 +10,7 @@ pub fn Combobox(
|
|||
#[prop(optional, into)] class: MaybeProp<String>,
|
||||
#[prop(optional, into)] value: Model<String>,
|
||||
#[prop(optional, into)] selected_options: VecModel<String>,
|
||||
/// If set, the combobox will show an icon to clear the current value.
|
||||
#[prop(optional)] clearable: bool,
|
||||
children: Children,
|
||||
) -> impl IntoView {
|
||||
|
|
|
@ -7,7 +7,9 @@ use thaw_utils::class_list;
|
|||
#[component]
|
||||
pub fn ComboboxOption(
|
||||
#[prop(optional, into)] class: MaybeProp<String>,
|
||||
/// Defines a unique identifier for the option. Defaults to `text` if not provided.
|
||||
#[prop(optional, into)] value: Option<String>,
|
||||
/// An optional override the string value of the Option's display text, defaulting to the Option's child content.
|
||||
#[prop(into)] text: String,
|
||||
#[prop(optional)] children: Option<Children>,
|
||||
) -> impl IntoView {
|
||||
|
|
|
@ -6,6 +6,7 @@ use thaw_utils::{class_list, mount_style, Model};
|
|||
#[component]
|
||||
pub fn Dialog(
|
||||
#[prop(optional, into)] class: MaybeProp<String>,
|
||||
/// Controls the open state of the dialog
|
||||
#[prop(into)] open: Model<bool>,
|
||||
#[prop(default = true.into(), into)] mask_closeable: MaybeSignal<bool>,
|
||||
#[prop(default = true, into)] close_on_esc: bool,
|
||||
|
|
Loading…
Add table
Reference in a new issue