0.0.5 • Published 7 years ago
inferno-tree-select v0.0.5
Inferno Tree Select
A select for tree using Inferno.
Repository
grauwoelfchen/inferno-tree-select (GitLab.com)
Usage
See example about detail of usage as Component.
import { render } from 'inferno';
import { h } from 'inferno-hyperscript';
import { TreeSelect } from 'inferno-tree-select';
class MyComponent extedns Component {
...
render() {
const { options } = this.state;
return h(TreeSelect, {
options
, selected: '4'
, onSelect: (node) => { console.log(node); }
});
}
}Tree data
A node must have label, value and children.
[{
"label": "foo",
"value": "1",
"children": [{
"label": "bar",
"value": "2",
"children": [{
"label": "qux",
"value": "4",
"children": []
}, {
"label": "quux",
"value": "5",
"children": []
}]
}]
}, {
"label": "baz",
"value": "3",
"children": []
}]Development
Build
% make buildLint
% make vet:lintTest
Unit Test
% make test:unitBrowser (EtoE) Test
% make test:etoe
: if you have `xvfb-run` (for Docker on CI etc.)
% xvfb-run make test:etoeLicense
This program is free software: you can redistribute it and/or modify it under the terms of the MIT License.
See LICENSE.
Inferno Tree Select
Copyright (c) 2018 Yasuhiro Asaka