Skip to content

Commit 7fb05c8

Browse files
committed
Initial <task-lists> element
0 parents  commit 7fb05c8

16 files changed

+7402
-0
lines changed

.eslintrc.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": [
3+
"plugin:github/es6",
4+
"plugin:github/browser",
5+
"plugin:github/flow"
6+
]
7+
}

.flowconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[ignore]
2+
3+
[include]
4+
5+
[libs]
6+
7+
[options]
8+
9+
[lints]

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dist/
2+
node_modules/

LICENSE

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2018 GitHub, Inc.
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is
8+
furnished to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19+
SOFTWARE.

README.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# &lt;task-lists&gt; element
2+
3+
Drag and drop task list items.
4+
5+
## Installation
6+
7+
```
8+
$ npm install --save @github/task-lists-element
9+
```
10+
11+
## Usage
12+
13+
```js
14+
import '@github/task-lists-element'
15+
```
16+
17+
```html
18+
<task-lists sortable>
19+
<ul class="contains-task-list">
20+
<li class="task-list-item">
21+
<input type="checkbox" class="task-list-item-checkbox">
22+
Hubot
23+
</li>
24+
<li class="task-list-item">
25+
<input type="checkbox" class="task-list-item-checkbox">
26+
Bender
27+
</li>
28+
</ul>
29+
30+
<ul class="contains-task-list">
31+
<li class="task-list-item">
32+
<input type="checkbox" class="task-list-item-checkbox">
33+
BB-8
34+
</li>
35+
<li class="task-list-item">
36+
<input type="checkbox" class="task-list-item-checkbox">
37+
WALL-E
38+
</li>
39+
</ul>
40+
</task-lists>
41+
```
42+
43+
## Events
44+
45+
```js
46+
const list = document.querySelector('task-lists')
47+
48+
list.addEventListener('task-lists:check', function(event) {
49+
const {position, checked} = event.detail
50+
console.log(position, checked)
51+
})
52+
53+
list.addEventListener('task-lists:move', function(event) {
54+
const {src, dst} = event.detail
55+
console.log(src, dst)
56+
})
57+
```
58+
59+
## Browser support
60+
61+
- Chrome
62+
- Firefox
63+
- Safari 9+
64+
- Internet Explorer 11
65+
- Microsoft Edge
66+
67+
## Development
68+
69+
```
70+
npm install
71+
npm test
72+
```
73+
74+
## License
75+
76+
Distributed under the MIT license. See LICENSE for details.

0 commit comments

Comments
 (0)