JSPM

treeui

0.1.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 12
  • Score
    100M100P100Q47528F
  • License ISC

a tree user interface for files and other things

Package Exports

  • treeui

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (treeui) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

treeui

A simple collapsible tree ui, for file selectors and the like.

install

npm install --save treeui

example

Live example on requirebin

var treeui = require('treeui');

treeui(request)
    .onclick(function(level) {
        console.log(level);
    })
    .appendTo(document.body);

function request(tree, callback) {
    callback(null, [1 + tree, 2 + tree, 3 + tree]);
}

api

treeui(request)

Request is a function that takes (level, callback) and calls callback with (err, results), where results is an array.

onclick(callback)

Call callback with the tree level of clicked items

appendTo(elem)

Append the UI to a given DOM element.