Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/github/check-all
Multiple checkbox selection helper.
https://github.com/github/check-all
decorator
Last synced: about 1 month ago
JSON representation
Multiple checkbox selection helper.
- Host: GitHub
- URL: https://github.com/github/check-all
- Owner: github
- License: mit
- Created: 2018-08-30T17:20:31.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2024-09-23T14:19:06.000Z (about 2 months ago)
- Last Synced: 2024-09-25T07:36:32.437Z (about 2 months ago)
- Topics: decorator
- Language: JavaScript
- Homepage: http://github.github.io/check-all/examples
- Size: 811 KB
- Stars: 80
- Watchers: 263
- Forks: 17
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# Check All
- Check/uncheck `[data-check-all]` to check/uncheck all checkboxes in a container.
- Shift click on `[data-check-all-item]` to select all checkboxes between the last checked checkbox and the target checkbox.
- Auto-update `[data-check-all-count]` to count of checked items.## Installation
```
$ npm install @github/check-all
```## Usage
### JS
```js
import checkAll from '@github/check-all'
checkAll(document.querySelector('[data-check-all-container]'))
```Using a library like [selector-observer](https://github.com/josh/selector-observer), the behavior can automatically be applied to any container matching a selector.
```js
import {observe} from 'selector-observer'
import checkAll from '@github/check-all'observe('[data-check-all-container]', { subscribe: checkAll })
```### HTML
```html
Count: 0
Check All
github/fetch
github/textarea-autosize
github/eventlistener-polyfill
github/quote-selection
```## Development
```
npm install
npm test
```## License
Distributed under the MIT license. See LICENSE for details.