Skip to content

Commit b799844

Browse files
committed
update readme
1 parent 1b8a5ac commit b799844

File tree

2 files changed

+92
-14
lines changed

2 files changed

+92
-14
lines changed

README.md

+29-14
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
1-
# tree.el
1+
# <u1-tree1> - element
22
treeview component (beta)
33

44
## Ussage
5+
56
```html
6-
<u1-tree1>
7-
<u1-tree1>
8-
Folder 1
9-
<u1-tree1>
10-
<span slot=icon>📄</span>
11-
File 1.1
12-
</u1-tree1>
7+
<u1-tree1 aria-expanded=true>root
8+
<u1-tree1 aria-expanded=true>Folder 1
9+
<u1-tree1>File 1.1</u1-tree1>
10+
<u1-tree1>File 1.2</u1-tree1>
1311
</u1-tree1>
14-
<u1-tree1>
15-
<span slot=icon>📄</span>
16-
File 3
12+
<u1-tree1>Folder 3
13+
<u1-tree1>File 3.1</u1-tree1>
14+
<u1-tree1>File 3.2</u1-tree1>
1715
</u1-tree1>
1816
</u1-tree1>
19-
```
17+
```
2018

2119
## Settings
2220

@@ -32,7 +30,6 @@ This is either not expandable or like aria-expanded="false" if it has children.
3230
This indicates, that the node has to be loaded.
3331
The `u1-tree1-collapse` event will get a property `event.load(promise)` to load their children.
3432

35-
3633
## Events
3734

3835
### expand / collapse
@@ -49,15 +46,33 @@ treeElement.addEventListener('u1-tree1-select', (e) => { ... });
4946
```
5047

5148
## API
49+
5250
```js
5351
el.select();
5452
el.toggleExpand(true/false);
5553
```
5654

55+
## Demos
5756

57+
https://raw.githack.com/u1ui/tree1.el/main/tests/custom.html
58+
https://raw.githack.com/u1ui/tree1.el/main/tests/minimal.html
59+
https://raw.githack.com/u1ui/tree1.el/main/tests/test.html
60+
61+
## Install
62+
63+
```html
64+
<link href="https://cdn.jsdelivr.net/gh/u1ui/tree1.el@1.0.0/tree1.min.css" rel=stylesheet>
65+
<script src="https://cdn.jsdelivr.net/gh/u1ui/tree1.el@1.0.0/tree1.min.js" type=module>
66+
```
67+
68+
## Demo
5869
59-
## Demos
6070
https://raw.githack.com/u1ui/tree1.el/main/tests/custom.html
6171
https://raw.githack.com/u1ui/tree1.el/main/tests/minimal.html
6272
https://raw.githack.com/u1ui/tree1.el/main/tests/test.html
6373
74+
## About
75+
76+
- MIT License, Copyright (c) 2022 <u1> (like all repositories in this organization) <br>
77+
- Suggestions, ideas, finding bugs and making pull requests make us very happy. ♥
78+

README.old.md

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# tree.el
2+
treeview component (beta)
3+
4+
## Ussage
5+
```html
6+
<u1-tree1>
7+
<u1-tree1>
8+
Folder 1
9+
<u1-tree1>
10+
<span slot=icon>📄</span>
11+
File 1.1
12+
</u1-tree1>
13+
</u1-tree1>
14+
<u1-tree1>
15+
<span slot=icon>📄</span>
16+
File 3
17+
</u1-tree1>
18+
</u1-tree1>
19+
```
20+
21+
## Settings
22+
23+
### aria-expanded
24+
This will initialy expand the tree:
25+
```<u1-tree1 aria-expanded="true">...</u1-tree1>```
26+
27+
This is either not expandable or like aria-expanded="false" if it has children.
28+
`<u1-tree1></u1-tree1>
29+
30+
### aria-live
31+
`<u1-tree1 aria-live></u1-tree1>`
32+
This indicates, that the node has to be loaded.
33+
The `u1-tree1-collapse` event will get a property `event.load(promise)` to load their children.
34+
35+
36+
## Events
37+
38+
### expand / collapse
39+
```js
40+
treeElement.addEventListener('u1-tree1-expand', (e) => {
41+
e.load && e.load(promise);
42+
});
43+
treeElement.addEventListener('u1-tree1-collapse', (e) => {...});
44+
```
45+
46+
### select
47+
```js
48+
treeElement.addEventListener('u1-tree1-select', (e) => { ... });
49+
```
50+
51+
## API
52+
```js
53+
el.select();
54+
el.toggleExpand(true/false);
55+
```
56+
57+
58+
59+
## Demos
60+
https://raw.githack.com/u1ui/tree1.el/main/tests/custom.html
61+
https://raw.githack.com/u1ui/tree1.el/main/tests/minimal.html
62+
https://raw.githack.com/u1ui/tree1.el/main/tests/test.html
63+

0 commit comments

Comments
 (0)