0.1.22 • Published 5 years ago

react-hierarchical-select v0.1.22

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

react-hierarchical-select


Overview

This project is a fork of react-dropdown-tree-select by @dowjones with some features added:

  • Search highlighting
  • Singular select (no tag-based selections)
  • Support for prepending a component to the dropdown
  • Logic for node traversal/expansion/collapse
  • Support for hover events on nodes
  • Changes to how nodes are selected
Please note: this project has been extended to a specific use case.
Your mileage may vary.

Getting Started

Please follow the instructions on the react-dropdown-tree-select Github page.

Usage

As noted above, this library extends the existing feature set of react-dropdown-tree-select, with the following properties and associated functionality added:

PropValueDescription
prependElementAny valid JSX elementThis allows for pre-pending an element to the top of the dropdown component (first child of the .root element).
enforceSingleSelectionbooleanWhen selected, will allow for only selecting a single element (as opposed to the tag-based selection bundled with this library by default)
highlightSearchbooleanEnables phrase matching/highlighting on search
onNodeHoverfunctionProvides a callback for mouseover events on individual nodes
onInputChangefunctionProvides a callback for when the search's input changes

Example usage:

import HierarchicalSelect from 'react-hierarchical-select';

<HierarchicalSelect
  mode="hierarchical"
  showDropdown="always"
  data={menuItems}
  prependElement={
   <div>Foo</div>
  }
  enforceSingleSelection={true}
  highlightSearch={true}
  onChange={this.onChange}
  onNodeHover={this.onNodeHover}
  onInputChange={this.onInputChange}
  onNodeNavigate={this.onNodeNavigate}  
  value={this.props.selected}
/>
0.1.22

5 years ago

0.1.21

5 years ago

0.1.20

5 years ago

0.1.19

5 years ago

0.1.18

5 years ago

0.1.16

5 years ago

0.1.17

5 years ago

0.1.15

5 years ago

0.1.14

5 years ago

0.1.13

5 years ago

0.1.12

5 years ago

0.1.11

5 years ago

0.1.10

5 years ago

0.1.9

5 years ago

0.1.8

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.0

6 years ago