feat(lepots-v0.7): demo component

This commit is contained in:
luoxiao 2024-07-08 00:29:04 +08:00 committed by luoxiaozero
parent 5188f95704
commit 9557637496
5 changed files with 72 additions and 54 deletions

View file

@ -17,6 +17,7 @@ palette = "0.7.4"
chrono = "0.4.33"
cfg-if = "1.0.0"
leptos-use = "0.10.10"
send_wrapper = "0.6"
[features]
default = ["csr"]

View file

@ -50,46 +50,59 @@ fn TheRouter(is_routing: RwSignal<bool>) -> impl IntoView {
<Route path=(StaticSegment("development"), StaticSegment("components")) view=DevelopmentComponentsMdPage/>
</ParentRoute>
<ParentRoute path=StaticSegment("components") view=ComponentsPage>
// // <Route path="/tabbar" view=TabbarPage/>
// // <Route path="/nav-bar" view=NavBarPage/>
// // <Route path="/toast" view=ToastPage/>
// <Route path=StaticSegment("accordion") view=AccordionMdPage/>
// <Route path=StaticSegment("anchor") view=AnchorMdPage/>
// <Route path=StaticSegment("auto-complete") view=AutoCompleteMdPage/>
// <Route path=StaticSegment("avatar") view=AvatarMdPage/>
// <Route path=StaticSegment("back-top") view=BackTopMdPage/>
// <Route path=StaticSegment("badge") view=BadgeMdPage/>
// <Route path=StaticSegment("breadcrumb") view=BreadcrumbMdPage/>
<Route path=StaticSegment("button") view=ButtonMdPage/>
<Route path=StaticSegment("calendar") view=CalendarMdPage/>
<Route path=StaticSegment("card") view=CardMdPage/>
<Route path=StaticSegment("checkbox") view=CheckboxMdPage/>
<Route path=StaticSegment("color-picker") view=ColorPickerMdPage/>
<Route path=StaticSegment("combobox") view=ComboboxMdPage/>
<Route path=StaticSegment("config-provider") view=ConfigProviderMdPage/>
<Route path=StaticSegment("date-picker") view=DatePickerMdPage/>
<Route path=StaticSegment("dialog") view=DialogMdPage/>
<Route path=StaticSegment("divider") view=DividerMdPage/>
<Route path=StaticSegment("drawer") view=DrawerMdPage/>
<Route path=StaticSegment("grid") view=GridMdPage/>
// <Route path=StaticSegment("icon") view=IconMdPage/>
// <Route path=StaticSegment("image") view=ImageMdPage/>
// <Route path=StaticSegment("input") view=InputMdPage/>
// <Route path=StaticSegment("layout") view=LayoutMdPage/>
// <Route path=StaticSegment("loading-bar") view=LoadingBarMdPage/>
// <Route path="/message" view=MessageMdPage/>
// <Route path=StaticSegment("message-bar") view=MessageBarMdPage/>
// <Route path=StaticSegment("popover") view=PopoverMdPage/>
// <Route path=StaticSegment("progress-bar") view=ProgressBarMdPage/>
// <Route path=StaticSegment("radio") view=RadioMdPage/>
// <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/>
{
view! {
<Route path=StaticSegment("accordion") view=AccordionMdPage/>
<Route path=StaticSegment("anchor") view=AnchorMdPage/>
<Route path=StaticSegment("auto-complete") view=AutoCompleteMdPage/>
<Route path=StaticSegment("avatar") view=AvatarMdPage/>
<Route path=StaticSegment("back-top") view=BackTopMdPage/>
<Route path=StaticSegment("badge") view=BadgeMdPage/>
<Route path=StaticSegment("breadcrumb") view=BreadcrumbMdPage/>
<Route path=StaticSegment("button") view=ButtonMdPage/>
<Route path=StaticSegment("calendar") view=CalendarMdPage/>
<Route path=StaticSegment("card") view=CardMdPage/>
<Route path=StaticSegment("checkbox") view=CheckboxMdPage/>
<Route path=StaticSegment("color-picker") view=ColorPickerMdPage/>
<Route path=StaticSegment("combobox") view=ComboboxMdPage/>
<Route path=StaticSegment("config-provider") view=ConfigProviderMdPage/>
}
}
{
view! {
<Route path=StaticSegment("date-picker") view=DatePickerMdPage/>
<Route path=StaticSegment("dialog") view=DialogMdPage/>
<Route path=StaticSegment("divider") view=DividerMdPage/>
<Route path=StaticSegment("drawer") view=DrawerMdPage/>
<Route path=StaticSegment("grid") view=GridMdPage/>
<Route path=StaticSegment("icon") view=IconMdPage/>
<Route path=StaticSegment("image") view=ImageMdPage/>
<Route path=StaticSegment("input") view=InputMdPage/>
<Route path=StaticSegment("layout") view=LayoutMdPage/>
<Route path=StaticSegment("loading-bar") view=LoadingBarMdPage/>
// <Route path="/message" view=MessageMdPage/>
<Route path=StaticSegment("message-bar") view=MessageBarMdPage/>
<Route path=StaticSegment("popover") view=PopoverMdPage/>
<Route path=StaticSegment("progress-bar") view=ProgressBarMdPage/>
<Route path=StaticSegment("radio") view=RadioMdPage/>
}
}
{
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("table") view=TableMdPage/>
// <Route path=StaticSegment("tag") view=TagMdPage/>

View file

@ -1,8 +1,10 @@
# Upload
```rust demo
use send_wrapper::SendWrapper;
let message = use_message();
let custom_request = move |file_list| {
let custom_request = move |file_list: SendWrapper<FileList>| {
message.create(
format!("Number of uploaded files: {}", file_list.length()),
MessageVariant::Success,
@ -22,8 +24,10 @@ view!{
### Drag to upload
```rust demo
use send_wrapper::SendWrapper;
let message = use_message();
let custom_request = move |file_list| {
let custom_request = move |file_list: SendWrapper<FileList>| {
message.create(
format!("Number of uploaded files: {}", file_list.length()),
MessageVariant::Success,

View file

@ -54,26 +54,26 @@ pub fn include_md(_token_stream: proc_macro::TokenStream) -> proc_macro::TokenSt
"LayoutMdPage" => "../docs/layout/mod.md",
"LoadingBarMdPage" => "../docs/loading_bar/mod.md",
// "MessageMdPage" => "../docs/message/mod.md",
"MessageBarMdPage" => "../docs/message_bar/mod.md"
// "PopoverMdPage" => "../docs/popover/mod.md",
// "ProgressBarMdPage" => "../docs/progress_bar/mod.md",
// "RadioMdPage" => "../docs/radio/mod.md",
// "ScrollbarMdPage" => "../docs/scrollbar/mod.md",
// // "SelectMdPage" => "../docs/select/mod.md",
// "SkeletonMdPage" => "../docs/skeleton/mod.md",
// "SliderMdPage" => "../docs/slider/mod.md",
// "SpaceMdPage" => "../docs/space/mod.md",
// "SpinButtonMdPage" => "../docs/spin_button/mod.md",
// "SpinnerMdPage" => "../docs/spinner/mod.md",
// "SwitchMdPage" => "../docs/switch/mod.md",
"MessageBarMdPage" => "../docs/message_bar/mod.md",
"PopoverMdPage" => "../docs/popover/mod.md",
"ProgressBarMdPage" => "../docs/progress_bar/mod.md",
"RadioMdPage" => "../docs/radio/mod.md",
"ScrollbarMdPage" => "../docs/scrollbar/mod.md",
// "SelectMdPage" => "../docs/select/mod.md",
"SkeletonMdPage" => "../docs/skeleton/mod.md",
"SliderMdPage" => "../docs/slider/mod.md",
"SpaceMdPage" => "../docs/space/mod.md",
"SpinButtonMdPage" => "../docs/spin_button/mod.md",
"SpinnerMdPage" => "../docs/spinner/mod.md",
"SwitchMdPage" => "../docs/switch/mod.md"
// "TabListMdPage" => "../docs/tab_list/mod.md",
// "TableMdPage" => "../docs/table/mod.md",
// "TagMdPage" => "../docs/tag/mod.md",
// "TextareaMdPage" => "../docs/textarea/mod.md",
// "TimePickerMdPage" => "../docs/time_picker/mod.md",
// "TextMdPage" => "../docs/text/mod.md",
// "ToastMdPage" => "../docs/toast/mod.md",
// "UploadMdPage" => "../docs/upload/mod.md"
// // "ToastMdPage" => "../docs/toast/mod.md",
// // "UploadMdPage" => "../docs/upload/mod.md"
};
let mut fn_list = vec![];

View file

@ -11,7 +11,7 @@ use thaw_utils::{add_event_listener, mount_style};
pub fn Upload(
#[prop(optional, into)] accept: MaybeSignal<String>,
#[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,
) -> impl IntoView {
mount_style("upload", include_str!("./upload.css"));