mirror of
https://github.com/adoyle0/thaw.git
synced 2025-01-23 06:19:22 -05:00
feat: adding parameter comments
This commit is contained in:
parent
e632665005
commit
875e7ffbbc
12 changed files with 21 additions and 0 deletions
|
@ -5,6 +5,7 @@ use thaw_utils::{class_list, mount_style};
|
||||||
#[component]
|
#[component]
|
||||||
pub fn Divider(
|
pub fn Divider(
|
||||||
#[prop(optional, into)] class: MaybeProp<String>,
|
#[prop(optional, into)] class: MaybeProp<String>,
|
||||||
|
/// A divider can be horizontal (default) or vertical.
|
||||||
#[prop(optional, into)] vertical: MaybeSignal<bool>,
|
#[prop(optional, into)] vertical: MaybeSignal<bool>,
|
||||||
#[prop(optional)] children: Option<Children>,
|
#[prop(optional)] children: Option<Children>,
|
||||||
) -> impl IntoView {
|
) -> impl IntoView {
|
||||||
|
|
|
@ -6,8 +6,11 @@ use thaw_utils::{class_list, mount_style, Model};
|
||||||
#[component]
|
#[component]
|
||||||
pub fn InlineDrawer(
|
pub fn InlineDrawer(
|
||||||
#[prop(optional, into)] class: MaybeProp<String>,
|
#[prop(optional, into)] class: MaybeProp<String>,
|
||||||
|
/// Controls the open state of the Drawer.
|
||||||
#[prop(into)] open: Model<bool>,
|
#[prop(into)] open: Model<bool>,
|
||||||
|
/// Position of the drawer.
|
||||||
#[prop(optional, into)] position: MaybeSignal<DrawerPosition>,
|
#[prop(optional, into)] position: MaybeSignal<DrawerPosition>,
|
||||||
|
/// Size of the drawer.
|
||||||
#[prop(optional, into)] size: MaybeSignal<DrawerSize>,
|
#[prop(optional, into)] size: MaybeSignal<DrawerSize>,
|
||||||
children: Children,
|
children: Children,
|
||||||
) -> impl IntoView {
|
) -> impl IntoView {
|
||||||
|
|
|
@ -7,10 +7,13 @@ use thaw_utils::{class_list, mount_style, use_lock_html_scroll, Model};
|
||||||
#[component]
|
#[component]
|
||||||
pub fn OverlayDrawer(
|
pub fn OverlayDrawer(
|
||||||
#[prop(optional, into)] class: MaybeProp<String>,
|
#[prop(optional, into)] class: MaybeProp<String>,
|
||||||
|
/// Controls the open state of the Drawer.
|
||||||
#[prop(into)] open: Model<bool>,
|
#[prop(into)] open: Model<bool>,
|
||||||
#[prop(default = true.into(), into)] mask_closeable: MaybeSignal<bool>,
|
#[prop(default = true.into(), into)] mask_closeable: MaybeSignal<bool>,
|
||||||
#[prop(optional, into)] close_on_esc: bool,
|
#[prop(optional, into)] close_on_esc: bool,
|
||||||
|
/// Position of the drawer.
|
||||||
#[prop(optional, into)] position: MaybeSignal<DrawerPosition>,
|
#[prop(optional, into)] position: MaybeSignal<DrawerPosition>,
|
||||||
|
/// Size of the drawer.
|
||||||
#[prop(optional, into)] size: MaybeSignal<DrawerSize>,
|
#[prop(optional, into)] size: MaybeSignal<DrawerSize>,
|
||||||
children: Children,
|
children: Children,
|
||||||
) -> impl IntoView {
|
) -> impl IntoView {
|
||||||
|
|
|
@ -4,7 +4,9 @@ use thaw_utils::class_list;
|
||||||
|
|
||||||
#[component]
|
#[component]
|
||||||
pub fn GridItem(
|
pub fn GridItem(
|
||||||
|
/// The number of columns occupied by the grid. The grid item would be hidden if it's 0.
|
||||||
#[prop(default = MaybeSignal::Static(1u16), into)] column: MaybeSignal<u16>,
|
#[prop(default = MaybeSignal::Static(1u16), into)] column: MaybeSignal<u16>,
|
||||||
|
/// The number of intervals to the left of the grid.
|
||||||
#[prop(optional, into)] offset: MaybeSignal<u16>,
|
#[prop(optional, into)] offset: MaybeSignal<u16>,
|
||||||
#[prop(optional, into)] class: MaybeProp<String>,
|
#[prop(optional, into)] class: MaybeProp<String>,
|
||||||
children: Children,
|
children: Children,
|
||||||
|
|
|
@ -6,8 +6,11 @@ use thaw_utils::class_list;
|
||||||
|
|
||||||
#[component]
|
#[component]
|
||||||
pub fn Grid(
|
pub fn Grid(
|
||||||
|
/// Number of grids displayed.
|
||||||
#[prop(default = MaybeSignal::Static(1u16), into)] cols: MaybeSignal<u16>,
|
#[prop(default = MaybeSignal::Static(1u16), into)] cols: MaybeSignal<u16>,
|
||||||
|
// Horizontal gap.
|
||||||
#[prop(optional, into)] x_gap: MaybeSignal<u16>,
|
#[prop(optional, into)] x_gap: MaybeSignal<u16>,
|
||||||
|
/// Vertical gap.
|
||||||
#[prop(optional, into)] y_gap: MaybeSignal<u16>,
|
#[prop(optional, into)] y_gap: MaybeSignal<u16>,
|
||||||
#[prop(optional, into)] class: MaybeProp<String>,
|
#[prop(optional, into)] class: MaybeProp<String>,
|
||||||
children: Children,
|
children: Children,
|
||||||
|
|
|
@ -36,9 +36,11 @@ pub fn Input(
|
||||||
#[prop(optional, into)] value: Model<String>,
|
#[prop(optional, into)] value: Model<String>,
|
||||||
#[prop(optional, into)] allow_value: Option<BoxOneCallback<String, bool>>,
|
#[prop(optional, into)] allow_value: Option<BoxOneCallback<String, bool>>,
|
||||||
#[prop(optional, into)] variant: MaybeSignal<InputVariant>,
|
#[prop(optional, into)] variant: MaybeSignal<InputVariant>,
|
||||||
|
/// Placeholder text for the input.
|
||||||
#[prop(optional, into)] placeholder: OptionalProp<MaybeSignal<String>>,
|
#[prop(optional, into)] placeholder: OptionalProp<MaybeSignal<String>>,
|
||||||
#[prop(optional, into)] on_focus: Option<BoxOneCallback<ev::FocusEvent>>,
|
#[prop(optional, into)] on_focus: Option<BoxOneCallback<ev::FocusEvent>>,
|
||||||
#[prop(optional, into)] on_blur: Option<BoxOneCallback<ev::FocusEvent>>,
|
#[prop(optional, into)] on_blur: Option<BoxOneCallback<ev::FocusEvent>>,
|
||||||
|
/// Whether the input is disabled
|
||||||
#[prop(optional, into)] disabled: MaybeSignal<bool>,
|
#[prop(optional, into)] disabled: MaybeSignal<bool>,
|
||||||
#[prop(optional)] input_prefix: Option<InputPrefix>,
|
#[prop(optional)] input_prefix: Option<InputPrefix>,
|
||||||
#[prop(optional)] input_suffix: Option<InputSuffix>,
|
#[prop(optional)] input_suffix: Option<InputSuffix>,
|
||||||
|
|
|
@ -30,6 +30,7 @@ pub fn Layout(
|
||||||
#[prop(optional, into)] content_class: MaybeProp<String>,
|
#[prop(optional, into)] content_class: MaybeProp<String>,
|
||||||
#[prop(optional, into)] content_style: MaybeProp<String>,
|
#[prop(optional, into)] content_style: MaybeProp<String>,
|
||||||
#[prop(optional)] position: LayoutPosition,
|
#[prop(optional)] position: LayoutPosition,
|
||||||
|
/// Whether the component has sider inside. If so it must be true.
|
||||||
#[prop(optional, into)] has_sider: MaybeSignal<bool>,
|
#[prop(optional, into)] has_sider: MaybeSignal<bool>,
|
||||||
children: Children,
|
children: Children,
|
||||||
) -> impl IntoView {
|
) -> impl IntoView {
|
||||||
|
|
|
@ -5,6 +5,7 @@ use thaw_utils::{class_list, mount_style, StoredMaybeSignal};
|
||||||
pub fn MessageBar(
|
pub fn MessageBar(
|
||||||
#[prop(optional, into)] class: MaybeProp<String>,
|
#[prop(optional, into)] class: MaybeProp<String>,
|
||||||
#[prop(optional, into)] layout: MaybeSignal<MessageBarLayout>,
|
#[prop(optional, into)] layout: MaybeSignal<MessageBarLayout>,
|
||||||
|
/// Default designs announcement presets.
|
||||||
#[prop(optional, into)] intent: MaybeSignal<MessageBarIntent>,
|
#[prop(optional, into)] intent: MaybeSignal<MessageBarIntent>,
|
||||||
children: Children,
|
children: Children,
|
||||||
) -> impl IntoView {
|
) -> impl IntoView {
|
||||||
|
|
|
@ -17,6 +17,7 @@ pub fn Popover(
|
||||||
#[prop(optional)] trigger_type: PopoverTriggerType,
|
#[prop(optional)] trigger_type: PopoverTriggerType,
|
||||||
popover_trigger: PopoverTrigger,
|
popover_trigger: PopoverTrigger,
|
||||||
#[prop(optional)] placement: PopoverPlacement,
|
#[prop(optional)] placement: PopoverPlacement,
|
||||||
|
/// A popover can appear styled with brand or inverted. When not specified, the default style is used.
|
||||||
#[prop(optional, into)] appearance: Option<MaybeSignal<PopoverAppearance>>,
|
#[prop(optional, into)] appearance: Option<MaybeSignal<PopoverAppearance>>,
|
||||||
children: Children,
|
children: Children,
|
||||||
) -> impl IntoView {
|
) -> impl IntoView {
|
||||||
|
|
|
@ -5,6 +5,8 @@ use thaw_utils::{class_list, mount_style};
|
||||||
pub fn ProgressBar(
|
pub fn ProgressBar(
|
||||||
#[prop(optional, into)] class: MaybeProp<String>,
|
#[prop(optional, into)] class: MaybeProp<String>,
|
||||||
#[prop(into, optional)] value: MaybeSignal<f64>,
|
#[prop(into, optional)] value: MaybeSignal<f64>,
|
||||||
|
/// The maximum value, which indicates the task is complete.
|
||||||
|
/// The ProgressBar bar will be full when value equals max.
|
||||||
#[prop(default = 1.0.into(), optional)] max: MaybeSignal<f64>,
|
#[prop(default = 1.0.into(), optional)] max: MaybeSignal<f64>,
|
||||||
#[prop(into, optional)] color: MaybeSignal<ProgressBarColor>,
|
#[prop(into, optional)] color: MaybeSignal<ProgressBarColor>,
|
||||||
) -> impl IntoView {
|
) -> impl IntoView {
|
||||||
|
|
|
@ -10,6 +10,7 @@ use thaw_utils::{class_list, mount_style};
|
||||||
pub fn Radio(
|
pub fn Radio(
|
||||||
#[prop(optional, into)] class: MaybeProp<String>,
|
#[prop(optional, into)] class: MaybeProp<String>,
|
||||||
#[prop(optional, into)] value: String,
|
#[prop(optional, into)] value: String,
|
||||||
|
/// The Radio's label.
|
||||||
#[prop(optional, into)] label: MaybeProp<String>,
|
#[prop(optional, into)] label: MaybeProp<String>,
|
||||||
) -> impl IntoView {
|
) -> impl IntoView {
|
||||||
mount_style("radio", include_str!("./radio.css"));
|
mount_style("radio", include_str!("./radio.css"));
|
||||||
|
|
|
@ -4,6 +4,7 @@ use thaw_utils::{class_list, OptionModel};
|
||||||
#[component]
|
#[component]
|
||||||
pub fn RadioGroup(
|
pub fn RadioGroup(
|
||||||
#[prop(optional, into)] class: MaybeProp<String>,
|
#[prop(optional, into)] class: MaybeProp<String>,
|
||||||
|
/// The selected Radio item in this group.
|
||||||
#[prop(optional, into)] value: OptionModel<String>,
|
#[prop(optional, into)] value: OptionModel<String>,
|
||||||
/// The name of this radio group.
|
/// The name of this radio group.
|
||||||
#[prop(optional, into)]
|
#[prop(optional, into)]
|
||||||
|
|
Loading…
Add table
Reference in a new issue