0.4.27 • Published 2 years ago

uxcore-tree-select v0.4.27

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

uxcore-tree-select

NPM version build status Test Coverage Dependency Status devDependency Status NPM downloads

Sauce Test Status

TL;DR

uxcore-tree-select ui component for react

setup develop environment

$ git clone https://github.com/uxcore/uxcore-tree-select
$ cd uxcore-tree-select
$ npm install
$ npm run server

Usage

demo

http://uxcore.github.io/

API

TreeSelect props

namedescriptiontypedefaultsince Ver.
classNameadditional css class of root dom nodeString''
prefixClsprefix classString'uxcore-tree-select'
animationdropdown animation name. only support slide-up nowString''
transitionNamedropdown css animation nameString''
choiceTransitionNamecss animation name for selected items at multiple modeString''
dropdownMatchSelectWidthwhether dropdown's with is same with selectboolfalse
dropdownClassNameadditional className applied to dropdownString-
dropdownStyleadditional style applied to dropdownObject{}
dropdownPopupAlignspecify alignment for dropdownObject-
notFoundContentspecify content to show when no result matches.String'Not Found'
showSearchwhether show search input in single modeboolfalse
allowClearwhether allowClearboolfalse
maxTagTextLengthmax tag text length to shownumber-
multiplewhether multiple select (true when enable treeCheckable)boolfalse
disabledwhether disabled selectboolfalse
inputValueif enable search, you can set default input's value, if set to null, auto clear input value when finish select/unselect operationstring/null''
defaultValueinitial selected treeNode(s)same as value type-
valuecurrent selected treeNode(s).normal: String/Array. labelInValue: {value:String,label:React.Node}/Array<{value,label}>. treeCheckStrictly(halfChecked default false): {value:String,label:React.Node, halfChecked}/Array<{value,label,halfChecked}>.-
labelInValuewhether to embed label in value, see above value typeBoolfalse
onChangecalled when select treeNode or input value changefunction(value, label(null), extra)-
onSelectcalled when select treeNodefunction(value, node, extra)-
onSearchcalled when input changedfunction-
onAllClearcalled when click all clearfunction-
showCheckedStrategyTreeSelect.SHOW_ALL: show all checked treeNodes (Include parent treeNode). TreeSelect.SHOW_PARENT: show checked treeNodes (Just show parent treeNode). Default just show child.enum{TreeSelect.SHOW_ALL, TreeSelect.SHOW_PARENT, TreeSelect.SHOW_CHILD }TreeSelect.SHOW_CHILD
treeIconshow tree iconboolfalse
treeLineshow tree lineboolfalse
treeDefaultExpandAlldefault expand all treeNodeboolfalse
treeCheckablewhether tree show checkbox (select callback will not fire)boolfalse
treeCheckStrictlycheck node precisely, parent and children nodes are not associatedboolfalse
filterTreeNodewhether filter treeNodes by input value. default filter by treeNode's treeNodeFilterProp prop's valuebool/Function(inputValue:string, treeNode:TreeNode)Function
treeNodeFilterPropwhich prop value of treeNode will be used for filter if filterTreeNode return trueString'title'
treeNodeLabelPropwhich prop value of treeNode will render as content of selectString'title'
treeDatatreeNodes data Array, if set it then you need not to construct children TreeNode. (value should be unique across the whole array)array<{value,label,children, disabled}>[]
treeDataSimpleModeenable simple mode of treeData.(treeData should be like this: {"id":1, "pId":0, "label":"test1"},..., pId is parent node's id)bool/object{id:'id', pId:'pId', rootPId:null}false
loadDataload data asynchronouslyfunction(node)-
resultsPanelAllClearBtn在下拉框右半部分中是否显示清除按钮booltrue0.2.0
resultsPanelTitle在下拉框右半部分中显示标题/说明string''0.2.0
resultsPanelTitleStyle下拉框右半部分中的标题/说明的样式object{}0.2.0
filterResultsPanel下拉框右半部分中的结果是否受inputValue影响,如果为true,则右边树形结果也会根据inputValue过滤booltrue0.2.0
locale国际化,枚举值 'en-us' 'zh-cn'string'zh-cn'0.2.2
size尺寸 'large' 'middle' 'small'string'large'0.4.15

TreeNode props

note: you'd better to use treeData instead of using TreeNode.

namedescriptiontypedefault
disableddisable treeNodeboolfalse
keyit's value must be unique across the tree's all TreeNode, you must set itString-
valuedefault as treeNodeFilterProp (be unique across the tree's all TreeNode)String''
titletree/subTree's titleString/element'---'
isLeafwhether it's leaf nodeboolfalse
0.4.26

2 years ago

0.4.27

2 years ago

0.4.25

5 years ago

0.4.24

6 years ago

0.4.23

6 years ago

0.4.22

6 years ago

0.4.21

6 years ago

0.4.20

6 years ago

0.4.18

6 years ago

0.4.17

6 years ago

0.4.16

6 years ago

0.4.14

7 years ago

0.4.13

7 years ago

0.4.12

7 years ago

0.4.11

7 years ago

0.4.10

7 years ago

0.4.9

7 years ago

0.4.8

7 years ago

0.4.7

7 years ago

0.4.6

7 years ago

1.0.0-beta.1

7 years ago

0.4.5

7 years ago

0.4.4

7 years ago

0.4.3

7 years ago

0.4.2

7 years ago

0.4.1

7 years ago

0.4.0

8 years ago

0.3.2

8 years ago

0.2.5

8 years ago

0.3.1

8 years ago

0.3.0

8 years ago

0.1.6

8 years ago

0.1.5

8 years ago

0.2.4

8 years ago

0.2.3

8 years ago

0.2.2

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago

0.1.4

8 years ago

0.1.3

9 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago