esp-library

component library for the end of studies project by Khalil Jabbahi and Tarik Sghiouri Idrissi

Usage no npm install needed!

<script type="module">
  import espLibrary from 'https://cdn.skypack.dev/esp-library';
</script>

README

esp-library

component library for the end of studies project by Khalil Jabbahi and Tarik Sghiouri Idrissi

NPM JavaScript Style Guide

Install

npm install --save esp-library

Usage

import React, { Component } from 'react'

import {TreeView} from 'esp-library'

class Example extends Component {

  onSelect = data => console.log(data);

  render () {

    render () {
    //creating TreeView structure 
    const data = [{
      id : 12,
      label : "root",
      icon : icon,
      isOpen : true,
      children : [{   id : 19,
                    label : "rChild1",
                    icon : icon,
                    isOpen : true,
                    onSelect: this.onSelect,
                    children : []
                },{   id : 18,
                  label : "rChild2",
                  icon : icon,
                  isOpen : true,
                  children : [
                    {id : 39,
                    label : "rc",
                    isOpen : true,
                    onSelect: this.onSelect,
                    children : []
                }]
              },{   id : 17,
                label : "rChild3",
                icon : icon,
                isOpen : true,
                onSelect: this.onSelect,
                children : []
            }]
    },{
      id : 14,
      label : "rChild3",
      icon : icon,
      isOpen : true,
      onSelect: this.onSelect,
      children : []
    }
  
  ];

    return (
      <TreeView  data={data}/>
    )
  }
}

License

MIT © Kh4L1L0