Skip to content

Commit 897c14a

Browse files
committed
add components
1 parent 4b4fc27 commit 897c14a

35 files changed

+819
-124
lines changed

docs/v0.1.0/en/api/option/network.mdx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,17 @@ plugin! {
5050
### Use in Component
5151

5252
```rust
53-
#[before_create]
54-
fn before_create(){
55-
let _ = http_get!(http_response1);
56-
}
53+
impl MyView{
54+
#[before_mount]
55+
fn before_create(&mut self){
56+
let _ = http_get!(http_response1);
57+
}
5758

58-
#[http_response]
59-
fn http_response1(response: &HttpResponse){
60-
dbg!("response");
61-
if response.status_code == 200 {
62-
// ...
59+
#[http_response]
60+
fn http_response1(&mut self, response: &HttpResponse){
61+
if response.status_code == 200 {
62+
// ...
63+
}
6364
}
6465
}
6566
```

docs/v0.1.0/en/components/_meta.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,10 @@
1818
"type": "dir",
1919
"name": "data",
2020
"label": "Data Components"
21+
},
22+
{
23+
"type": "dir",
24+
"name": "feedback",
25+
"label": "Feedback Components"
2126
}
2227
]

docs/v0.1.0/en/components/basic/image.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Please make sure the image address exists before use. Use the `dep` built-in fun
1515
<image src="dep('crate://self/resources/genui.png')"></image>
1616
```
1717

18-
## Attributes
18+
## Props
1919

2020
| Name | Description | Type |
2121
| ---------------- | ---------------------- | ---------------- |

docs/v0.1.0/en/components/basic/svg.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Make sure the icon address exists before use. Use the `dep` built-in function to
1212
<svg src="dep('crate://self/resources/genui.svg')"></svg>
1313
```
1414

15-
## Attributes
15+
## Props
1616

1717
| Name | Description | Type |
1818
| -------------------- | -------------------------- | ---------------- |
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
[]
1+
[
2+
"tag",
3+
"loading",
4+
"collapse"
5+
]
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# `collapse`
2+
3+
Use the folding panel to store content area
4+
5+
## Example
6+
7+
### Basic usage
8+
9+
```html
10+
<collapse height="180.0" width="300.0" position="Bottom" opened="false">
11+
<view as_prop="header" theme="Info" height="40.0">
12+
<label text="'default collapse'"></label>
13+
</view>
14+
<view as_prop="body" theme="Error" height="140.0"></view>
15+
</collapse>
16+
```
17+
18+
## Properties
19+
20+
| Name | Description | Type |
21+
| ---------------- | ----------------------------- | ------------- |
22+
| `rect_size` | Rectangle size | `F64` |
23+
| `opened` | Whether to open | `bool` |
24+
| `fold` | Folding degree | `F64` |
25+
| `cursor` | Cursor type | `MouseCursor` |
26+
| `grab_key_focus` | Whether to get keyboard focus | `bool` |
27+
| `visible` | Is it visible | `bool` |
28+
| `animation_key` | Is animation enabled | `bool` |
29+
| `position` | Position parameter | `Position4` |
30+
| `event_key` | Event identifier | `bool` |
31+
| `abs_pos` | Absolute position | `DVec2` |
32+
| `margin` | Margin | `Margin` |
33+
| `width` | Width | `Size` |
34+
| `height` | Height | `Size` |
35+
| `scroll` | Scroll offset | `DVec2` |
36+
| `clip_x` | Clip X axis or not | `bool` |
37+
| `clip_y` | Clip Y axis or not | `bool` |
38+
| `padding` | Padding | `Padding` |
39+
| `align` | Alignment | `Align` |
40+
| `flow` | Flow | `Flow` |
41+
| `spacing` | Spacing | `F64` |
42+
43+
## Event callback
44+
45+
| Name | Description | Parameters |
46+
| -------- | ----------- | ------------------ |
47+
| `hover` | Hover event | `FingerHoverEvent` |
48+
| `opened` | Open event | `FingerUpEvent` |
49+
| `closed` | Close event | `FingerUpEvent` |
50+
51+
## Slots
52+
53+
- header
54+
- body
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# `loading`
2+
3+
Display animation while loading data.
4+
5+
## Example
6+
7+
### Basic usage
8+
9+
```
10+
<loading theme="Error"></loading>
11+
<loading loading_type="DotLine"></loading>
12+
```
13+
14+
## Properties
15+
16+
| Name | Description | Type |
17+
| --------------- | ------------------ | -------------- |
18+
| `theme` | Themes | `Themes` |
19+
| `stroke_color` | Outline color | `MakepadColor` |
20+
| `loading_type` | Loading type | `GLoadingType` |
21+
| `visible` | Visible | `bool` |
22+
| `animation_key` | Enable animation | `bool` |
23+
| `event_key` | Event identifier | `bool` |
24+
| `abs_pos` | Absolute position | `DVec2` |
25+
| `margin` | Margin | `Margin` |
26+
| `width` | Width | `Size` |
27+
| `height` | Height | `Size` |
28+
| `scroll` | Scroll offset | `DVec2` |
29+
| `clip_x` | Clip X axis or not | `bool` |
30+
| `clip_y` | Clip Y axis or not | `bool` |
31+
| `padding` | Padding | `Padding` |
32+
| `align` | Alignment | `Align` |
33+
| `flow` | Flow | `Flow` |
34+
| `spacing` | Spacing | `F64` |
35+
36+
## Event callback
37+
38+
| Name | Description | Parameters |
39+
| -------- | ----------- | -------------------- |
40+
| `opened` | Open event | `GLoadingEventParam` |
41+
| `closed` | Close event | `GLoadingEventParam` |
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# `tag`
2+
3+
Used for marking and selection
4+
5+
## Example
6+
7+
### Basic usage
8+
9+
```html
10+
<tag text="'tag 1'"></tag>
11+
<tag text="'hello'" color="#ff0000" theme="Error"></tag>
12+
```
13+
14+
### Closeable
15+
16+
```html
17+
<tag text="'hello'" closeable></tag>
18+
```
19+
20+
## Attributes
21+
22+
| Name | Description | Type |
23+
| -------------------- | --------------------------------- | ---------------- |
24+
| `theme` | Themes | `Themes` |
25+
| `background_color` | Background color | `MakepadColor` |
26+
| `background_visible` | Whether to display the background | `bool` |
27+
| `hover_color` | Hover color | `MakepadColor` |
28+
| `stroke_hover_color` | Border hover color | `MakepadColor` |
29+
| `text_hover_color` | Text hover color | `MakepadColor` |
30+
| `focus_color` | Focus color | `MakepadColor` |
31+
| `stroke_focus_color` | Border focus color | `MakepadColor` |
32+
| `text_focus_color` | Text focus color | `MakepadColor` |
33+
| `border_color` | Border color | `MakepadColor` |
34+
| `border_width` | Border width | `F32` |
35+
| `border_radius` | Border radius | `F32` |
36+
| `shadow_color` | Shadow color | `MakepadColor` |
37+
| `spread_radius` | Shadow spread radius | `F32` |
38+
| `blur_radius` | Shadow blur radius | `F32` |
39+
| `shadow_offset` | Shadow offset | `Vec2` |
40+
| `text` | Text content | `String` |
41+
| `font_size` | Font size | `F64` |
42+
| `color` | Font color | `MakepadColor` |
43+
| `font_family` | Font family | `LiveDependency` |
44+
| `height_factor` | Height factor | `F64` |
45+
| `line_scale` | Line spacing ratio | `F64` |
46+
| `cursor` | Mouse pointer | `MouseCursor` |
47+
| `closeable` | Closeable | `bool` |
48+
| `src` | Resource path | `LiveDependency` |
49+
| `icon_brightness` | Icon brightness | `F32` |
50+
| `icon_curve` | Icon curve | `F32` |
51+
| `icon_linearize` | Icon linearization | `F32` |
52+
| `icon_scale` | Icon scaling | `F64` |
53+
| `icon_color` | Icon color | `MakepadColor` |
54+
| `icon_draw_depth` | Icon drawing depth | `F32` |
55+
| `visible` | Visible or not | `bool` |
56+
| `text_walk` | Text layout parameters | `TextWalk` |
57+
| `grab_key_focus` | Whether to get keyboard focus | `bool` |
58+
| `icon_walk` | Icon layout parameters | `Walk` |
59+
| `icon_layout | Icon layout | `Layout` |
60+
| `abs_pos` | Absolute position | `DVec2` |
61+
| `margin` | Margin | `Margin` |
62+
| `width` | Width | `Size` |
63+
| `height` | Height | `Size` |
64+
| `scroll` | Scroll offset | `DVec2` |
65+
| `clip_x` | whether to clip X | `bool` |
66+
| `clip_y` | whether to clip Y | `bool` |
67+
| `padding` | inner margin | `Padding` |
68+
| `align` | alignment | `Align` |
69+
| `flow` | flow | `Flow` |
70+
| `spacing` | spacing | `F64` |
71+
| `animation_key` | whether to enable animation | `bool` |
72+
| `event_key` | event identifier | `bool` |
73+
74+
## event callback
75+
76+
| name | description | parameter |
77+
| ------------ | ------------ | -------------------- |
78+
| `clicked` | click event | `GTagClickedParam` |
79+
| `hover_in` | hover in | `GTagHoverParam` |
80+
| `hover_out` | hover out | `GTagHoverParam` |
81+
| `closed` | closed event | `GTagClosedParam` |
82+
| `focus` | get focus | `GTagFocusParam` |
83+
| `focus_lost` | lose focus | `GTagFocusLostParam` |
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[
2+
"dropdown",
3+
"popup",
4+
"dialog",
5+
"tooltip",
6+
"drawer"
7+
]

docs/v0.1.0/en/components/feedback/dialog.mdx

Whitespace-only changes.

0 commit comments

Comments
 (0)