0.1.22 • Published 4 years ago

react-hierarchical-select v0.1.22

Weekly downloads
2
License
MIT
Repository
github
Last release
4 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

4 years ago

0.1.21

4 years ago

0.1.20

4 years ago

0.1.19

4 years ago

0.1.18

4 years ago

0.1.16

4 years ago

0.1.17

4 years ago

0.1.15

4 years ago

0.1.14

4 years ago

0.1.13

4 years ago

0.1.12

4 years ago

0.1.11

4 years ago

0.1.10

4 years ago

0.1.9

4 years ago

0.1.8

4 years ago

0.1.7

4 years ago

0.1.6

4 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.0

5 years ago