GithubHelp home page GithubHelp logo

isabella232 / ivy-tree Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ivyapp/ivy-tree

0.0 0.0 0.0 498 KB

WAI-ARIA accessible tree for Ember.

Home Page: http://ivyapp.github.io/ivy-tree

License: MIT License

JavaScript 79.84% CSS 1.26% HTML 18.90%

ivy-tree's Introduction

ivy-tree

Build Status

A group of Ember Components that interact to create a WAI-ARIA tree interface.

Note that this addon makes use of Contextual Components, which means that it won't work with Ember versions prior to 2.3.

Installation

$ ember install ivy-tree

Usage

The following example is adapted from the OpenAjax Alliance Accessibility Treeview Example:

{{#ivy-tree as |tree|}}
  {{#tree.treeitem as |fruits|}}
    <span>Fruits</span>
    {{#fruits.group as |fruitsGroup|}}
      {{#fruitsGroup.treeitem}}Oranges{{/fruitsGroup.treeitem}}
      {{#fruitsGroup.treeitem}}Pineapples{{/fruitsGroup.treeitem}}
      {{#fruitsGroup.treeitem as |apples|}}
        <span>Apples</span>
        {{#apples.group as |applesGroup|}}
          {{#applesGroup.treeitem}}Macintosh{{/applesGroup.treeitem}}
          {{#applesGroup.treeitem as |granny|}}
            <span>Granny Smith</span>
            {{#granny.group as |grannyGroup|}}
              {{#grannyGroup.treeitem}}Washington State{{/grannyGroup.treeitem}}
              {{#grannyGroup.treeitem}}Michigan{{/grannyGroup.treeitem}}
              {{#grannyGroup.treeitem}}New York{{/grannyGroup.treeitem}}
            {{/granny.group}}
          {{/applesGroup.treeitem}}
          {{#applesGroup.treeitem}}Fuji{{/applesGroup.treeitem}}
        {{/apples.group}}
      {{/fruitsGroup.treeitem}}
      {{#fruitsGroup.treeitem}}Bananas{{/fruitsGroup.treeitem}}
      {{#fruitsGroup.treeitem}}Pears{{/fruitsGroup.treeitem}}
    {{/fruits.group}}
  {{/tree.treeitem}}
  {{#tree.treeitem as |veggies|}}
    <span>Vegetables</span>
    {{#veggies.group as |veggiesGroup|}}
      {{#veggiesGroup.treeitem}}Broccoli{{/veggiesGroup.treeitem}}
      {{#veggiesGroup.treeitem}}Carrots{{/veggiesGroup.treeitem}}
    {{/veggies.group}}
  {{/tree.treeitem}}
{{/ivy-tree}}

Keyboard Shortcuts

The following keyboard shortcuts are supported:

  • Up: Select the previous visible tree item.
  • Down: Select the next visible tree item.
  • Left: Collapse the selected node, if it has children and is expanded. Otherwise, select its parent node.
  • Right: Expand the selected node, if it has children and is collapsed. Select its first child node.
  • Home: Select the first visible tree item.
  • End: Select the last visible tree item.
  • Enter: Toggle the expanded or collapsed state of the selected node.
  • *: Expand all parent nodes in the tree.

In addition, clicking a node will select it, and double-clicking a parent node will toggle its expanded or collapsed state.

Contributing

Fork this repo, make a new branch, and send a pull request. Make sure your change is tested or it won't be merged.

Installation

git clone [email protected]:IvyApp/ivy-tree.git
cd ivy-tree
npm install
bower install

Running

ember server

Then visit your app at http://localhost:4200.

Running Tests

ember test    # or
npm test      # (Runs `ember try:testall` to test your addon against multiple Ember versions)

Or, to start a test server:

ember test --server

Building

ember build

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

ivy-tree's People

Contributors

nbibler avatar omghax avatar ember-tomster avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.