zu/filled_input/
mod.rs

1// Copyright (c) 2024 Xu Shaohua <shaohua@biofan.org>. All rights reserved.
2// Use of this source is governed by Lesser General Public License
3// that can be found in the LICENSE file.
4
5use yew::{function_component, html, AttrValue, Callback, Classes, Html, Properties};
6
7use crate::styles::color::Color;
8use crate::styles::input_type::InputType;
9
10#[derive(Debug, Clone, PartialEq, Properties)]
11pub struct Props {
12    #[prop_or_default]
13    pub aria_described_by: AttrValue,
14
15    #[prop_or_default]
16    pub auto_complete: AttrValue,
17
18    #[prop_or_default]
19    pub auto_focus: bool,
20
21    #[prop_or_default]
22    pub classes: Classes,
23
24    #[prop_or_default]
25    pub color: Color,
26
27    #[prop_or_default]
28    pub default_value: AttrValue,
29
30    // pub default_value: AttrValue,
31    #[prop_or(false)]
32    pub disabled: bool,
33
34    #[prop_or(false)]
35    pub disable_underline: bool,
36
37    #[prop_or_default]
38    pub end_adornment: Option<Html>,
39
40    #[prop_or(false)]
41    pub error: bool,
42
43    #[prop_or(false)]
44    pub full_width: bool,
45
46    #[prop_or(false)]
47    pub hidden_label: bool,
48
49    #[prop_or_default]
50    pub id: AttrValue,
51
52    #[prop_or_default]
53    pub input_component: AttrValue,
54
55    #[prop_or(false)]
56    pub dense_margin: bool,
57
58    #[prop_or_default]
59    pub max_rows: Option<i32>,
60
61    #[prop_or_default]
62    pub min_rows: Option<i32>,
63
64    #[prop_or(false)]
65    pub multiline: bool,
66
67    #[prop_or_default]
68    pub name: AttrValue,
69
70    #[prop_or_default]
71    pub on_blur: Option<Callback<()>>,
72
73    /// Callback fired when the value is changed.
74    #[prop_or_default]
75    pub on_change: Option<Callback<AttrValue>>,
76
77    #[prop_or_default]
78    pub on_focus: Option<Callback<()>>,
79
80    #[prop_or_default]
81    pub placeholder: AttrValue,
82
83    #[prop_or(false)]
84    pub read_only: bool,
85
86    #[prop_or(false)]
87    pub required: bool,
88
89    #[prop_or_default]
90    pub rows: Option<i32>,
91
92    #[prop_or_default]
93    pub start_adornment: Option<Html>,
94
95    #[prop_or_default]
96    pub style: AttrValue,
97
98    /// Default is "text".
99    #[prop_or_default]
100    pub input_type: InputType,
101
102    #[prop_or_default]
103    pub value: AttrValue,
104}
105
106#[function_component(FilledInput)]
107pub fn filled_input(_props: &Props) -> Html {
108    html! {
109        <>
110        </>
111    }
112}