{"name":"rc-tree-select","version":"5.27.0","description":"tree-select ui component for react","keywords":["react","react-component","react-tree-select","tree-select"],"homepage":"https://github.com/react-component/tree-select","bugs":{"url":"https://github.com/react-component/tree-select/issues"},"repository":{"type":"git","url":"git+https://github.com/react-component/tree-select.git"},"license":"MIT","author":{"name":"smith3816@gmail.com"},"main":"./lib/index","module":"./es/index","scripts":{"build":"dumi build","compile":"father build","lint":"eslint src/ examples/ --ext .tsx,.ts,.jsx,.js","now-build":"npm run build","prepare":"husky && dumi setup","prepublishOnly":"npm run compile && np --yolo --no-publish --any-branch","prettier":"prettier '{src,tests}/**/*.{ts,tsx}' 'tests/**/*.js' --write","start":"dumi dev","test":"rc-test"},"lint-staged":{"*":"prettier --write --ignore-unknown"},"dependencies":{"@babel/runtime":"^7.25.7","classnames":"2.x","rc-select":"~14.16.2","rc-tree":"~5.13.0","rc-util":"^5.43.0"},"devDependencies":{"@rc-component/father-plugin":"^1.1.0","@rc-component/trigger":"^1.18.3","@testing-library/react":"^12.1.5","@types/jest":"^29.5.13","@types/node":"^22.7.5","@types/react":"^18.3.11","@types/react-dom":"^19.0.1","@types/warning":"^3.0.3","@umijs/fabric":"^4.0.1","cheerio":"1.0.0-rc.12","cross-env":"^7.0.3","dumi":"^2.4.12","enzyme":"^3.11.0","enzyme-adapter-react-16":"^1.15.8","enzyme-to-json":"^3.6.2","eslint":"^8.57.1","eslint-plugin-jest":"^28.10.0","eslint-plugin-unicorn":"^56.0.0","father":"^4.5.0","glob":"^11.0.0","husky":"^9.1.6","lint-staged":"^15.2.10","np":"^10.0.7","prettier":"^3.3.3","rc-dialog":"^9.6.0","rc-field-form":"^2.4.0","rc-test":"^7.1.1","rc-virtual-list":"^3.14.8","react":"^16.0.0","react-dom":"^16.0.0","typescript":"^5.6.3"},"peerDependencies":{"react":"*","react-dom":"*"},"_id":"rc-tree-select@5.27.0","gitHead":"1867fce01f8251f73090e4a1e7fdadb34546877d","types":"./lib/index.d.ts","_nodeVersion":"22.5.1","_npmVersion":"10.8.2","dist":{"integrity":"sha512-2qTBTzwIT7LRI1o7zLyrCzmo5tQanmyGbSaGTIf7sYimCklAToVVfpMC6OAldSKolcnjorBYPNSKQqJmN3TCww==","shasum":"3daa62972ae80846dac96bf4776d1a9dc9c7c4c6","tarball":"http://registry-npm.ywwl.com/rc-tree-select/download/rc-tree-select-5.27.0.tgz","fileCount":77,"unpackedSize":179293,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDjR4es0bxDdKSRA3sf7NB3oc6G/Hc33s3Ymj2lsYXU7AIgYqfDmCOEdXbeAFQUeU8UckouWHopkiyST90huRSsrbU="}],"size":38215,"noattachment":false,"key":"/rc-tree-select/-/rc-tree-select-5.27.0.tgz"},"_npmUser":{"name":"zombiej","email":"smith3816@gmail.com"},"directories":{},"maintainers":[{"name":"yesmeck","email":"yesmeck@gmail.com"},{"name":"afc163","email":"afc163@gmail.com"},{"name":"yiminghe","email":"yiminghe@gmail.com"},{"name":"warmhug","email":"hualei5280@gmail.com"},{"name":"valleykid","email":"valleykiddy@gmail.com"},{"name":"zombiej","email":"smith3816@gmail.com"},{"name":"madccc","email":"1075746765@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/rc-tree-select_5.27.0_1736220459649_0.8759798506614243"},"_hasShrinkwrap":false,"readme":"# rc-tree-select\n\nReact TreeSelect Component\n\n<!-- prettier-ignore -->\n[![NPM version][npm-image]][npm-url]\n[![npm download][download-image]][download-url]\n[![build status][github-actions-image]][github-actions-url]\n[![Codecov][codecov-image]][codecov-url]\n[![bundle size][bundlephobia-image]][bundlephobia-url]\n[![dumi][dumi-image]][dumi-url]\n\n[npm-image]: http://img.shields.io/npm/v/rc-tree-select.svg?style=flat-square\n[npm-url]: http://npmjs.org/package/rc-tree-select\n[travis-image]: https://img.shields.io/travis/react-component/tree-select/master?style=flat-square\n[travis-url]: https://travis-ci.com/react-component/tree-select\n[github-actions-image]: https://github.com/react-component/tree-select/workflows/CI/badge.svg\n[github-actions-url]: https://github.com/react-component/tree-select/actions\n[codecov-image]: https://img.shields.io/codecov/c/github/react-component/tree-select/master.svg?style=flat-square\n[codecov-url]: https://app.codecov.io/gh/react-component/tree-select\n[david-url]: https://david-dm.org/react-component/tree-select\n[david-image]: https://david-dm.org/react-component/tree-select/status.svg?style=flat-square\n[david-dev-url]: https://david-dm.org/react-component/tree-select?type=dev\n[david-dev-image]: https://david-dm.org/react-component/tree-select/dev-status.svg?style=flat-square\n[download-image]: https://img.shields.io/npm/dm/rc-tree-select.svg?style=flat-square\n[download-url]: https://npmjs.org/package/rc-tree-select\n[bundlephobia-url]: https://bundlephobia.com/package/rc-tree-select\n[bundlephobia-image]: https://badgen.net/bundlephobia/minzip/rc-tree-select\n[dumi-url]: https://github.com/umijs/dumi\n[dumi-image]: https://img.shields.io/badge/docs%20by-dumi-blue?style=flat-square\n\n## Screenshots\n\n<img src=\"https://os.alipayobjects.com/rmsportal/HUhyhmpWyiGKnZF.png\" width=\"288\"/>\n\n## Development\n\n```\nnpm install\nnpm start\n```\n\n## Example\n\nhttp://localhost:8000/examples/\n\nonline example: https://tree-select-react-component.vercel.app/\n\n## install\n\n[![rc-tree-select](https://nodei.co/npm/rc-tree-select.png)](https://npmjs.org/package/rc-tree-select)\n\n## API\n\n### TreeSelect props\n\n| name                     | description                                                                                                                                                                         | type                                                                                                                                                                                                                           | default                           |\n| ------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------- |\n| className                | additional css class of root dom node                                                                                                                                               | String                                                                                                                                                                                                                         | ''                                |\n| prefixCls                | prefix class                                                                                                                                                                        | String                                                                                                                                                                                                                         | ''                                |\n| animation                | dropdown animation name. only support slide-up now                                                                                                                                  | String                                                                                                                                                                                                                         | ''                                |\n| transitionName           | dropdown css animation name                                                                                                                                                         | String                                                                                                                                                                                                                         | ''                                |\n| choiceTransitionName     | css animation name for selected items at multiple mode                                                                                                                              | String                                                                                                                                                                                                                         | ''                                |\n| dropdownMatchSelectWidth | whether dropdown's with is same with select. Default set `min-width` same as input                                                                                                  | bool                                                                                                                                                                                                                           | true                              |\n| dropdownClassName        | additional className applied to dropdown                                                                                                                                            | String                                                                                                                                                                                                                         | -                                 |\n| dropdownStyle            | additional style applied to dropdown                                                                                                                                                | Object                                                                                                                                                                                                                         | {}                                |\n| onDropdownVisibleChange  | control dropdown visible                                                                                                                                                            | function                                                                                                                                                                                                                       | `() => { return true; }`          |\n| notFoundContent          | specify content to show when no result matches.                                                                                                                                     | String                                                                                                                                                                                                                         | 'Not Found'                       |\n| showSearch               | whether show search input in single mode                                                                                                                                            | bool                                                                                                                                                                                                                           | true                              |\n| allowClear               | whether allowClear                                                                                                                                                                  | bool                                                                                                                                                                                                                           | false                             |\n| maxTagTextLength         | max tag text length to show                                                                                                                                                         | number                                                                                                                                                                                                                         | -                                 |\n| maxTagCount              | max tag count to show                                                                                                                                                               | number                                                                                                                                                                                                                         | -                                 |\n| maxCount                 | Limit the maximum number of items that can be selected in multiple mode                                                                                                             | number                                                                                                                                                                                                                         | -                                 |\n| maxTagPlaceholder        | placeholder for omitted values                                                                                                                                                      | ReactNode/function(omittedValues)                                                                                                                                                                                              | -                                 |\n| multiple                 | whether multiple select (true when enable treeCheckable)                                                                                                                            | bool                                                                                                                                                                                                                           | false                             |\n| disabled                 | whether disabled select                                                                                                                                                             | bool                                                                                                                                                                                                                           | false                             |\n| searchValue              | work with `onSearch` to make search value controlled.                                                                                                                               | string                                                                                                                                                                                                                         | ''                                |\n| defaultValue             | initial selected treeNode(s)                                                                                                                                                        | same as value type                                                                                                                                                                                                             | -                                 |\n| value                    | current selected treeNode(s).                                                                                                                                                       | normal: String/Array<String>. labelInValue: {value:String,label:React.Node}/Array<{value,label}>. treeCheckStrictly(halfChecked default false): {value:String,label:React.Node, halfChecked}/Array<{value,label,halfChecked}>. | -                                 |\n| labelInValue             | whether to embed label in value, see above value type                                                                                                                               | Bool                                                                                                                                                                                                                           | false                             |\n| onChange                 | called when select treeNode or input value change                                                                                                                                   | function(value, label(null), extra)                                                                                                                                                                                            | -                                 |\n| onSelect                 | called when select treeNode                                                                                                                                                         | function(value, node, extra)                                                                                                                                                                                                   | -                                 |\n| onSearch                 | called when input changed                                                                                                                                                           | function                                                                                                                                                                                                                       | -                                 |\n| onTreeExpand             | called when tree node expand                                                                                                                                                        | function(expandedKeys)                                                                                                                                                                                                         | -                                 |\n| onPopupScroll            | called when popup scroll                                                                                                                                                            | function(event)                                                                                                                                                                                                                | -                                 |\n| showCheckedStrategy      | `TreeSelect.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             |\n| treeIcon                 | show tree icon                                                                                                                                                                      | bool                                                                                                                                                                                                                           | false                             |\n| treeLine                 | show tree line                                                                                                                                                                      | bool                                                                                                                                                                                                                           | false                             |\n| treeDefaultExpandAll     | default expand all treeNode                                                                                                                                                         | bool                                                                                                                                                                                                                           | false                             |\n| treeDefaultExpandedKeys  | default expanded treeNode keys                                                                                                                                                      | Array<String>                                                                                                                                                                                                                  | -                                 |\n| treeExpandedKeys         | set tree expanded keys                                                                                                                                                              | Array<String>                                                                                                                                                                                                                  | -                                 |\n| treeExpandAction         | Tree open logic, optional: false \\| `click` \\| `doubleClick`, same as `expandAction` of `rc-tree`                                                                                   | string \\| boolean                                                                                                                                                                                                              | `click`                           |\n| treeCheckable            | whether tree show checkbox (select callback will not fire)                                                                                                                          | bool                                                                                                                                                                                                                           | false                             |\n| treeCheckStrictly        | check node precisely, parent and children nodes are not associated                                                                                                                  | bool                                                                                                                                                                                                                           | false                             |\n| filterTreeNode           | whether filter treeNodes by input value. default filter by treeNode's treeNodeFilterProp prop's value                                                                               | bool/Function(inputValue:string, treeNode:TreeNode)                                                                                                                                                                            | Function                          |\n| treeNodeFilterProp       | which prop value of treeNode will be used for filter if filterTreeNode return true                                                                                                  | String                                                                                                                                                                                                                         | 'value'                           |\n| treeNodeLabelProp        | which prop value of treeNode will render as content of select                                                                                                                       | String                                                                                                                                                                                                                         | 'title'                           |\n| treeData                 | treeNodes 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,selectable]}>                                                                                                                                                                           | []                                |\n| treeDataSimpleMode       | enable simple mode of treeData.(treeData should be like this: [{id:1, pId:0, value:'1', label:\"test1\",...},...], `pId` is parent node's id)                                         | bool/object{id:'id', pId:'pId', rootPId:null}                                                                                                                                                                                  | false                             |\n| treeTitleRender          | Custom render nodes                                                                                                                                                                 | (nodeData: OptionType) => ReactNode                                                                                                                                                                                            |\n| loadData                 | load data asynchronously                                                                                                                                                            | function(node)                                                                                                                                                                                                                 | -                                 |\n| getPopupContainer        | container which popup select menu rendered into                                                                                                                                     | function(trigger:Node):Node                                                                                                                                                                                                    | function(){return document.body;} |\n| autoClearSearchValue     | auto clear search input value when multiple select is selected/deselected                                                                                                           | boolean                                                                                                                                                                                                                        | true                              |\n| suffixIcon               | specify the select arrow icon                                                                                                                                                       | ReactNode \\| (props: TreeProps) => ReactNode                                                                                                                                                                                   | -                                 |\n| clearIcon                | specify the clear icon                                                                                                                                                              | ReactNode \\| (props: TreeProps) => ReactNode                                                                                                                                                                                   | -                                 |\n| removeIcon               | specify the remove icon                                                                                                                                                             | ReactNode \\| (props: TreeProps) => ReactNode                                                                                                                                                                                   | -                                 |\n| switcherIcon             | specify the switcher icon                                                                                                                                                           | ReactNode \\| (props: TreeProps) => ReactNode                                                                                                                                                                                   | -                                 |\n| virtual                  | Disable virtual when `false`                                                                                                                                                        | false                                                                                                                                                                                                                          | -                                 |\n\n### TreeNode props\n\n> note: you'd better to use `treeData` instead of using TreeNode.\n\n| name     | description                                                               | type           | default |\n| -------- | ------------------------------------------------------------------------- | -------------- | ------- |\n| disabled | disable treeNode                                                          | bool           | false   |\n| key      | it's value must be unique across the tree's all TreeNode, you must set it | String         | -       |\n| value    | default as treeNodeFilterProp (be unique across the tree's all TreeNode)  | String         | ''      |\n| title    | tree/subTree's title                                                      | String/element | '---'   |\n| isLeaf   | whether it's leaf node                                                    | bool           | false   |\n\n## note\n\n1. Optimization tips(when there are large amounts of data, like more than 5000 nodes)\n   - Do not Expand all nodes.\n   - Recommend not exist many `TreeSelect` components in a page at the same time.\n   - Recommend not use `treeCheckable` mode, or use `treeCheckStrictly`.\n2. In `treeCheckable` mode, It has the same effect when click `x`(node in Selection box) or uncheck in the treeNode(in dropdown panel), but the essence is not the same. So, even if both of them trigger `onChange` method, but the parameters (the third parameter) are different. （中文：在`treeCheckable`模式下，已选择节点上的`x`删除操作、和相应 treeNode 节点上 checkbox 的 uncheck 操作，最终效果相同，但本质不一样。前者跟弹出的 tree 组件可以“毫无关系”（例如 dropdown 没展开过，tree 也就没渲染好），而后者是 tree 组件上的节点 uncheck 事件。所以、即便两者都会触发`onChange`方法、但它们的参数（第三个参数）是不同的。）\n\n## Test Case\n\nhttp://localhost:8000/tests/runner.html?coverage\n\n## Coverage\n\nhttp://localhost:8000/node_modules/rc-server/node_modules/node-jscover/lib/front-end/jscoverage.html?w=http://localhost:8000/tests/runner.html?coverage\n\n## License\n\nrc-tree-select is released under the MIT license.\n","publish_time":1736220459864,"_cnpm_publish_time":1736220459864,"dist-tags":{"latest":"5.27.0"}}