You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+36-13Lines changed: 36 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,7 @@
24
24
25
25
## React Dropdown Tree Select
26
26
27
-
A lightweight and fast control to render a select component that can display hierarchical tree data. In addition, the control shows the selection in pills and allows user to search the options for quick filtering and selection.
27
+
A lightweight and fast control to render a select component that can display hierarchical tree data. In addition, the control shows the selection in pills and allows user to search the options for quick filtering and selection. Also supports displaying partially selected nodes.
28
28
29
29
## Table of Contents
30
30
@@ -35,6 +35,8 @@ A lightweight and fast control to render a select component that can display hie
35
35
*[With Material Design](#with-material-design)
36
36
*[As Single Select](#as-single-select)
37
37
*[Install](#install)
38
+
*[As NPM package](#as-npm-package)
39
+
*[Using a CDN](#using-a-cdn)
38
40
*[Peer Dependencies](#peer-dependencies)
39
41
*[Usage](#usage)
40
42
*[Props](#props)
@@ -46,6 +48,7 @@ A lightweight and fast control to render a select component that can display hie
46
48
*[noMatchesText](#noMatchesText)
47
49
*[keepTreeOnSearch](#keeptreeonsearch)
48
50
*[simpleSelect](#simpleselect)
51
+
*[showPartiallySelected](#showPartiallySelected)
49
52
*[Styling and Customization](#styling-and-customization)
50
53
*[Using default styles](#default-styles)
51
54
*[Customizing with Bootstrap, Material Design styles](#customizing-styles)
**Note:** Above example will always fetch the latest version. To fetch a specific version, use `https://unpkg.com/react-dropdown-tree-select@<version>/dist/...`
108
+
Visit [unpkg.com](https://unpkg.com/#/) to see other options.
109
+
94
110
### Peer Dependencies
95
111
96
112
In order to avoid version conflicts in your project, you must specify and install [react](https://www.npmjs.com/package/react), [react-dom](https://www.npmjs.com/package/react-dom) as [peer dependencies](https://nodejs.org/en/blog/npm/peer-dependencies/). Note that NPM doesn't install peer dependencies automatically. Instead it will show you a warning message with instructions on how to install them.
97
113
114
+
If you're using the UMD builds, you'd also need to install the peer dependencies in your application:
) // in real world, you'd want to render to an element, instead of body.
157
+
ReactDOM.render(<DropdownTreeSelect data={data} onChange={onChange} onAction={onAction} onNodeToggle={onNodeToggle} />, document.body) // in real world, you'd want to render to an element, instead of body.
Turns the dropdown into a simple, single select dropdown. If you pass tree data, only immediate children are picked, grandchildren nodes are ignored. Defaults to `false`.
246
263
264
+
### showPartiallySelected
265
+
266
+
Type: `bool` (default: `false`)
267
+
268
+
If set to true, shows checkboxes in a partial state when one, but not all of their children are selected. Allows styling of partially selected nodes as well, by using [:indeterminate](https://developer.mozilla.org/en-US/docs/Web/CSS/:indeterminate) pseudo class. Simply add desired styles to `.node.partial .checkbox-item:indeterminate { ... }` in your CSS.
0 commit comments