Exciting news!Announcing our $4.6M Series Seed. Learn more
Socket
LoveBlogFAQ
Install
Log in

@github/check-all

Package Overview
Dependencies
0
Maintainers
14
Versions
10
Issues
File Explorer

Advanced tools

@github/check-all

Multiple checkbox selection helper.

    0.4.0latest

Version published
Maintainers
14
Yearly downloads
16,620
increased by151.86%

Weekly downloads

Changelog

Source

v0.4.0

  • TypeScript conversion. #17
  • UMD build is removed. #17
  • Ensure shift-click on <label> work for range selection. (#16 fixed by #18)

Readme

Source

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

import checkAll from '@github/check-all' checkAll(document.querySelector('[data-check-all-container]'))

Using a library like selector-observer, the behavior can automatically be applied to any container matching a selector.

import {observe} from 'selector-observer' import checkAll from '@github/check-all' observe('[data-check-all-container]', { subscribe: checkAll })

HTML

<div data-check-all-container> Count: <span data-check-all-count>0</span> <label><input type="checkbox" data-check-all> Check All</label> <label><input type="checkbox" data-check-all-item> github/fetch</label> <label><input type="checkbox" data-check-all-item> github/textarea-autosize</label> <label><input type="checkbox" data-check-all-item> github/eventlistener-polyfill</label> <label><input type="checkbox" data-check-all-item> github/quote-selection</label> </div>

Development

npm install npm test

License

Distributed under the MIT license. See LICENSE for details.

Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc