ember-aria-switch
ARIA Switch button in an Ember addon.
Last updated a month ago by rajasegar .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install ember-aria-switch 
SYNC missed versions from official npm registry.

ember-aria-switch

Build Status Coverage Status semantic-release npm version EmberObserver

ARIA Switch button in an Ember addon based on the WAI-ARIA specifications.

Demo

Demo

Installation

  • ember install ember-aria-switch

Usage

Example Markup:

<AriaSwitch @label="My Label" @checked={{true}} />

With external label


<p id="ex_label">
  Item 2
</p>
<AriaSwitch @ariaLabelledBy="ex_label" />

With disabled state

<AriaSwitch @label="My Label" @disabled={{true}} />

Without aria-label

<AriaSwitch />

With custom on/off labels

<AriaSwitch @onLabel="Yes" @offLabel="No" />

With toggle callback

<AriaSwitch @onToggle={{this.toggleCallback}} />

And your toggleCallback can be defined such as:

export default class IndexController extends Controller{
    @action
    toggleCallback(toggleValue) {
      let val = toggleValue ? "ON" : "OFF";
      alert(`ARIA Switch: You turned me ${val}!`);
    }
}

Running

Running Tests

  • npm test (Runs ember try:each to test your addon against multiple Ember versions)
  • ember test
  • ember test --server

Building

  • ember build

For more information on using ember-cli, visit https://ember-cli.com/.

Current Tags

  • 1.0.14                                ...           latest (a month ago)

20 Versions

  • 1.0.14                                ...           a month ago
  • 1.0.13                                ...           a month ago
  • 1.0.12                                ...           2 months ago
  • 1.0.11                                ...           4 months ago
  • 1.0.10                                ...           6 months ago
  • 1.0.8                                ...           6 months ago
  • 1.0.7                                ...           6 months ago
  • 1.0.6                                ...           8 months ago
  • 1.0.5                                ...           a year ago
  • 1.0.4                                ...           a year ago
  • 1.0.3                                ...           a year ago
  • 1.0.2                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 0.1.6                                ...           3 years ago
  • 0.1.5                                ...           3 years ago
  • 0.1.4                                ...           3 years ago
  • 0.1.3                                ...           3 years ago
  • 0.1.2                                ...           3 years ago
  • 0.1.1                                ...           3 years ago
  • 0.1.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 0
Last Month 33
Dependencies (2)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |