mirror of
https://github.com/adoyle0/thaw.git
synced 2025-01-22 22:09:22 -05:00
feat(lepots-v0.7): demo component
This commit is contained in:
parent
5188f95704
commit
9557637496
5 changed files with 72 additions and 54 deletions
|
@ -17,6 +17,7 @@ palette = "0.7.4"
|
||||||
chrono = "0.4.33"
|
chrono = "0.4.33"
|
||||||
cfg-if = "1.0.0"
|
cfg-if = "1.0.0"
|
||||||
leptos-use = "0.10.10"
|
leptos-use = "0.10.10"
|
||||||
|
send_wrapper = "0.6"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["csr"]
|
default = ["csr"]
|
||||||
|
|
|
@ -50,46 +50,59 @@ fn TheRouter(is_routing: RwSignal<bool>) -> impl IntoView {
|
||||||
<Route path=(StaticSegment("development"), StaticSegment("components")) view=DevelopmentComponentsMdPage/>
|
<Route path=(StaticSegment("development"), StaticSegment("components")) view=DevelopmentComponentsMdPage/>
|
||||||
</ParentRoute>
|
</ParentRoute>
|
||||||
<ParentRoute path=StaticSegment("components") view=ComponentsPage>
|
<ParentRoute path=StaticSegment("components") view=ComponentsPage>
|
||||||
|
|
||||||
// // <Route path="/tabbar" view=TabbarPage/>
|
// // <Route path="/tabbar" view=TabbarPage/>
|
||||||
// // <Route path="/nav-bar" view=NavBarPage/>
|
// // <Route path="/nav-bar" view=NavBarPage/>
|
||||||
// // <Route path="/toast" view=ToastPage/>
|
// // <Route path="/toast" view=ToastPage/>
|
||||||
// <Route path=StaticSegment("accordion") view=AccordionMdPage/>
|
{
|
||||||
// <Route path=StaticSegment("anchor") view=AnchorMdPage/>
|
view! {
|
||||||
// <Route path=StaticSegment("auto-complete") view=AutoCompleteMdPage/>
|
<Route path=StaticSegment("accordion") view=AccordionMdPage/>
|
||||||
// <Route path=StaticSegment("avatar") view=AvatarMdPage/>
|
<Route path=StaticSegment("anchor") view=AnchorMdPage/>
|
||||||
// <Route path=StaticSegment("back-top") view=BackTopMdPage/>
|
<Route path=StaticSegment("auto-complete") view=AutoCompleteMdPage/>
|
||||||
// <Route path=StaticSegment("badge") view=BadgeMdPage/>
|
<Route path=StaticSegment("avatar") view=AvatarMdPage/>
|
||||||
// <Route path=StaticSegment("breadcrumb") view=BreadcrumbMdPage/>
|
<Route path=StaticSegment("back-top") view=BackTopMdPage/>
|
||||||
<Route path=StaticSegment("button") view=ButtonMdPage/>
|
<Route path=StaticSegment("badge") view=BadgeMdPage/>
|
||||||
<Route path=StaticSegment("calendar") view=CalendarMdPage/>
|
<Route path=StaticSegment("breadcrumb") view=BreadcrumbMdPage/>
|
||||||
<Route path=StaticSegment("card") view=CardMdPage/>
|
<Route path=StaticSegment("button") view=ButtonMdPage/>
|
||||||
<Route path=StaticSegment("checkbox") view=CheckboxMdPage/>
|
<Route path=StaticSegment("calendar") view=CalendarMdPage/>
|
||||||
<Route path=StaticSegment("color-picker") view=ColorPickerMdPage/>
|
<Route path=StaticSegment("card") view=CardMdPage/>
|
||||||
<Route path=StaticSegment("combobox") view=ComboboxMdPage/>
|
<Route path=StaticSegment("checkbox") view=CheckboxMdPage/>
|
||||||
<Route path=StaticSegment("config-provider") view=ConfigProviderMdPage/>
|
<Route path=StaticSegment("color-picker") view=ColorPickerMdPage/>
|
||||||
<Route path=StaticSegment("date-picker") view=DatePickerMdPage/>
|
<Route path=StaticSegment("combobox") view=ComboboxMdPage/>
|
||||||
<Route path=StaticSegment("dialog") view=DialogMdPage/>
|
<Route path=StaticSegment("config-provider") view=ConfigProviderMdPage/>
|
||||||
<Route path=StaticSegment("divider") view=DividerMdPage/>
|
}
|
||||||
<Route path=StaticSegment("drawer") view=DrawerMdPage/>
|
}
|
||||||
<Route path=StaticSegment("grid") view=GridMdPage/>
|
{
|
||||||
// <Route path=StaticSegment("icon") view=IconMdPage/>
|
view! {
|
||||||
// <Route path=StaticSegment("image") view=ImageMdPage/>
|
<Route path=StaticSegment("date-picker") view=DatePickerMdPage/>
|
||||||
// <Route path=StaticSegment("input") view=InputMdPage/>
|
<Route path=StaticSegment("dialog") view=DialogMdPage/>
|
||||||
// <Route path=StaticSegment("layout") view=LayoutMdPage/>
|
<Route path=StaticSegment("divider") view=DividerMdPage/>
|
||||||
// <Route path=StaticSegment("loading-bar") view=LoadingBarMdPage/>
|
<Route path=StaticSegment("drawer") view=DrawerMdPage/>
|
||||||
// <Route path="/message" view=MessageMdPage/>
|
<Route path=StaticSegment("grid") view=GridMdPage/>
|
||||||
// <Route path=StaticSegment("message-bar") view=MessageBarMdPage/>
|
<Route path=StaticSegment("icon") view=IconMdPage/>
|
||||||
// <Route path=StaticSegment("popover") view=PopoverMdPage/>
|
<Route path=StaticSegment("image") view=ImageMdPage/>
|
||||||
// <Route path=StaticSegment("progress-bar") view=ProgressBarMdPage/>
|
<Route path=StaticSegment("input") view=InputMdPage/>
|
||||||
// <Route path=StaticSegment("radio") view=RadioMdPage/>
|
<Route path=StaticSegment("layout") view=LayoutMdPage/>
|
||||||
// <Route path=StaticSegment("scrollbar") view=ScrollbarMdPage/>
|
<Route path=StaticSegment("loading-bar") view=LoadingBarMdPage/>
|
||||||
// // <Route path="/select" view=SelectMdPage/>
|
// <Route path="/message" view=MessageMdPage/>
|
||||||
// <Route path=StaticSegment("skeleton") view=SkeletonMdPage/>
|
<Route path=StaticSegment("message-bar") view=MessageBarMdPage/>
|
||||||
// <Route path=StaticSegment("slider") view=SliderMdPage/>
|
<Route path=StaticSegment("popover") view=PopoverMdPage/>
|
||||||
// <Route path=StaticSegment("space") view=SpaceMdPage/>
|
<Route path=StaticSegment("progress-bar") view=ProgressBarMdPage/>
|
||||||
// <Route path=StaticSegment("spin-button") view=SpinButtonMdPage/>
|
<Route path=StaticSegment("radio") view=RadioMdPage/>
|
||||||
// <Route path=StaticSegment("spinner") view=SpinnerMdPage/>
|
}
|
||||||
// <Route path=StaticSegment("switch") view=SwitchMdPage/>
|
}
|
||||||
|
{
|
||||||
|
view! {
|
||||||
|
<Route path=StaticSegment("scrollbar") view=ScrollbarMdPage/>
|
||||||
|
// <Route path="/select" view=SelectMdPage/>
|
||||||
|
<Route path=StaticSegment("skeleton") view=SkeletonMdPage/>
|
||||||
|
<Route path=StaticSegment("slider") view=SliderMdPage/>
|
||||||
|
<Route path=StaticSegment("space") view=SpaceMdPage/>
|
||||||
|
<Route path=StaticSegment("spin-button") view=SpinButtonMdPage/>
|
||||||
|
<Route path=StaticSegment("spinner") view=SpinnerMdPage/>
|
||||||
|
<Route path=StaticSegment("switch") view=SwitchMdPage/>
|
||||||
|
}
|
||||||
|
}
|
||||||
// <Route path=StaticSegment("tab-list") view=TabListMdPage/>
|
// <Route path=StaticSegment("tab-list") view=TabListMdPage/>
|
||||||
// <Route path=StaticSegment("table") view=TableMdPage/>
|
// <Route path=StaticSegment("table") view=TableMdPage/>
|
||||||
// <Route path=StaticSegment("tag") view=TagMdPage/>
|
// <Route path=StaticSegment("tag") view=TagMdPage/>
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
# Upload
|
# Upload
|
||||||
|
|
||||||
```rust demo
|
```rust demo
|
||||||
|
use send_wrapper::SendWrapper;
|
||||||
|
|
||||||
let message = use_message();
|
let message = use_message();
|
||||||
let custom_request = move |file_list| {
|
let custom_request = move |file_list: SendWrapper<FileList>| {
|
||||||
message.create(
|
message.create(
|
||||||
format!("Number of uploaded files: {}", file_list.length()),
|
format!("Number of uploaded files: {}", file_list.length()),
|
||||||
MessageVariant::Success,
|
MessageVariant::Success,
|
||||||
|
@ -22,8 +24,10 @@ view!{
|
||||||
### Drag to upload
|
### Drag to upload
|
||||||
|
|
||||||
```rust demo
|
```rust demo
|
||||||
|
use send_wrapper::SendWrapper;
|
||||||
|
|
||||||
let message = use_message();
|
let message = use_message();
|
||||||
let custom_request = move |file_list| {
|
let custom_request = move |file_list: SendWrapper<FileList>| {
|
||||||
message.create(
|
message.create(
|
||||||
format!("Number of uploaded files: {}", file_list.length()),
|
format!("Number of uploaded files: {}", file_list.length()),
|
||||||
MessageVariant::Success,
|
MessageVariant::Success,
|
||||||
|
|
|
@ -54,26 +54,26 @@ pub fn include_md(_token_stream: proc_macro::TokenStream) -> proc_macro::TokenSt
|
||||||
"LayoutMdPage" => "../docs/layout/mod.md",
|
"LayoutMdPage" => "../docs/layout/mod.md",
|
||||||
"LoadingBarMdPage" => "../docs/loading_bar/mod.md",
|
"LoadingBarMdPage" => "../docs/loading_bar/mod.md",
|
||||||
// "MessageMdPage" => "../docs/message/mod.md",
|
// "MessageMdPage" => "../docs/message/mod.md",
|
||||||
"MessageBarMdPage" => "../docs/message_bar/mod.md"
|
"MessageBarMdPage" => "../docs/message_bar/mod.md",
|
||||||
// "PopoverMdPage" => "../docs/popover/mod.md",
|
"PopoverMdPage" => "../docs/popover/mod.md",
|
||||||
// "ProgressBarMdPage" => "../docs/progress_bar/mod.md",
|
"ProgressBarMdPage" => "../docs/progress_bar/mod.md",
|
||||||
// "RadioMdPage" => "../docs/radio/mod.md",
|
"RadioMdPage" => "../docs/radio/mod.md",
|
||||||
// "ScrollbarMdPage" => "../docs/scrollbar/mod.md",
|
"ScrollbarMdPage" => "../docs/scrollbar/mod.md",
|
||||||
// // "SelectMdPage" => "../docs/select/mod.md",
|
// "SelectMdPage" => "../docs/select/mod.md",
|
||||||
// "SkeletonMdPage" => "../docs/skeleton/mod.md",
|
"SkeletonMdPage" => "../docs/skeleton/mod.md",
|
||||||
// "SliderMdPage" => "../docs/slider/mod.md",
|
"SliderMdPage" => "../docs/slider/mod.md",
|
||||||
// "SpaceMdPage" => "../docs/space/mod.md",
|
"SpaceMdPage" => "../docs/space/mod.md",
|
||||||
// "SpinButtonMdPage" => "../docs/spin_button/mod.md",
|
"SpinButtonMdPage" => "../docs/spin_button/mod.md",
|
||||||
// "SpinnerMdPage" => "../docs/spinner/mod.md",
|
"SpinnerMdPage" => "../docs/spinner/mod.md",
|
||||||
// "SwitchMdPage" => "../docs/switch/mod.md",
|
"SwitchMdPage" => "../docs/switch/mod.md"
|
||||||
// "TabListMdPage" => "../docs/tab_list/mod.md",
|
// "TabListMdPage" => "../docs/tab_list/mod.md",
|
||||||
// "TableMdPage" => "../docs/table/mod.md",
|
// "TableMdPage" => "../docs/table/mod.md",
|
||||||
// "TagMdPage" => "../docs/tag/mod.md",
|
// "TagMdPage" => "../docs/tag/mod.md",
|
||||||
// "TextareaMdPage" => "../docs/textarea/mod.md",
|
// "TextareaMdPage" => "../docs/textarea/mod.md",
|
||||||
// "TimePickerMdPage" => "../docs/time_picker/mod.md",
|
// "TimePickerMdPage" => "../docs/time_picker/mod.md",
|
||||||
// "TextMdPage" => "../docs/text/mod.md",
|
// "TextMdPage" => "../docs/text/mod.md",
|
||||||
// "ToastMdPage" => "../docs/toast/mod.md",
|
// // "ToastMdPage" => "../docs/toast/mod.md",
|
||||||
// "UploadMdPage" => "../docs/upload/mod.md"
|
// // "UploadMdPage" => "../docs/upload/mod.md"
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut fn_list = vec![];
|
let mut fn_list = vec![];
|
||||||
|
|
|
@ -11,7 +11,7 @@ use thaw_utils::{add_event_listener, mount_style};
|
||||||
pub fn Upload(
|
pub fn Upload(
|
||||||
#[prop(optional, into)] accept: MaybeSignal<String>,
|
#[prop(optional, into)] accept: MaybeSignal<String>,
|
||||||
#[prop(optional, into)] multiple: MaybeSignal<bool>,
|
#[prop(optional, into)] multiple: MaybeSignal<bool>,
|
||||||
#[prop(optional, into)] custom_request: Option<Callback<SendWrapper<FileList>, ()>>,
|
#[prop(optional, into)] custom_request: Option<Callback<SendWrapper<FileList>>>,
|
||||||
children: Children,
|
children: Children,
|
||||||
) -> impl IntoView {
|
) -> impl IntoView {
|
||||||
mount_style("upload", include_str!("./upload.css"));
|
mount_style("upload", include_str!("./upload.css"));
|
||||||
|
|
Loading…
Add table
Reference in a new issue