@rc-component/tree-select 1.3.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/README.md +12 -12
  2. package/package.json +6 -7
  3. package/dist/223.90c7e648.async.js +0 -3
  4. package/dist/338.a2a48f3b.async.js +0 -15
  5. package/dist/338.e8c51481.chunk.css +0 -5
  6. package/dist/404.html +0 -20
  7. package/dist/439.67bede3f.async.js +0 -137
  8. package/dist/929.df8dd03f.async.js +0 -32
  9. package/dist/demo/basic/index.html +0 -20
  10. package/dist/demo/big-data/index.html +0 -20
  11. package/dist/demo/controlled/index.html +0 -20
  12. package/dist/demo/custom-icons/index.html +0 -20
  13. package/dist/demo/debug/index.html +0 -20
  14. package/dist/demo/disable/index.html +0 -20
  15. package/dist/demo/dynamic/index.html +0 -20
  16. package/dist/demo/field-names/index.html +0 -20
  17. package/dist/demo/filter/index.html +0 -20
  18. package/dist/demo/form/index.html +0 -20
  19. package/dist/demo/mutiple-with-max-count/index.html +0 -20
  20. package/dist/demo/tree-node-label-prop/index.html +0 -20
  21. package/dist/demo/width/index.html +0 -20
  22. package/dist/demos.f221b577.async.js +0 -1
  23. package/dist/docs__demo__basic.md.bcb0edb7.async.js +0 -1
  24. package/dist/docs__demo__big-data.md.8783cd6b.async.js +0 -1
  25. package/dist/docs__demo__controlled.md.e65ef7d7.async.js +0 -1
  26. package/dist/docs__demo__custom-icons.md.d53bf2f9.async.js +0 -1
  27. package/dist/docs__demo__debug.md.099ad226.async.js +0 -1
  28. package/dist/docs__demo__disable.md.6ba57652.async.js +0 -1
  29. package/dist/docs__demo__dynamic.md.f7559890.async.js +0 -1
  30. package/dist/docs__demo__fieldNames.md.16131d9f.async.js +0 -1
  31. package/dist/docs__demo__filter.md.02527db4.async.js +0 -1
  32. package/dist/docs__demo__form.md.6b77dffe.async.js +0 -1
  33. package/dist/docs__demo__mutiple-with-maxCount.md.7268d4ad.async.js +0 -1
  34. package/dist/docs__demo__treeNodeLabelProp.md.24709916.async.js +0 -1
  35. package/dist/docs__demo__width.md.24bfecd6.async.js +0 -1
  36. package/dist/docs__index.md.a6e45331.async.js +0 -1
  37. package/dist/dumi__tmp-production__dumi__theme__ContextWrapper.f56a0670.async.js +0 -1
  38. package/dist/index.html +0 -20
  39. package/dist/meta__docs.255fc42b.chunk.css +0 -1
  40. package/dist/meta__docs.dbf04b66.async.js +0 -3359
  41. package/dist/nm__dumi__dist__client__pages__404.8b85f2d9.chunk.css +0 -1
  42. package/dist/nm__dumi__dist__client__pages__404.ca2add38.async.js +0 -1
  43. package/dist/nm__dumi__dist__client__pages__Demo__index.29e9ef8f.async.js +0 -1
  44. package/dist/nm__dumi__dist__client__pages__Demo__index.578aa5c0.chunk.css +0 -1
  45. package/dist/nm__dumi__theme-default__layouts__DocLayout__index.8ed833d7.async.js +0 -1
  46. package/dist/preload_helper.d41c4da0.js +0 -1
  47. package/dist/umi.4f47b921.js +0 -124
  48. package/dist/umi.8faca2de.css +0 -1
  49. package/dist/~demos/:id/index.html +0 -20
  50. package/dist/~demos/docs-demo-basic-demo-basic/index.html +0 -20
  51. package/dist/~demos/docs-demo-big-data-demo-big-data/index.html +0 -20
  52. package/dist/~demos/docs-demo-controlled-demo-controlled/index.html +0 -20
  53. package/dist/~demos/docs-demo-custom-icons-demo-custom-icons/index.html +0 -20
  54. package/dist/~demos/docs-demo-debug-demo-debug/index.html +0 -20
  55. package/dist/~demos/docs-demo-disable-demo-disable/index.html +0 -20
  56. package/dist/~demos/docs-demo-dynamic-demo-dynamic/index.html +0 -20
  57. package/dist/~demos/docs-demo-field-names-demo-fieldnames/index.html +0 -20
  58. package/dist/~demos/docs-demo-filter-demo-filter/index.html +0 -20
  59. package/dist/~demos/docs-demo-form-demo-form/index.html +0 -20
  60. package/dist/~demos/docs-demo-mutiple-with-max-count-demo-mutiple-with-maxcount/index.html +0 -20
  61. package/dist/~demos/docs-demo-tree-node-label-prop-demo-treenodelabelprop/index.html +0 -20
  62. package/dist/~demos/docs-demo-width-demo-width/index.html +0 -20
@@ -1,3359 +0,0 @@
1
- "use strict";(self.webpackChunk_rc_component_tree_select=self.webpackChunk_rc_component_tree_select||[]).push([[904],{86420:function(v,t,e){var c;e.r(t),e.d(t,{demos:function(){return G}});var o=e(7557),u=e.n(o),P=e(41498),g=e.n(P),r=e(96162),U=e(80206),E=e(55311),h=e(6701),l=e(8645),s=e(25240),a=e(63484),n=e(56253),_=e(27165),p=e(84670),D=e(28853),f=e(87643),i=e(83238),m=e(95094),M=e(99217),y=e(8399),I=e(47239),O=e(43647),C=e(89957),T=e(64803),j=e(76536),x=e(2971),S=e(41234),R=e(46077),A=e(19811),L=e(87992),V=e(72770),Z=e(43880),$=e(29213),J=e(64887),b=e(1732),d=e(26694),X=e(4216),G={"docs-demo-basic-demo-basic":{component:r.memo(r.lazy(function(){return e.e(433).then(e.bind(e,59558))})),asset:{type:"BLOCK",id:"docs-demo-basic-demo-basic",refAtomIds:[],dependencies:{"index.tsx":{type:"FILE",value:e(45745).Z},"rc-dialog":{type:"NPM",value:"9.6.0"},react:{type:"NPM",value:"16.14.0"},"./utils/dataUtil.ts":{type:"FILE",value:e(37756).Z},"../assets/index.less":{type:"FILE",value:e(25866).Z},"../src.tsx":{type:"FILE",value:e(42103).Z},"./utils/strategyUtil.ts":{type:"FILE",value:e(76742).Z},"./TreeSelect.tsx":{type:"FILE",value:e(51184).Z},"./TreeNode.tsx":{type:"FILE",value:e(41849).Z},"@rc-component/select":{type:"NPM",value:"1.0.0"},"./valueUtil.ts":{type:"FILE",value:e(4370).Z},"rc-tree":{type:"NPM",value:"5.13.1"},"@rc-component/util":{type:"NPM",value:"1.2.1"},"./utils/warningPropsUtil.ts":{type:"FILE",value:e(29162).Z},"./hooks/useCache.ts":{type:"FILE",value:e(95108).Z},"./hooks/useCheckedKeys.ts":{type:"FILE",value:e(7118).Z},"./LegacyContext.tsx":{type:"FILE",value:e(28458).Z},"./hooks/useTreeData.ts":{type:"FILE",value:e(4997).Z},"./hooks/useDataEntities.ts":{type:"FILE",value:e(31367).Z},"./hooks/useFilterTreeData.ts":{type:"FILE",value:e(67685).Z},"./hooks/useRefFunc.ts":{type:"FILE",value:e(60133).Z},"./TreeSelectContext.ts":{type:"FILE",value:e(29285).Z},"./OptionList.tsx":{type:"FILE",value:e(49597).Z},"./utils/legacyUtil.tsx":{type:"FILE",value:e(29035).Z}},entry:"index.tsx"},context:{"./utils/dataUtil.ts":l,"../assets/index.less":s,"../src.tsx":a,"./utils/strategyUtil.ts":n,"./TreeSelect.tsx":_,"./TreeNode.tsx":p,"./valueUtil.ts":f,"./utils/warningPropsUtil.ts":I,"./hooks/useCache.ts":O,"./hooks/useCheckedKeys.ts":C,"./LegacyContext.tsx":T,"./hooks/useTreeData.ts":j,"./hooks/useDataEntities.ts":x,"./hooks/useFilterTreeData.ts":S,"./hooks/useRefFunc.ts":R,"./TreeSelectContext.ts":A,"./OptionList.tsx":L,"./utils/legacyUtil.tsx":V,"rc-dialog":E,"rc-dialog/assets/index.css":h,react:c||(c=e.t(r,2)),"/Users/jilin/projects/antd/rc-tree-select/examples/utils/dataUtil.ts":l,"/Users/jilin/projects/antd/rc-tree-select/assets/index.less":s,"/Users/jilin/projects/antd/rc-tree-select/src/index.tsx":a,"/Users/jilin/projects/antd/rc-tree-select/src/utils/strategyUtil.ts":n,"/Users/jilin/projects/antd/rc-tree-select/src/TreeSelect.tsx":_,"/Users/jilin/projects/antd/rc-tree-select/src/TreeNode.tsx":p,"@rc-component/select":D,"/Users/jilin/projects/antd/rc-tree-select/src/utils/valueUtil.ts":f,"@rc-component/select/lib/hooks/useId":i,"rc-tree/lib/utils/conductUtil":m,"@rc-component/util/lib/hooks/useMergedState":M,"@rc-component/util/lib/warning":y,"/Users/jilin/projects/antd/rc-tree-select/src/utils/warningPropsUtil.ts":I,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useCache.ts":O,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useCheckedKeys.ts":C,"/Users/jilin/projects/antd/rc-tree-select/src/LegacyContext.tsx":T,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useTreeData.ts":j,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useDataEntities.ts":x,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useFilterTreeData.ts":S,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useRefFunc.ts":R,"/Users/jilin/projects/antd/rc-tree-select/src/TreeSelectContext.ts":A,"/Users/jilin/projects/antd/rc-tree-select/src/OptionList.tsx":L,"/Users/jilin/projects/antd/rc-tree-select/src/utils/legacyUtil.tsx":V,"rc-tree/lib/utils/treeUtil":Z,"@rc-component/util/lib/Children/toArray":$,"rc-tree":J,"@rc-component/util/lib/KeyCode":b,"@rc-component/util/lib/hooks/useMemo":d,"@rc-component/util":X},renderOpts:{compile:function(){var F=g()(u()().mark(function k(){var K,W=arguments;return u()().wrap(function(N){for(;;)switch(N.prev=N.next){case 0:return N.next=2,e.e(439).then(e.bind(e,56439));case 2:return N.abrupt("return",(K=N.sent).default.apply(K,W));case 3:case"end":return N.stop()}},k)}));function H(){return F.apply(this,arguments)}return H}()}}}},53443:function(v,t,e){var c;e.r(t),e.d(t,{demos:function(){return X}});var o=e(7557),u=e.n(o),P=e(41498),g=e.n(P),r=e(96162),U=e(2934),E=e(31458),h=e(25240),l=e(63484),s=e(8645),a=e(56253),n=e(27165),_=e(84670),p=e(28853),D=e(87643),f=e(83238),i=e(95094),m=e(99217),M=e(8399),y=e(2971),I=e(43647),O=e(89957),C=e(47239),T=e(76536),j=e(64803),x=e(87992),S=e(19811),R=e(72770),A=e(41234),L=e(46077),V=e(43880),Z=e(29213),$=e(64887),J=e(1732),b=e(26694),d=e(4216),X={"docs-demo-big-data-demo-big-data":{component:r.memo(r.lazy(function(){return e.e(433).then(e.bind(e,42681))})),asset:{type:"BLOCK",id:"docs-demo-big-data-demo-big-data",refAtomIds:[],dependencies:{"index.tsx":{type:"FILE",value:e(13371).Z},react:{type:"NPM",value:"16.14.0"},"./utils/big-data-generator.tsx":{type:"FILE",value:e(30390).Z},"../assets/index.less":{type:"FILE",value:e(25866).Z},"../src.tsx":{type:"FILE",value:e(42103).Z},"./dataUtil.ts":{type:"FILE",value:e(37756).Z},"./utils/strategyUtil.ts":{type:"FILE",value:e(76742).Z},"./TreeSelect.tsx":{type:"FILE",value:e(51184).Z},"./TreeNode.tsx":{type:"FILE",value:e(41849).Z},"@rc-component/select":{type:"NPM",value:"1.0.0"},"./valueUtil.ts":{type:"FILE",value:e(4370).Z},"rc-tree":{type:"NPM",value:"5.13.1"},"@rc-component/util":{type:"NPM",value:"1.2.1"},"./hooks/useDataEntities.ts":{type:"FILE",value:e(31367).Z},"./hooks/useCache.ts":{type:"FILE",value:e(95108).Z},"./hooks/useCheckedKeys.ts":{type:"FILE",value:e(7118).Z},"./utils/warningPropsUtil.ts":{type:"FILE",value:e(29162).Z},"./hooks/useTreeData.ts":{type:"FILE",value:e(4997).Z},"./LegacyContext.tsx":{type:"FILE",value:e(28458).Z},"./OptionList.tsx":{type:"FILE",value:e(49597).Z},"./TreeSelectContext.ts":{type:"FILE",value:e(29285).Z},"./utils/legacyUtil.tsx":{type:"FILE",value:e(29035).Z},"./hooks/useFilterTreeData.ts":{type:"FILE",value:e(67685).Z},"./hooks/useRefFunc.ts":{type:"FILE",value:e(60133).Z}},entry:"index.tsx"},context:{"./utils/big-data-generator.tsx":E,"../assets/index.less":h,"../src.tsx":l,"./dataUtil.ts":s,"./utils/strategyUtil.ts":a,"./TreeSelect.tsx":n,"./TreeNode.tsx":_,"./valueUtil.ts":D,"./hooks/useDataEntities.ts":y,"./hooks/useCache.ts":I,"./hooks/useCheckedKeys.ts":O,"./utils/warningPropsUtil.ts":C,"./hooks/useTreeData.ts":T,"./LegacyContext.tsx":j,"./OptionList.tsx":x,"./TreeSelectContext.ts":S,"./utils/legacyUtil.tsx":R,"./hooks/useFilterTreeData.ts":A,"./hooks/useRefFunc.ts":L,react:c||(c=e.t(r,2)),"/Users/jilin/projects/antd/rc-tree-select/examples/utils/big-data-generator.tsx":E,"/Users/jilin/projects/antd/rc-tree-select/assets/index.less":h,"/Users/jilin/projects/antd/rc-tree-select/src/index.tsx":l,"/Users/jilin/projects/antd/rc-tree-select/examples/utils/dataUtil.ts":s,"/Users/jilin/projects/antd/rc-tree-select/src/utils/strategyUtil.ts":a,"/Users/jilin/projects/antd/rc-tree-select/src/TreeSelect.tsx":n,"/Users/jilin/projects/antd/rc-tree-select/src/TreeNode.tsx":_,"@rc-component/select":p,"/Users/jilin/projects/antd/rc-tree-select/src/utils/valueUtil.ts":D,"@rc-component/select/lib/hooks/useId":f,"rc-tree/lib/utils/conductUtil":i,"@rc-component/util/lib/hooks/useMergedState":m,"@rc-component/util/lib/warning":M,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useDataEntities.ts":y,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useCache.ts":I,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useCheckedKeys.ts":O,"/Users/jilin/projects/antd/rc-tree-select/src/utils/warningPropsUtil.ts":C,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useTreeData.ts":T,"/Users/jilin/projects/antd/rc-tree-select/src/LegacyContext.tsx":j,"/Users/jilin/projects/antd/rc-tree-select/src/OptionList.tsx":x,"/Users/jilin/projects/antd/rc-tree-select/src/TreeSelectContext.ts":S,"/Users/jilin/projects/antd/rc-tree-select/src/utils/legacyUtil.tsx":R,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useFilterTreeData.ts":A,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useRefFunc.ts":L,"rc-tree/lib/utils/treeUtil":V,"@rc-component/util/lib/Children/toArray":Z,"rc-tree":$,"@rc-component/util/lib/KeyCode":J,"@rc-component/util/lib/hooks/useMemo":b,"@rc-component/util":d},renderOpts:{compile:function(){var G=g()(u()().mark(function H(){var k,K=arguments;return u()().wrap(function(le){for(;;)switch(le.prev=le.next){case 0:return le.next=2,e.e(439).then(e.bind(e,56439));case 2:return le.abrupt("return",(k=le.sent).default.apply(k,K));case 3:case"end":return le.stop()}},H)}));function F(){return G.apply(this,arguments)}return F}()}}}},43345:function(v,t,e){var c;e.r(t),e.d(t,{demos:function(){return d}});var o=e(7557),u=e.n(o),P=e(41498),g=e.n(P),r=e(96162),U=e(86795),E=e(6701),h=e(63484),l=e(25240),s=e(56253),a=e(27165),n=e(84670),_=e(28853),p=e(87643),D=e(83238),f=e(95094),i=e(99217),m=e(8399),M=e(47239),y=e(43647),I=e(89957),O=e(2971),C=e(41234),T=e(46077),j=e(76536),x=e(64803),S=e(87992),R=e(19811),A=e(72770),L=e(43880),V=e(29213),Z=e(64887),$=e(1732),J=e(26694),b=e(4216),d={"docs-demo-controlled-demo-controlled":{component:r.memo(r.lazy(function(){return e.e(433).then(e.bind(e,6190))})),asset:{type:"BLOCK",id:"docs-demo-controlled-demo-controlled",refAtomIds:[],dependencies:{"index.tsx":{type:"FILE",value:e(19760).Z},react:{type:"NPM",value:"16.14.0"},"rc-dialog":{type:"NPM",value:"9.6.0"},"../src.tsx":{type:"FILE",value:e(42103).Z},"../assets/index.less":{type:"FILE",value:e(25866).Z},"./utils/strategyUtil.ts":{type:"FILE",value:e(76742).Z},"./TreeSelect.tsx":{type:"FILE",value:e(51184).Z},"./TreeNode.tsx":{type:"FILE",value:e(41849).Z},"@rc-component/select":{type:"NPM",value:"1.0.0"},"./valueUtil.ts":{type:"FILE",value:e(4370).Z},"rc-tree":{type:"NPM",value:"5.13.1"},"@rc-component/util":{type:"NPM",value:"1.2.1"},"./utils/warningPropsUtil.ts":{type:"FILE",value:e(29162).Z},"./hooks/useCache.ts":{type:"FILE",value:e(95108).Z},"./hooks/useCheckedKeys.ts":{type:"FILE",value:e(7118).Z},"./hooks/useDataEntities.ts":{type:"FILE",value:e(31367).Z},"./hooks/useFilterTreeData.ts":{type:"FILE",value:e(67685).Z},"./hooks/useRefFunc.ts":{type:"FILE",value:e(60133).Z},"./hooks/useTreeData.ts":{type:"FILE",value:e(4997).Z},"./LegacyContext.tsx":{type:"FILE",value:e(28458).Z},"./OptionList.tsx":{type:"FILE",value:e(49597).Z},"./TreeSelectContext.ts":{type:"FILE",value:e(29285).Z},"./utils/legacyUtil.tsx":{type:"FILE",value:e(29035).Z}},entry:"index.tsx"},context:{"../src.tsx":h,"../assets/index.less":l,"./utils/strategyUtil.ts":s,"./TreeSelect.tsx":a,"./TreeNode.tsx":n,"./valueUtil.ts":p,"./utils/warningPropsUtil.ts":M,"./hooks/useCache.ts":y,"./hooks/useCheckedKeys.ts":I,"./hooks/useDataEntities.ts":O,"./hooks/useFilterTreeData.ts":C,"./hooks/useRefFunc.ts":T,"./hooks/useTreeData.ts":j,"./LegacyContext.tsx":x,"./OptionList.tsx":S,"./TreeSelectContext.ts":R,"./utils/legacyUtil.tsx":A,react:c||(c=e.t(r,2)),"rc-dialog/assets/index.css":E,"/Users/jilin/projects/antd/rc-tree-select/src/index.tsx":h,"/Users/jilin/projects/antd/rc-tree-select/assets/index.less":l,"/Users/jilin/projects/antd/rc-tree-select/src/utils/strategyUtil.ts":s,"/Users/jilin/projects/antd/rc-tree-select/src/TreeSelect.tsx":a,"/Users/jilin/projects/antd/rc-tree-select/src/TreeNode.tsx":n,"@rc-component/select":_,"/Users/jilin/projects/antd/rc-tree-select/src/utils/valueUtil.ts":p,"@rc-component/select/lib/hooks/useId":D,"rc-tree/lib/utils/conductUtil":f,"@rc-component/util/lib/hooks/useMergedState":i,"@rc-component/util/lib/warning":m,"/Users/jilin/projects/antd/rc-tree-select/src/utils/warningPropsUtil.ts":M,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useCache.ts":y,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useCheckedKeys.ts":I,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useDataEntities.ts":O,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useFilterTreeData.ts":C,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useRefFunc.ts":T,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useTreeData.ts":j,"/Users/jilin/projects/antd/rc-tree-select/src/LegacyContext.tsx":x,"/Users/jilin/projects/antd/rc-tree-select/src/OptionList.tsx":S,"/Users/jilin/projects/antd/rc-tree-select/src/TreeSelectContext.ts":R,"/Users/jilin/projects/antd/rc-tree-select/src/utils/legacyUtil.tsx":A,"rc-tree/lib/utils/treeUtil":L,"@rc-component/util/lib/Children/toArray":V,"rc-tree":Z,"@rc-component/util/lib/KeyCode":$,"@rc-component/util/lib/hooks/useMemo":J,"@rc-component/util":b},renderOpts:{compile:function(){var X=g()(u()().mark(function F(){var H,k=arguments;return u()().wrap(function(W){for(;;)switch(W.prev=W.next){case 0:return W.next=2,e.e(439).then(e.bind(e,56439));case 2:return W.abrupt("return",(H=W.sent).default.apply(H,k));case 3:case"end":return W.stop()}},F)}));function G(){return X.apply(this,arguments)}return G}()}}}},11002:function(v,t,e){var c;e.r(t),e.d(t,{demos:function(){return X}});var o=e(7557),u=e.n(o),P=e(41498),g=e.n(P),r=e(96162),U=e(32445),E=e(6701),h=e(8645),l=e(25240),s=e(63484),a=e(56253),n=e(27165),_=e(84670),p=e(28853),D=e(87643),f=e(83238),i=e(95094),m=e(99217),M=e(8399),y=e(47239),I=e(43647),O=e(89957),C=e(2971),T=e(41234),j=e(46077),x=e(76536),S=e(64803),R=e(87992),A=e(19811),L=e(72770),V=e(43880),Z=e(29213),$=e(64887),J=e(1732),b=e(26694),d=e(4216),X={"docs-demo-custom-icons-demo-custom-icons":{component:r.memo(r.lazy(function(){return e.e(433).then(e.bind(e,54472))})),asset:{type:"BLOCK",id:"docs-demo-custom-icons-demo-custom-icons",refAtomIds:[],dependencies:{"index.tsx":{type:"FILE",value:e(79898).Z},react:{type:"NPM",value:"16.14.0"},"rc-dialog":{type:"NPM",value:"9.6.0"},"./utils/dataUtil.ts":{type:"FILE",value:e(37756).Z},"../assets/index.less":{type:"FILE",value:e(25866).Z},"../src.tsx":{type:"FILE",value:e(42103).Z},"./utils/strategyUtil.ts":{type:"FILE",value:e(76742).Z},"./TreeSelect.tsx":{type:"FILE",value:e(51184).Z},"./TreeNode.tsx":{type:"FILE",value:e(41849).Z},"@rc-component/select":{type:"NPM",value:"1.0.0"},"./valueUtil.ts":{type:"FILE",value:e(4370).Z},"rc-tree":{type:"NPM",value:"5.13.1"},"@rc-component/util":{type:"NPM",value:"1.2.1"},"./utils/warningPropsUtil.ts":{type:"FILE",value:e(29162).Z},"./hooks/useCache.ts":{type:"FILE",value:e(95108).Z},"./hooks/useCheckedKeys.ts":{type:"FILE",value:e(7118).Z},"./hooks/useDataEntities.ts":{type:"FILE",value:e(31367).Z},"./hooks/useFilterTreeData.ts":{type:"FILE",value:e(67685).Z},"./hooks/useRefFunc.ts":{type:"FILE",value:e(60133).Z},"./hooks/useTreeData.ts":{type:"FILE",value:e(4997).Z},"./LegacyContext.tsx":{type:"FILE",value:e(28458).Z},"./OptionList.tsx":{type:"FILE",value:e(49597).Z},"./TreeSelectContext.ts":{type:"FILE",value:e(29285).Z},"./utils/legacyUtil.tsx":{type:"FILE",value:e(29035).Z}},entry:"index.tsx"},context:{"./utils/dataUtil.ts":h,"../assets/index.less":l,"../src.tsx":s,"./utils/strategyUtil.ts":a,"./TreeSelect.tsx":n,"./TreeNode.tsx":_,"./valueUtil.ts":D,"./utils/warningPropsUtil.ts":y,"./hooks/useCache.ts":I,"./hooks/useCheckedKeys.ts":O,"./hooks/useDataEntities.ts":C,"./hooks/useFilterTreeData.ts":T,"./hooks/useRefFunc.ts":j,"./hooks/useTreeData.ts":x,"./LegacyContext.tsx":S,"./OptionList.tsx":R,"./TreeSelectContext.ts":A,"./utils/legacyUtil.tsx":L,react:c||(c=e.t(r,2)),"rc-dialog/assets/index.css":E,"/Users/jilin/projects/antd/rc-tree-select/examples/utils/dataUtil.ts":h,"/Users/jilin/projects/antd/rc-tree-select/assets/index.less":l,"/Users/jilin/projects/antd/rc-tree-select/src/index.tsx":s,"/Users/jilin/projects/antd/rc-tree-select/src/utils/strategyUtil.ts":a,"/Users/jilin/projects/antd/rc-tree-select/src/TreeSelect.tsx":n,"/Users/jilin/projects/antd/rc-tree-select/src/TreeNode.tsx":_,"@rc-component/select":p,"/Users/jilin/projects/antd/rc-tree-select/src/utils/valueUtil.ts":D,"@rc-component/select/lib/hooks/useId":f,"rc-tree/lib/utils/conductUtil":i,"@rc-component/util/lib/hooks/useMergedState":m,"@rc-component/util/lib/warning":M,"/Users/jilin/projects/antd/rc-tree-select/src/utils/warningPropsUtil.ts":y,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useCache.ts":I,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useCheckedKeys.ts":O,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useDataEntities.ts":C,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useFilterTreeData.ts":T,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useRefFunc.ts":j,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useTreeData.ts":x,"/Users/jilin/projects/antd/rc-tree-select/src/LegacyContext.tsx":S,"/Users/jilin/projects/antd/rc-tree-select/src/OptionList.tsx":R,"/Users/jilin/projects/antd/rc-tree-select/src/TreeSelectContext.ts":A,"/Users/jilin/projects/antd/rc-tree-select/src/utils/legacyUtil.tsx":L,"rc-tree/lib/utils/treeUtil":V,"@rc-component/util/lib/Children/toArray":Z,"rc-tree":$,"@rc-component/util/lib/KeyCode":J,"@rc-component/util/lib/hooks/useMemo":b,"@rc-component/util":d},renderOpts:{compile:function(){var G=g()(u()().mark(function H(){var k,K=arguments;return u()().wrap(function(le){for(;;)switch(le.prev=le.next){case 0:return le.next=2,e.e(439).then(e.bind(e,56439));case 2:return le.abrupt("return",(k=le.sent).default.apply(k,K));case 3:case"end":return le.stop()}},H)}));function F(){return G.apply(this,arguments)}return F}()}}}},80743:function(v,t,e){var c;e.r(t),e.d(t,{demos:function(){return b}});var o=e(7557),u=e.n(o),P=e(41498),g=e.n(P),r=e(96162),U=e(55145),E=e(25240),h=e(63484),l=e(56253),s=e(27165),a=e(84670),n=e(28853),_=e(83238),p=e(87643),D=e(95094),f=e(99217),i=e(8399),m=e(47239),M=e(43647),y=e(89957),I=e(2971),O=e(41234),C=e(46077),T=e(76536),j=e(64803),x=e(87992),S=e(19811),R=e(72770),A=e(64887),L=e(29213),V=e(43880),Z=e(1732),$=e(26694),J=e(4216),b={"docs-demo-debug-demo-debug":{component:r.memo(r.lazy(function(){return e.e(433).then(e.bind(e,83939))})),asset:{type:"BLOCK",id:"docs-demo-debug-demo-debug",refAtomIds:[],dependencies:{"index.tsx":{type:"FILE",value:e(91938).Z},react:{type:"NPM",value:"16.14.0"},"../assets/index.less":{type:"FILE",value:e(25866).Z},"../src.tsx":{type:"FILE",value:e(42103).Z},"./utils/strategyUtil.ts":{type:"FILE",value:e(76742).Z},"./TreeSelect.tsx":{type:"FILE",value:e(51184).Z},"./TreeNode.tsx":{type:"FILE",value:e(41849).Z},"@rc-component/select":{type:"NPM",value:"1.0.0"},"./valueUtil.ts":{type:"FILE",value:e(4370).Z},"rc-tree":{type:"NPM",value:"5.13.1"},"@rc-component/util":{type:"NPM",value:"1.2.1"},"./utils/warningPropsUtil.ts":{type:"FILE",value:e(29162).Z},"./hooks/useCache.ts":{type:"FILE",value:e(95108).Z},"./hooks/useCheckedKeys.ts":{type:"FILE",value:e(7118).Z},"./hooks/useDataEntities.ts":{type:"FILE",value:e(31367).Z},"./hooks/useFilterTreeData.ts":{type:"FILE",value:e(67685).Z},"./hooks/useRefFunc.ts":{type:"FILE",value:e(60133).Z},"./hooks/useTreeData.ts":{type:"FILE",value:e(4997).Z},"./LegacyContext.tsx":{type:"FILE",value:e(28458).Z},"./OptionList.tsx":{type:"FILE",value:e(49597).Z},"./TreeSelectContext.ts":{type:"FILE",value:e(29285).Z},"./utils/legacyUtil.tsx":{type:"FILE",value:e(29035).Z}},entry:"index.tsx"},context:{"../assets/index.less":E,"../src.tsx":h,"./utils/strategyUtil.ts":l,"./TreeSelect.tsx":s,"./TreeNode.tsx":a,"./valueUtil.ts":p,"./utils/warningPropsUtil.ts":m,"./hooks/useCache.ts":M,"./hooks/useCheckedKeys.ts":y,"./hooks/useDataEntities.ts":I,"./hooks/useFilterTreeData.ts":O,"./hooks/useRefFunc.ts":C,"./hooks/useTreeData.ts":T,"./LegacyContext.tsx":j,"./OptionList.tsx":x,"./TreeSelectContext.ts":S,"./utils/legacyUtil.tsx":R,react:c||(c=e.t(r,2)),"/Users/jilin/projects/antd/rc-tree-select/assets/index.less":E,"/Users/jilin/projects/antd/rc-tree-select/src/index.tsx":h,"/Users/jilin/projects/antd/rc-tree-select/src/utils/strategyUtil.ts":l,"/Users/jilin/projects/antd/rc-tree-select/src/TreeSelect.tsx":s,"/Users/jilin/projects/antd/rc-tree-select/src/TreeNode.tsx":a,"@rc-component/select":n,"@rc-component/select/lib/hooks/useId":_,"/Users/jilin/projects/antd/rc-tree-select/src/utils/valueUtil.ts":p,"rc-tree/lib/utils/conductUtil":D,"@rc-component/util/lib/hooks/useMergedState":f,"@rc-component/util/lib/warning":i,"/Users/jilin/projects/antd/rc-tree-select/src/utils/warningPropsUtil.ts":m,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useCache.ts":M,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useCheckedKeys.ts":y,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useDataEntities.ts":I,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useFilterTreeData.ts":O,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useRefFunc.ts":C,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useTreeData.ts":T,"/Users/jilin/projects/antd/rc-tree-select/src/LegacyContext.tsx":j,"/Users/jilin/projects/antd/rc-tree-select/src/OptionList.tsx":x,"/Users/jilin/projects/antd/rc-tree-select/src/TreeSelectContext.ts":S,"/Users/jilin/projects/antd/rc-tree-select/src/utils/legacyUtil.tsx":R,"rc-tree":A,"@rc-component/util/lib/Children/toArray":L,"rc-tree/lib/utils/treeUtil":V,"@rc-component/util/lib/KeyCode":Z,"@rc-component/util/lib/hooks/useMemo":$,"@rc-component/util":J},renderOpts:{compile:function(){var d=g()(u()().mark(function G(){var F,H=arguments;return u()().wrap(function(K){for(;;)switch(K.prev=K.next){case 0:return K.next=2,e.e(439).then(e.bind(e,56439));case 2:return K.abrupt("return",(F=K.sent).default.apply(F,H));case 3:case"end":return K.stop()}},G)}));function X(){return d.apply(this,arguments)}return X}()}}}},1016:function(v,t,e){var c;e.r(t),e.d(t,{demos:function(){return b}});var o=e(7557),u=e.n(o),P=e(41498),g=e.n(P),r=e(96162),U=e(94785),E=e(63484),h=e(25240),l=e(27165),s=e(56253),a=e(84670),n=e(28853),_=e(83238),p=e(87643),D=e(95094),f=e(99217),i=e(8399),m=e(47239),M=e(43647),y=e(89957),I=e(2971),O=e(87992),C=e(19811),T=e(72770),j=e(46077),x=e(41234),S=e(76536),R=e(64803),A=e(64887),L=e(43880),V=e(29213),Z=e(1732),$=e(26694),J=e(4216),b={"docs-demo-disable-demo-disable":{component:r.memo(r.lazy(function(){return e.e(433).then(e.bind(e,38228))})),asset:{type:"BLOCK",id:"docs-demo-disable-demo-disable",refAtomIds:[],dependencies:{"index.tsx":{type:"FILE",value:e(73633).Z},react:{type:"NPM",value:"16.14.0"},"../src.tsx":{type:"FILE",value:e(42103).Z},"../assets/index.less":{type:"FILE",value:e(25866).Z},"./TreeSelect.tsx":{type:"FILE",value:e(51184).Z},"./utils/strategyUtil.ts":{type:"FILE",value:e(76742).Z},"./TreeNode.tsx":{type:"FILE",value:e(41849).Z},"@rc-component/select":{type:"NPM",value:"1.0.0"},"./valueUtil.ts":{type:"FILE",value:e(4370).Z},"rc-tree":{type:"NPM",value:"5.13.1"},"@rc-component/util":{type:"NPM",value:"1.2.1"},"./utils/warningPropsUtil.ts":{type:"FILE",value:e(29162).Z},"./hooks/useCache.ts":{type:"FILE",value:e(95108).Z},"./hooks/useCheckedKeys.ts":{type:"FILE",value:e(7118).Z},"./hooks/useDataEntities.ts":{type:"FILE",value:e(31367).Z},"./OptionList.tsx":{type:"FILE",value:e(49597).Z},"./TreeSelectContext.ts":{type:"FILE",value:e(29285).Z},"./utils/legacyUtil.tsx":{type:"FILE",value:e(29035).Z},"./hooks/useRefFunc.ts":{type:"FILE",value:e(60133).Z},"./hooks/useFilterTreeData.ts":{type:"FILE",value:e(67685).Z},"./hooks/useTreeData.ts":{type:"FILE",value:e(4997).Z},"./LegacyContext.tsx":{type:"FILE",value:e(28458).Z}},entry:"index.tsx"},context:{"../src.tsx":E,"../assets/index.less":h,"./TreeSelect.tsx":l,"./utils/strategyUtil.ts":s,"./TreeNode.tsx":a,"./valueUtil.ts":p,"./utils/warningPropsUtil.ts":m,"./hooks/useCache.ts":M,"./hooks/useCheckedKeys.ts":y,"./hooks/useDataEntities.ts":I,"./OptionList.tsx":O,"./TreeSelectContext.ts":C,"./utils/legacyUtil.tsx":T,"./hooks/useRefFunc.ts":j,"./hooks/useFilterTreeData.ts":x,"./hooks/useTreeData.ts":S,"./LegacyContext.tsx":R,react:c||(c=e.t(r,2)),"/Users/jilin/projects/antd/rc-tree-select/src/index.tsx":E,"/Users/jilin/projects/antd/rc-tree-select/assets/index.less":h,"/Users/jilin/projects/antd/rc-tree-select/src/TreeSelect.tsx":l,"/Users/jilin/projects/antd/rc-tree-select/src/utils/strategyUtil.ts":s,"/Users/jilin/projects/antd/rc-tree-select/src/TreeNode.tsx":a,"@rc-component/select":n,"@rc-component/select/lib/hooks/useId":_,"/Users/jilin/projects/antd/rc-tree-select/src/utils/valueUtil.ts":p,"rc-tree/lib/utils/conductUtil":D,"@rc-component/util/lib/hooks/useMergedState":f,"@rc-component/util/lib/warning":i,"/Users/jilin/projects/antd/rc-tree-select/src/utils/warningPropsUtil.ts":m,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useCache.ts":M,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useCheckedKeys.ts":y,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useDataEntities.ts":I,"/Users/jilin/projects/antd/rc-tree-select/src/OptionList.tsx":O,"/Users/jilin/projects/antd/rc-tree-select/src/TreeSelectContext.ts":C,"/Users/jilin/projects/antd/rc-tree-select/src/utils/legacyUtil.tsx":T,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useRefFunc.ts":j,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useFilterTreeData.ts":x,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useTreeData.ts":S,"/Users/jilin/projects/antd/rc-tree-select/src/LegacyContext.tsx":R,"rc-tree":A,"rc-tree/lib/utils/treeUtil":L,"@rc-component/util/lib/Children/toArray":V,"@rc-component/util/lib/KeyCode":Z,"@rc-component/util/lib/hooks/useMemo":$,"@rc-component/util":J},renderOpts:{compile:function(){var d=g()(u()().mark(function G(){var F,H=arguments;return u()().wrap(function(K){for(;;)switch(K.prev=K.next){case 0:return K.next=2,e.e(439).then(e.bind(e,56439));case 2:return K.abrupt("return",(F=K.sent).default.apply(F,H));case 3:case"end":return K.stop()}},G)}));function X(){return d.apply(this,arguments)}return X}()}}}},28156:function(v,t,e){var c;e.r(t),e.d(t,{demos:function(){return d}});var o=e(7557),u=e.n(o),P=e(41498),g=e.n(P),r=e(96162),U=e(547),E=e(25240),h=e(8645),l=e(63484),s=e(56253),a=e(27165),n=e(84670),_=e(28853),p=e(87643),D=e(83238),f=e(95094),i=e(99217),m=e(8399),M=e(46077),y=e(43647),I=e(47239),O=e(89957),C=e(2971),T=e(76536),j=e(41234),x=e(64803),S=e(87992),R=e(19811),A=e(72770),L=e(43880),V=e(64887),Z=e(29213),$=e(1732),J=e(26694),b=e(4216),d={"docs-demo-dynamic-demo-dynamic":{component:r.memo(r.lazy(function(){return e.e(433).then(e.bind(e,19890))})),asset:{type:"BLOCK",id:"docs-demo-dynamic-demo-dynamic",refAtomIds:[],dependencies:{"index.tsx":{type:"FILE",value:e(86272).Z},react:{type:"NPM",value:"16.14.0"},"../assets/index.less":{type:"FILE",value:e(25866).Z},"./utils/dataUtil.ts":{type:"FILE",value:e(37756).Z},"../src.tsx":{type:"FILE",value:e(42103).Z},"./utils/strategyUtil.ts":{type:"FILE",value:e(76742).Z},"./TreeSelect.tsx":{type:"FILE",value:e(51184).Z},"./TreeNode.tsx":{type:"FILE",value:e(41849).Z},"@rc-component/select":{type:"NPM",value:"1.0.0"},"./valueUtil.ts":{type:"FILE",value:e(4370).Z},"rc-tree":{type:"NPM",value:"5.13.1"},"@rc-component/util":{type:"NPM",value:"1.2.1"},"./hooks/useRefFunc.ts":{type:"FILE",value:e(60133).Z},"./hooks/useCache.ts":{type:"FILE",value:e(95108).Z},"./utils/warningPropsUtil.ts":{type:"FILE",value:e(29162).Z},"./hooks/useCheckedKeys.ts":{type:"FILE",value:e(7118).Z},"./hooks/useDataEntities.ts":{type:"FILE",value:e(31367).Z},"./hooks/useTreeData.ts":{type:"FILE",value:e(4997).Z},"./hooks/useFilterTreeData.ts":{type:"FILE",value:e(67685).Z},"./LegacyContext.tsx":{type:"FILE",value:e(28458).Z},"./OptionList.tsx":{type:"FILE",value:e(49597).Z},"./TreeSelectContext.ts":{type:"FILE",value:e(29285).Z},"./utils/legacyUtil.tsx":{type:"FILE",value:e(29035).Z}},entry:"index.tsx"},context:{"../assets/index.less":E,"./utils/dataUtil.ts":h,"../src.tsx":l,"./utils/strategyUtil.ts":s,"./TreeSelect.tsx":a,"./TreeNode.tsx":n,"./valueUtil.ts":p,"./hooks/useRefFunc.ts":M,"./hooks/useCache.ts":y,"./utils/warningPropsUtil.ts":I,"./hooks/useCheckedKeys.ts":O,"./hooks/useDataEntities.ts":C,"./hooks/useTreeData.ts":T,"./hooks/useFilterTreeData.ts":j,"./LegacyContext.tsx":x,"./OptionList.tsx":S,"./TreeSelectContext.ts":R,"./utils/legacyUtil.tsx":A,react:c||(c=e.t(r,2)),"/Users/jilin/projects/antd/rc-tree-select/assets/index.less":E,"/Users/jilin/projects/antd/rc-tree-select/examples/utils/dataUtil.ts":h,"/Users/jilin/projects/antd/rc-tree-select/src/index.tsx":l,"/Users/jilin/projects/antd/rc-tree-select/src/utils/strategyUtil.ts":s,"/Users/jilin/projects/antd/rc-tree-select/src/TreeSelect.tsx":a,"/Users/jilin/projects/antd/rc-tree-select/src/TreeNode.tsx":n,"@rc-component/select":_,"/Users/jilin/projects/antd/rc-tree-select/src/utils/valueUtil.ts":p,"@rc-component/select/lib/hooks/useId":D,"rc-tree/lib/utils/conductUtil":f,"@rc-component/util/lib/hooks/useMergedState":i,"@rc-component/util/lib/warning":m,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useRefFunc.ts":M,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useCache.ts":y,"/Users/jilin/projects/antd/rc-tree-select/src/utils/warningPropsUtil.ts":I,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useCheckedKeys.ts":O,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useDataEntities.ts":C,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useTreeData.ts":T,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useFilterTreeData.ts":j,"/Users/jilin/projects/antd/rc-tree-select/src/LegacyContext.tsx":x,"/Users/jilin/projects/antd/rc-tree-select/src/OptionList.tsx":S,"/Users/jilin/projects/antd/rc-tree-select/src/TreeSelectContext.ts":R,"/Users/jilin/projects/antd/rc-tree-select/src/utils/legacyUtil.tsx":A,"rc-tree/lib/utils/treeUtil":L,"rc-tree":V,"@rc-component/util/lib/Children/toArray":Z,"@rc-component/util/lib/KeyCode":$,"@rc-component/util/lib/hooks/useMemo":J,"@rc-component/util":b},renderOpts:{compile:function(){var X=g()(u()().mark(function F(){var H,k=arguments;return u()().wrap(function(W){for(;;)switch(W.prev=W.next){case 0:return W.next=2,e.e(439).then(e.bind(e,56439));case 2:return W.abrupt("return",(H=W.sent).default.apply(H,k));case 3:case"end":return W.stop()}},F)}));function G(){return X.apply(this,arguments)}return G}()}}}},22820:function(v,t,e){var c;e.r(t),e.d(t,{demos:function(){return d}});var o=e(7557),u=e.n(o),P=e(41498),g=e.n(P),r=e(96162),U=e(55230),E=e(6701),h=e(63484),l=e(25240),s=e(56253),a=e(84670),n=e(27165),_=e(28853),p=e(87643),D=e(83238),f=e(95094),i=e(99217),m=e(8399),M=e(47239),y=e(43647),I=e(89957),O=e(2971),C=e(64803),T=e(87992),j=e(41234),x=e(19811),S=e(72770),R=e(76536),A=e(46077),L=e(64887),V=e(43880),Z=e(29213),$=e(1732),J=e(26694),b=e(4216),d={"docs-demo-field-names-demo-fieldnames":{component:r.memo(r.lazy(function(){return e.e(433).then(e.bind(e,80981))})),asset:{type:"BLOCK",id:"docs-demo-field-names-demo-fieldnames",refAtomIds:[],dependencies:{"index.tsx":{type:"FILE",value:e(14610).Z},react:{type:"NPM",value:"16.14.0"},"rc-dialog":{type:"NPM",value:"9.6.0"},"../src.tsx":{type:"FILE",value:e(42103).Z},"../assets/index.less":{type:"FILE",value:e(25866).Z},"./utils/strategyUtil.ts":{type:"FILE",value:e(76742).Z},"./TreeNode.tsx":{type:"FILE",value:e(41849).Z},"./TreeSelect.tsx":{type:"FILE",value:e(51184).Z},"@rc-component/select":{type:"NPM",value:"1.0.0"},"./valueUtil.ts":{type:"FILE",value:e(4370).Z},"rc-tree":{type:"NPM",value:"5.13.1"},"@rc-component/util":{type:"NPM",value:"1.2.1"},"./utils/warningPropsUtil.ts":{type:"FILE",value:e(29162).Z},"./hooks/useCache.ts":{type:"FILE",value:e(95108).Z},"./hooks/useCheckedKeys.ts":{type:"FILE",value:e(7118).Z},"./hooks/useDataEntities.ts":{type:"FILE",value:e(31367).Z},"./LegacyContext.tsx":{type:"FILE",value:e(28458).Z},"./OptionList.tsx":{type:"FILE",value:e(49597).Z},"./hooks/useFilterTreeData.ts":{type:"FILE",value:e(67685).Z},"./TreeSelectContext.ts":{type:"FILE",value:e(29285).Z},"./utils/legacyUtil.tsx":{type:"FILE",value:e(29035).Z},"./hooks/useTreeData.ts":{type:"FILE",value:e(4997).Z},"./hooks/useRefFunc.ts":{type:"FILE",value:e(60133).Z}},entry:"index.tsx"},context:{"../src.tsx":h,"../assets/index.less":l,"./utils/strategyUtil.ts":s,"./TreeNode.tsx":a,"./TreeSelect.tsx":n,"./valueUtil.ts":p,"./utils/warningPropsUtil.ts":M,"./hooks/useCache.ts":y,"./hooks/useCheckedKeys.ts":I,"./hooks/useDataEntities.ts":O,"./LegacyContext.tsx":C,"./OptionList.tsx":T,"./hooks/useFilterTreeData.ts":j,"./TreeSelectContext.ts":x,"./utils/legacyUtil.tsx":S,"./hooks/useTreeData.ts":R,"./hooks/useRefFunc.ts":A,react:c||(c=e.t(r,2)),"rc-dialog/assets/index.css":E,"/Users/jilin/projects/antd/rc-tree-select/src/index.tsx":h,"/Users/jilin/projects/antd/rc-tree-select/assets/index.less":l,"/Users/jilin/projects/antd/rc-tree-select/src/utils/strategyUtil.ts":s,"/Users/jilin/projects/antd/rc-tree-select/src/TreeNode.tsx":a,"/Users/jilin/projects/antd/rc-tree-select/src/TreeSelect.tsx":n,"@rc-component/select":_,"/Users/jilin/projects/antd/rc-tree-select/src/utils/valueUtil.ts":p,"@rc-component/select/lib/hooks/useId":D,"rc-tree/lib/utils/conductUtil":f,"@rc-component/util/lib/hooks/useMergedState":i,"@rc-component/util/lib/warning":m,"/Users/jilin/projects/antd/rc-tree-select/src/utils/warningPropsUtil.ts":M,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useCache.ts":y,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useCheckedKeys.ts":I,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useDataEntities.ts":O,"/Users/jilin/projects/antd/rc-tree-select/src/LegacyContext.tsx":C,"/Users/jilin/projects/antd/rc-tree-select/src/OptionList.tsx":T,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useFilterTreeData.ts":j,"/Users/jilin/projects/antd/rc-tree-select/src/TreeSelectContext.ts":x,"/Users/jilin/projects/antd/rc-tree-select/src/utils/legacyUtil.tsx":S,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useTreeData.ts":R,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useRefFunc.ts":A,"rc-tree":L,"rc-tree/lib/utils/treeUtil":V,"@rc-component/util/lib/Children/toArray":Z,"@rc-component/util/lib/KeyCode":$,"@rc-component/util/lib/hooks/useMemo":J,"@rc-component/util":b},renderOpts:{compile:function(){var X=g()(u()().mark(function F(){var H,k=arguments;return u()().wrap(function(W){for(;;)switch(W.prev=W.next){case 0:return W.next=2,e.e(439).then(e.bind(e,56439));case 2:return W.abrupt("return",(H=W.sent).default.apply(H,k));case 3:case"end":return W.stop()}},F)}));function G(){return X.apply(this,arguments)}return G}()}}}},74242:function(v,t,e){var c;e.r(t),e.d(t,{demos:function(){return d}});var o=e(7557),u=e.n(o),P=e(41498),g=e.n(P),r=e(96162),U=e(63166),E=e(25240),h=e(8645),l=e(63484),s=e(27165),a=e(56253),n=e(84670),_=e(28853),p=e(87643),D=e(83238),f=e(95094),i=e(99217),m=e(8399),M=e(47239),y=e(43647),I=e(89957),O=e(2971),C=e(64803),T=e(41234),j=e(46077),x=e(76536),S=e(19811),R=e(87992),A=e(72770),L=e(43880),V=e(64887),Z=e(29213),$=e(1732),J=e(26694),b=e(4216),d={"docs-demo-filter-demo-filter":{component:r.memo(r.lazy(function(){return e.e(433).then(e.bind(e,76595))})),asset:{type:"BLOCK",id:"docs-demo-filter-demo-filter",refAtomIds:[],dependencies:{"index.tsx":{type:"FILE",value:e(33073).Z},react:{type:"NPM",value:"16.14.0"},"../assets/index.less":{type:"FILE",value:e(25866).Z},"./utils/dataUtil.ts":{type:"FILE",value:e(37756).Z},"../src.tsx":{type:"FILE",value:e(42103).Z},"./TreeSelect.tsx":{type:"FILE",value:e(51184).Z},"./utils/strategyUtil.ts":{type:"FILE",value:e(76742).Z},"./TreeNode.tsx":{type:"FILE",value:e(41849).Z},"@rc-component/select":{type:"NPM",value:"1.0.0"},"./valueUtil.ts":{type:"FILE",value:e(4370).Z},"rc-tree":{type:"NPM",value:"5.13.1"},"@rc-component/util":{type:"NPM",value:"1.2.1"},"./utils/warningPropsUtil.ts":{type:"FILE",value:e(29162).Z},"./hooks/useCache.ts":{type:"FILE",value:e(95108).Z},"./hooks/useCheckedKeys.ts":{type:"FILE",value:e(7118).Z},"./hooks/useDataEntities.ts":{type:"FILE",value:e(31367).Z},"./LegacyContext.tsx":{type:"FILE",value:e(28458).Z},"./hooks/useFilterTreeData.ts":{type:"FILE",value:e(67685).Z},"./hooks/useRefFunc.ts":{type:"FILE",value:e(60133).Z},"./hooks/useTreeData.ts":{type:"FILE",value:e(4997).Z},"./TreeSelectContext.ts":{type:"FILE",value:e(29285).Z},"./OptionList.tsx":{type:"FILE",value:e(49597).Z},"./utils/legacyUtil.tsx":{type:"FILE",value:e(29035).Z}},entry:"index.tsx"},context:{"../assets/index.less":E,"./utils/dataUtil.ts":h,"../src.tsx":l,"./TreeSelect.tsx":s,"./utils/strategyUtil.ts":a,"./TreeNode.tsx":n,"./valueUtil.ts":p,"./utils/warningPropsUtil.ts":M,"./hooks/useCache.ts":y,"./hooks/useCheckedKeys.ts":I,"./hooks/useDataEntities.ts":O,"./LegacyContext.tsx":C,"./hooks/useFilterTreeData.ts":T,"./hooks/useRefFunc.ts":j,"./hooks/useTreeData.ts":x,"./TreeSelectContext.ts":S,"./OptionList.tsx":R,"./utils/legacyUtil.tsx":A,react:c||(c=e.t(r,2)),"/Users/jilin/projects/antd/rc-tree-select/assets/index.less":E,"/Users/jilin/projects/antd/rc-tree-select/examples/utils/dataUtil.ts":h,"/Users/jilin/projects/antd/rc-tree-select/src/index.tsx":l,"/Users/jilin/projects/antd/rc-tree-select/src/TreeSelect.tsx":s,"/Users/jilin/projects/antd/rc-tree-select/src/utils/strategyUtil.ts":a,"/Users/jilin/projects/antd/rc-tree-select/src/TreeNode.tsx":n,"@rc-component/select":_,"/Users/jilin/projects/antd/rc-tree-select/src/utils/valueUtil.ts":p,"@rc-component/select/lib/hooks/useId":D,"rc-tree/lib/utils/conductUtil":f,"@rc-component/util/lib/hooks/useMergedState":i,"@rc-component/util/lib/warning":m,"/Users/jilin/projects/antd/rc-tree-select/src/utils/warningPropsUtil.ts":M,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useCache.ts":y,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useCheckedKeys.ts":I,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useDataEntities.ts":O,"/Users/jilin/projects/antd/rc-tree-select/src/LegacyContext.tsx":C,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useFilterTreeData.ts":T,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useRefFunc.ts":j,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useTreeData.ts":x,"/Users/jilin/projects/antd/rc-tree-select/src/TreeSelectContext.ts":S,"/Users/jilin/projects/antd/rc-tree-select/src/OptionList.tsx":R,"/Users/jilin/projects/antd/rc-tree-select/src/utils/legacyUtil.tsx":A,"rc-tree/lib/utils/treeUtil":L,"rc-tree":V,"@rc-component/util/lib/Children/toArray":Z,"@rc-component/util/lib/KeyCode":$,"@rc-component/util/lib/hooks/useMemo":J,"@rc-component/util":b},renderOpts:{compile:function(){var X=g()(u()().mark(function F(){var H,k=arguments;return u()().wrap(function(W){for(;;)switch(W.prev=W.next){case 0:return W.next=2,e.e(439).then(e.bind(e,56439));case 2:return W.abrupt("return",(H=W.sent).default.apply(H,k));case 3:case"end":return W.stop()}},F)}));function G(){return X.apply(this,arguments)}return G}()}}}},16748:function(v,t,e){var c;e.r(t),e.d(t,{demos:function(){return G}});var o=e(7557),u=e.n(o),P=e(41498),g=e.n(P),r=e(96162),U=e(29272),E=e(28853),h=e(7866),l=e(70624),s=e(8645),a=e(63484),n=e(25240),_=e(56253),p=e(27165),D=e(84670),f=e(87643),i=e(83238),m=e(95094),M=e(99217),y=e(8399),I=e(47239),O=e(43647),C=e(89957),T=e(64803),j=e(76536),x=e(87992),S=e(2971),R=e(19811),A=e(72770),L=e(41234),V=e(46077),Z=e(43880),$=e(64887),J=e(29213),b=e(1732),d=e(26694),X=e(4216),G={"docs-demo-form-demo-form":{component:r.memo(r.lazy(function(){return e.e(433).then(e.bind(e,23576))})),asset:{type:"BLOCK",id:"docs-demo-form-demo-form",refAtomIds:[],dependencies:{"index.tsx":{type:"FILE",value:e(43335).Z},react:{type:"NPM",value:"16.14.0"},"@rc-component/select":{type:"NPM",value:"1.0.0"},"rc-field-form":{type:"NPM",value:"2.7.0"},"./utils/dataUtil.ts":{type:"FILE",value:e(37756).Z},"../src.tsx":{type:"FILE",value:e(42103).Z},"../assets/index.less":{type:"FILE",value:e(25866).Z},"./utils/strategyUtil.ts":{type:"FILE",value:e(76742).Z},"./TreeSelect.tsx":{type:"FILE",value:e(51184).Z},"./TreeNode.tsx":{type:"FILE",value:e(41849).Z},"./valueUtil.ts":{type:"FILE",value:e(4370).Z},"rc-tree":{type:"NPM",value:"5.13.1"},"@rc-component/util":{type:"NPM",value:"1.2.1"},"./utils/warningPropsUtil.ts":{type:"FILE",value:e(29162).Z},"./hooks/useCache.ts":{type:"FILE",value:e(95108).Z},"./hooks/useCheckedKeys.ts":{type:"FILE",value:e(7118).Z},"./LegacyContext.tsx":{type:"FILE",value:e(28458).Z},"./hooks/useTreeData.ts":{type:"FILE",value:e(4997).Z},"./OptionList.tsx":{type:"FILE",value:e(49597).Z},"./hooks/useDataEntities.ts":{type:"FILE",value:e(31367).Z},"./TreeSelectContext.ts":{type:"FILE",value:e(29285).Z},"./utils/legacyUtil.tsx":{type:"FILE",value:e(29035).Z},"./hooks/useFilterTreeData.ts":{type:"FILE",value:e(67685).Z},"./hooks/useRefFunc.ts":{type:"FILE",value:e(60133).Z}},entry:"index.tsx"},context:{"./utils/dataUtil.ts":s,"../src.tsx":a,"../assets/index.less":n,"./utils/strategyUtil.ts":_,"./TreeSelect.tsx":p,"./TreeNode.tsx":D,"./valueUtil.ts":f,"./utils/warningPropsUtil.ts":I,"./hooks/useCache.ts":O,"./hooks/useCheckedKeys.ts":C,"./LegacyContext.tsx":T,"./hooks/useTreeData.ts":j,"./OptionList.tsx":x,"./hooks/useDataEntities.ts":S,"./TreeSelectContext.ts":R,"./utils/legacyUtil.tsx":A,"./hooks/useFilterTreeData.ts":L,"./hooks/useRefFunc.ts":V,react:c||(c=e.t(r,2)),"@rc-component/select":E,"rc-field-form":h,"@rc-component/select/assets/index.less":l,"/Users/jilin/projects/antd/rc-tree-select/examples/utils/dataUtil.ts":s,"/Users/jilin/projects/antd/rc-tree-select/src/index.tsx":a,"/Users/jilin/projects/antd/rc-tree-select/assets/index.less":n,"/Users/jilin/projects/antd/rc-tree-select/src/utils/strategyUtil.ts":_,"/Users/jilin/projects/antd/rc-tree-select/src/TreeSelect.tsx":p,"/Users/jilin/projects/antd/rc-tree-select/src/TreeNode.tsx":D,"/Users/jilin/projects/antd/rc-tree-select/src/utils/valueUtil.ts":f,"@rc-component/select/lib/hooks/useId":i,"rc-tree/lib/utils/conductUtil":m,"@rc-component/util/lib/hooks/useMergedState":M,"@rc-component/util/lib/warning":y,"/Users/jilin/projects/antd/rc-tree-select/src/utils/warningPropsUtil.ts":I,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useCache.ts":O,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useCheckedKeys.ts":C,"/Users/jilin/projects/antd/rc-tree-select/src/LegacyContext.tsx":T,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useTreeData.ts":j,"/Users/jilin/projects/antd/rc-tree-select/src/OptionList.tsx":x,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useDataEntities.ts":S,"/Users/jilin/projects/antd/rc-tree-select/src/TreeSelectContext.ts":R,"/Users/jilin/projects/antd/rc-tree-select/src/utils/legacyUtil.tsx":A,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useFilterTreeData.ts":L,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useRefFunc.ts":V,"rc-tree/lib/utils/treeUtil":Z,"rc-tree":$,"@rc-component/util/lib/Children/toArray":J,"@rc-component/util/lib/KeyCode":b,"@rc-component/util/lib/hooks/useMemo":d,"@rc-component/util":X},renderOpts:{compile:function(){var F=g()(u()().mark(function k(){var K,W=arguments;return u()().wrap(function(N){for(;;)switch(N.prev=N.next){case 0:return N.next=2,e.e(439).then(e.bind(e,56439));case 2:return N.abrupt("return",(K=N.sent).default.apply(K,W));case 3:case"end":return N.stop()}},k)}));function H(){return F.apply(this,arguments)}return H}()}}}},58077:function(v,t,e){var c;e.r(t),e.d(t,{demos:function(){return J}});var o=e(7557),u=e.n(o),P=e(41498),g=e.n(P),r=e(96162),U=e(20189),E=e(63484),h=e(27165),l=e(56253),s=e(84670),a=e(28853),n=e(87643),_=e(83238),p=e(95094),D=e(99217),f=e(8399),i=e(47239),m=e(43647),M=e(89957),y=e(2971),I=e(41234),O=e(46077),C=e(76536),T=e(64803),j=e(87992),x=e(19811),S=e(72770),R=e(64887),A=e(43880),L=e(29213),V=e(1732),Z=e(26694),$=e(4216),J={"docs-demo-mutiple-with-max-count-demo-mutiple-with-maxcount":{component:r.memo(r.lazy(function(){return e.e(433).then(e.bind(e,54129))})),asset:{type:"BLOCK",id:"docs-demo-mutiple-with-max-count-demo-mutiple-with-maxcount",refAtomIds:[],dependencies:{"index.tsx":{type:"FILE",value:e(67959).Z},react:{type:"NPM",value:"16.14.0"},"../src.tsx":{type:"FILE",value:e(42103).Z},"./TreeSelect.tsx":{type:"FILE",value:e(51184).Z},"./utils/strategyUtil.ts":{type:"FILE",value:e(76742).Z},"./TreeNode.tsx":{type:"FILE",value:e(41849).Z},"@rc-component/select":{type:"NPM",value:"1.0.0"},"./valueUtil.ts":{type:"FILE",value:e(4370).Z},"rc-tree":{type:"NPM",value:"5.13.1"},"@rc-component/util":{type:"NPM",value:"1.2.1"},"./utils/warningPropsUtil.ts":{type:"FILE",value:e(29162).Z},"./hooks/useCache.ts":{type:"FILE",value:e(95108).Z},"./hooks/useCheckedKeys.ts":{type:"FILE",value:e(7118).Z},"./hooks/useDataEntities.ts":{type:"FILE",value:e(31367).Z},"./hooks/useFilterTreeData.ts":{type:"FILE",value:e(67685).Z},"./hooks/useRefFunc.ts":{type:"FILE",value:e(60133).Z},"./hooks/useTreeData.ts":{type:"FILE",value:e(4997).Z},"./LegacyContext.tsx":{type:"FILE",value:e(28458).Z},"./OptionList.tsx":{type:"FILE",value:e(49597).Z},"./TreeSelectContext.ts":{type:"FILE",value:e(29285).Z},"./utils/legacyUtil.tsx":{type:"FILE",value:e(29035).Z}},entry:"index.tsx"},context:{"../src.tsx":E,"./TreeSelect.tsx":h,"./utils/strategyUtil.ts":l,"./TreeNode.tsx":s,"./valueUtil.ts":n,"./utils/warningPropsUtil.ts":i,"./hooks/useCache.ts":m,"./hooks/useCheckedKeys.ts":M,"./hooks/useDataEntities.ts":y,"./hooks/useFilterTreeData.ts":I,"./hooks/useRefFunc.ts":O,"./hooks/useTreeData.ts":C,"./LegacyContext.tsx":T,"./OptionList.tsx":j,"./TreeSelectContext.ts":x,"./utils/legacyUtil.tsx":S,react:c||(c=e.t(r,2)),"/Users/jilin/projects/antd/rc-tree-select/src/index.tsx":E,"/Users/jilin/projects/antd/rc-tree-select/src/TreeSelect.tsx":h,"/Users/jilin/projects/antd/rc-tree-select/src/utils/strategyUtil.ts":l,"/Users/jilin/projects/antd/rc-tree-select/src/TreeNode.tsx":s,"@rc-component/select":a,"/Users/jilin/projects/antd/rc-tree-select/src/utils/valueUtil.ts":n,"@rc-component/select/lib/hooks/useId":_,"rc-tree/lib/utils/conductUtil":p,"@rc-component/util/lib/hooks/useMergedState":D,"@rc-component/util/lib/warning":f,"/Users/jilin/projects/antd/rc-tree-select/src/utils/warningPropsUtil.ts":i,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useCache.ts":m,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useCheckedKeys.ts":M,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useDataEntities.ts":y,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useFilterTreeData.ts":I,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useRefFunc.ts":O,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useTreeData.ts":C,"/Users/jilin/projects/antd/rc-tree-select/src/LegacyContext.tsx":T,"/Users/jilin/projects/antd/rc-tree-select/src/OptionList.tsx":j,"/Users/jilin/projects/antd/rc-tree-select/src/TreeSelectContext.ts":x,"/Users/jilin/projects/antd/rc-tree-select/src/utils/legacyUtil.tsx":S,"rc-tree":R,"rc-tree/lib/utils/treeUtil":A,"@rc-component/util/lib/Children/toArray":L,"@rc-component/util/lib/KeyCode":V,"@rc-component/util/lib/hooks/useMemo":Z,"@rc-component/util":$},renderOpts:{compile:function(){var b=g()(u()().mark(function X(){var G,F=arguments;return u()().wrap(function(k){for(;;)switch(k.prev=k.next){case 0:return k.next=2,e.e(439).then(e.bind(e,56439));case 2:return k.abrupt("return",(G=k.sent).default.apply(G,F));case 3:case"end":return k.stop()}},X)}));function d(){return b.apply(this,arguments)}return d}()}}}},15371:function(v,t,e){var c;e.r(t),e.d(t,{demos:function(){return b}});var o=e(7557),u=e.n(o),P=e(41498),g=e.n(P),r=e(96162),U=e(67928),E=e(25240),h=e(63484),l=e(56253),s=e(27165),a=e(84670),n=e(28853),_=e(87643),p=e(83238),D=e(95094),f=e(99217),i=e(8399),m=e(47239),M=e(46077),y=e(76536),I=e(64803),O=e(87992),C=e(43647),T=e(19811),j=e(89957),x=e(72770),S=e(2971),R=e(41234),A=e(64887),L=e(29213),V=e(43880),Z=e(1732),$=e(26694),J=e(4216),b={"docs-demo-tree-node-label-prop-demo-treenodelabelprop":{component:r.memo(r.lazy(function(){return e.e(433).then(e.bind(e,89658))})),asset:{type:"BLOCK",id:"docs-demo-tree-node-label-prop-demo-treenodelabelprop",refAtomIds:[],dependencies:{"index.tsx":{type:"FILE",value:e(73007).Z},react:{type:"NPM",value:"16.14.0"},"../assets/index.less":{type:"FILE",value:e(25866).Z},"../src.tsx":{type:"FILE",value:e(42103).Z},"./utils/strategyUtil.ts":{type:"FILE",value:e(76742).Z},"./TreeSelect.tsx":{type:"FILE",value:e(51184).Z},"./TreeNode.tsx":{type:"FILE",value:e(41849).Z},"@rc-component/select":{type:"NPM",value:"1.0.0"},"./valueUtil.ts":{type:"FILE",value:e(4370).Z},"rc-tree":{type:"NPM",value:"5.13.1"},"@rc-component/util":{type:"NPM",value:"1.2.1"},"./utils/warningPropsUtil.ts":{type:"FILE",value:e(29162).Z},"./hooks/useRefFunc.ts":{type:"FILE",value:e(60133).Z},"./hooks/useTreeData.ts":{type:"FILE",value:e(4997).Z},"./LegacyContext.tsx":{type:"FILE",value:e(28458).Z},"./OptionList.tsx":{type:"FILE",value:e(49597).Z},"./hooks/useCache.ts":{type:"FILE",value:e(95108).Z},"./TreeSelectContext.ts":{type:"FILE",value:e(29285).Z},"./hooks/useCheckedKeys.ts":{type:"FILE",value:e(7118).Z},"./utils/legacyUtil.tsx":{type:"FILE",value:e(29035).Z},"./hooks/useDataEntities.ts":{type:"FILE",value:e(31367).Z},"./hooks/useFilterTreeData.ts":{type:"FILE",value:e(67685).Z}},entry:"index.tsx"},context:{"../assets/index.less":E,"../src.tsx":h,"./utils/strategyUtil.ts":l,"./TreeSelect.tsx":s,"./TreeNode.tsx":a,"./valueUtil.ts":_,"./utils/warningPropsUtil.ts":m,"./hooks/useRefFunc.ts":M,"./hooks/useTreeData.ts":y,"./LegacyContext.tsx":I,"./OptionList.tsx":O,"./hooks/useCache.ts":C,"./TreeSelectContext.ts":T,"./hooks/useCheckedKeys.ts":j,"./utils/legacyUtil.tsx":x,"./hooks/useDataEntities.ts":S,"./hooks/useFilterTreeData.ts":R,react:c||(c=e.t(r,2)),"/Users/jilin/projects/antd/rc-tree-select/assets/index.less":E,"/Users/jilin/projects/antd/rc-tree-select/src/index.tsx":h,"/Users/jilin/projects/antd/rc-tree-select/src/utils/strategyUtil.ts":l,"/Users/jilin/projects/antd/rc-tree-select/src/TreeSelect.tsx":s,"/Users/jilin/projects/antd/rc-tree-select/src/TreeNode.tsx":a,"@rc-component/select":n,"/Users/jilin/projects/antd/rc-tree-select/src/utils/valueUtil.ts":_,"@rc-component/select/lib/hooks/useId":p,"rc-tree/lib/utils/conductUtil":D,"@rc-component/util/lib/hooks/useMergedState":f,"@rc-component/util/lib/warning":i,"/Users/jilin/projects/antd/rc-tree-select/src/utils/warningPropsUtil.ts":m,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useRefFunc.ts":M,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useTreeData.ts":y,"/Users/jilin/projects/antd/rc-tree-select/src/LegacyContext.tsx":I,"/Users/jilin/projects/antd/rc-tree-select/src/OptionList.tsx":O,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useCache.ts":C,"/Users/jilin/projects/antd/rc-tree-select/src/TreeSelectContext.ts":T,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useCheckedKeys.ts":j,"/Users/jilin/projects/antd/rc-tree-select/src/utils/legacyUtil.tsx":x,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useDataEntities.ts":S,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useFilterTreeData.ts":R,"rc-tree":A,"@rc-component/util/lib/Children/toArray":L,"rc-tree/lib/utils/treeUtil":V,"@rc-component/util/lib/KeyCode":Z,"@rc-component/util/lib/hooks/useMemo":$,"@rc-component/util":J},renderOpts:{compile:function(){var d=g()(u()().mark(function G(){var F,H=arguments;return u()().wrap(function(K){for(;;)switch(K.prev=K.next){case 0:return K.next=2,e.e(439).then(e.bind(e,56439));case 2:return K.abrupt("return",(F=K.sent).default.apply(F,H));case 3:case"end":return K.stop()}},G)}));function X(){return d.apply(this,arguments)}return X}()}}}},43072:function(v,t,e){var c;e.r(t),e.d(t,{demos:function(){return b}});var o=e(7557),u=e.n(o),P=e(41498),g=e.n(P),r=e(96162),U=e(15316),E=e(63484),h=e(25240),l=e(27165),s=e(56253),a=e(84670),n=e(28853),_=e(87643),p=e(83238),D=e(95094),f=e(99217),i=e(8399),m=e(47239),M=e(43647),y=e(89957),I=e(2971),O=e(41234),C=e(46077),T=e(76536),j=e(64803),x=e(87992),S=e(19811),R=e(72770),A=e(43880),L=e(29213),V=e(64887),Z=e(1732),$=e(26694),J=e(4216),b={"docs-demo-width-demo-width":{component:r.memo(r.lazy(function(){return e.e(433).then(e.bind(e,36112))})),asset:{type:"BLOCK",id:"docs-demo-width-demo-width",refAtomIds:[],dependencies:{"index.tsx":{type:"FILE",value:e(33149).Z},react:{type:"NPM",value:"16.14.0"},"../src.tsx":{type:"FILE",value:e(42103).Z},"../assets/index.less":{type:"FILE",value:e(25866).Z},"./TreeSelect.tsx":{type:"FILE",value:e(51184).Z},"./utils/strategyUtil.ts":{type:"FILE",value:e(76742).Z},"./TreeNode.tsx":{type:"FILE",value:e(41849).Z},"@rc-component/select":{type:"NPM",value:"1.0.0"},"./valueUtil.ts":{type:"FILE",value:e(4370).Z},"rc-tree":{type:"NPM",value:"5.13.1"},"@rc-component/util":{type:"NPM",value:"1.2.1"},"./utils/warningPropsUtil.ts":{type:"FILE",value:e(29162).Z},"./hooks/useCache.ts":{type:"FILE",value:e(95108).Z},"./hooks/useCheckedKeys.ts":{type:"FILE",value:e(7118).Z},"./hooks/useDataEntities.ts":{type:"FILE",value:e(31367).Z},"./hooks/useFilterTreeData.ts":{type:"FILE",value:e(67685).Z},"./hooks/useRefFunc.ts":{type:"FILE",value:e(60133).Z},"./hooks/useTreeData.ts":{type:"FILE",value:e(4997).Z},"./LegacyContext.tsx":{type:"FILE",value:e(28458).Z},"./OptionList.tsx":{type:"FILE",value:e(49597).Z},"./TreeSelectContext.ts":{type:"FILE",value:e(29285).Z},"./utils/legacyUtil.tsx":{type:"FILE",value:e(29035).Z}},entry:"index.tsx"},context:{"../src.tsx":E,"../assets/index.less":h,"./TreeSelect.tsx":l,"./utils/strategyUtil.ts":s,"./TreeNode.tsx":a,"./valueUtil.ts":_,"./utils/warningPropsUtil.ts":m,"./hooks/useCache.ts":M,"./hooks/useCheckedKeys.ts":y,"./hooks/useDataEntities.ts":I,"./hooks/useFilterTreeData.ts":O,"./hooks/useRefFunc.ts":C,"./hooks/useTreeData.ts":T,"./LegacyContext.tsx":j,"./OptionList.tsx":x,"./TreeSelectContext.ts":S,"./utils/legacyUtil.tsx":R,react:c||(c=e.t(r,2)),"/Users/jilin/projects/antd/rc-tree-select/src/index.tsx":E,"/Users/jilin/projects/antd/rc-tree-select/assets/index.less":h,"/Users/jilin/projects/antd/rc-tree-select/src/TreeSelect.tsx":l,"/Users/jilin/projects/antd/rc-tree-select/src/utils/strategyUtil.ts":s,"/Users/jilin/projects/antd/rc-tree-select/src/TreeNode.tsx":a,"@rc-component/select":n,"/Users/jilin/projects/antd/rc-tree-select/src/utils/valueUtil.ts":_,"@rc-component/select/lib/hooks/useId":p,"rc-tree/lib/utils/conductUtil":D,"@rc-component/util/lib/hooks/useMergedState":f,"@rc-component/util/lib/warning":i,"/Users/jilin/projects/antd/rc-tree-select/src/utils/warningPropsUtil.ts":m,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useCache.ts":M,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useCheckedKeys.ts":y,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useDataEntities.ts":I,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useFilterTreeData.ts":O,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useRefFunc.ts":C,"/Users/jilin/projects/antd/rc-tree-select/src/hooks/useTreeData.ts":T,"/Users/jilin/projects/antd/rc-tree-select/src/LegacyContext.tsx":j,"/Users/jilin/projects/antd/rc-tree-select/src/OptionList.tsx":x,"/Users/jilin/projects/antd/rc-tree-select/src/TreeSelectContext.ts":S,"/Users/jilin/projects/antd/rc-tree-select/src/utils/legacyUtil.tsx":R,"rc-tree/lib/utils/treeUtil":A,"@rc-component/util/lib/Children/toArray":L,"rc-tree":V,"@rc-component/util/lib/KeyCode":Z,"@rc-component/util/lib/hooks/useMemo":$,"@rc-component/util":J},renderOpts:{compile:function(){var d=g()(u()().mark(function G(){var F,H=arguments;return u()().wrap(function(K){for(;;)switch(K.prev=K.next){case 0:return K.next=2,e.e(439).then(e.bind(e,56439));case 2:return K.abrupt("return",(F=K.sent).default.apply(F,H));case 3:case"end":return K.stop()}},G)}));function X(){return d.apply(this,arguments)}return X}()}}}},81059:function(v,t,e){e.r(t),e.d(t,{demos:function(){return u}});var c=e(96162),o=e(8210),u={}},31458:function(v,t,e){e.r(t);var c=e(82100),o=e.n(c),u=e(29186),P=e.n(u),g=e(13720),r=e.n(g),U=e(80619),E=e.n(U),h=e(47074),l=e.n(h),s=e(85573),a=e.n(s),n=e(96162),_=e(8645),p=function(D){E()(i,D);var f=l()(i);function i(){var m;o()(this,i);for(var M=arguments.length,y=new Array(M),I=0;I<M;I++)y[I]=arguments[I];return m=f.call.apply(f,[this].concat(y)),a()(r()(m),"xRef",n.createRef()),a()(r()(m),"yRef",n.createRef()),a()(r()(m),"zRef",n.createRef()),a()(r()(m),"state",{nums:""}),a()(r()(m),"onGen",function(O){var C=m.props.onGen;O.preventDefault();var T=m.getVals();C((0,_.generateData)(T.x,T.y,T.z)),m.setState({nums:(0,_.calcTotal)(T.x,T.y,T.z)})}),a()(r()(m),"getVals",function(){return{x:parseInt(m.xRef.current.value,10),y:parseInt(m.yRef.current.value,10),z:parseInt(m.zRef.current.value,10)}}),a()(r()(m),"getDefaultValue",function(O){return O in m.props?String(m.props[O]):null}),m}return P()(i,[{key:"componentDidMount",value:function(){var M=this.props.onGen,y=this.getVals();M((0,_.generateData)(y.x,y.y,y.z))}},{key:"render",value:function(){var M=this.state.nums,y=this.props,I=y.x,O=y.y,C=y.z;return n.createElement("div",{style:{padding:"0 20px"}},n.createElement("h2",null,"big data generator"),n.createElement("form",{onSubmit:this.onGen},n.createElement("span",{style:{marginRight:10}},"x:"," ",n.createElement("input",{ref:this.xRef,defaultValue:this.getDefaultValue("x"),type:"number",min:"1",required:!0,style:{width:50}})),n.createElement("span",{style:{marginRight:10}},"y:"," ",n.createElement("input",{ref:this.yRef,defaultValue:this.getDefaultValue("y"),type:"number",min:"1",required:!0,style:{width:50}})),n.createElement("span",{style:{marginRight:10}},"z:"," ",n.createElement("input",{ref:this.zRef,defaultValue:this.getDefaultValue("z"),type:"number",min:"1",required:!0,style:{width:50}})),n.createElement("button",{type:"submit"},"Generate"),n.createElement("p",null,"total nodes: ",M||(0,_.calcTotal)(I,O,C))),n.createElement("p",{style:{fontSize:12}},"x\uFF1A\u6BCF\u4E00\u7EA7\u4E0B\u7684\u8282\u70B9\u603B\u6570\u3002y\uFF1A\u6BCF\u7EA7\u8282\u70B9\u91CC\u6709y\u4E2A\u8282\u70B9\u3001\u5B58\u5728\u5B50\u8282\u70B9\u3002z\uFF1A\u6811\u7684level\u5C42\u7EA7\u6570\uFF080\u8868\u793A\u4E00\u7EA7\uFF09"))}}]),i}(n.Component);a()(p,"defaultProps",{onGen:function(){},x:20,y:18,z:1}),t.default=p},8645:function(v,t,e){e.r(t),e.d(t,{calcTotal:function(){return o},gData:function(){return u},generateData:function(){return c},generateTreeNodes:function(){return P},getFilterValue:function(){return h},getNewTreeData:function(){return r}});function c(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:3,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:[];function _(p,D,f){for(var i=D||"0",m=f||n,M=[],y=0;y<l;y++){var I="".concat(i,"-").concat(y);m.push({label:"".concat(I,"-label"),value:"".concat(I,"-value"),key:I,disabled:I==="0-0-0-1"||!1}),y<s&&M.push(I)}if(p<0)return m;var O=p-1;return M.forEach(function(C,T){return m[T].children=[],_(O,C,m[T].children)}),null}return _(a),n}function o(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:3,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,n=function _(p){return p>=0?l*Math.pow(s,p--)+_(p):0};return n(a+1)}console.log("\u603B\u8282\u70B9\u6570\uFF08\u5355\u4E2Atree\uFF09\uFF1A",o());var u=c();function P(l){for(var s=[],a=l.props.eventKey,n=0;n<3;n++)s.push({label:"".concat(a,"-").concat(n,"-label"),value:"".concat(a,"-").concat(n,"-value"),key:"".concat(a,"-").concat(n)});return s}function g(l,s,a){var n=function _(p,D){var f=D-1;p.forEach(function(i){(i.key.length>s.length?i.key.indexOf(s)!==0:s.indexOf(i.key)!==0)||(i.children?_(i.children,f):f<1&&(i.isLeaf=!0))})};n(l,a+1)}function r(l,s,a,n){var _=function p(D){n<1||s.length-3>n*2||D.forEach(function(f){s.indexOf(f.key)===0&&(f.children?p(f.children):f.children=a)})};_(l),g(l,s,n)}function U(l,s){var a=function n(_){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"0";_.forEach(function(D,f){var i="".concat(p,"-").concat(f);D.children&&n(D.children,i),s(D,f,i)})};a(l)}function E(l,s){return s.length<l.length||s.length>l.length&&s.charAt(l.length)!=="-"?!1:s.substr(0,l.length)===l}function h(l,s,a){var n=[],_=[];U(u,function(f,i,m){s.indexOf(f.value)>-1&&n.push(m),a.indexOf(f.value)>-1&&_.push(m)});var p=[];_.forEach(function(f){n.forEach(function(i){E(f,i)||E(i,f)||p.push(i)})});var D=[];return p.length&&U(u,function(f,i,m){p.indexOf(m)>-1&&D.push(f.value)}),D}},64803:function(v,t,e){e.r(t);var c=e(96162),o=c.createContext(null);t.default=o},87992:function(v,t,e){e.r(t);var c=e(95582),o=e.n(c),u=e(91232),P=e.n(u),g=e(37205),r=e.n(g),U=e(79800),E=e.n(U),h=e(28853),l=e(64887),s=e(1732),a=e(26694),n=e(96162),_=e(64803),p=e(19811),D=e(87643),f=e(4216),i={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},m=function(I,O){var C=(0,h.useBaseProps)(),T=C.prefixCls,j=C.multiple,x=C.searchValue,S=C.toggleOpen,R=C.open,A=C.notFoundContent,L=n.useContext(p.default),V=L.virtual,Z=L.listHeight,$=L.listItemHeight,J=L.listItemScrollOffset,b=L.treeData,d=L.fieldNames,X=L.onSelect,G=L.dropdownMatchSelectWidth,F=L.treeExpandAction,H=L.treeTitleRender,k=L.onPopupScroll,K=L.leftMaxCount,W=L.leafCountOnly,le=L.valueEntities,N=n.useContext(_.default),De=N.checkable,ie=N.checkedKeys,Oe=N.halfCheckedKeys,Ue=N.treeExpandedKeys,It=N.treeDefaultExpandAll,Pt=N.treeDefaultExpandedKeys,Ne=N.onTreeExpand,Be=N.treeIcon,nt=N.showTreeIcon,be=N.switcherIcon,Ct=N.treeLine,ve=N.treeNodeFilterProp,ue=N.loadData,Fe=N.treeLoadedKeys,ye=N.treeMotion,st=N.onTreeLoad,Ut=N.keyEntities,Te=n.useRef(),Ve=(0,a.default)(function(){return b},[R,b],function(B,Q){return Q[0]&&B[1]!==Q[1]}),lt=n.useMemo(function(){return De?{checked:ie,halfChecked:Oe}:null},[De,ie,Oe]);n.useEffect(function(){if(R&&!j&&ie.length){var B;(B=Te.current)===null||B===void 0||B.scrollTo({key:ie[0]})}},[R]);var Ze=function(Q){Q.preventDefault()},xe=function(Q,ae){var se=ae.node;De&&(0,D.isCheckDisabled)(se)||(X(se.key,{selected:!ie.includes(se.key)}),j||S(!1))},rt=n.useState(Pt),He=E()(rt,2),ge=He[0],at=He[1],ot=n.useState(null),ke=E()(ot,2),$e=ke[0],ze=ke[1],Ge=n.useMemo(function(){return Ue?r()(Ue):x?$e:ge},[ge,$e,Ue,x]),ct=function(Q){at(Q),ze(Q),Ne&&Ne(Q)},Ye=String(x).toLowerCase(),Je=function(Q){return Ye?String(Q[ve]).toLowerCase().includes(Ye):!1};n.useEffect(function(){x&&ze((0,D.getAllKeys)(b,d))},[x]);var Xe=n.useState(function(){return new Map}),Qe=E()(Xe,2),Ie=Qe[0],it=Qe[1];n.useEffect(function(){K&&it(new Map)},[K]);function _t(B){var Q=B[d.value];if(!Ie.has(Q)){var ae=le.get(Q),se=(ae.children||[]).length===0;if(se)Ie.set(Q,!1);else{var ce=ae.children.filter(function(q){return!q.node.disabled&&!q.node.disableCheckbox&&!ie.includes(q.node[d.value])}),oe=ce.length;Ie.set(Q,oe>K)}}return Ie.get(Q)}var we=(0,f.useEvent)(function(B){var Q=B[d.value];return ie.includes(Q)||K===null?!1:K<=0?!0:W&&K?_t(B):!1}),dt=function B(Q){var ae=P()(Q),se;try{for(ae.s();!(se=ae.n()).done;){var ce=se.value;if(!(ce.disabled||ce.selectable===!1)){if(x){if(Je(ce))return ce}else return ce;if(ce[d.children]){var oe=B(ce[d.children]);if(oe)return oe}}}}catch(q){ae.e(q)}finally{ae.f()}return null},ut=n.useState(null),Ee=E()(ut,2),je=Ee[0],pt=Ee[1],me=Ut[je];n.useEffect(function(){if(R){var B=null,Q=function(){var se=dt(Ve);return se?se[d.value]:null};!j&&ie.length&&!x?B=ie[0]:B=Q(),pt(B)}},[R,x]),n.useImperativeHandle(O,function(){var B;return{scrollTo:(B=Te.current)===null||B===void 0?void 0:B.scrollTo,onKeyDown:function(ae){var se,ce=ae.which;switch(ce){case s.default.UP:case s.default.DOWN:case s.default.LEFT:case s.default.RIGHT:(se=Te.current)===null||se===void 0||se.onKeyDown(ae);break;case s.default.ENTER:{if(me){var oe=we(me.node),q=(me==null?void 0:me.node)||{},Mt=q.selectable,vt=q.value,Et=q.disabled;Mt!==!1&&!Et&&!oe&&xe(null,{node:{key:je},selected:!ie.includes(vt)})}break}case s.default.ESC:S(!1)}},onKeyUp:function(){}}});var Le=(0,a.default)(function(){return!x},[x,Ue||ge],function(B,Q){var ae=E()(B,1),se=ae[0],ce=E()(Q,2),oe=ce[0],q=ce[1];return se!==oe&&!!(oe||q)}),Re=Le?ue:null;if(Ve.length===0)return n.createElement("div",{role:"listbox",className:"".concat(T,"-empty"),onMouseDown:Ze},A);var Ke={fieldNames:d};return Fe&&(Ke.loadedKeys=Fe),Ge&&(Ke.expandedKeys=Ge),n.createElement("div",{onMouseDown:Ze},me&&R&&n.createElement("span",{style:i,"aria-live":"assertive"},me.node.value),n.createElement(l.UnstableContext.Provider,{value:{nodeDisabled:we}},n.createElement(l.default,o()({ref:Te,focusable:!1,prefixCls:"".concat(T,"-tree"),treeData:Ve,height:Z,itemHeight:$,itemScrollOffset:J,virtual:V!==!1&&G!==!1,multiple:j,icon:Be,showIcon:nt,switcherIcon:be,showLine:Ct,loadData:Re,motion:ye,activeKey:je,checkable:De,checkStrictly:!0,checkedKeys:lt,selectedKeys:De?[]:ie,defaultExpandAll:It,titleRender:H},Ke,{onActiveChange:pt,onSelect:xe,onCheck:xe,onExpand:ct,onLoad:st,filterTreeNode:Je,expandAction:F,onScroll:k}))))},M=n.forwardRef(m);t.default=M},84670:function(v,t,e){e.r(t);var c=function(){return null};t.default=c},27165:function(v,t,e){e.r(t);var c=e(95582),o=e.n(c),u=e(37205),P=e.n(u),g=e(82242),r=e.n(g),U=e(79800),E=e.n(U),h=e(39647),l=e.n(h),s=e(31468),a=e.n(s),n=e(28853),_=e(83238),p=e(95094),D=e(99217),f=e(8399),i=e(96162),m=e(43647),M=e(89957),y=e(2971),I=e(41234),O=e(46077),C=e(76536),T=e(64803),j=e(87992),x=e(84670),S=e(19811),R=e(72770),A=e(56253),L=e(87643),V=e(47239),Z=["id","prefixCls","value","defaultValue","onChange","onSelect","onDeselect","searchValue","inputValue","onSearch","autoClearSearchValue","filterTreeNode","treeNodeFilterProp","showCheckedStrategy","treeNodeLabelProp","multiple","treeCheckable","treeCheckStrictly","labelInValue","maxCount","fieldNames","treeDataSimpleMode","treeData","children","loadData","treeLoadedKeys","onTreeLoad","treeDefaultExpandAll","treeExpandedKeys","treeDefaultExpandedKeys","onTreeExpand","treeExpandAction","virtual","listHeight","listItemHeight","listItemScrollOffset","onDropdownVisibleChange","dropdownMatchSelectWidth","treeLine","treeIcon","showTreeIcon","switcherIcon","treeMotion","treeTitleRender","onPopupScroll"];function $(d){return!d||a()(d)!=="object"}var J=i.forwardRef(function(d,X){var G=d.id,F=d.prefixCls,H=F===void 0?"rc-tree-select":F,k=d.value,K=d.defaultValue,W=d.onChange,le=d.onSelect,N=d.onDeselect,De=d.searchValue,ie=d.inputValue,Oe=d.onSearch,Ue=d.autoClearSearchValue,It=Ue===void 0?!0:Ue,Pt=d.filterTreeNode,Ne=d.treeNodeFilterProp,Be=Ne===void 0?"value":Ne,nt=d.showCheckedStrategy,be=d.treeNodeLabelProp,Ct=d.multiple,ve=d.treeCheckable,ue=d.treeCheckStrictly,Fe=d.labelInValue,ye=d.maxCount,st=d.fieldNames,Ut=d.treeDataSimpleMode,Te=d.treeData,Ve=d.children,lt=d.loadData,Ze=d.treeLoadedKeys,xe=d.onTreeLoad,rt=d.treeDefaultExpandAll,He=d.treeExpandedKeys,ge=d.treeDefaultExpandedKeys,at=d.onTreeExpand,ot=d.treeExpandAction,ke=d.virtual,$e=d.listHeight,ze=$e===void 0?200:$e,Ge=d.listItemHeight,ct=Ge===void 0?20:Ge,Ye=d.listItemScrollOffset,Je=Ye===void 0?0:Ye,Xe=d.onDropdownVisibleChange,Qe=d.dropdownMatchSelectWidth,Ie=Qe===void 0?!0:Qe,it=d.treeLine,_t=d.treeIcon,we=d.showTreeIcon,dt=d.switcherIcon,ut=d.treeMotion,Ee=d.treeTitleRender,je=d.onPopupScroll,pt=l()(d,Z),me=(0,_.default)(G),Le=ve&&!ue,Re=ve||ue,Ke=ue||Fe,B=Re||Ct,Q=(0,D.default)(K,{value:k}),ae=E()(Q,2),se=ae[0],ce=ae[1],oe=i.useMemo(function(){return ve?nt||A.SHOW_CHILD:A.SHOW_ALL},[nt,ve]),q=i.useMemo(function(){return(0,L.fillFieldNames)(st)},[JSON.stringify(st)]),Mt=(0,D.default)("",{value:De!==void 0?De:ie,postState:function(z){return z||""}}),vt=E()(Mt,2),Et=vt[0],xt=vt[1],bt=function(z){xt(z),Oe==null||Oe(z)},ht=(0,C.default)(Te,Ve,Ut),gt=(0,y.default)(ht,q),de=gt.keyEntities,fe=gt.valueEntities,jt=i.useCallback(function(Y){var z=[],w=[];return Y.forEach(function(ee){fe.has(ee)?w.push(ee):z.push(ee)}),{missingRawValues:z,existRawValues:w}},[fe]),Lt=(0,I.default)(ht,Et,{fieldNames:q,treeNodeFilterProp:Be,filterTreeNode:Pt}),Rt=i.useCallback(function(Y){if(Y){if(be)return Y[be];for(var z=q._title,w=0;w<z.length;w+=1){var ee=Y[z[w]];if(ee!==void 0)return ee}}},[q,be]),qe=i.useCallback(function(Y){var z=(0,L.toArray)(Y);return z.map(function(w){return $(w)?{value:w}:w})},[]),mt=i.useCallback(function(Y){var z=qe(Y);return z.map(function(w){var ee=w.label,pe=w.value,re=w.halfChecked,te,ne=fe.get(pe);if(ne){var _e;ee=Ee?Ee(ne.node):(_e=ee)!==null&&_e!==void 0?_e:Rt(ne.node),te=ne.node.disabled}else if(ee===void 0){var Pe=qe(se).find(function(et){return et.value===pe});ee=Pe.label}return{label:ee,value:pe,halfChecked:re,disabled:te}})},[fe,Rt,qe,se]),Kt=i.useMemo(function(){return qe(se===null?[]:se)},[qe,se]),Ft=i.useMemo(function(){var Y=[],z=[];return Kt.forEach(function(w){w.halfChecked?z.push(w):Y.push(w)}),[Y,z]},[Kt]),St=E()(Ft,2),Se=St[0],At=St[1],Wt=i.useMemo(function(){return Se.map(function(Y){return Y.value})},[Se]),Vt=(0,M.default)(Se,At,Le,de),Nt=E()(Vt,2),Ae=Nt[0],ft=Nt[1],Zt=i.useMemo(function(){var Y=(0,A.formatStrategyValues)(Ae,oe,de,q),z=Y.map(function(re){var te,ne;return(te=(ne=de[re])===null||ne===void 0||(ne=ne.node)===null||ne===void 0?void 0:ne[q.value])!==null&&te!==void 0?te:re}),w=z.map(function(re){var te=Se.find(function(_e){return _e.value===re}),ne=Fe?te==null?void 0:te.label:Ee==null?void 0:Ee(te);return{value:re,label:ne}}),ee=mt(w),pe=ee[0];return!B&&pe&&(0,L.isNil)(pe.value)&&(0,L.isNil)(pe.label)?[]:ee.map(function(re){var te;return r()(r()({},re),{},{label:(te=re.label)!==null&&te!==void 0?te:re.value})})},[q,B,Ae,Se,mt,oe,de]),Ht=(0,m.default)(Zt),kt=E()(Ht,1),Ot=kt[0],Bt=i.useMemo(function(){return B&&(oe==="SHOW_CHILD"||ue||!ve)?ye:null},[ye,B,ue,oe,ve]),Dt=(0,O.default)(function(Y,z,w){var ee=(0,A.formatStrategyValues)(Y,oe,de,q);if(!(Bt&&ee.length>Bt)){var pe=mt(Y);if(ce(pe),It&&xt(""),W){var re=Y;Le&&(re=ee.map(function(he){var Ce=fe.get(he);return Ce?Ce.node[q.value]:he}));var te=z||{triggerValue:void 0,selected:void 0},ne=te.triggerValue,_e=te.selected,Pe=re;if(ue){var et=At.filter(function(he){return!re.includes(he.value)});Pe=[].concat(P()(Pe),P()(et))}var tt=mt(Pe),Me={preValue:Se,triggerValue:ne},We=!0;(ue||w==="selection"&&!_e)&&(We=!1),(0,R.fillAdditionalInfo)(Me,ne,Y,ht,We,q),Re?Me.checked=_e:Me.selected=_e;var yt=Ke?tt:tt.map(function(he){return he.value});W(B?yt:yt[0],Ke?null:tt.map(function(he){return he.label}),Me)}}}),Tt=i.useCallback(function(Y,z){var w,ee=z.selected,pe=z.source,re=de[Y],te=re==null?void 0:re.node,ne=(w=te==null?void 0:te[q.value])!==null&&w!==void 0?w:Y;if(!B)Dt([ne],{selected:!0,triggerValue:ne},"option");else{var _e=ee?[].concat(P()(Wt),[ne]):Ae.filter(function(Ce){return Ce!==ne});if(Le){var Pe=jt(_e),et=Pe.missingRawValues,tt=Pe.existRawValues,Me=tt.map(function(Ce){return fe.get(Ce).key}),We;if(ee){var yt=(0,p.conductCheck)(Me,!0,de);We=yt.checkedKeys}else{var he=(0,p.conductCheck)(Me,{checked:!1,halfCheckedKeys:ft},de);We=he.checkedKeys}_e=[].concat(P()(et),P()(We.map(function(Ce){return de[Ce].node[q.value]})))}Dt(_e,{selected:ee,triggerValue:ne},pe||"option")}ee||!B?le==null||le(ne,(0,R.fillLegacyProps)(te)):N==null||N(ne,(0,R.fillLegacyProps)(te))},[jt,fe,de,q,B,Wt,Dt,Le,le,N,Ae,ft,ye]),$t=i.useCallback(function(Y){if(Xe){var z={};Object.defineProperty(z,"documentClickClose",{get:function(){return(0,f.default)(!1,"Second param of `onDropdownVisibleChange` has been removed."),!1}}),Xe(Y,z)}},[Xe]),zt=(0,O.default)(function(Y,z){var w=Y.map(function(ee){return ee.value});if(z.type==="clear"){Dt(w,{},"selection");return}z.values.length&&Tt(z.values[0].value,{selected:!1,source:"selection"})}),Gt=i.useMemo(function(){return{virtual:ke,dropdownMatchSelectWidth:Ie,listHeight:ze,listItemHeight:ct,listItemScrollOffset:Je,treeData:Lt,fieldNames:q,onSelect:Tt,treeExpandAction:ot,treeTitleRender:Ee,onPopupScroll:je,leftMaxCount:ye===void 0?null:ye-Ot.length,leafCountOnly:oe==="SHOW_CHILD"&&!ue&&!!ve,valueEntities:fe}},[ke,Ie,ze,ct,Je,Lt,q,Tt,ot,Ee,je,ye,Ot.length,oe,ue,ve,fe]),Yt=i.useMemo(function(){return{checkable:Re,loadData:lt,treeLoadedKeys:Ze,onTreeLoad:xe,checkedKeys:Ae,halfCheckedKeys:ft,treeDefaultExpandAll:rt,treeExpandedKeys:He,treeDefaultExpandedKeys:ge,onTreeExpand:at,treeIcon:_t,treeMotion:ut,showTreeIcon:we,switcherIcon:dt,treeLine:it,treeNodeFilterProp:Be,keyEntities:de}},[Re,lt,Ze,xe,Ae,ft,rt,He,ge,at,_t,ut,we,dt,it,Be,de]);return i.createElement(S.default.Provider,{value:Gt},i.createElement(T.default.Provider,{value:Yt},i.createElement(n.BaseSelect,o()({ref:X},pt,{id:me,prefixCls:H,mode:B?"multiple":void 0,displayValues:Ot,onDisplayValuesChange:zt,searchValue:Et,onSearch:bt,OptionList:j.default,emptyOptions:!ht.length,onDropdownVisibleChange:$t,dropdownMatchSelectWidth:Ie}))))}),b=J;b.TreeNode=x.default,b.SHOW_ALL=A.SHOW_ALL,b.SHOW_PARENT=A.SHOW_PARENT,b.SHOW_CHILD=A.SHOW_CHILD,t.default=b},19811:function(v,t,e){e.r(t);var c=e(96162),o=c.createContext(null);t.default=o},43647:function(v,t,e){e.r(t);var c=e(82242),o=e.n(c),u=e(96162);t.default=function(P){var g=u.useRef({valueLabels:new Map});return u.useMemo(function(){var r=g.current.valueLabels,U=new Map,E=P.map(function(h){var l=h.value,s=h.label,a=s!=null?s:r.get(l);return U.set(l,a),o()(o()({},h),{},{label:a})});return g.current.valueLabels=U,[E]},[P])}},89957:function(v,t,e){e.r(t);var c=e(37205),o=e.n(c),u=e(96162),P=e(95094),g=function(U,E,h,l){return u.useMemo(function(){var s=function(m){return m.map(function(M){var y=M.value;return y})},a=s(U),n=s(E),_=a.filter(function(i){return!l[i]}),p=a,D=n;if(h){var f=(0,P.conductCheck)(a,!0,l);p=f.checkedKeys,D=f.halfCheckedKeys}return[Array.from(new Set([].concat(o()(_),o()(p)))),D]},[U,E,h,l])};t.default=g},2971:function(v,t,e){e.r(t);var c=e(82242),o=e.n(c),u=e(96162),P=e(43880),g=e(8399);t.default=function(r,U){return u.useMemo(function(){var E=(0,P.convertDataToEntities)(r,{fieldNames:U,initWrapper:function(l){return o()(o()({},l),{},{valueEntities:new Map})},processEntity:function(l,s){var a=l.node[U.value];if(0)var n;s.valueEntities.set(a,l)}});return E},[r,U])}},41234:function(v,t,e){e.r(t);var c=e(85573),o=e.n(c),u=e(82242),P=e.n(u),g=e(96162),r=e(72770),U=function(h,l,s){var a=s.fieldNames,n=s.treeNodeFilterProp,_=s.filterTreeNode,p=a.children;return g.useMemo(function(){if(!l||_===!1)return h;var D=typeof _=="function"?_:function(i,m){return String(m[n]).toUpperCase().includes(l.toUpperCase())},f=function i(m){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return m.reduce(function(y,I){var O=I[p],C=M||D(l,(0,r.fillLegacyProps)(I)),T=i(O||[],C);return(C||T.length)&&y.push(P()(P()({},I),{},o()({isLeaf:void 0},p,T))),y},[])};return f(h)},[h,l,p,n,_])};t.default=U},46077:function(v,t,e){e.r(t),e.d(t,{default:function(){return o}});var c=e(96162);function o(u){var P=c.useRef();P.current=u;var g=c.useCallback(function(){return P.current.apply(P,arguments)},[]);return g}},76536:function(v,t,e){e.r(t),e.d(t,{default:function(){return E}});var c=e(31468),o=e.n(c),u=e(82242),P=e.n(u),g=e(96162),r=e(72770);function U(h,l){var s=l.id,a=l.pId,n=l.rootPId,_=new Map,p=[];return h.forEach(function(D){var f=D[s],i=P()(P()({},D),{},{key:D.key||f});_.set(f,i)}),_.forEach(function(D){var f=D[a],i=_.get(f);i?(i.children=i.children||[],i.children.push(D)):(f===n||n===null)&&p.push(D)}),p}function E(h,l,s){return g.useMemo(function(){if(h){if(s){var a=P()({id:"id",pId:"pId",rootPId:null},o()(s)==="object"?s:{});return U(h,a)}return h}return(0,r.convertChildrenToData)(l)},[l,s,h])}},63484:function(v,t,e){e.r(t),e.d(t,{SHOW_ALL:function(){return u.SHOW_ALL},SHOW_CHILD:function(){return u.SHOW_CHILD},SHOW_PARENT:function(){return u.SHOW_PARENT},TreeNode:function(){return o.default}});var c=e(27165),o=e(84670),u=e(56253);t.default=c.default},72770:function(v,t,e){e.r(t),e.d(t,{convertChildrenToData:function(){return l},fillAdditionalInfo:function(){return a},fillLegacyProps:function(){return s}});var c=e(82242),o=e.n(c),u=e(39647),P=e.n(u),g=e(96162),r=e(29213),U=e(8399),E=e(84670),h=["children","value"];function l(n){return(0,r.default)(n).map(function(_){if(!g.isValidElement(_)||!_.type)return null;var p=_,D=p.key,f=p.props,i=f.children,m=f.value,M=P()(f,h),y=o()({key:D,value:m},M),I=l(i);return I.length&&(y.children=I),y}).filter(function(_){return _})}function s(n){if(!n)return n;var _=o()({},n);return"props"in _||Object.defineProperty(_,"props",{get:function(){return(0,U.default)(!1,"New `rc-tree-select` not support return node instance as argument anymore. Please consider to remove `props` access."),_}}),_}function a(n,_,p,D,f,i){var m=null,M=null;function y(){function I(O){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"0",T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return O.map(function(j,x){var S="".concat(C,"-").concat(x),R=j[i.value],A=p.includes(R),L=I(j[i.children]||[],S,A),V=g.createElement(E.default,j,L.map(function($){return $.node}));if(_===R&&(m=V),A){var Z={pos:S,node:V,children:L};return T||M.push(Z),Z}return null}).filter(function(j){return j})}M||(M=[],I(D),M.sort(function(O,C){var T=O.node.props.value,j=C.node.props.value,x=p.indexOf(T),S=p.indexOf(j);return x-S}))}Object.defineProperty(n,"triggerNode",{get:function(){return(0,U.default)(!1,"`triggerNode` is deprecated. Please consider decoupling data with node."),y(),m}}),Object.defineProperty(n,"allCheckedNodes",{get:function(){return(0,U.default)(!1,"`allCheckedNodes` is deprecated. Please consider decoupling data with node."),y(),f?M:M.map(function(O){var C=O.node;return C})}})}},56253:function(v,t,e){e.r(t),e.d(t,{SHOW_ALL:function(){return o},SHOW_CHILD:function(){return P},SHOW_PARENT:function(){return u},formatStrategyValues:function(){return g}});var c=e(87643),o="SHOW_ALL",u="SHOW_PARENT",P="SHOW_CHILD";function g(r,U,E,h){var l=new Set(r);return U===P?r.filter(function(s){var a=E[s];return!a||!a.children||!a.children.some(function(n){var _=n.node;return l.has(_[h.value])})||!a.children.every(function(n){var _=n.node;return(0,c.isCheckDisabled)(_)||l.has(_[h.value])})}):U===u?r.filter(function(s){var a=E[s],n=a?a.parent:null;return!n||(0,c.isCheckDisabled)(n.node)||!l.has(n.key)}):r}},87643:function(v,t,e){e.r(t),e.d(t,{fillFieldNames:function(){return o},getAllKeys:function(){return P},isCheckDisabled:function(){return u},isNil:function(){return g},toArray:function(){return c}});var c=function(U){return Array.isArray(U)?U:U!==void 0?[U]:[]},o=function(U){var E=U||{},h=E.label,l=E.value,s=E.children;return{_title:h?[h]:["title","label"],value:l||"value",key:l||"value",children:s||"children"}},u=function(U){return!U||U.disabled||U.disableCheckbox||U.checkable===!1},P=function(U,E){var h=[],l=function s(a){a.forEach(function(n){var _=n[E.children];_&&(h.push(n[E.value]),s(_))})};return l(U),h},g=function(U){return U==null}},47239:function(v,t,e){e.r(t);var c=e(31468),o=e.n(c),u=e(8399),P=e(87643);function g(r){var U=r.searchPlaceholder,E=r.treeCheckStrictly,h=r.treeCheckable,l=r.labelInValue,s=r.value,a=r.multiple,n=r.showCheckedStrategy,_=r.maxCount;(0,u.default)(!U,"`searchPlaceholder` has been removed."),E&&l===!1&&(0,u.default)(!1,"`treeCheckStrictly` will force set `labelInValue` to `true`."),(l||E)&&(0,u.default)((0,P.toArray)(s).every(function(p){return p&&o()(p)==="object"&&"value"in p}),"Invalid prop `value` supplied to `TreeSelect`. You should use { label: string, value: string | number } or [{ label: string, value: string | number }] instead."),E||a||h?(0,u.default)(!s||Array.isArray(s),"`value` should be an array when `TreeSelect` is checkable or multiple."):(0,u.default)(!Array.isArray(s),"`value` should not be array when `TreeSelect` is single mode."),_&&(n==="SHOW_ALL"&&!E||n==="SHOW_PARENT")&&(0,u.default)(!1,"`maxCount` not work with `showCheckedStrategy=SHOW_ALL` (when `treeCheckStrictly=false`) or `showCheckedStrategy=SHOW_PARENT`.")}t.default=g},25240:function(v,t,e){e.r(t)},9450:function(v,t,e){e.r(t),e.d(t,{texts:function(){return o}});var c=e(80206);const o=[]},31479:function(v,t,e){e.r(t),e.d(t,{texts:function(){return o}});var c=e(2934);const o=[]},34334:function(v,t,e){e.r(t),e.d(t,{texts:function(){return o}});var c=e(86795);const o=[]},69557:function(v,t,e){e.r(t),e.d(t,{texts:function(){return o}});var c=e(32445);const o=[]},17948:function(v,t,e){e.r(t),e.d(t,{texts:function(){return o}});var c=e(55145);const o=[]},92463:function(v,t,e){e.r(t),e.d(t,{texts:function(){return o}});var c=e(94785);const o=[]},20137:function(v,t,e){e.r(t),e.d(t,{texts:function(){return o}});var c=e(547);const o=[]},90673:function(v,t,e){e.r(t),e.d(t,{texts:function(){return o}});var c=e(55230);const o=[]},43064:function(v,t,e){e.r(t),e.d(t,{texts:function(){return o}});var c=e(63166);const o=[]},33546:function(v,t,e){e.r(t),e.d(t,{texts:function(){return o}});var c=e(29272);const o=[]},48502:function(v,t,e){e.r(t),e.d(t,{texts:function(){return o}});var c=e(20189);const o=[]},59807:function(v,t,e){e.r(t),e.d(t,{texts:function(){return o}});var c=e(67928);const o=[]},80011:function(v,t,e){e.r(t),e.d(t,{texts:function(){return o}});var c=e(15316);const o=[]},99944:function(v,t,e){e.r(t),e.d(t,{texts:function(){return o}});var c=e(8210);const o=[{value:"React TreeSelect Component",paraId:0,tocIndex:0},{value:`npm install
2
- npm start
3
- `,paraId:1,tocIndex:2},{value:"http://localhost:8000/examples/",paraId:2,tocIndex:3},{value:"online example: ",paraId:3,tocIndex:3},{value:"https://tree-select-react-component.vercel.app/",paraId:3,tocIndex:3},{value:"name",paraId:4,tocIndex:6},{value:"description",paraId:4,tocIndex:6},{value:"type",paraId:4,tocIndex:6},{value:"default",paraId:4,tocIndex:6},{value:"className",paraId:4,tocIndex:6},{value:"additional css class of root dom node",paraId:4,tocIndex:6},{value:"String",paraId:4,tocIndex:6},{value:"''",paraId:4,tocIndex:6},{value:"prefixCls",paraId:4,tocIndex:6},{value:"prefix class",paraId:4,tocIndex:6},{value:"String",paraId:4,tocIndex:6},{value:"''",paraId:4,tocIndex:6},{value:"animation",paraId:4,tocIndex:6},{value:"dropdown animation name. only support slide-up now",paraId:4,tocIndex:6},{value:"String",paraId:4,tocIndex:6},{value:"''",paraId:4,tocIndex:6},{value:"transitionName",paraId:4,tocIndex:6},{value:"dropdown css animation name",paraId:4,tocIndex:6},{value:"String",paraId:4,tocIndex:6},{value:"''",paraId:4,tocIndex:6},{value:"choiceTransitionName",paraId:4,tocIndex:6},{value:"css animation name for selected items at multiple mode",paraId:4,tocIndex:6},{value:"String",paraId:4,tocIndex:6},{value:"''",paraId:4,tocIndex:6},{value:"dropdownMatchSelectWidth",paraId:4,tocIndex:6},{value:"whether dropdown's with is same with select. Default set ",paraId:4,tocIndex:6},{value:"min-width",paraId:4,tocIndex:6},{value:" same as input",paraId:4,tocIndex:6},{value:"bool",paraId:4,tocIndex:6},{value:"true",paraId:4,tocIndex:6},{value:"dropdownClassName",paraId:4,tocIndex:6},{value:"additional className applied to dropdown",paraId:4,tocIndex:6},{value:"String",paraId:4,tocIndex:6},{value:"-",paraId:4,tocIndex:6},{value:"dropdownStyle",paraId:4,tocIndex:6},{value:"additional style applied to dropdown",paraId:4,tocIndex:6},{value:"Object",paraId:4,tocIndex:6},{value:"{}",paraId:4,tocIndex:6},{value:"onDropdownVisibleChange",paraId:4,tocIndex:6},{value:"control dropdown visible",paraId:4,tocIndex:6},{value:"function",paraId:4,tocIndex:6},{value:"() => { return true; }",paraId:4,tocIndex:6},{value:"notFoundContent",paraId:4,tocIndex:6},{value:"specify content to show when no result matches.",paraId:4,tocIndex:6},{value:"String",paraId:4,tocIndex:6},{value:"'Not Found'",paraId:4,tocIndex:6},{value:"showSearch",paraId:4,tocIndex:6},{value:"whether show search input in single mode",paraId:4,tocIndex:6},{value:"bool",paraId:4,tocIndex:6},{value:"true",paraId:4,tocIndex:6},{value:"allowClear",paraId:4,tocIndex:6},{value:"whether allowClear",paraId:4,tocIndex:6},{value:"bool",paraId:4,tocIndex:6},{value:"false",paraId:4,tocIndex:6},{value:"maxTagTextLength",paraId:4,tocIndex:6},{value:"max tag text length to show",paraId:4,tocIndex:6},{value:"number",paraId:4,tocIndex:6},{value:"-",paraId:4,tocIndex:6},{value:"maxTagCount",paraId:4,tocIndex:6},{value:"max tag count to show",paraId:4,tocIndex:6},{value:"number",paraId:4,tocIndex:6},{value:"-",paraId:4,tocIndex:6},{value:"maxCount",paraId:4,tocIndex:6},{value:"Limit the maximum number of items that can be selected in multiple mode",paraId:4,tocIndex:6},{value:"number",paraId:4,tocIndex:6},{value:"-",paraId:4,tocIndex:6},{value:"maxTagPlaceholder",paraId:4,tocIndex:6},{value:"placeholder for omitted values",paraId:4,tocIndex:6},{value:"ReactNode/function(omittedValues)",paraId:4,tocIndex:6},{value:"-",paraId:4,tocIndex:6},{value:"multiple",paraId:4,tocIndex:6},{value:"whether multiple select (true when enable treeCheckable)",paraId:4,tocIndex:6},{value:"bool",paraId:4,tocIndex:6},{value:"false",paraId:4,tocIndex:6},{value:"disabled",paraId:4,tocIndex:6},{value:"whether disabled select",paraId:4,tocIndex:6},{value:"bool",paraId:4,tocIndex:6},{value:"false",paraId:4,tocIndex:6},{value:"searchValue",paraId:4,tocIndex:6},{value:"work with ",paraId:4,tocIndex:6},{value:"onSearch",paraId:4,tocIndex:6},{value:" to make search value controlled.",paraId:4,tocIndex:6},{value:"string",paraId:4,tocIndex:6},{value:"''",paraId:4,tocIndex:6},{value:"defaultValue",paraId:4,tocIndex:6},{value:"initial selected treeNode(s)",paraId:4,tocIndex:6},{value:"same as value type",paraId:4,tocIndex:6},{value:"-",paraId:4,tocIndex:6},{value:"value",paraId:4,tocIndex:6},{value:"current selected treeNode(s).",paraId:4,tocIndex:6},{value:"normal: String/Array",paraId:4,tocIndex:6},{value:". labelInValue: {value:String,label:React.Node}/Array<{value,label}>. treeCheckStrictly(halfChecked default false): {value:String,label:React.Node, halfChecked}/Array<{value,label,halfChecked}>.",paraId:5,tocIndex:6},{value:"-",paraId:4,tocIndex:6},{value:"labelInValue",paraId:4,tocIndex:6},{value:"whether to embed label in value, see above value type",paraId:4,tocIndex:6},{value:"Bool",paraId:4,tocIndex:6},{value:"false",paraId:4,tocIndex:6},{value:"onChange",paraId:4,tocIndex:6},{value:"called when select treeNode or input value change",paraId:4,tocIndex:6},{value:"function(value, label(null), extra)",paraId:4,tocIndex:6},{value:"-",paraId:4,tocIndex:6},{value:"onSelect",paraId:4,tocIndex:6},{value:"called when select treeNode",paraId:4,tocIndex:6},{value:"function(value, node, extra)",paraId:4,tocIndex:6},{value:"-",paraId:4,tocIndex:6},{value:"onSearch",paraId:4,tocIndex:6},{value:"called when input changed",paraId:4,tocIndex:6},{value:"function",paraId:4,tocIndex:6},{value:"-",paraId:4,tocIndex:6},{value:"onTreeExpand",paraId:4,tocIndex:6},{value:"called when tree node expand",paraId:4,tocIndex:6},{value:"function(expandedKeys)",paraId:4,tocIndex:6},{value:"-",paraId:4,tocIndex:6},{value:"onPopupScroll",paraId:4,tocIndex:6},{value:"called when popup scroll",paraId:4,tocIndex:6},{value:"function(event)",paraId:4,tocIndex:6},{value:"-",paraId:4,tocIndex:6},{value:"showCheckedStrategy",paraId:4,tocIndex:6},{value:"TreeSelect.SHOW_ALL",paraId:4,tocIndex:6},{value:": show all checked treeNodes (Include parent treeNode). ",paraId:4,tocIndex:6},{value:"TreeSelect.SHOW_PARENT",paraId:4,tocIndex:6},{value:": show checked treeNodes (Just show parent treeNode). Default just show child.",paraId:4,tocIndex:6},{value:"enum{TreeSelect.SHOW_ALL, TreeSelect.SHOW_PARENT, TreeSelect.SHOW_CHILD }",paraId:4,tocIndex:6},{value:"TreeSelect.SHOW_CHILD",paraId:4,tocIndex:6},{value:"treeIcon",paraId:4,tocIndex:6},{value:"show tree icon",paraId:4,tocIndex:6},{value:"bool",paraId:4,tocIndex:6},{value:"false",paraId:4,tocIndex:6},{value:"treeLine",paraId:4,tocIndex:6},{value:"show tree line",paraId:4,tocIndex:6},{value:"bool",paraId:4,tocIndex:6},{value:"false",paraId:4,tocIndex:6},{value:"treeDefaultExpandAll",paraId:4,tocIndex:6},{value:"default expand all treeNode",paraId:4,tocIndex:6},{value:"bool",paraId:4,tocIndex:6},{value:"false",paraId:4,tocIndex:6},{value:"treeDefaultExpandedKeys",paraId:4,tocIndex:6},{value:"default expanded treeNode keys",paraId:4,tocIndex:6},{value:"Array",paraId:4,tocIndex:6},{value:"-",paraId:4,tocIndex:6},{value:"treeExpandedKeys",paraId:4,tocIndex:6},{value:"set tree expanded keys",paraId:4,tocIndex:6},{value:"Array",paraId:4,tocIndex:6},{value:"-",paraId:4,tocIndex:6},{value:"treeExpandAction",paraId:4,tocIndex:6},{value:"Tree open logic, optional: false | ",paraId:4,tocIndex:6},{value:"click",paraId:4,tocIndex:6},{value:" | ",paraId:4,tocIndex:6},{value:"doubleClick",paraId:4,tocIndex:6},{value:", same as ",paraId:4,tocIndex:6},{value:"expandAction",paraId:4,tocIndex:6},{value:" of ",paraId:4,tocIndex:6},{value:"rc-tree",paraId:4,tocIndex:6},{value:"string | boolean",paraId:4,tocIndex:6},{value:"click",paraId:4,tocIndex:6},{value:"treeCheckable",paraId:4,tocIndex:6},{value:"whether tree show checkbox (select callback will not fire)",paraId:4,tocIndex:6},{value:"bool",paraId:4,tocIndex:6},{value:"false",paraId:4,tocIndex:6},{value:"treeCheckStrictly",paraId:4,tocIndex:6},{value:"check node precisely, parent and children nodes are not associated",paraId:4,tocIndex:6},{value:"bool",paraId:4,tocIndex:6},{value:"false",paraId:4,tocIndex:6},{value:"filterTreeNode",paraId:4,tocIndex:6},{value:"whether filter treeNodes by input value. default filter by treeNode's treeNodeFilterProp prop's value",paraId:4,tocIndex:6},{value:"bool/Function(inputValue:string, treeNode:TreeNode)",paraId:4,tocIndex:6},{value:"Function",paraId:4,tocIndex:6},{value:"treeNodeFilterProp",paraId:4,tocIndex:6},{value:"which prop value of treeNode will be used for filter if filterTreeNode return true",paraId:4,tocIndex:6},{value:"String",paraId:4,tocIndex:6},{value:"'value'",paraId:4,tocIndex:6},{value:"treeNodeLabelProp",paraId:4,tocIndex:6},{value:"which prop value of treeNode will render as content of select",paraId:4,tocIndex:6},{value:"String",paraId:4,tocIndex:6},{value:"'title'",paraId:4,tocIndex:6},{value:"treeData",paraId:4,tocIndex:6},{value:"treeNodes data Array, if set it then you need not to construct children TreeNode. (value should be unique across the whole array)",paraId:4,tocIndex:6},{value:"array<{value,label,children, [disabled,selectable]}>",paraId:4,tocIndex:6},{value:"[]",paraId:4,tocIndex:6},{value:"treeDataSimpleMode",paraId:4,tocIndex:6},{value:`enable simple mode of treeData.(treeData should be like this: [{id:1, pId:0, value:'1', label:"test1",...},...], `,paraId:4,tocIndex:6},{value:"pId",paraId:4,tocIndex:6},{value:" is parent node's id)",paraId:4,tocIndex:6},{value:"bool/object{id:'id', pId:'pId', rootPId:null}",paraId:4,tocIndex:6},{value:"false",paraId:4,tocIndex:6},{value:"treeTitleRender",paraId:4,tocIndex:6},{value:"Custom render nodes",paraId:4,tocIndex:6},{value:"(nodeData: OptionType) => ReactNode",paraId:4,tocIndex:6},{value:"loadData",paraId:4,tocIndex:6},{value:"load data asynchronously",paraId:4,tocIndex:6},{value:"function(node)",paraId:4,tocIndex:6},{value:"-",paraId:4,tocIndex:6},{value:"getPopupContainer",paraId:4,tocIndex:6},{value:"container which popup select menu rendered into",paraId:4,tocIndex:6},{value:"function(trigger:Node):Node",paraId:4,tocIndex:6},{value:"function(){return document.body;}",paraId:4,tocIndex:6},{value:"autoClearSearchValue",paraId:4,tocIndex:6},{value:"auto clear search input value when multiple select is selected/deselected",paraId:4,tocIndex:6},{value:"boolean",paraId:4,tocIndex:6},{value:"true",paraId:4,tocIndex:6},{value:"suffixIcon",paraId:4,tocIndex:6},{value:"specify the select arrow icon",paraId:4,tocIndex:6},{value:"ReactNode | (props: TreeProps) => ReactNode",paraId:4,tocIndex:6},{value:"-",paraId:4,tocIndex:6},{value:"clearIcon",paraId:4,tocIndex:6},{value:"specify the clear icon",paraId:4,tocIndex:6},{value:"ReactNode | (props: TreeProps) => ReactNode",paraId:4,tocIndex:6},{value:"-",paraId:4,tocIndex:6},{value:"removeIcon",paraId:4,tocIndex:6},{value:"specify the remove icon",paraId:4,tocIndex:6},{value:"ReactNode | (props: TreeProps) => ReactNode",paraId:4,tocIndex:6},{value:"-",paraId:4,tocIndex:6},{value:"switcherIcon",paraId:4,tocIndex:6},{value:"specify the switcher icon",paraId:4,tocIndex:6},{value:"ReactNode | (props: TreeProps) => ReactNode",paraId:4,tocIndex:6},{value:"-",paraId:4,tocIndex:6},{value:"virtual",paraId:4,tocIndex:6},{value:"Disable virtual when ",paraId:4,tocIndex:6},{value:"false",paraId:4,tocIndex:6},{value:"false",paraId:4,tocIndex:6},{value:"-",paraId:4,tocIndex:6},{value:"note: you'd better to use ",paraId:6,tocIndex:7},{value:"treeData",paraId:6,tocIndex:7},{value:" instead of using TreeNode.",paraId:6,tocIndex:7},{value:"name",paraId:7,tocIndex:7},{value:"description",paraId:7,tocIndex:7},{value:"type",paraId:7,tocIndex:7},{value:"default",paraId:7,tocIndex:7},{value:"disabled",paraId:7,tocIndex:7},{value:"disable treeNode",paraId:7,tocIndex:7},{value:"bool",paraId:7,tocIndex:7},{value:"false",paraId:7,tocIndex:7},{value:"key",paraId:7,tocIndex:7},{value:"it's value must be unique across the tree's all TreeNode, you must set it",paraId:7,tocIndex:7},{value:"String",paraId:7,tocIndex:7},{value:"-",paraId:7,tocIndex:7},{value:"value",paraId:7,tocIndex:7},{value:"default as treeNodeFilterProp (be unique across the tree's all TreeNode)",paraId:7,tocIndex:7},{value:"String",paraId:7,tocIndex:7},{value:"''",paraId:7,tocIndex:7},{value:"title",paraId:7,tocIndex:7},{value:"tree/subTree's title",paraId:7,tocIndex:7},{value:"String/element",paraId:7,tocIndex:7},{value:"'---'",paraId:7,tocIndex:7},{value:"isLeaf",paraId:7,tocIndex:7},{value:"whether it's leaf node",paraId:7,tocIndex:7},{value:"bool",paraId:7,tocIndex:7},{value:"false",paraId:7,tocIndex:7},{value:`Optimization tips(when there are large amounts of data, like more than 5000 nodes)
4
- `,paraId:8,tocIndex:8},{value:"Do not Expand all nodes.",paraId:9,tocIndex:8},{value:"Recommend not exist many ",paraId:9,tocIndex:8},{value:"TreeSelect",paraId:9,tocIndex:8},{value:" components in a page at the same time.",paraId:9,tocIndex:8},{value:"Recommend not use ",paraId:9,tocIndex:8},{value:"treeCheckable",paraId:9,tocIndex:8},{value:" mode, or use ",paraId:9,tocIndex:8},{value:"treeCheckStrictly",paraId:9,tocIndex:8},{value:".",paraId:9,tocIndex:8},{value:"In ",paraId:8,tocIndex:8},{value:"treeCheckable",paraId:8,tocIndex:8},{value:" mode, It has the same effect when click ",paraId:8,tocIndex:8},{value:"x",paraId:8,tocIndex:8},{value:"(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 ",paraId:8,tocIndex:8},{value:"onChange",paraId:8,tocIndex:8},{value:" method, but the parameters (the third parameter) are different. \uFF08\u4E2D\u6587\uFF1A\u5728",paraId:8,tocIndex:8},{value:"treeCheckable",paraId:8,tocIndex:8},{value:"\u6A21\u5F0F\u4E0B\uFF0C\u5DF2\u9009\u62E9\u8282\u70B9\u4E0A\u7684",paraId:8,tocIndex:8},{value:"x",paraId:8,tocIndex:8},{value:"\u5220\u9664\u64CD\u4F5C\u3001\u548C\u76F8\u5E94 treeNode \u8282\u70B9\u4E0A checkbox \u7684 uncheck \u64CD\u4F5C\uFF0C\u6700\u7EC8\u6548\u679C\u76F8\u540C\uFF0C\u4F46\u672C\u8D28\u4E0D\u4E00\u6837\u3002\u524D\u8005\u8DDF\u5F39\u51FA\u7684 tree \u7EC4\u4EF6\u53EF\u4EE5\u201C\u6BEB\u65E0\u5173\u7CFB\u201D\uFF08\u4F8B\u5982 dropdown \u6CA1\u5C55\u5F00\u8FC7\uFF0Ctree \u4E5F\u5C31\u6CA1\u6E32\u67D3\u597D\uFF09\uFF0C\u800C\u540E\u8005\u662F tree \u7EC4\u4EF6\u4E0A\u7684\u8282\u70B9 uncheck \u4E8B\u4EF6\u3002\u6240\u4EE5\u3001\u5373\u4FBF\u4E24\u8005\u90FD\u4F1A\u89E6\u53D1",paraId:8,tocIndex:8},{value:"onChange",paraId:8,tocIndex:8},{value:"\u65B9\u6CD5\u3001\u4F46\u5B83\u4EEC\u7684\u53C2\u6570\uFF08\u7B2C\u4E09\u4E2A\u53C2\u6570\uFF09\u662F\u4E0D\u540C\u7684\u3002\uFF09",paraId:8,tocIndex:8},{value:"http://localhost:8000/tests/runner.html?coverage",paraId:10,tocIndex:9},{value:"http://localhost:8000/node_modules/rc-server/node_modules/node-jscover/lib/front-end/jscoverage.html?w=http://localhost:8000/tests/runner.html?coverage",paraId:11,tocIndex:10},{value:"rc-tree-select is released under the MIT license.",paraId:12,tocIndex:11}]},25866:function(v,t){t.Z=`@import "./select.less";
5
- @import "./tree.less";
6
- `},45745:function(v,t){t.Z=`import Dialog from 'rc-dialog';
7
- import 'rc-dialog/assets/index.css';
8
- import React from 'react';
9
- import '../assets/index.less';
10
- import TreeSelect, { SHOW_PARENT, TreeNode } from '../src';
11
- import { gData } from './utils/dataUtil';
12
-
13
- function isLeaf(value) {
14
- if (!value) {
15
- return false;
16
- }
17
- let queues = [...gData];
18
- while (queues.length) {
19
- // BFS
20
- const item = queues.shift();
21
- if (item.value === value) {
22
- if (!item.children) {
23
- return true;
24
- }
25
- return false;
26
- }
27
- if (item.children) {
28
- queues = queues.concat(item.children);
29
- }
30
- }
31
- return false;
32
- }
33
-
34
- function findPath(value, data) {
35
- const sel = [];
36
- function loop(selected, children) {
37
- for (let i = 0; i < children.length; i += 1) {
38
- const item = children[i];
39
- if (selected === item.value) {
40
- sel.push(item);
41
- return;
42
- }
43
- if (item.children) {
44
- loop(selected, item.children);
45
- if (sel.length) {
46
- sel.push(item);
47
- return;
48
- }
49
- }
50
- }
51
- }
52
- loop(value, data);
53
- return sel;
54
- }
55
-
56
- class Demo extends React.Component {
57
- state = {
58
- tsOpen: false,
59
- visible: false,
60
- searchValue: '0-0-0-label',
61
- value: '0-0-0-value1',
62
- // value: ['0-0-0-0-value', '0-0-0-1-value', '0-0-0-2-value'],
63
- lv: { value: '0-0-0-value', label: 'spe label' },
64
- multipleValue: [],
65
- simpleSearchValue: 'test111',
66
- simpleTreeData: [
67
- { key: 1, pId: 0, label: 'test1', value: 'test1' },
68
- { key: 121, pId: 0, label: 'test2', value: 'test2' },
69
- { key: 11, pId: 1, label: 'test11', value: 'test11' },
70
- { key: 12, pId: 1, label: 'test12', value: 'test12' },
71
- { key: 111, pId: 11, label: 'test111', value: 'test111' },
72
- ],
73
- treeDataSimpleMode: {
74
- id: 'key',
75
- rootPId: 0,
76
- },
77
- };
78
-
79
- onClick = () => {
80
- this.setState({
81
- visible: true,
82
- });
83
- };
84
-
85
- onClose = () => {
86
- this.setState({
87
- visible: false,
88
- });
89
- };
90
-
91
- onSearch = (value, ...args) => {
92
- console.log('Do Search:', value, ...args);
93
- this.setState({ searchValue: value });
94
- };
95
-
96
- onChange = (value, ...rest) => {
97
- console.log('onChange', value, ...rest);
98
- this.setState({ value });
99
- };
100
-
101
- onChangeChildren = (...args) => {
102
- const { value: preValue } = this.state;
103
- console.log('onChangeChildren', ...args);
104
- const value = args[0];
105
- const pre = value ? preValue : undefined;
106
- this.setState({ value: isLeaf(value) ? value : pre });
107
- };
108
-
109
- onChangeLV = (value, ...args) => {
110
- console.log('labelInValue', value, ...args);
111
- if (!value) {
112
- this.setState({ lv: undefined });
113
- return;
114
- }
115
- const path = findPath(value.value, gData)
116
- .map(i => i.label)
117
- .reverse()
118
- .join(' > ');
119
- this.setState({ lv: { value: value.value, label: path } });
120
- };
121
-
122
- onMultipleChange = value => {
123
- console.log('onMultipleChange', value);
124
- this.setState({ multipleValue: value });
125
- };
126
-
127
- onSelect = (...args) => {
128
- // use onChange instead
129
- console.log(args);
130
- };
131
-
132
- onDropdownVisibleChange = visible => {
133
- const { value } = this.state;
134
- console.log(visible, value);
135
- if (Array.isArray(value) && value.length > 1 && value.length < 3) {
136
- window.alert('please select more than two item or less than one item.');
137
- return false;
138
- }
139
- return true;
140
- };
141
-
142
- filterTreeNode = (input, child) => String(child.props.title).indexOf(input) === 0;
143
-
144
- render() {
145
- const {
146
- visible,
147
- value,
148
- searchValue,
149
- tsOpen,
150
- multipleValue,
151
- lv,
152
- simpleTreeData,
153
- simpleSearchValue,
154
- treeDataSimpleMode,
155
- } = this.state;
156
- return (
157
- <div style={{ margin: 20 }}>
158
- <h2>tree-select in dialog</h2>
159
- <button type="button" className="btn btn-primary" onClick={this.onClick}>
160
- show dialog
161
- </button>
162
- {visible ? (
163
- <Dialog
164
- visible={visible}
165
- animation="zoom"
166
- maskAnimation="fade"
167
- onClose={this.onClose}
168
- // style={{ width: 600, height: 400, overflow: 'auto' }}
169
- >
170
- <div style={{ height: 600, paddingTop: 100 }}>
171
- <TreeSelect
172
- getPopupContainer={triggerNode => triggerNode.parentNode}
173
- style={{ width: 300 }}
174
- transitionName="rc-tree-select-dropdown-slide-up"
175
- choiceTransitionName="rc-tree-select-selection__choice-zoom"
176
- // dropdownStyle={{ maxHeight: 200, overflow: 'auto', zIndex: 1500 }}
177
- placeholder={<i>\u8BF7\u4E0B\u62C9\u9009\u62E9</i>}
178
- showSearch
179
- allowClear
180
- treeLine
181
- value={value}
182
- treeData={gData}
183
- treeNodeFilterProp="label"
184
- filterTreeNode={false}
185
- onSearch={this.onSearch}
186
- onChange={this.onChange}
187
- onSelect={this.onSelect}
188
- />
189
- </div>
190
- </Dialog>
191
- ) : null}
192
- <h2>single select</h2>
193
- <TreeSelect
194
- style={{ width: 300 }}
195
- transitionName="rc-tree-select-dropdown-slide-up"
196
- choiceTransitionName="rc-tree-select-selection__choice-zoom"
197
- // dropdownStyle={{ maxHeight: 200, overflow: 'auto' }}
198
- placeholder={<i>\u8BF7\u4E0B\u62C9\u9009\u62E9</i>}
199
- showSearch
200
- allowClear
201
- treeLine
202
- searchValue={searchValue}
203
- value={value}
204
- treeData={gData}
205
- treeNodeFilterProp="label"
206
- filterTreeNode={false}
207
- onSearch={this.onSearch}
208
- open={tsOpen}
209
- onChange={(val, ...args) => {
210
- console.log('onChange', val, ...args);
211
- this.setState({ value: val });
212
- }}
213
- onDropdownVisibleChange={v => {
214
- console.log('single onDropdownVisibleChange', v);
215
- this.setState({
216
- tsOpen: v,
217
- });
218
- }}
219
- onSelect={this.onSelect}
220
- onPopupScroll={evt => {
221
- console.log('onPopupScroll:', evt.target);
222
- }}
223
- />
224
-
225
- <h2>single select (just select children)</h2>
226
- <TreeSelect
227
- style={{ width: 300 }}
228
- transitionName="rc-tree-select-dropdown-slide-up"
229
- choiceTransitionName="rc-tree-select-selection__choice-zoom"
230
- // dropdownStyle={{ maxHeight: 200, overflow: 'auto' }}
231
- placeholder={<i>\u8BF7\u4E0B\u62C9\u9009\u62E9</i>}
232
- showSearch
233
- allowClear
234
- treeLine
235
- value={value}
236
- treeData={gData}
237
- treeNodeFilterProp="label"
238
- filterTreeNode={false}
239
- onChange={this.onChangeChildren}
240
- />
241
-
242
- <h2>multiple select</h2>
243
- <TreeSelect
244
- style={{ width: 300 }}
245
- transitionName="rc-tree-select-dropdown-slide-up"
246
- choiceTransitionName="rc-tree-select-selection__choice-zoom"
247
- // dropdownStyle={{ maxHeight: 200, overflow: 'auto' }}
248
- placeholder={<i>\u8BF7\u4E0B\u62C9\u9009\u62E9</i>}
249
- multiple
250
- value={multipleValue}
251
- treeData={gData}
252
- treeNodeFilterProp="title"
253
- onChange={this.onMultipleChange}
254
- onSelect={this.onSelect}
255
- allowClear
256
- />
257
-
258
- <h2>check select</h2>
259
- <TreeSelect
260
- open
261
- allowClear
262
- className="check-select"
263
- transitionName="rc-tree-select-dropdown-slide-up"
264
- choiceTransitionName="rc-tree-select-selection__choice-zoom"
265
- style={{ width: 300 }}
266
- // dropdownStyle={{ height: 200, overflow: 'auto' }}
267
- popupAlign={{
268
- overflow: { adjustY: 0, adjustX: 0 },
269
- offset: [0, 2],
270
- }}
271
- onDropdownVisibleChange={this.onDropdownVisibleChange}
272
- placeholder={<i>\u8BF7\u4E0B\u62C9\u9009\u62E9</i>}
273
- treeLine
274
- maxTagTextLength={10}
275
- value={value}
276
- autoClearSearchValue
277
- treeData={gData}
278
- treeNodeFilterProp="title"
279
- treeCheckable
280
- showCheckedStrategy={SHOW_PARENT}
281
- onChange={this.onChange}
282
- onSelect={this.onSelect}
283
- maxTagCount="responsive"
284
- maxTagPlaceholder={valueList => {
285
- // console.log('Max Tag Rest Value:', valueList);
286
- return \`\${valueList.length} rest...\`;
287
- }}
288
- />
289
-
290
- <h2>labelInValue & show path</h2>
291
- <TreeSelect
292
- style={{ width: 500 }}
293
- transitionName="rc-tree-select-dropdown-slide-up"
294
- choiceTransitionName="rc-tree-select-selection__choice-zoom"
295
- // dropdownStyle={{ maxHeight: 200, overflow: 'auto' }}
296
- placeholder={<i>\u8BF7\u4E0B\u62C9\u9009\u62E9</i>}
297
- showSearch
298
- allowClear
299
- treeLine
300
- value={lv}
301
- labelInValue
302
- treeData={gData}
303
- treeNodeFilterProp="label"
304
- filterTreeNode={false}
305
- onChange={this.onChangeLV}
306
- />
307
-
308
- <h2>use treeDataSimpleMode</h2>
309
- <TreeSelect
310
- style={{ width: 300 }}
311
- // dropdownStyle={{ maxHeight: 200, overflow: 'auto' }}
312
- placeholder={<i>\u8BF7\u4E0B\u62C9\u9009\u62E9</i>}
313
- // treeLine
314
- maxTagTextLength={10}
315
- searchValue={simpleSearchValue}
316
- onSearch={val => {
317
- this.setState({ simpleSearchValue: val });
318
- }}
319
- value={value}
320
- treeData={simpleTreeData}
321
- treeNodeFilterProp="title"
322
- treeDataSimpleMode={treeDataSimpleMode}
323
- treeCheckable
324
- showCheckedStrategy={SHOW_PARENT}
325
- onChange={this.onChange}
326
- onSelect={(...args) => {
327
- this.setState({ simpleSearchValue: '' });
328
- this.onSelect(...args);
329
- }}
330
- />
331
-
332
- <h2>Testing in extreme conditions (Boundary conditions test) </h2>
333
- <TreeSelect
334
- style={{ width: 200 }}
335
- popupStyle={{ maxHeight: 200, overflow: 'auto' }}
336
- defaultValue="leaf1"
337
- multiple
338
- treeCheckable
339
- showCheckedStrategy={SHOW_PARENT}
340
- treeDefaultExpandAll
341
- treeData={[
342
- { key: '', value: '', label: 'empty value', children: [] },
343
- {
344
- key: '0',
345
- value: '0',
346
- label: '0 label',
347
- children: [
348
- { key: '00', value: '00', label: '00 label', children: [] },
349
- { key: '01', value: '01', label: '01 label', children: [] },
350
- ],
351
- },
352
- ]}
353
- onChange={(val, ...args) => console.log(val, ...args)}
354
- />
355
-
356
- <h2>use TreeNode Component (not recommend)</h2>
357
- <TreeSelect
358
- style={{ width: 200 }}
359
- // dropdownStyle={{ maxHeight: 200, overflow: 'auto' }}
360
- defaultValue="leaf1"
361
- treeDefaultExpandAll
362
- treeNodeFilterProp="title"
363
- filterTreeNode={this.filterTreeNode}
364
- onChange={(val, ...args) => console.log(val, ...args)}
365
- >
366
- <TreeNode value="" title="parent 1" key="">
367
- <TreeNode value="parent 1-0" title="parent 1-0" key="0-1-0">
368
- <TreeNode value="leaf1" title="my leaf" key="random" />
369
- <TreeNode value="leaf2" title="your leaf" key="random1" disabled />
370
- </TreeNode>
371
- <TreeNode value="parent 1-1" title="parent 1-1" key="0-1-1">
372
- <TreeNode
373
- value="sss"
374
- title={<span style={{ color: 'red' }}>sss</span>}
375
- key="random3"
376
- />
377
- <TreeNode value="same value1" title="same txtle" key="0-1-1-1">
378
- <TreeNode
379
- value="same value10"
380
- title="same titlexd"
381
- key="0-1-1-1-0"
382
- style={{ color: 'red', background: 'green' }}
383
- />
384
- </TreeNode>
385
- </TreeNode>
386
- </TreeNode>
387
- <TreeNode value="same value2" title="same title" key="0-2">
388
- <TreeNode value="2same value" title="2same title" key="0-2-0" />
389
- </TreeNode>
390
- <TreeNode value="same value3" title="same title" key="0-3" />
391
- </TreeSelect>
392
-
393
- <h2>title render</h2>
394
- <TreeSelect<{ label: string }>
395
- open
396
- style={{ width: 300 }}
397
- treeData={gData}
398
- treeTitleRender={node => node.label + 'ok'}
399
- />
400
- </div>
401
- );
402
- }
403
- }
404
-
405
- export default Demo;
406
- `},13371:function(v,t){t.Z=`import '../assets/index.less';
407
- import React from 'react';
408
- import TreeSelect, { SHOW_PARENT } from '../src';
409
- import Gen from './utils/big-data-generator';
410
-
411
- class Demo extends React.Component {
412
- state = {
413
- gData: [],
414
- gData1: [],
415
- value: '',
416
- value1: '',
417
- };
418
-
419
- onChange = value => {
420
- console.log('onChange', value);
421
- this.setState({ value });
422
- };
423
-
424
- onChangeStrictly = value1 => {
425
- console.log('onChangeStrictly', value1);
426
- const ind = parseInt(\`\${Math.random() * 3}\`, 10);
427
- value1.push({
428
- value: \`0-0-0-\${ind}-value\`,
429
- label: \`0-0-0-\${ind}-label\`,
430
- halfChecked: true,
431
- });
432
- this.setState({
433
- value1,
434
- });
435
- };
436
-
437
- onGen = data => {
438
- this.setState({
439
- gData: data,
440
- gData1: [...data],
441
- value: '0-0-0-value',
442
- value1: [
443
- { value: '0-0-value', label: '0-0-label', halfChecked: true },
444
- { value: '0-0-0-value', label: '0-0-0-label' },
445
- ],
446
- });
447
- };
448
-
449
- render() {
450
- const { value1, gData1, value, gData } = this.state;
451
-
452
- // console.log('>>>', gData, gData1, value1);
453
-
454
- return (
455
- <div style={{ padding: '0 20px' }}>
456
- <Gen onGen={this.onGen} />
457
- <div style={{ display: 'flex' }}>
458
- <div style={{ marginRight: 20 }}>
459
- <h3>normal check</h3>
460
- <TreeSelect
461
- style={{ width: 300 }}
462
- // dropdownStyle={{ maxHeight: 200, overflow: 'auto' }}
463
- treeData={gData}
464
- treeLine
465
- value={value}
466
- placeholder={<i>\u8BF7\u4E0B\u62C9\u9009\u62E9</i>}
467
- treeCheckable
468
- showCheckedStrategy={SHOW_PARENT}
469
- onChange={this.onChange}
470
- />
471
- </div>
472
- <div>
473
- <h3>checkStrictly</h3>
474
- <TreeSelect
475
- style={{ width: 300 }}
476
- // dropdownStyle={{ maxHeight: 200, overflow: 'auto' }}
477
- treeData={gData1}
478
- treeLine
479
- value={value1}
480
- placeholder={<i>\u8BF7\u4E0B\u62C9\u9009\u62E9</i>}
481
- treeCheckable
482
- treeCheckStrictly
483
- showCheckedStrategy={SHOW_PARENT}
484
- onChange={this.onChangeStrictly}
485
- />
486
- </div>
487
- </div>
488
- </div>
489
- );
490
- }
491
- }
492
-
493
- export default Demo;
494
- `},19760:function(v,t){t.Z=`import '../assets/index.less';
495
- import React from 'react';
496
- import 'rc-dialog/assets/index.css';
497
- import TreeSelect, { TreeNode } from '../src';
498
-
499
- class Demo extends React.Component {
500
- state = {
501
- treeExpandedKeys: [],
502
- };
503
-
504
- onTreeExpand = treeExpandedKeys => {
505
- this.setState({
506
- treeExpandedKeys,
507
- });
508
- };
509
-
510
- treeExpandedKeys = () => {
511
- this.setState({
512
- treeExpandedKeys: ['000', '0-1-0'],
513
- });
514
- };
515
-
516
- render() {
517
- const { treeExpandedKeys } = this.state;
518
-
519
- return (
520
- <div>
521
- <h2>Conrolled treeExpandedKeys</h2>
522
- <TreeSelect
523
- style={{ width: 200 }}
524
- // dropdownStyle={{ maxHeight: 200, overflow: 'auto' }}
525
- treeExpandedKeys={treeExpandedKeys}
526
- onTreeExpand={this.onTreeExpand}
527
- >
528
- <TreeNode value="" title="parent 1" key="000">
529
- <TreeNode value="parent 1-0" title="parent 1-0" key="0-1-0">
530
- <TreeNode value="leaf1" title="my leaf" key="random" />
531
- <TreeNode
532
- value="leaf2"
533
- title="your leaf"
534
- key="random1"
535
- disabled
536
- />
537
- </TreeNode>
538
- <TreeNode value="parent 1-1" title="parent 1-1" key="0-1-1">
539
- <TreeNode
540
- value="sss"
541
- title={<span style={{ color: 'red' }}>sss</span>}
542
- key="random3"
543
- />
544
- <TreeNode value="same value1" title="same txtle" key="0-1-1-1">
545
- <TreeNode
546
- value="same value10"
547
- title="same titlexd"
548
- key="0-1-1-1-0"
549
- style={{ color: 'red', background: 'green' }}
550
- />
551
- </TreeNode>
552
- </TreeNode>
553
- </TreeNode>
554
- <TreeNode value="same value2" title="same title" key="0-2">
555
- <TreeNode value="2same value" title="2same title" key="0-2-0" />
556
- </TreeNode>
557
- <TreeNode value="same value3" title="same title" key="0-3" />
558
- </TreeSelect>
559
- <button type="button" onClick={this.treeExpandedKeys}>
560
- Set treeExpandedKeys
561
- </button>
562
- </div>
563
- );
564
- }
565
- }
566
-
567
- export default Demo;
568
- `},79898:function(v,t){t.Z=`import '../assets/index.less';
569
- import React from 'react';
570
- import 'rc-dialog/assets/index.css';
571
- import TreeSelect from '../src';
572
- import { gData } from './utils/dataUtil';
573
-
574
- const bubblePath =
575
- 'M632 888H392c-4.4 0-8 3.6-8 8v32c0 ' +
576
- '17.7 14.3 32 32 32h192c17.7 0 32-14.3 32-32v-3' +
577
- '2c0-4.4-3.6-8-8-8zM512 64c-181.1 0-328 146.9-3' +
578
- '28 328 0 121.4 66 227.4 164 284.1V792c0 17.7 1' +
579
- '4.3 32 32 32h264c17.7 0 32-14.3 32-32V676.1c98' +
580
- '-56.7 164-162.7 164-284.1 0-181.1-146.9-328-32' +
581
- '8-328z m127.9 549.8L604 634.6V752H420V634.6l-3' +
582
- '5.9-20.8C305.4 568.3 256 484.5 256 392c0-141.4' +
583
- ' 114.6-256 256-256s256 114.6 256 256c0 92.5-49' +
584
- '.4 176.3-128.1 221.8z';
585
-
586
- const clearPath =
587
- 'M793 242H366v-74c0-6.7-7.7-10.4-12.9' +
588
- '-6.3l-142 112c-4.1 3.2-4.1 9.4 0 12.6l142 112c' +
589
- '5.2 4.1 12.9 0.4 12.9-6.3v-74h415v470H175c-4.4' +
590
- ' 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h618c35.3 0 64-' +
591
- '28.7 64-64V306c0-35.3-28.7-64-64-64z';
592
-
593
- const arrowPath =
594
- 'M765.7 486.8L314.9 134.7c-5.3-4.1' +
595
- '-12.9-0.4-12.9 6.3v77.3c0 4.9 2.3 9.6 6.1 12.6l36' +
596
- '0 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6' +
597
- '.7 7.7 10.4 12.9 6.3l450.8-352.1c16.4-12.8 16.4-3' +
598
- '7.6 0-50.4z';
599
-
600
- const getSvg = (path, iStyle = {}, style = {}) => (
601
- <i style={iStyle}>
602
- <svg
603
- viewBox="0 0 1024 1024"
604
- width="1em"
605
- height="1em"
606
- fill="currentColor"
607
- style={{ verticalAlign: '-.125em', ...style }}
608
- >
609
- <path d={path} />
610
- </svg>
611
- </i>
612
- );
613
-
614
- const switcherIcon = obj => {
615
- if (obj.isLeaf) {
616
- return getSvg(
617
- arrowPath,
618
- { cursor: 'pointer', backgroundColor: 'white' },
619
- { transform: 'rotate(270deg)' },
620
- );
621
- }
622
- return getSvg(
623
- arrowPath,
624
- { cursor: 'pointer', backgroundColor: 'white' },
625
- { transform: \`rotate(\${obj.expanded ? 90 : 0}deg)\` },
626
- );
627
- };
628
-
629
- const suffixIcon = getSvg(bubblePath);
630
- const clearIcon = getSvg(clearPath);
631
- const removeIcon = getSvg(clearPath);
632
-
633
- const iconProps = {
634
- suffixIcon,
635
- clearIcon,
636
- removeIcon,
637
- switcherIcon,
638
- };
639
-
640
- const iconPropsFunction = {
641
- suffixIcon: () => suffixIcon,
642
- clearIcon: () => clearIcon,
643
- removeIcon: () => removeIcon,
644
- switcherIcon,
645
- };
646
-
647
- function Demo() {
648
- return (
649
- <div className="custom-icon-demo">
650
- <h2>Single</h2>
651
- <TreeSelect
652
- treeData={gData}
653
- placeholder={<span>Please Select</span>}
654
- transitionName="rc-tree-select-dropdown-slide-up"
655
- style={{ width: 300 }}
656
- popupStyle={{ maxHeight: 200, overflow: 'auto', zIndex: 1500 }}
657
- showSearch
658
- allowClear
659
- {...iconProps}
660
- />
661
- <br />
662
- <h2>Multiple</h2>
663
- <TreeSelect
664
- treeData={gData}
665
- multiple
666
- placeholder={<span>Please Select</span>}
667
- transitionName="rc-tree-select-dropdown-slide-up"
668
- style={{ width: 300 }}
669
- popupStyle={{ maxHeight: 200, overflow: 'auto', zIndex: 1500 }}
670
- showSearch
671
- allowClear
672
- {...iconPropsFunction}
673
- />
674
- </div>
675
- );
676
- }
677
-
678
- export default Demo;
679
- `},91938:function(v,t){t.Z=`import React from 'react';
680
- import TreeSelect from '../src';
681
- import '../assets/index.less';
682
-
683
- const treeData = [
684
- { key: '0', value: '0', title: 'label0' },
685
- { key: '1', value: '1', title: 'label1' },
686
- ];
687
-
688
- const createSelect = props => <TreeSelect treeData={treeData} labelInValue {...props} />;
689
-
690
- export default () =>
691
- createSelect({
692
- maxTagCount: 1,
693
- defaultValue: {
694
- value: '0',
695
- label: '2333',
696
- },
697
- });
698
- `},73633:function(v,t){t.Z=`import '../assets/index.less';
699
- import React from 'react';
700
- import TreeSelect from '../src';
701
-
702
- const { SHOW_PARENT } = TreeSelect;
703
-
704
- const treeData = [
705
- {
706
- label: 'Node1',
707
- value: '0-0',
708
- key: '0-0',
709
- children: [
710
- {
711
- label: 'Child Node1',
712
- value: '0-0-0',
713
- key: '0-0-0',
714
- },
715
- ],
716
- },
717
- {
718
- label: 'Node2',
719
- value: '0-1',
720
- key: '0-1',
721
- children: [
722
- {
723
- label: 'Child Node3',
724
- value: '0-1-0',
725
- key: '0-1-0',
726
- },
727
- {
728
- label: 'Child Node4',
729
- value: '0-1-1',
730
- key: '0-1-1',
731
- },
732
- {
733
- label: 'Child Node5',
734
- value: '0-1-2',
735
- key: '0-1-2',
736
- },
737
- ],
738
- },
739
- ];
740
-
741
- class Demo extends React.Component {
742
- state = {
743
- value: ['0-0-0'],
744
- disabled: false,
745
- };
746
-
747
- onChange = (value, ...args) => {
748
- console.log('onChange ', value, args);
749
- this.setState({ value });
750
- };
751
-
752
- switch = checked => {
753
- this.setState({ disabled: checked });
754
- };
755
-
756
- render() {
757
- const { disabled, value } = this.state;
758
- const tProps = {
759
- treeData,
760
- disabled,
761
- value,
762
- onChange: this.onChange,
763
- multiple: true,
764
- allowClear: true,
765
- treeCheckable: true,
766
- showCheckedStrategy: SHOW_PARENT,
767
- style: {
768
- width: 300,
769
- },
770
- };
771
- return (
772
- <div>
773
- <TreeSelect {...tProps} />
774
- <input type="checkbox" onChange={e => this.switch(e.target.checked)} /> \u7981\u7528
775
- </div>
776
- );
777
- }
778
- }
779
-
780
- export default Demo;
781
- /* eslint-enable */
782
- `},86272:function(v,t){t.Z=`import '../assets/index.less';
783
- import React from 'react';
784
- import TreeSelect from '../src';
785
- import { getNewTreeData, generateTreeNodes } from './utils/dataUtil';
786
-
787
- function getTreeData() {
788
- return [
789
- { label: 'pNode 01', value: '0-0', key: '0-0' },
790
- { label: 'pNode 02', value: '0-1', key: '0-1' },
791
- { label: 'pNode 03', value: '0-2', key: '0-2', isLeaf: true },
792
- ];
793
- }
794
-
795
- class Demo extends React.Component {
796
- static propTypes = {};
797
-
798
- state = {
799
- treeData: getTreeData(),
800
- // value: '0-0',
801
- value: { value: '0-0-0-value', label: '0-0-0-label' },
802
- loadedKeys: [],
803
- };
804
-
805
- onChange = value => {
806
- console.log(value);
807
- this.setState({
808
- value,
809
- });
810
- };
811
-
812
- loadData = treeNode => {
813
- console.log('trigger load:', treeNode);
814
- return new Promise<void>(resolve => {
815
- setTimeout(() => {
816
- let { treeData } = this.state;
817
- treeData = treeData.slice();
818
- getNewTreeData(
819
- treeData,
820
- treeNode.props.eventKey,
821
- generateTreeNodes(treeNode),
822
- 2,
823
- );
824
- this.setState({ treeData });
825
- resolve();
826
- }, 500);
827
- });
828
- };
829
-
830
- onTreeLoad = loadedKeys => {
831
- this.setState({ loadedKeys });
832
- };
833
-
834
- onResetTree = () => {
835
- this.setState({
836
- treeData: getTreeData(),
837
- });
838
- };
839
-
840
- onResetLoadedKeys = () => {
841
- this.setState({
842
- loadedKeys: [],
843
- });
844
- };
845
-
846
- render() {
847
- const { treeData, value, loadedKeys } = this.state;
848
- return (
849
- <div style={{ padding: '10px 30px' }}>
850
- <h2>dynamic render</h2>
851
- <TreeSelect
852
- style={{ width: 300 }}
853
- treeData={treeData}
854
- labelInValue
855
- value={value}
856
- onChange={this.onChange}
857
- loadData={this.loadData}
858
- />
859
- <h2>Controlled</h2>
860
- <TreeSelect
861
- style={{ width: 300 }}
862
- treeData={treeData}
863
- labelInValue
864
- showSearch
865
- value={value}
866
- treeLoadedKeys={loadedKeys}
867
- onChange={this.onChange}
868
- loadData={this.loadData}
869
- onTreeLoad={this.onTreeLoad}
870
- />
871
-
872
- <button type="button" onClick={this.onResetTree}>
873
- Reset Tree
874
- </button>
875
- <button type="button" onClick={this.onResetLoadedKeys}>
876
- Reset LoadedKeys
877
- </button>
878
- </div>
879
- );
880
- }
881
- }
882
-
883
- export default Demo;
884
- `},14610:function(v,t){t.Z=`import '../assets/index.less';
885
- import React from 'react';
886
- import 'rc-dialog/assets/index.css';
887
- import TreeSelect from '../src';
888
-
889
- export default () => {
890
- return (
891
- <div>
892
- <h2>basic</h2>
893
- <TreeSelect
894
- treeDefaultExpandAll
895
- treeData={[
896
- {
897
- myLabel: 'Parent',
898
- myValue: 'parent',
899
- myChildren: [
900
- {
901
- myLabel: 'Sub 1',
902
- myValue: 'sub_1',
903
- },
904
- {
905
- myLabel: 'Sub 2',
906
- myValue: 'sub_2',
907
- },
908
- ],
909
- },
910
- ]}
911
- fieldNames={{
912
- label: 'myLabel',
913
- value: 'myValue',
914
- children: 'myChildren',
915
- }}
916
- />
917
-
918
- <h2>title render</h2>
919
- <TreeSelect
920
- treeDefaultExpandAll
921
- treeTitleRender={node => <span>{node.myLabel}</span>}
922
- treeData={[
923
- {
924
- myLabel: 'Parent',
925
- myValue: 'parent',
926
- myChildren: [
927
- {
928
- myLabel: 'Sub 1',
929
- myValue: 'sub_1',
930
- },
931
- {
932
- myLabel: 'Sub 2',
933
- myValue: 'sub_2',
934
- },
935
- ],
936
- },
937
- ]}
938
- fieldNames={{
939
- label: 'myLabel',
940
- value: 'myValue',
941
- children: 'myChildren',
942
- }}
943
- />
944
- </div>
945
- );
946
- };
947
- `},33073:function(v,t){t.Z=`import '../assets/index.less';
948
- import React from 'react';
949
- import TreeSelect, { SHOW_PARENT } from '../src';
950
- import { gData } from './utils/dataUtil';
951
-
952
- console.log('TreeData:', gData);
953
-
954
- class Demo extends React.Component {
955
- state = {
956
- value: '11',
957
- // value: ['0-0-0-0-value', '0-0-0-1-value', '0-0-0-2-value'],
958
- simpleTreeData: [
959
- { key: 1, pId: 0, label: 'a', value: 'a' },
960
- { key: 11, pId: 1, label: 'a12', value: 'a12', disabled: true },
961
- { key: 111, pId: 11, label: 'a00', value: 'a00', selectable: false },
962
- { key: 2, pId: 0, label: 'b', value: 'b' },
963
- { key: 20, pId: 2, label: 'b10', value: 'b10' },
964
- { key: 21, pId: 2, label: 'b1', value: 'b1' },
965
- { key: 22, pId: 2, label: 'b12', value: 'b12' },
966
- ],
967
- treeDataSimpleMode: {
968
- id: 'key',
969
- rootPId: 0,
970
- },
971
- };
972
-
973
- onChange = value => {
974
- const { simpleTreeData } = this.state;
975
- if (value.length === 1) {
976
- // return;
977
- }
978
- console.log('onChange', value, simpleTreeData);
979
- this.setState({ value });
980
- };
981
-
982
- onSelect = () => {
983
- // use onChange instead
984
- // console.log(arguments);
985
- };
986
-
987
- onDataChange = () => {
988
- const { simpleTreeData } = this.state;
989
- const data = simpleTreeData.slice();
990
- data.forEach(i => {
991
- if (i.key === 11) {
992
- // eslint-disable-next-line no-param-reassign
993
- delete i.disabled;
994
- }
995
- if (i.key === 20) {
996
- // eslint-disable-next-line no-param-reassign
997
- i.disabled = true;
998
- }
999
- });
1000
- this.setState({ simpleTreeData: data });
1001
- };
1002
-
1003
- render() {
1004
- const { value, simpleTreeData, treeDataSimpleMode } = this.state;
1005
- return (
1006
- <div style={{ margin: 20 }}>
1007
- <h2>check select</h2>
1008
- <TreeSelect
1009
- style={{ width: 300 }}
1010
- transitionName="rc-tree-select-dropdown-slide-up"
1011
- choiceTransitionName="rc-tree-select-selection__choice-zoom"
1012
- // dropdownStyle={{ height: 200, overflow: 'auto' }}
1013
- // dropdownPopupAlign={{
1014
- // overflow: { adjustY: 0, adjustX: 0 },
1015
- // offset: [0, 2],
1016
- // }}
1017
- placeholder={<i>\u8BF7\u4E0B\u62C9\u9009\u62E9</i>}
1018
- treeLine
1019
- maxTagTextLength={10}
1020
- value={value}
1021
- treeData={gData}
1022
- treeNodeFilterProp="title"
1023
- treeCheckable
1024
- onChange={this.onChange}
1025
- onSelect={this.onSelect}
1026
- />
1027
-
1028
- <h2>use treeDataSimpleMode</h2>
1029
- <TreeSelect
1030
- style={{ width: 300 }}
1031
- popupStyle={{ maxHeight: 200, overflow: 'auto' }}
1032
- placeholder={<i>\u8BF7\u4E0B\u62C9\u9009\u62E9</i>}
1033
- treeLine
1034
- maxTagTextLength={10}
1035
- inputValue={null}
1036
- value={value}
1037
- treeData={simpleTreeData}
1038
- treeDefaultExpandAll
1039
- treeNodeFilterProp="title"
1040
- treeDataSimpleMode={treeDataSimpleMode}
1041
- treeCheckable
1042
- showCheckedStrategy={SHOW_PARENT}
1043
- onChange={this.onChange}
1044
- onSelect={this.onSelect}
1045
- />
1046
- <button type="button" onClick={this.onDataChange}>
1047
- change data
1048
- </button>
1049
- </div>
1050
- );
1051
- }
1052
- }
1053
-
1054
- export default Demo;
1055
- `},43335:function(v,t){t.Z=`import React, { Component } from 'react';
1056
- import Select from '@rc-component/select';
1057
- import Form, { useForm, Field } from 'rc-field-form';
1058
- import TreeSelect from '../src';
1059
- import '@rc-component/select/assets/index.less';
1060
- import '../assets/index.less';
1061
- import { gData } from './utils/dataUtil';
1062
-
1063
- const { Option } = Select;
1064
-
1065
- const regionStyle = {
1066
- border: '1px solid red',
1067
- marginTop: 10,
1068
- padding: 10,
1069
- };
1070
-
1071
- const errorStyle = {
1072
- color: 'red',
1073
- marginTop: 10,
1074
- padding: 10,
1075
- };
1076
-
1077
- class TreeSelectInput extends Component<{
1078
- onChange?: (value: string[]) => void;
1079
- style: React.CSSProperties;
1080
- }> {
1081
- onChange = (value, ...args) => {
1082
- console.log(value, ...args);
1083
- const { props } = this;
1084
- if (props.onChange) {
1085
- props.onChange(value);
1086
- }
1087
- };
1088
-
1089
- render() {
1090
- return <TreeSelect {...this.props} onChange={this.onChange} />;
1091
- }
1092
- }
1093
-
1094
- const Demo = () => {
1095
- const [form] = useForm();
1096
-
1097
- const onFinish = values => {
1098
- console.log('Submit:', values);
1099
- };
1100
-
1101
- const onReset = () => {
1102
- form.resetFields();
1103
- };
1104
-
1105
- const tProps = {
1106
- multiple: true,
1107
- treeData: gData,
1108
- treeCheckable: true,
1109
- };
1110
-
1111
- return (
1112
- <div style={{ margin: 20 }}>
1113
- <h2>validity</h2>
1114
- <Form
1115
- form={form}
1116
- onFinish={onFinish}
1117
- initialValues={{
1118
- 'tree-select': ['0-0-0-value'],
1119
- 'tree-select1': ['0-0-0-value'],
1120
- select: ['jack'],
1121
- }}
1122
- >
1123
- <div style={regionStyle}>
1124
- <div>
1125
- <p style={{ color: 'blue' }}>no onChange</p>
1126
- <Field
1127
- name="tree-select"
1128
- rules={[
1129
- {
1130
- required: true,
1131
- type: 'array',
1132
- message: 'tree-select \u9700\u8981\u5FC5\u586B',
1133
- },
1134
- ]}
1135
- >
1136
- {(control, { errors }) => (
1137
- <div>
1138
- <TreeSelect {...tProps} {...control} style={{ width: 300 }} />
1139
-
1140
- <p style={errorStyle}>{errors.join(',')}</p>
1141
- </div>
1142
- )}
1143
- </Field>
1144
- </div>
1145
- </div>
1146
-
1147
- <div style={regionStyle}>
1148
- <div>
1149
- <p style={{ color: 'blue' }}>custom onChange</p>
1150
- <Field
1151
- name="tree-select1"
1152
- rules={[
1153
- {
1154
- required: true,
1155
- type: 'array',
1156
- message: 'tree-select1 \u9700\u8981\u5FC5\u586B',
1157
- },
1158
- ]}
1159
- >
1160
- {(control, { errors }) => (
1161
- <div>
1162
- <TreeSelectInput {...tProps} {...control} style={{ width: 300 }} />
1163
-
1164
- <p style={errorStyle}>{errors.join(',')}</p>
1165
- </div>
1166
- )}
1167
- </Field>
1168
- </div>
1169
- </div>
1170
-
1171
- <div style={regionStyle}>
1172
- <div>
1173
- <Field
1174
- name="select"
1175
- rules={[{ required: true, type: 'array', message: 'select \u9700\u8981\u5FC5\u586B' }]}
1176
- >
1177
- {(control, { errors }) => (
1178
- <div>
1179
- <Select style={{ width: 200 }} {...control} allowClear mode="multiple">
1180
- <Option value="jack">jack</Option>
1181
- <Option value="lucy">lucy</Option>
1182
- <Option value="disabled" disabled>
1183
- disabled
1184
- </Option>
1185
- <Option value="yiminghe">yiminghe</Option>
1186
- </Select>
1187
-
1188
- <p style={errorStyle}>{errors.join(',')}</p>
1189
- </div>
1190
- )}
1191
- </Field>
1192
- </div>
1193
- </div>
1194
-
1195
- <div style={regionStyle}>
1196
- <button type="button" onClick={onReset}>
1197
- reset
1198
- </button>
1199
- &nbsp;
1200
- <input type="submit" value="submit" />
1201
- </div>
1202
- </Form>
1203
- </div>
1204
- );
1205
- };
1206
-
1207
- export default Demo;
1208
- `},67959:function(v,t){t.Z=`import React, { useState } from 'react';
1209
- import TreeSelect from '../src';
1210
-
1211
- export default () => {
1212
- const [value, setValue] = useState<string[]>(['1']);
1213
- const [checkValue, setCheckValue] = useState<string[]>(['1']);
1214
-
1215
- const treeData = [
1216
- {
1217
- key: '1',
1218
- value: '1',
1219
- title: '1',
1220
- children: [
1221
- {
1222
- key: '1-1',
1223
- value: '1-1',
1224
- title: '1-1',
1225
- },
1226
- {
1227
- key: '1-2',
1228
- value: '1-2',
1229
- title: '1-2',
1230
- disabled: true,
1231
- children: [
1232
- {
1233
- key: '1-2-1',
1234
- value: '1-2-1',
1235
- title: '1-2-1',
1236
- disabled: true,
1237
- },
1238
- {
1239
- key: '1-2-2',
1240
- value: '1-2-2',
1241
- title: '1-2-2',
1242
- },
1243
- ],
1244
- },
1245
- {
1246
- key: '1-3',
1247
- value: '1-3',
1248
- title: '1-3',
1249
- },
1250
- ],
1251
- },
1252
- {
1253
- key: '2',
1254
- value: '2',
1255
- title: '2',
1256
- },
1257
- {
1258
- key: '3',
1259
- value: '3',
1260
- title: '3',
1261
- },
1262
- {
1263
- key: '4',
1264
- value: '4',
1265
- title: '4',
1266
- },
1267
- ];
1268
-
1269
- const onChange = (val: string[]) => {
1270
- setValue(val);
1271
- };
1272
-
1273
- const onCheckChange = (val: string[]) => {
1274
- setCheckValue(val);
1275
- };
1276
-
1277
- return (
1278
- <>
1279
- <h2>multiple with maxCount</h2>
1280
- <TreeSelect
1281
- style={{ width: 300 }}
1282
- fieldNames={{ value: 'value', label: 'title' }}
1283
- multiple
1284
- maxCount={3}
1285
- treeData={treeData}
1286
- />
1287
- <h2>checkable with maxCount</h2>
1288
- <TreeSelect
1289
- style={{ width: 300 }}
1290
- treeCheckable
1291
- // showCheckedStrategy="SHOW_ALL"
1292
- // showCheckedStrategy="SHOW_PARENT"
1293
- maxCount={4}
1294
- treeData={treeData}
1295
- onChange={onChange}
1296
- value={value}
1297
- />
1298
- <h2>checkable with maxCount and treeCheckStrictly</h2>
1299
- <TreeSelect
1300
- style={{ width: 300 }}
1301
- multiple
1302
- treeCheckable
1303
- treeCheckStrictly
1304
- maxCount={3}
1305
- treeData={treeData}
1306
- onChange={onCheckChange}
1307
- value={checkValue}
1308
- />
1309
- </>
1310
- );
1311
- };
1312
- `},73007:function(v,t){t.Z=`import '../assets/index.less';
1313
- import React from 'react';
1314
- import TreeSelect, { TreeNode } from '../src';
1315
-
1316
- const treeData = [
1317
- {
1318
- title: 'a list is option only',
1319
- showTitle: 'Node2',
1320
- value: '0-1',
1321
- },
1322
- ];
1323
-
1324
- function Demo() {
1325
- return (
1326
- <>
1327
- <TreeSelect
1328
- style={{ width: '100%' }}
1329
- treeDefaultExpandAll
1330
- treeData={treeData}
1331
- treeNodeLabelProp="showTitle"
1332
- />
1333
- <TreeSelect style={{ width: '100%' }} treeDefaultExpandAll treeNodeLabelProp="showTitle">
1334
- <TreeNode value="0-0" title="a list is option only" showTitle="Node2" />
1335
- </TreeSelect>
1336
- </>
1337
- );
1338
- }
1339
-
1340
- export default Demo;
1341
- `},30390:function(v,t){t.Z=`import React from 'react';
1342
- import { generateData, calcTotal } from './dataUtil';
1343
-
1344
- interface GenProps {
1345
- onGen: (data: any[]) => void;
1346
- x: number;
1347
- y: number;
1348
- z: number;
1349
- }
1350
-
1351
- class Gen extends React.Component<GenProps> {
1352
- static defaultProps = {
1353
- onGen: () => {},
1354
- x: 20,
1355
- y: 18,
1356
- z: 1,
1357
- };
1358
-
1359
- xRef = React.createRef<HTMLInputElement>();
1360
-
1361
- yRef = React.createRef<HTMLInputElement>();
1362
-
1363
- zRef = React.createRef<HTMLInputElement>();
1364
-
1365
- state = {
1366
- nums: '',
1367
- };
1368
-
1369
- componentDidMount() {
1370
- const { onGen } = this.props;
1371
- const vals = this.getVals();
1372
- onGen(generateData(vals.x, vals.y, vals.z));
1373
- }
1374
-
1375
- onGen = e => {
1376
- const { onGen } = this.props;
1377
- e.preventDefault();
1378
- const vals = this.getVals();
1379
- onGen(generateData(vals.x, vals.y, vals.z));
1380
- this.setState({
1381
- nums: calcTotal(vals.x, vals.y, vals.z),
1382
- });
1383
- };
1384
-
1385
- getVals = () => ({
1386
- x: parseInt(this.xRef.current.value, 10),
1387
- y: parseInt(this.yRef.current.value, 10),
1388
- z: parseInt(this.zRef.current.value, 10),
1389
- });
1390
-
1391
- getDefaultValue = (key: string) => {
1392
- if (key in this.props) {
1393
- return String(this.props[key]);
1394
- }
1395
- return null;
1396
- };
1397
-
1398
- render() {
1399
- const { nums } = this.state;
1400
- const { x, y, z } = this.props;
1401
- return (
1402
- <div style={{ padding: '0 20px' }}>
1403
- <h2>big data generator</h2>
1404
- <form onSubmit={this.onGen}>
1405
- <span style={{ marginRight: 10 }}>
1406
- x:{' '}
1407
- <input
1408
- ref={this.xRef}
1409
- defaultValue={this.getDefaultValue('x')}
1410
- type="number"
1411
- min="1"
1412
- required
1413
- style={{ width: 50 }}
1414
- />
1415
- </span>
1416
- <span style={{ marginRight: 10 }}>
1417
- y:{' '}
1418
- <input
1419
- ref={this.yRef}
1420
- defaultValue={this.getDefaultValue('y')}
1421
- type="number"
1422
- min="1"
1423
- required
1424
- style={{ width: 50 }}
1425
- />
1426
- </span>
1427
- <span style={{ marginRight: 10 }}>
1428
- z:{' '}
1429
- <input
1430
- ref={this.zRef}
1431
- defaultValue={this.getDefaultValue('z')}
1432
- type="number"
1433
- min="1"
1434
- required
1435
- style={{ width: 50 }}
1436
- />
1437
- </span>
1438
- <button type="submit">Generate</button>
1439
- <p>total nodes: {nums || calcTotal(x, y, z)}</p>
1440
- </form>
1441
- <p style={{ fontSize: 12 }}>
1442
- x\uFF1A\u6BCF\u4E00\u7EA7\u4E0B\u7684\u8282\u70B9\u603B\u6570\u3002y\uFF1A\u6BCF\u7EA7\u8282\u70B9\u91CC\u6709y\u4E2A\u8282\u70B9\u3001\u5B58\u5728\u5B50\u8282\u70B9\u3002z\uFF1A\u6811\u7684level\u5C42\u7EA7\u6570\uFF080\u8868\u793A\u4E00\u7EA7\uFF09
1443
- </p>
1444
- </div>
1445
- );
1446
- }
1447
- }
1448
-
1449
- export default Gen;
1450
- `},37756:function(v,t){t.Z=`/* eslint-disable no-plusplus, no-mixed-operators, no-underscore-dangle */
1451
- export function generateData(x = 3, y = 2, z = 1, gData = []) {
1452
- // x\uFF1A\u6BCF\u4E00\u7EA7\u4E0B\u7684\u8282\u70B9\u603B\u6570\u3002y\uFF1A\u6BCF\u7EA7\u8282\u70B9\u91CC\u6709y\u4E2A\u8282\u70B9\u3001\u5B58\u5728\u5B50\u8282\u70B9\u3002z\uFF1A\u6811\u7684level\u5C42\u7EA7\u6570\uFF080\u8868\u793A\u4E00\u7EA7\uFF09
1453
- function _loop(_level, _preKey?, _tns?) {
1454
- const preKey = _preKey || '0';
1455
- const tns = _tns || gData;
1456
-
1457
- const children = [];
1458
- for (let i = 0; i < x; i++) {
1459
- const key = \`\${preKey}-\${i}\`;
1460
- tns.push({
1461
- label: \`\${key}-label\`,
1462
- value: \`\${key}-value\`,
1463
- key,
1464
- disabled: key === '0-0-0-1' || false,
1465
- });
1466
- if (i < y) {
1467
- children.push(key);
1468
- }
1469
- }
1470
- if (_level < 0) {
1471
- return tns;
1472
- }
1473
- const __level = _level - 1;
1474
- children.forEach((key, index) => {
1475
- tns[index].children = [];
1476
- return _loop(__level, key, tns[index].children);
1477
- });
1478
-
1479
- return null;
1480
- }
1481
- _loop(z);
1482
- return gData;
1483
- }
1484
- export function calcTotal(x = 3, y = 2, z = 1) {
1485
- /* eslint no-param-reassign:0 */
1486
- const rec = n => (n >= 0 ? x * y ** n-- + rec(n) : 0);
1487
- return rec(z + 1);
1488
- }
1489
- console.log('\u603B\u8282\u70B9\u6570\uFF08\u5355\u4E2Atree\uFF09\uFF1A', calcTotal());
1490
- export const gData = generateData();
1491
-
1492
- export function generateTreeNodes(treeNode) {
1493
- const arr = [];
1494
- const key = treeNode.props.eventKey;
1495
- for (let i = 0; i < 3; i++) {
1496
- arr.push({ label: \`\${key}-\${i}-label\`, value: \`\${key}-\${i}-value\`, key: \`\${key}-\${i}\` });
1497
- }
1498
- return arr;
1499
- }
1500
-
1501
- function setLeaf(treeData, curKey, level) {
1502
- const loopLeaf = (data, lev) => {
1503
- const l = lev - 1;
1504
- data.forEach(item => {
1505
- if (
1506
- item.key.length > curKey.length
1507
- ? item.key.indexOf(curKey) !== 0
1508
- : curKey.indexOf(item.key) !== 0
1509
- ) {
1510
- return;
1511
- }
1512
- if (item.children) {
1513
- loopLeaf(item.children, l);
1514
- } else if (l < 1) {
1515
- item.isLeaf = true;
1516
- }
1517
- });
1518
- };
1519
- loopLeaf(treeData, level + 1);
1520
- }
1521
-
1522
- export function getNewTreeData(treeData, curKey, child, level) {
1523
- const loop = data => {
1524
- if (level < 1 || curKey.length - 3 > level * 2) return;
1525
- data.forEach(item => {
1526
- if (curKey.indexOf(item.key) === 0) {
1527
- if (item.children) {
1528
- loop(item.children);
1529
- } else {
1530
- item.children = child;
1531
- }
1532
- }
1533
- });
1534
- };
1535
- loop(treeData);
1536
- setLeaf(treeData, curKey, level);
1537
- }
1538
-
1539
- function loopData(data, callback) {
1540
- const loop = (d, level = '0') => {
1541
- d.forEach((item, index) => {
1542
- const pos = \`\${level}-\${index}\`;
1543
- if (item.children) {
1544
- loop(item.children, pos);
1545
- }
1546
- callback(item, index, pos);
1547
- });
1548
- };
1549
- loop(data);
1550
- }
1551
-
1552
- function isPositionPrefix(smallPos, bigPos) {
1553
- if (bigPos.length < smallPos.length) {
1554
- return false;
1555
- }
1556
- // attention: "0-0-1" "0-0-10"
1557
- if (bigPos.length > smallPos.length && bigPos.charAt(smallPos.length) !== '-') {
1558
- return false;
1559
- }
1560
- return bigPos.substr(0, smallPos.length) === smallPos;
1561
- }
1562
- // console.log(isPositionPrefix("0-1", "0-10-1"));
1563
-
1564
- export function getFilterValue(val, sVal, delVal) {
1565
- const allPos = [];
1566
- const delPos = [];
1567
- loopData(gData, (item, index, pos) => {
1568
- if (sVal.indexOf(item.value) > -1) {
1569
- allPos.push(pos);
1570
- }
1571
- if (delVal.indexOf(item.value) > -1) {
1572
- delPos.push(pos);
1573
- }
1574
- });
1575
- const newPos = [];
1576
- delPos.forEach(item => {
1577
- allPos.forEach(i => {
1578
- if (isPositionPrefix(item, i) || isPositionPrefix(i, item)) {
1579
- // \u8FC7\u6EE4\u6389 \u7236\u7EA7\u8282\u70B9 \u548C \u6240\u6709\u5B50\u8282\u70B9\u3002
1580
- // \u56E0\u4E3A node\u8282\u70B9 \u4E0D\u9009\u65F6\uFF0C\u5176 \u7236\u7EA7\u8282\u70B9 \u548C \u6240\u6709\u5B50\u8282\u70B9 \u90FD\u4E0D\u9009\u3002
1581
- return;
1582
- }
1583
- newPos.push(i);
1584
- });
1585
- });
1586
- const newVal = [];
1587
- if (newPos.length) {
1588
- loopData(gData, (item, index, pos) => {
1589
- if (newPos.indexOf(pos) > -1) {
1590
- newVal.push(item.value);
1591
- }
1592
- });
1593
- }
1594
- return newVal;
1595
- }
1596
- `},33149:function(v,t){t.Z=`import '../assets/index.less';
1597
- import React from 'react';
1598
- import TreeSelect, { TreeNode } from '../src';
1599
-
1600
- function Demo() {
1601
- return (
1602
- <TreeSelect style={{ width: 120 }} dropdownMatchSelectWidth={false} treeDefaultExpandAll>
1603
- <TreeNode value="parent 1" title="parent 1">
1604
- <TreeNode value="parent 1-0 sdfsdfsdsdfsd" title="parent 1-0 sdfsdfsd">
1605
- <TreeNode value="leaf1 sdfsdf" title="leaf1" />
1606
- <TreeNode value="leaf2 sdfsdfsdf" title="leaf2" />
1607
- </TreeNode>
1608
- <TreeNode value="parent 1-1 sdfsdfsdf" title="parent 1-1 sdfsdfsd">
1609
- <TreeNode value="leaf3" title={<b style={{ color: '#08c' }}>leaf3</b>} />
1610
- </TreeNode>
1611
- <TreeNode value="parent 1-2 sdfsdfsdf" title="parent 1-2 sdfsdfsd">
1612
- <TreeNode value="leaf3" title={<b style={{ color: '#08c' }}>leaf3</b>} />
1613
- </TreeNode>
1614
- <TreeNode value="parent 1-3 sdfsdfsdf" title="parent 1-2 sdfsdfsd">
1615
- <TreeNode value="leaf3" title={<b style={{ color: '#08c' }}>leaf3</b>} />
1616
- </TreeNode>
1617
- <TreeNode value="parent 1-4 sdfsdfsdf" title="parent 1-4 sdfsdfsd">
1618
- <TreeNode value="leaf3" title={<b style={{ color: '#08c' }}>leaf3</b>} />
1619
- </TreeNode>
1620
- <TreeNode value="parent 1-5 2sdfsdfsdf" title="parent 1-5 sdfsdfsd">
1621
- <TreeNode value="leaf3" title={<b style={{ color: '#08c' }}>leaf3</b>} />
1622
- </TreeNode>
1623
- </TreeNode>
1624
- </TreeSelect>
1625
- );
1626
- }
1627
-
1628
- export default Demo;
1629
- `},28458:function(v,t){t.Z=`import * as React from 'react';
1630
- import type { DataEntity, IconType } from 'rc-tree/lib/interface';
1631
- import type { LegacyDataNode, SafeKey, Key } from './interface';
1632
-
1633
- interface LegacyContextProps {
1634
- checkable: boolean | React.ReactNode;
1635
- checkedKeys: Key[];
1636
- halfCheckedKeys: Key[];
1637
- treeExpandedKeys: Key[];
1638
- treeDefaultExpandedKeys: Key[];
1639
- onTreeExpand: (keys: Key[]) => void;
1640
- treeDefaultExpandAll: boolean;
1641
- treeIcon: IconType;
1642
- showTreeIcon: boolean;
1643
- switcherIcon: IconType;
1644
- treeLine: boolean;
1645
- treeNodeFilterProp: string;
1646
- treeLoadedKeys: Key[];
1647
- treeMotion: any;
1648
- loadData: (treeNode: LegacyDataNode) => Promise<unknown>;
1649
- onTreeLoad: (loadedKeys: Key[]) => void;
1650
-
1651
- keyEntities: Record<SafeKey, DataEntity<any>>;
1652
- }
1653
-
1654
- const LegacySelectContext = React.createContext<LegacyContextProps>(null);
1655
-
1656
- export default LegacySelectContext;
1657
- `},49597:function(v,t){t.Z=`import { useBaseProps } from '@rc-component/select';
1658
- import type { RefOptionListProps } from '@rc-component/select/lib/OptionList';
1659
- import type { TreeProps } from 'rc-tree';
1660
- import Tree from 'rc-tree';
1661
- import { UnstableContext } from 'rc-tree';
1662
- import type { EventDataNode, ScrollTo } from 'rc-tree/lib/interface';
1663
- import KeyCode from '@rc-component/util/lib/KeyCode';
1664
- import useMemo from '@rc-component/util/lib/hooks/useMemo';
1665
- import * as React from 'react';
1666
- import LegacyContext from './LegacyContext';
1667
- import TreeSelectContext from './TreeSelectContext';
1668
- import type { DataNode, Key, SafeKey } from './interface';
1669
- import { getAllKeys, isCheckDisabled } from './utils/valueUtil';
1670
- import { useEvent } from '@rc-component/util';
1671
-
1672
- const HIDDEN_STYLE = {
1673
- width: 0,
1674
- height: 0,
1675
- display: 'flex',
1676
- overflow: 'hidden',
1677
- opacity: 0,
1678
- border: 0,
1679
- padding: 0,
1680
- margin: 0,
1681
- };
1682
-
1683
- interface TreeEventInfo {
1684
- node: { key: Key };
1685
- selected?: boolean;
1686
- checked?: boolean;
1687
- }
1688
-
1689
- type ReviseRefOptionListProps = Omit<RefOptionListProps, 'scrollTo'> & { scrollTo: ScrollTo };
1690
-
1691
- const OptionList: React.ForwardRefRenderFunction<ReviseRefOptionListProps> = (_, ref) => {
1692
- const { prefixCls, multiple, searchValue, toggleOpen, open, notFoundContent } = useBaseProps();
1693
-
1694
- const {
1695
- virtual,
1696
- listHeight,
1697
- listItemHeight,
1698
- listItemScrollOffset,
1699
- treeData,
1700
- fieldNames,
1701
- onSelect,
1702
- dropdownMatchSelectWidth,
1703
- treeExpandAction,
1704
- treeTitleRender,
1705
- onPopupScroll,
1706
- leftMaxCount,
1707
- leafCountOnly,
1708
- valueEntities,
1709
- } = React.useContext(TreeSelectContext);
1710
-
1711
- const {
1712
- checkable,
1713
- checkedKeys,
1714
- halfCheckedKeys,
1715
- treeExpandedKeys,
1716
- treeDefaultExpandAll,
1717
- treeDefaultExpandedKeys,
1718
- onTreeExpand,
1719
- treeIcon,
1720
- showTreeIcon,
1721
- switcherIcon,
1722
- treeLine,
1723
- treeNodeFilterProp,
1724
- loadData,
1725
- treeLoadedKeys,
1726
- treeMotion,
1727
- onTreeLoad,
1728
- keyEntities,
1729
- } = React.useContext(LegacyContext);
1730
-
1731
- const treeRef = React.useRef<Tree>();
1732
-
1733
- const memoTreeData = useMemo(
1734
- () => treeData,
1735
- // eslint-disable-next-line react-hooks/exhaustive-deps
1736
- [open, treeData],
1737
- (prev, next) => next[0] && prev[1] !== next[1],
1738
- );
1739
-
1740
- // ========================== Values ==========================
1741
- const mergedCheckedKeys = React.useMemo(() => {
1742
- if (!checkable) {
1743
- return null;
1744
- }
1745
-
1746
- return {
1747
- checked: checkedKeys,
1748
- halfChecked: halfCheckedKeys,
1749
- };
1750
- }, [checkable, checkedKeys, halfCheckedKeys]);
1751
-
1752
- // ========================== Scroll ==========================
1753
- React.useEffect(() => {
1754
- // Single mode should scroll to current key
1755
- if (open && !multiple && checkedKeys.length) {
1756
- treeRef.current?.scrollTo({ key: checkedKeys[0] });
1757
- }
1758
- // eslint-disable-next-line react-hooks/exhaustive-deps
1759
- }, [open]);
1760
-
1761
- // ========================== Events ==========================
1762
- const onListMouseDown: React.MouseEventHandler<HTMLDivElement> = event => {
1763
- event.preventDefault();
1764
- };
1765
-
1766
- const onInternalSelect = (__: Key[], info: TreeEventInfo) => {
1767
- const { node } = info;
1768
-
1769
- if (checkable && isCheckDisabled(node)) {
1770
- return;
1771
- }
1772
-
1773
- onSelect(node.key, {
1774
- selected: !checkedKeys.includes(node.key),
1775
- });
1776
-
1777
- if (!multiple) {
1778
- toggleOpen(false);
1779
- }
1780
- };
1781
-
1782
- // =========================== Keys ===========================
1783
- const [expandedKeys, setExpandedKeys] = React.useState<Key[]>(treeDefaultExpandedKeys);
1784
- const [searchExpandedKeys, setSearchExpandedKeys] = React.useState<Key[]>(null);
1785
-
1786
- const mergedExpandedKeys = React.useMemo(() => {
1787
- if (treeExpandedKeys) {
1788
- return [...treeExpandedKeys];
1789
- }
1790
- return searchValue ? searchExpandedKeys : expandedKeys;
1791
- }, [expandedKeys, searchExpandedKeys, treeExpandedKeys, searchValue]);
1792
-
1793
- const onInternalExpand = (keys: Key[]) => {
1794
- setExpandedKeys(keys);
1795
- setSearchExpandedKeys(keys);
1796
-
1797
- if (onTreeExpand) {
1798
- onTreeExpand(keys);
1799
- }
1800
- };
1801
-
1802
- // ========================== Search ==========================
1803
- const lowerSearchValue = String(searchValue).toLowerCase();
1804
- const filterTreeNode = (treeNode: EventDataNode<any>) => {
1805
- if (!lowerSearchValue) {
1806
- return false;
1807
- }
1808
- return String(treeNode[treeNodeFilterProp]).toLowerCase().includes(lowerSearchValue);
1809
- };
1810
-
1811
- React.useEffect(() => {
1812
- if (searchValue) {
1813
- setSearchExpandedKeys(getAllKeys(treeData, fieldNames));
1814
- }
1815
- // eslint-disable-next-line react-hooks/exhaustive-deps
1816
- }, [searchValue]);
1817
-
1818
- // ========================= Disabled =========================
1819
- // Cache disabled states in React state to ensure re-render when cache updates
1820
- const [disabledCache, setDisabledCache] = React.useState<Map<string, boolean>>(() => new Map());
1821
-
1822
- React.useEffect(() => {
1823
- if (leftMaxCount) {
1824
- setDisabledCache(new Map());
1825
- }
1826
- }, [leftMaxCount]);
1827
-
1828
- function getDisabledWithCache(node: DataNode) {
1829
- const value = node[fieldNames.value];
1830
- if (!disabledCache.has(value)) {
1831
- const entity = valueEntities.get(value);
1832
- const isLeaf = (entity.children || []).length === 0;
1833
-
1834
- if (!isLeaf) {
1835
- const checkableChildren = entity.children.filter(
1836
- childTreeNode =>
1837
- !childTreeNode.node.disabled &&
1838
- !childTreeNode.node.disableCheckbox &&
1839
- !checkedKeys.includes(childTreeNode.node[fieldNames.value]),
1840
- );
1841
-
1842
- const checkableChildrenCount = checkableChildren.length;
1843
- disabledCache.set(value, checkableChildrenCount > leftMaxCount);
1844
- } else {
1845
- disabledCache.set(value, false);
1846
- }
1847
- }
1848
- return disabledCache.get(value);
1849
- }
1850
-
1851
- const nodeDisabled = useEvent((node: DataNode) => {
1852
- const nodeValue = node[fieldNames.value];
1853
-
1854
- if (checkedKeys.includes(nodeValue)) {
1855
- return false;
1856
- }
1857
-
1858
- if (leftMaxCount === null) {
1859
- return false;
1860
- }
1861
-
1862
- if (leftMaxCount <= 0) {
1863
- return true;
1864
- }
1865
-
1866
- // This is a low performance calculation
1867
- if (leafCountOnly && leftMaxCount) {
1868
- return getDisabledWithCache(node);
1869
- }
1870
-
1871
- return false;
1872
- });
1873
-
1874
- // ========================== Get First Selectable Node ==========================
1875
- const getFirstMatchingNode = (nodes: EventDataNode<any>[]): EventDataNode<any> | null => {
1876
- for (const node of nodes) {
1877
- if (node.disabled || node.selectable === false) {
1878
- continue;
1879
- }
1880
-
1881
- if (searchValue) {
1882
- if (filterTreeNode(node)) {
1883
- return node;
1884
- }
1885
- } else {
1886
- return node;
1887
- }
1888
-
1889
- if (node[fieldNames.children]) {
1890
- const matchInChildren = getFirstMatchingNode(node[fieldNames.children]);
1891
- if (matchInChildren) {
1892
- return matchInChildren;
1893
- }
1894
- }
1895
- }
1896
- return null;
1897
- };
1898
-
1899
- // ========================== Active ==========================
1900
- const [activeKey, setActiveKey] = React.useState<Key>(null);
1901
- const activeEntity = keyEntities[activeKey as SafeKey];
1902
-
1903
- React.useEffect(() => {
1904
- if (!open) {
1905
- return;
1906
- }
1907
- let nextActiveKey = null;
1908
-
1909
- const getFirstNode = () => {
1910
- const firstNode = getFirstMatchingNode(memoTreeData);
1911
- return firstNode ? firstNode[fieldNames.value] : null;
1912
- };
1913
-
1914
- // single mode active first checked node
1915
- if (!multiple && checkedKeys.length && !searchValue) {
1916
- nextActiveKey = checkedKeys[0];
1917
- } else {
1918
- nextActiveKey = getFirstNode();
1919
- }
1920
-
1921
- setActiveKey(nextActiveKey);
1922
- }, [open, searchValue]);
1923
-
1924
- // ========================= Keyboard =========================
1925
- React.useImperativeHandle(ref, () => ({
1926
- scrollTo: treeRef.current?.scrollTo,
1927
- onKeyDown: event => {
1928
- const { which } = event;
1929
- switch (which) {
1930
- // >>> Arrow keys
1931
- case KeyCode.UP:
1932
- case KeyCode.DOWN:
1933
- case KeyCode.LEFT:
1934
- case KeyCode.RIGHT:
1935
- treeRef.current?.onKeyDown(event as React.KeyboardEvent<HTMLDivElement>);
1936
- break;
1937
-
1938
- // >>> Select item
1939
- case KeyCode.ENTER: {
1940
- if (activeEntity) {
1941
- const isNodeDisabled = nodeDisabled(activeEntity.node);
1942
- const { selectable, value, disabled } = activeEntity?.node || {};
1943
- if (selectable !== false && !disabled && !isNodeDisabled) {
1944
- onInternalSelect(null, {
1945
- node: { key: activeKey },
1946
- selected: !checkedKeys.includes(value),
1947
- });
1948
- }
1949
- }
1950
- break;
1951
- }
1952
-
1953
- // >>> Close
1954
- case KeyCode.ESC: {
1955
- toggleOpen(false);
1956
- }
1957
- }
1958
- },
1959
- onKeyUp: () => {},
1960
- }));
1961
-
1962
- const hasLoadDataFn = useMemo(
1963
- () => (searchValue ? false : true),
1964
- [searchValue, treeExpandedKeys || expandedKeys],
1965
- ([preSearchValue], [nextSearchValue, nextExcludeSearchExpandedKeys]) =>
1966
- preSearchValue !== nextSearchValue && !!(nextSearchValue || nextExcludeSearchExpandedKeys),
1967
- );
1968
-
1969
- const syncLoadData = hasLoadDataFn ? loadData : null;
1970
-
1971
- // ========================== Render ==========================
1972
- if (memoTreeData.length === 0) {
1973
- return (
1974
- <div role="listbox" className={\`\${prefixCls}-empty\`} onMouseDown={onListMouseDown}>
1975
- {notFoundContent}
1976
- </div>
1977
- );
1978
- }
1979
-
1980
- const treeProps: Partial<TreeProps> = {
1981
- fieldNames,
1982
- };
1983
- if (treeLoadedKeys) {
1984
- treeProps.loadedKeys = treeLoadedKeys;
1985
- }
1986
- if (mergedExpandedKeys) {
1987
- treeProps.expandedKeys = mergedExpandedKeys;
1988
- }
1989
-
1990
- return (
1991
- <div onMouseDown={onListMouseDown}>
1992
- {activeEntity && open && (
1993
- <span style={HIDDEN_STYLE} aria-live="assertive">
1994
- {activeEntity.node.value}
1995
- </span>
1996
- )}
1997
- <UnstableContext.Provider value={{ nodeDisabled }}>
1998
- <Tree
1999
- ref={treeRef}
2000
- focusable={false}
2001
- prefixCls={\`\${prefixCls}-tree\`}
2002
- treeData={memoTreeData}
2003
- height={listHeight}
2004
- itemHeight={listItemHeight}
2005
- itemScrollOffset={listItemScrollOffset}
2006
- virtual={virtual !== false && dropdownMatchSelectWidth !== false}
2007
- multiple={multiple}
2008
- icon={treeIcon}
2009
- showIcon={showTreeIcon}
2010
- switcherIcon={switcherIcon}
2011
- showLine={treeLine}
2012
- loadData={syncLoadData}
2013
- motion={treeMotion}
2014
- activeKey={activeKey}
2015
- // We handle keys by out instead tree self
2016
- checkable={checkable}
2017
- checkStrictly
2018
- checkedKeys={mergedCheckedKeys}
2019
- selectedKeys={!checkable ? checkedKeys : []}
2020
- defaultExpandAll={treeDefaultExpandAll}
2021
- titleRender={treeTitleRender}
2022
- {...treeProps}
2023
- // Proxy event out
2024
- onActiveChange={setActiveKey}
2025
- onSelect={onInternalSelect}
2026
- onCheck={onInternalSelect}
2027
- onExpand={onInternalExpand}
2028
- onLoad={onTreeLoad}
2029
- filterTreeNode={filterTreeNode}
2030
- expandAction={treeExpandAction}
2031
- onScroll={onPopupScroll}
2032
- />
2033
- </UnstableContext.Provider>
2034
- </div>
2035
- );
2036
- };
2037
-
2038
- const RefOptionList = React.forwardRef<ReviseRefOptionListProps>(OptionList);
2039
-
2040
- if (process.env.NODE_ENV !== 'production') {
2041
- RefOptionList.displayName = 'OptionList';
2042
- }
2043
-
2044
- export default RefOptionList;
2045
- `},41849:function(v,t){t.Z=`/* istanbul ignore file */
2046
- import type * as React from 'react';
2047
- import type { DataNode, Key } from './interface';
2048
-
2049
- export interface TreeNodeProps extends Omit<DataNode, 'children'> {
2050
- value: Key;
2051
- children?: React.ReactNode;
2052
- }
2053
-
2054
- /** This is a placeholder, not real render in dom */
2055
- const TreeNode: React.FC<TreeNodeProps> = () => null;
2056
-
2057
- export default TreeNode;
2058
- `},51184:function(v,t){t.Z=`import type { BaseSelectPropsWithoutPrivate, BaseSelectRef } from '@rc-component/select';
2059
- import { BaseSelect } from '@rc-component/select';
2060
- import useId from '@rc-component/select/lib/hooks/useId';
2061
- import type { IconType } from 'rc-tree/lib/interface';
2062
- import type { ExpandAction } from 'rc-tree/lib/Tree';
2063
- import { conductCheck } from 'rc-tree/lib/utils/conductUtil';
2064
- import useMergedState from '@rc-component/util/lib/hooks/useMergedState';
2065
- import warning from '@rc-component/util/lib/warning';
2066
- import * as React from 'react';
2067
- import useCache from './hooks/useCache';
2068
- import useCheckedKeys from './hooks/useCheckedKeys';
2069
- import useDataEntities from './hooks/useDataEntities';
2070
- import useFilterTreeData from './hooks/useFilterTreeData';
2071
- import useRefFunc from './hooks/useRefFunc';
2072
- import useTreeData from './hooks/useTreeData';
2073
- import LegacyContext from './LegacyContext';
2074
- import OptionList from './OptionList';
2075
- import TreeNode from './TreeNode';
2076
- import type { TreeSelectContextProps } from './TreeSelectContext';
2077
- import TreeSelectContext from './TreeSelectContext';
2078
- import { fillAdditionalInfo, fillLegacyProps } from './utils/legacyUtil';
2079
- import type { CheckedStrategy } from './utils/strategyUtil';
2080
- import { formatStrategyValues, SHOW_ALL, SHOW_CHILD, SHOW_PARENT } from './utils/strategyUtil';
2081
- import { fillFieldNames, isNil, toArray } from './utils/valueUtil';
2082
- import warningProps from './utils/warningPropsUtil';
2083
- import type {
2084
- LabeledValueType,
2085
- SafeKey,
2086
- Key,
2087
- DataNode,
2088
- SimpleModeConfig,
2089
- ChangeEventExtra,
2090
- SelectSource,
2091
- DefaultValueType,
2092
- FieldNames,
2093
- LegacyDataNode,
2094
- } from './interface';
2095
-
2096
- export interface TreeSelectProps<ValueType = any, OptionType extends DataNode = DataNode>
2097
- extends Omit<BaseSelectPropsWithoutPrivate, 'mode'> {
2098
- prefixCls?: string;
2099
- id?: string;
2100
- children?: React.ReactNode;
2101
-
2102
- // >>> Value
2103
- value?: ValueType;
2104
- defaultValue?: ValueType;
2105
- onChange?: (value: ValueType, labelList: React.ReactNode[], extra: ChangeEventExtra) => void;
2106
-
2107
- // >>> Search
2108
- searchValue?: string;
2109
- /** @deprecated Use \`searchValue\` instead */
2110
- inputValue?: string;
2111
- onSearch?: (value: string) => void;
2112
- autoClearSearchValue?: boolean;
2113
- filterTreeNode?: boolean | ((inputValue: string, treeNode: DataNode) => boolean);
2114
- treeNodeFilterProp?: string;
2115
-
2116
- // >>> Select
2117
- onSelect?: (value: ValueType, option: OptionType) => void;
2118
- onDeselect?: (value: ValueType, option: OptionType) => void;
2119
-
2120
- // >>> Selector
2121
- showCheckedStrategy?: CheckedStrategy;
2122
- treeNodeLabelProp?: string;
2123
-
2124
- // >>> Field Names
2125
- fieldNames?: FieldNames;
2126
-
2127
- // >>> Mode
2128
- multiple?: boolean;
2129
- treeCheckable?: boolean | React.ReactNode;
2130
- treeCheckStrictly?: boolean;
2131
- labelInValue?: boolean;
2132
- maxCount?: number;
2133
-
2134
- // >>> Data
2135
- treeData?: OptionType[];
2136
- treeDataSimpleMode?: boolean | SimpleModeConfig;
2137
- loadData?: (dataNode: LegacyDataNode) => Promise<unknown>;
2138
- treeLoadedKeys?: SafeKey[];
2139
- onTreeLoad?: (loadedKeys: SafeKey[]) => void;
2140
-
2141
- // >>> Expanded
2142
- treeDefaultExpandAll?: boolean;
2143
- treeExpandedKeys?: SafeKey[];
2144
- treeDefaultExpandedKeys?: SafeKey[];
2145
- onTreeExpand?: (expandedKeys: SafeKey[]) => void;
2146
- treeExpandAction?: ExpandAction;
2147
-
2148
- // >>> Options
2149
- virtual?: boolean;
2150
- listHeight?: number;
2151
- listItemHeight?: number;
2152
- listItemScrollOffset?: number;
2153
- onDropdownVisibleChange?: (open: boolean) => void;
2154
- treeTitleRender?: (node: OptionType) => React.ReactNode;
2155
-
2156
- // >>> Tree
2157
- treeLine?: boolean;
2158
- treeIcon?: IconType;
2159
- showTreeIcon?: boolean;
2160
- switcherIcon?: IconType;
2161
- treeMotion?: any;
2162
- }
2163
-
2164
- function isRawValue(value: SafeKey | LabeledValueType): value is SafeKey {
2165
- return !value || typeof value !== 'object';
2166
- }
2167
-
2168
- const TreeSelect = React.forwardRef<BaseSelectRef, TreeSelectProps>((props, ref) => {
2169
- const {
2170
- id,
2171
- prefixCls = 'rc-tree-select',
2172
-
2173
- // Value
2174
- value,
2175
- defaultValue,
2176
- onChange,
2177
- onSelect,
2178
- onDeselect,
2179
-
2180
- // Search
2181
- searchValue,
2182
- inputValue,
2183
- onSearch,
2184
- autoClearSearchValue = true,
2185
- filterTreeNode,
2186
- treeNodeFilterProp = 'value',
2187
-
2188
- // Selector
2189
- showCheckedStrategy,
2190
- treeNodeLabelProp,
2191
-
2192
- // Mode
2193
- multiple,
2194
- treeCheckable,
2195
- treeCheckStrictly,
2196
- labelInValue,
2197
- maxCount,
2198
-
2199
- // FieldNames
2200
- fieldNames,
2201
-
2202
- // Data
2203
- treeDataSimpleMode,
2204
- treeData,
2205
- children,
2206
- loadData,
2207
- treeLoadedKeys,
2208
- onTreeLoad,
2209
-
2210
- // Expanded
2211
- treeDefaultExpandAll,
2212
- treeExpandedKeys,
2213
- treeDefaultExpandedKeys,
2214
- onTreeExpand,
2215
- treeExpandAction,
2216
-
2217
- // Options
2218
- virtual,
2219
- listHeight = 200,
2220
- listItemHeight = 20,
2221
- listItemScrollOffset = 0,
2222
-
2223
- onDropdownVisibleChange,
2224
- dropdownMatchSelectWidth = true,
2225
-
2226
- // Tree
2227
- treeLine,
2228
- treeIcon,
2229
- showTreeIcon,
2230
- switcherIcon,
2231
- treeMotion,
2232
- treeTitleRender,
2233
-
2234
- onPopupScroll,
2235
- ...restProps
2236
- } = props;
2237
-
2238
- const mergedId = useId(id);
2239
- const treeConduction = treeCheckable && !treeCheckStrictly;
2240
- const mergedCheckable = treeCheckable || treeCheckStrictly;
2241
- const mergedLabelInValue = treeCheckStrictly || labelInValue;
2242
- const mergedMultiple = mergedCheckable || multiple;
2243
-
2244
- const [internalValue, setInternalValue] = useMergedState(defaultValue, { value });
2245
-
2246
- // \`multiple\` && \`!treeCheckable\` should be show all
2247
- const mergedShowCheckedStrategy = React.useMemo(() => {
2248
- if (!treeCheckable) {
2249
- return SHOW_ALL;
2250
- }
2251
-
2252
- return showCheckedStrategy || SHOW_CHILD;
2253
- }, [showCheckedStrategy, treeCheckable]);
2254
-
2255
- // ========================== Warning ===========================
2256
- if (process.env.NODE_ENV !== 'production') {
2257
- warningProps(props);
2258
- }
2259
-
2260
- // ========================= FieldNames =========================
2261
- const mergedFieldNames: FieldNames = React.useMemo(
2262
- () => fillFieldNames(fieldNames),
2263
- /* eslint-disable react-hooks/exhaustive-deps */
2264
- [JSON.stringify(fieldNames)],
2265
- /* eslint-enable react-hooks/exhaustive-deps */
2266
- );
2267
-
2268
- // =========================== Search ===========================
2269
- const [mergedSearchValue, setSearchValue] = useMergedState('', {
2270
- value: searchValue !== undefined ? searchValue : inputValue,
2271
- postState: search => search || '',
2272
- });
2273
-
2274
- const onInternalSearch = searchText => {
2275
- setSearchValue(searchText);
2276
- onSearch?.(searchText);
2277
- };
2278
-
2279
- // ============================ Data ============================
2280
- // \`useTreeData\` only do convert of \`children\` or \`simpleMode\`.
2281
- // Else will return origin \`treeData\` for perf consideration.
2282
- // Do not do anything to loop the data.
2283
- const mergedTreeData = useTreeData(treeData, children, treeDataSimpleMode);
2284
-
2285
- const { keyEntities, valueEntities } = useDataEntities(mergedTreeData, mergedFieldNames);
2286
-
2287
- /** Get \`missingRawValues\` which not exist in the tree yet */
2288
- const splitRawValues = React.useCallback(
2289
- (newRawValues: SafeKey[]) => {
2290
- const missingRawValues = [];
2291
- const existRawValues = [];
2292
-
2293
- // Keep missing value in the cache
2294
- newRawValues.forEach(val => {
2295
- if (valueEntities.has(val)) {
2296
- existRawValues.push(val);
2297
- } else {
2298
- missingRawValues.push(val);
2299
- }
2300
- });
2301
-
2302
- return { missingRawValues, existRawValues };
2303
- },
2304
- [valueEntities],
2305
- );
2306
-
2307
- // Filtered Tree
2308
- const filteredTreeData = useFilterTreeData(mergedTreeData, mergedSearchValue, {
2309
- fieldNames: mergedFieldNames,
2310
- treeNodeFilterProp,
2311
- filterTreeNode,
2312
- });
2313
-
2314
- // =========================== Label ============================
2315
- const getLabel = React.useCallback(
2316
- (item: DataNode) => {
2317
- if (item) {
2318
- if (treeNodeLabelProp) {
2319
- return item[treeNodeLabelProp];
2320
- }
2321
-
2322
- // Loop from fieldNames
2323
- const { _title: titleList } = mergedFieldNames;
2324
-
2325
- for (let i = 0; i < titleList.length; i += 1) {
2326
- const title = item[titleList[i]];
2327
- if (title !== undefined) {
2328
- return title;
2329
- }
2330
- }
2331
- }
2332
- },
2333
- [mergedFieldNames, treeNodeLabelProp],
2334
- );
2335
-
2336
- // ========================= Wrap Value =========================
2337
- const toLabeledValues = React.useCallback((draftValues: DefaultValueType) => {
2338
- const values = toArray(draftValues);
2339
-
2340
- return values.map(val => {
2341
- if (isRawValue(val)) {
2342
- return { value: val };
2343
- }
2344
- return val;
2345
- });
2346
- }, []);
2347
-
2348
- const convert2LabelValues = React.useCallback(
2349
- (draftValues: DefaultValueType) => {
2350
- const values = toLabeledValues(draftValues);
2351
-
2352
- return values.map(item => {
2353
- let { label: rawLabel } = item;
2354
- const { value: rawValue, halfChecked: rawHalfChecked } = item;
2355
-
2356
- let rawDisabled: boolean | undefined;
2357
-
2358
- const entity = valueEntities.get(rawValue);
2359
-
2360
- // Fill missing label & status
2361
- if (entity) {
2362
- rawLabel = treeTitleRender
2363
- ? treeTitleRender(entity.node)
2364
- : (rawLabel ?? getLabel(entity.node));
2365
- rawDisabled = entity.node.disabled;
2366
- } else if (rawLabel === undefined) {
2367
- // We try to find in current \`labelInValue\` value
2368
- const labelInValueItem = toLabeledValues(internalValue).find(
2369
- labeledItem => labeledItem.value === rawValue,
2370
- );
2371
- rawLabel = labelInValueItem.label;
2372
- }
2373
- return {
2374
- label: rawLabel,
2375
- value: rawValue,
2376
- halfChecked: rawHalfChecked,
2377
- disabled: rawDisabled,
2378
- };
2379
- });
2380
- },
2381
- [valueEntities, getLabel, toLabeledValues, internalValue],
2382
- );
2383
-
2384
- // =========================== Values ===========================
2385
- const rawMixedLabeledValues = React.useMemo(
2386
- () => toLabeledValues(internalValue === null ? [] : internalValue),
2387
- [toLabeledValues, internalValue],
2388
- );
2389
-
2390
- // Split value into full check and half check
2391
- const [rawLabeledValues, rawHalfLabeledValues] = React.useMemo(() => {
2392
- const fullCheckValues: LabeledValueType[] = [];
2393
- const halfCheckValues: LabeledValueType[] = [];
2394
-
2395
- rawMixedLabeledValues.forEach(item => {
2396
- if (item.halfChecked) {
2397
- halfCheckValues.push(item);
2398
- } else {
2399
- fullCheckValues.push(item);
2400
- }
2401
- });
2402
-
2403
- return [fullCheckValues, halfCheckValues];
2404
- }, [rawMixedLabeledValues]);
2405
-
2406
- // const [mergedValues] = useCache(rawLabeledValues);
2407
- const rawValues = React.useMemo(
2408
- () => rawLabeledValues.map(item => item.value),
2409
- [rawLabeledValues],
2410
- );
2411
-
2412
- // Convert value to key. Will fill missed keys for conduct check.
2413
- const [rawCheckedValues, rawHalfCheckedValues] = useCheckedKeys(
2414
- rawLabeledValues,
2415
- rawHalfLabeledValues,
2416
- treeConduction,
2417
- keyEntities,
2418
- );
2419
-
2420
- // Convert rawCheckedKeys to check strategy related values
2421
- const displayValues = React.useMemo(() => {
2422
- // Collect keys which need to show
2423
- const displayKeys = formatStrategyValues(
2424
- rawCheckedValues as SafeKey[],
2425
- mergedShowCheckedStrategy,
2426
- keyEntities,
2427
- mergedFieldNames,
2428
- );
2429
-
2430
- // Convert to value and filled with label
2431
- const values = displayKeys.map(key => keyEntities[key]?.node?.[mergedFieldNames.value] ?? key);
2432
-
2433
- // Back fill with origin label
2434
- const labeledValues = values.map(val => {
2435
- const targetItem = rawLabeledValues.find(item => item.value === val);
2436
- const label = labelInValue ? targetItem?.label : treeTitleRender?.(targetItem);
2437
- return {
2438
- value: val,
2439
- label,
2440
- };
2441
- });
2442
-
2443
- const rawDisplayValues = convert2LabelValues(labeledValues);
2444
-
2445
- const firstVal = rawDisplayValues[0];
2446
-
2447
- if (!mergedMultiple && firstVal && isNil(firstVal.value) && isNil(firstVal.label)) {
2448
- return [];
2449
- }
2450
-
2451
- return rawDisplayValues.map(item => ({
2452
- ...item,
2453
- label: item.label ?? item.value,
2454
- }));
2455
- // eslint-disable-next-line react-hooks/exhaustive-deps
2456
- }, [
2457
- mergedFieldNames,
2458
- mergedMultiple,
2459
- rawCheckedValues,
2460
- rawLabeledValues,
2461
- convert2LabelValues,
2462
- mergedShowCheckedStrategy,
2463
- keyEntities,
2464
- ]);
2465
-
2466
- const [cachedDisplayValues] = useCache(displayValues);
2467
-
2468
- // ========================== MaxCount ==========================
2469
- const mergedMaxCount = React.useMemo(() => {
2470
- if (
2471
- mergedMultiple &&
2472
- (mergedShowCheckedStrategy === 'SHOW_CHILD' || treeCheckStrictly || !treeCheckable)
2473
- ) {
2474
- return maxCount;
2475
- }
2476
- return null;
2477
- }, [maxCount, mergedMultiple, treeCheckStrictly, mergedShowCheckedStrategy, treeCheckable]);
2478
-
2479
- // =========================== Change ===========================
2480
- const triggerChange = useRefFunc(
2481
- (
2482
- newRawValues: SafeKey[],
2483
- extra: { triggerValue?: SafeKey; selected?: boolean },
2484
- source: SelectSource,
2485
- ) => {
2486
- const formattedKeyList = formatStrategyValues(
2487
- newRawValues,
2488
- mergedShowCheckedStrategy,
2489
- keyEntities,
2490
- mergedFieldNames,
2491
- );
2492
-
2493
- // Not allow pass with \`maxCount\`
2494
- if (mergedMaxCount && formattedKeyList.length > mergedMaxCount) {
2495
- return;
2496
- }
2497
-
2498
- const labeledValues = convert2LabelValues(newRawValues);
2499
- setInternalValue(labeledValues);
2500
-
2501
- // Clean up if needed
2502
- if (autoClearSearchValue) {
2503
- setSearchValue('');
2504
- }
2505
-
2506
- // Generate rest parameters is costly, so only do it when necessary
2507
- if (onChange) {
2508
- let eventValues: SafeKey[] = newRawValues;
2509
- if (treeConduction) {
2510
- eventValues = formattedKeyList.map(key => {
2511
- const entity = valueEntities.get(key);
2512
- return entity ? entity.node[mergedFieldNames.value] : key;
2513
- });
2514
- }
2515
-
2516
- const { triggerValue, selected } = extra || {
2517
- triggerValue: undefined,
2518
- selected: undefined,
2519
- };
2520
-
2521
- let returnRawValues: (LabeledValueType | SafeKey)[] = eventValues;
2522
-
2523
- // We need fill half check back
2524
- if (treeCheckStrictly) {
2525
- const halfValues = rawHalfLabeledValues.filter(item => !eventValues.includes(item.value));
2526
-
2527
- returnRawValues = [...returnRawValues, ...halfValues];
2528
- }
2529
-
2530
- const returnLabeledValues = convert2LabelValues(returnRawValues);
2531
- const additionalInfo = {
2532
- // [Legacy] Always return as array contains label & value
2533
- preValue: rawLabeledValues,
2534
- triggerValue,
2535
- } as ChangeEventExtra;
2536
-
2537
- // [Legacy] Fill legacy data if user query.
2538
- // This is expansive that we only fill when user query
2539
- // https://github.com/react-component/tree-select/blob/fe33eb7c27830c9ac70cd1fdb1ebbe7bc679c16a/src/Select.jsx
2540
- let showPosition = true;
2541
- if (treeCheckStrictly || (source === 'selection' && !selected)) {
2542
- showPosition = false;
2543
- }
2544
-
2545
- fillAdditionalInfo(
2546
- additionalInfo,
2547
- triggerValue,
2548
- newRawValues,
2549
- mergedTreeData,
2550
- showPosition,
2551
- mergedFieldNames,
2552
- );
2553
-
2554
- if (mergedCheckable) {
2555
- additionalInfo.checked = selected;
2556
- } else {
2557
- additionalInfo.selected = selected;
2558
- }
2559
-
2560
- const returnValues = mergedLabelInValue
2561
- ? returnLabeledValues
2562
- : returnLabeledValues.map(item => item.value);
2563
-
2564
- onChange(
2565
- mergedMultiple ? returnValues : returnValues[0],
2566
- mergedLabelInValue ? null : returnLabeledValues.map(item => item.label),
2567
- additionalInfo,
2568
- );
2569
- }
2570
- },
2571
- );
2572
-
2573
- // ========================== Options ===========================
2574
- /** Trigger by option list */
2575
- const onOptionSelect = React.useCallback(
2576
- (selectedKey: SafeKey, { selected, source }: { selected: boolean; source: SelectSource }) => {
2577
- const entity = keyEntities[selectedKey];
2578
- const node = entity?.node;
2579
- const selectedValue = node?.[mergedFieldNames.value] ?? selectedKey;
2580
-
2581
- // Never be falsy but keep it safe
2582
- if (!mergedMultiple) {
2583
- // Single mode always set value
2584
- triggerChange([selectedValue], { selected: true, triggerValue: selectedValue }, 'option');
2585
- } else {
2586
- let newRawValues = selected
2587
- ? [...rawValues, selectedValue]
2588
- : rawCheckedValues.filter(v => v !== selectedValue);
2589
-
2590
- // Add keys if tree conduction
2591
- if (treeConduction) {
2592
- // Should keep missing values
2593
- const { missingRawValues, existRawValues } = splitRawValues(newRawValues);
2594
- const keyList = existRawValues.map(val => valueEntities.get(val).key);
2595
-
2596
- // Conduction by selected or not
2597
- let checkedKeys: Key[];
2598
- if (selected) {
2599
- ({ checkedKeys } = conductCheck(keyList, true, keyEntities));
2600
- } else {
2601
- ({ checkedKeys } = conductCheck(
2602
- keyList,
2603
- { checked: false, halfCheckedKeys: rawHalfCheckedValues },
2604
- keyEntities,
2605
- ));
2606
- }
2607
-
2608
- // Fill back of keys
2609
- newRawValues = [
2610
- ...missingRawValues,
2611
- ...checkedKeys.map(key => keyEntities[key as SafeKey].node[mergedFieldNames.value]),
2612
- ];
2613
- }
2614
- triggerChange(newRawValues, { selected, triggerValue: selectedValue }, source || 'option');
2615
- }
2616
-
2617
- // Trigger select event
2618
- if (selected || !mergedMultiple) {
2619
- onSelect?.(selectedValue, fillLegacyProps(node));
2620
- } else {
2621
- onDeselect?.(selectedValue, fillLegacyProps(node));
2622
- }
2623
- },
2624
- [
2625
- splitRawValues,
2626
- valueEntities,
2627
- keyEntities,
2628
- mergedFieldNames,
2629
- mergedMultiple,
2630
- rawValues,
2631
- triggerChange,
2632
- treeConduction,
2633
- onSelect,
2634
- onDeselect,
2635
- rawCheckedValues,
2636
- rawHalfCheckedValues,
2637
- maxCount,
2638
- ],
2639
- );
2640
-
2641
- // ========================== Dropdown ==========================
2642
- const onInternalDropdownVisibleChange = React.useCallback(
2643
- (open: boolean) => {
2644
- if (onDropdownVisibleChange) {
2645
- const legacyParam = {};
2646
-
2647
- Object.defineProperty(legacyParam, 'documentClickClose', {
2648
- get() {
2649
- warning(false, 'Second param of \`onDropdownVisibleChange\` has been removed.');
2650
- return false;
2651
- },
2652
- });
2653
-
2654
- (onDropdownVisibleChange as any)(open, legacyParam);
2655
- }
2656
- },
2657
- [onDropdownVisibleChange],
2658
- );
2659
-
2660
- // ====================== Display Change ========================
2661
- const onDisplayValuesChange = useRefFunc((newValues, info) => {
2662
- const newRawValues = newValues.map(item => item.value);
2663
-
2664
- if (info.type === 'clear') {
2665
- triggerChange(newRawValues, {}, 'selection');
2666
- return;
2667
- }
2668
-
2669
- // TreeSelect only have multiple mode which means display change only has remove
2670
- if (info.values.length) {
2671
- onOptionSelect(info.values[0].value, { selected: false, source: 'selection' });
2672
- }
2673
- });
2674
-
2675
- // ========================== Context ===========================
2676
- const treeSelectContext = React.useMemo<TreeSelectContextProps>(() => {
2677
- return {
2678
- virtual,
2679
- dropdownMatchSelectWidth,
2680
- listHeight,
2681
- listItemHeight,
2682
- listItemScrollOffset,
2683
- treeData: filteredTreeData,
2684
- fieldNames: mergedFieldNames,
2685
- onSelect: onOptionSelect,
2686
- treeExpandAction,
2687
- treeTitleRender,
2688
- onPopupScroll,
2689
- leftMaxCount: maxCount === undefined ? null : maxCount - cachedDisplayValues.length,
2690
- leafCountOnly:
2691
- mergedShowCheckedStrategy === 'SHOW_CHILD' && !treeCheckStrictly && !!treeCheckable,
2692
- valueEntities,
2693
- };
2694
- }, [
2695
- virtual,
2696
- dropdownMatchSelectWidth,
2697
- listHeight,
2698
- listItemHeight,
2699
- listItemScrollOffset,
2700
- filteredTreeData,
2701
- mergedFieldNames,
2702
- onOptionSelect,
2703
- treeExpandAction,
2704
- treeTitleRender,
2705
- onPopupScroll,
2706
- maxCount,
2707
- cachedDisplayValues.length,
2708
- mergedShowCheckedStrategy,
2709
- treeCheckStrictly,
2710
- treeCheckable,
2711
- valueEntities,
2712
- ]);
2713
-
2714
- // ======================= Legacy Context =======================
2715
- const legacyContext = React.useMemo(
2716
- () => ({
2717
- checkable: mergedCheckable,
2718
- loadData,
2719
- treeLoadedKeys,
2720
- onTreeLoad,
2721
- checkedKeys: rawCheckedValues,
2722
- halfCheckedKeys: rawHalfCheckedValues,
2723
- treeDefaultExpandAll,
2724
- treeExpandedKeys,
2725
- treeDefaultExpandedKeys,
2726
- onTreeExpand,
2727
- treeIcon,
2728
- treeMotion,
2729
- showTreeIcon,
2730
- switcherIcon,
2731
- treeLine,
2732
- treeNodeFilterProp,
2733
- keyEntities,
2734
- }),
2735
- [
2736
- mergedCheckable,
2737
- loadData,
2738
- treeLoadedKeys,
2739
- onTreeLoad,
2740
- rawCheckedValues,
2741
- rawHalfCheckedValues,
2742
- treeDefaultExpandAll,
2743
- treeExpandedKeys,
2744
- treeDefaultExpandedKeys,
2745
- onTreeExpand,
2746
- treeIcon,
2747
- treeMotion,
2748
- showTreeIcon,
2749
- switcherIcon,
2750
- treeLine,
2751
- treeNodeFilterProp,
2752
- keyEntities,
2753
- ],
2754
- );
2755
-
2756
- // =========================== Render ===========================
2757
- return (
2758
- <TreeSelectContext.Provider value={treeSelectContext}>
2759
- <LegacyContext.Provider value={legacyContext}>
2760
- <BaseSelect
2761
- ref={ref}
2762
- {...restProps}
2763
- // >>> MISC
2764
- id={mergedId}
2765
- prefixCls={prefixCls}
2766
- mode={mergedMultiple ? 'multiple' : undefined}
2767
- // >>> Display Value
2768
- displayValues={cachedDisplayValues}
2769
- onDisplayValuesChange={onDisplayValuesChange}
2770
- // >>> Search
2771
- searchValue={mergedSearchValue}
2772
- onSearch={onInternalSearch}
2773
- // >>> Options
2774
- OptionList={OptionList}
2775
- emptyOptions={!mergedTreeData.length}
2776
- onDropdownVisibleChange={onInternalDropdownVisibleChange}
2777
- dropdownMatchSelectWidth={dropdownMatchSelectWidth}
2778
- />
2779
- </LegacyContext.Provider>
2780
- </TreeSelectContext.Provider>
2781
- );
2782
- });
2783
-
2784
- // Assign name for Debug
2785
- if (process.env.NODE_ENV !== 'production') {
2786
- TreeSelect.displayName = 'TreeSelect';
2787
- }
2788
-
2789
- const GenericTreeSelect = TreeSelect as unknown as (<
2790
- ValueType = any,
2791
- OptionType extends DataNode = DataNode,
2792
- >(
2793
- props: React.PropsWithChildren<TreeSelectProps<ValueType, OptionType>> & {
2794
- ref?: React.Ref<BaseSelectRef>;
2795
- },
2796
- ) => React.ReactElement) & {
2797
- TreeNode: typeof TreeNode;
2798
- SHOW_ALL: typeof SHOW_ALL;
2799
- SHOW_PARENT: typeof SHOW_PARENT;
2800
- SHOW_CHILD: typeof SHOW_CHILD;
2801
- };
2802
-
2803
- GenericTreeSelect.TreeNode = TreeNode;
2804
- GenericTreeSelect.SHOW_ALL = SHOW_ALL;
2805
- GenericTreeSelect.SHOW_PARENT = SHOW_PARENT;
2806
- GenericTreeSelect.SHOW_CHILD = SHOW_CHILD;
2807
-
2808
- export default GenericTreeSelect;
2809
- `},29285:function(v,t){t.Z=`import * as React from 'react';
2810
- import type { ExpandAction } from 'rc-tree/lib/Tree';
2811
- import type { DataNode, FieldNames, Key } from './interface';
2812
- import type useDataEntities from './hooks/useDataEntities';
2813
-
2814
- export interface TreeSelectContextProps {
2815
- virtual?: boolean;
2816
- dropdownMatchSelectWidth?: boolean | number;
2817
- listHeight: number;
2818
- listItemHeight: number;
2819
- listItemScrollOffset?: number;
2820
- treeData: DataNode[];
2821
- fieldNames: FieldNames;
2822
- onSelect: (value: Key, info: { selected: boolean }) => void;
2823
- treeExpandAction?: ExpandAction;
2824
- treeTitleRender?: (node: any) => React.ReactNode;
2825
- onPopupScroll?: React.UIEventHandler<HTMLDivElement>;
2826
-
2827
- // For \`maxCount\` usage
2828
- leftMaxCount: number | null;
2829
- /** When \`true\`, only take leaf node as count, or take all as count with \`maxCount\` limitation */
2830
- leafCountOnly: boolean;
2831
- valueEntities: ReturnType<typeof useDataEntities>['valueEntities'];
2832
- }
2833
-
2834
- const TreeSelectContext = React.createContext<TreeSelectContextProps>(null as any);
2835
-
2836
- export default TreeSelectContext;
2837
- `},95108:function(v,t){t.Z=`import * as React from 'react';
2838
- import type { LabeledValueType, SafeKey } from '../interface';
2839
-
2840
- /**
2841
- * This function will try to call requestIdleCallback if available to save performance.
2842
- * No need \`getLabel\` here since already fetch on \`rawLabeledValue\`.
2843
- */
2844
- export default (values: LabeledValueType[]): [LabeledValueType[]] => {
2845
- const cacheRef = React.useRef({
2846
- valueLabels: new Map<SafeKey, React.ReactNode>(),
2847
- });
2848
-
2849
- return React.useMemo(() => {
2850
- const { valueLabels } = cacheRef.current;
2851
- const valueLabelsCache = new Map<SafeKey, React.ReactNode>();
2852
-
2853
- const filledValues = values.map(item => {
2854
- const { value, label } = item;
2855
- const mergedLabel = label ?? valueLabels.get(value);
2856
-
2857
- // Save in cache
2858
- valueLabelsCache.set(value, mergedLabel);
2859
-
2860
- return {
2861
- ...item,
2862
- label: mergedLabel,
2863
- };
2864
- });
2865
-
2866
- cacheRef.current.valueLabels = valueLabelsCache;
2867
-
2868
- return [filledValues];
2869
- }, [values]);
2870
- };
2871
- `},7118:function(v,t){t.Z=`import * as React from 'react';
2872
- import type { DataEntity } from 'rc-tree/lib/interface';
2873
- import { conductCheck } from 'rc-tree/lib/utils/conductUtil';
2874
- import type { LabeledValueType, SafeKey, Key } from '../interface';
2875
-
2876
- const useCheckedKeys = (
2877
- rawLabeledValues: LabeledValueType[],
2878
- rawHalfCheckedValues: LabeledValueType[],
2879
- treeConduction: boolean,
2880
- keyEntities: Record<SafeKey, DataEntity>,
2881
- ) => {
2882
- return React.useMemo(() => {
2883
- const extractValues = (values: LabeledValueType[]): Key[] => values.map(({ value }) => value);
2884
-
2885
- const checkedKeys = extractValues(rawLabeledValues);
2886
- const halfCheckedKeys = extractValues(rawHalfCheckedValues);
2887
-
2888
- const missingValues = checkedKeys.filter(key => !keyEntities[key as SafeKey]);
2889
-
2890
- let finalCheckedKeys = checkedKeys;
2891
- let finalHalfCheckedKeys = halfCheckedKeys;
2892
-
2893
- if (treeConduction) {
2894
- const conductResult = conductCheck(checkedKeys, true, keyEntities);
2895
- finalCheckedKeys = conductResult.checkedKeys;
2896
- finalHalfCheckedKeys = conductResult.halfCheckedKeys;
2897
- }
2898
-
2899
- return [Array.from(new Set([...missingValues, ...finalCheckedKeys])), finalHalfCheckedKeys];
2900
- }, [rawLabeledValues, rawHalfCheckedValues, treeConduction, keyEntities]);
2901
- };
2902
-
2903
- export default useCheckedKeys;
2904
- `},31367:function(v,t){t.Z=`import * as React from 'react';
2905
- import { convertDataToEntities } from 'rc-tree/lib/utils/treeUtil';
2906
- import type { DataEntity } from 'rc-tree/lib/interface';
2907
- import type { SafeKey, FieldNames } from '../interface';
2908
- import warning from '@rc-component/util/lib/warning';
2909
- import { isNil } from '../utils/valueUtil';
2910
-
2911
- export default (treeData: any, fieldNames: FieldNames) =>
2912
- React.useMemo<{
2913
- valueEntities: Map<SafeKey, DataEntity>;
2914
- keyEntities: Record<string, DataEntity>;
2915
- }>(() => {
2916
- const collection = convertDataToEntities(treeData, {
2917
- fieldNames,
2918
- initWrapper: wrapper => ({
2919
- ...wrapper,
2920
- valueEntities: new Map(),
2921
- }),
2922
- processEntity: (entity, wrapper: any) => {
2923
- const val = entity.node[fieldNames.value];
2924
-
2925
- // Check if exist same value
2926
- if (process.env.NODE_ENV !== 'production') {
2927
- const key = entity.node.key;
2928
-
2929
- warning(!isNil(val), 'TreeNode \`value\` is invalidate: undefined');
2930
- warning(!wrapper.valueEntities.has(val), \`Same \\\`value\\\` exist in the tree: \${val}\`);
2931
- warning(
2932
- !key || String(key) === String(val),
2933
- \`\\\`key\\\` or \\\`value\\\` with TreeNode must be the same or you can remove one of them. key: \${key}, value: \${val}.\`,
2934
- );
2935
- }
2936
- wrapper.valueEntities.set(val, entity);
2937
- },
2938
- });
2939
-
2940
- return collection as any;
2941
- }, [treeData, fieldNames]);
2942
- `},67685:function(v,t){t.Z=`import * as React from 'react';
2943
- import type { TreeSelectProps } from '../TreeSelect';
2944
- import type { DataNode, FieldNames } from '../interface';
2945
- import { fillLegacyProps } from '../utils/legacyUtil';
2946
-
2947
- type FilterFn = NonNullable<TreeSelectProps['filterTreeNode']>;
2948
-
2949
- const useFilterTreeData = (
2950
- treeData: DataNode[],
2951
- searchValue: string,
2952
- options: {
2953
- fieldNames: FieldNames;
2954
- treeNodeFilterProp: string;
2955
- filterTreeNode: TreeSelectProps['filterTreeNode'];
2956
- },
2957
- ) => {
2958
- const { fieldNames, treeNodeFilterProp, filterTreeNode } = options;
2959
- const { children: fieldChildren } = fieldNames;
2960
-
2961
- return React.useMemo(() => {
2962
- if (!searchValue || filterTreeNode === false) {
2963
- return treeData;
2964
- }
2965
-
2966
- const filterOptionFunc: FilterFn =
2967
- typeof filterTreeNode === 'function'
2968
- ? filterTreeNode
2969
- : (_, dataNode) =>
2970
- String(dataNode[treeNodeFilterProp]).toUpperCase().includes(searchValue.toUpperCase());
2971
-
2972
- const filterTreeNodes = (nodes: DataNode[], keepAll = false): DataNode[] =>
2973
- nodes.reduce<DataNode[]>((filtered, node) => {
2974
- const children = node[fieldChildren];
2975
- const isMatch = keepAll || filterOptionFunc(searchValue, fillLegacyProps(node));
2976
- const filteredChildren = filterTreeNodes(children || [], isMatch);
2977
-
2978
- if (isMatch || filteredChildren.length) {
2979
- filtered.push({
2980
- ...node,
2981
- isLeaf: undefined,
2982
- [fieldChildren]: filteredChildren,
2983
- });
2984
- }
2985
- return filtered;
2986
- }, []);
2987
-
2988
- return filterTreeNodes(treeData);
2989
- }, [treeData, searchValue, fieldChildren, treeNodeFilterProp, filterTreeNode]);
2990
- };
2991
-
2992
- export default useFilterTreeData;
2993
- `},60133:function(v,t){t.Z=`import * as React from 'react';
2994
-
2995
- /**
2996
- * Same as \`React.useCallback\` but always return a memoized function
2997
- * but redirect to real function.
2998
- */
2999
- export default function useRefFunc<T extends (...args: any[]) => any>(callback: T): T {
3000
- const funcRef = React.useRef<T>();
3001
- funcRef.current = callback;
3002
-
3003
- const cacheFn = React.useCallback((...args: any[]) => {
3004
- return funcRef.current(...args);
3005
- }, []);
3006
-
3007
- return cacheFn as any;
3008
- }
3009
- `},4997:function(v,t){t.Z=`import * as React from 'react';
3010
- import type { DataNode, SimpleModeConfig } from '../interface';
3011
- import { convertChildrenToData } from '../utils/legacyUtil';
3012
-
3013
- function buildTreeStructure(nodes: DataNode[], config: SimpleModeConfig): DataNode[] {
3014
- const { id, pId, rootPId } = config;
3015
- const nodeMap = new Map<string, DataNode>();
3016
- const rootNodes: DataNode[] = [];
3017
-
3018
- nodes.forEach(node => {
3019
- const nodeKey = node[id];
3020
- const clonedNode = { ...node, key: node.key || nodeKey };
3021
- nodeMap.set(nodeKey, clonedNode);
3022
- });
3023
-
3024
- nodeMap.forEach(node => {
3025
- const parentKey = node[pId];
3026
- const parent = nodeMap.get(parentKey);
3027
-
3028
- if (parent) {
3029
- parent.children = parent.children || [];
3030
- parent.children.push(node);
3031
- } else if (parentKey === rootPId || rootPId === null) {
3032
- rootNodes.push(node);
3033
- }
3034
- });
3035
-
3036
- return rootNodes;
3037
- }
3038
-
3039
- /**
3040
- * \u5C06 \`treeData\` \u6216 \`children\` \u8F6C\u6362\u4E3A\u683C\u5F0F\u5316\u7684 \`treeData\`\u3002
3041
- * \u5982\u679C \`treeData\` \u6216 \`children\` \u6CA1\u6709\u53D8\u5316\uFF0C\u5219\u4E0D\u4F1A\u91CD\u65B0\u8BA1\u7B97\u3002
3042
- */
3043
- export default function useTreeData(
3044
- treeData: DataNode[],
3045
- children: React.ReactNode,
3046
- simpleMode: boolean | SimpleModeConfig,
3047
- ): DataNode[] {
3048
- return React.useMemo(() => {
3049
- if (treeData) {
3050
- if (simpleMode) {
3051
- const config: SimpleModeConfig = {
3052
- id: 'id',
3053
- pId: 'pId',
3054
- rootPId: null,
3055
- ...(typeof simpleMode === 'object' ? simpleMode : {}),
3056
- };
3057
- return buildTreeStructure(treeData, config);
3058
- }
3059
- return treeData;
3060
- }
3061
-
3062
- return convertChildrenToData(children);
3063
- }, [children, simpleMode, treeData]);
3064
- }
3065
- `},42103:function(v,t){t.Z=`import TreeSelect from './TreeSelect';
3066
- import type { TreeSelectProps } from './TreeSelect';
3067
- import TreeNode from './TreeNode';
3068
- import { SHOW_ALL, SHOW_CHILD, SHOW_PARENT } from './utils/strategyUtil';
3069
-
3070
- export { TreeNode, SHOW_ALL, SHOW_CHILD, SHOW_PARENT };
3071
- export type { TreeSelectProps };
3072
- export default TreeSelect;
3073
- `},29035:function(v,t){t.Z=`import * as React from 'react';
3074
- import toArray from '@rc-component/util/lib/Children/toArray';
3075
- import warning from '@rc-component/util/lib/warning';
3076
- import type {
3077
- DataNode,
3078
- ChangeEventExtra,
3079
- SafeKey,
3080
- LegacyCheckedNode,
3081
- FieldNames,
3082
- } from '../interface';
3083
- import TreeNode from '../TreeNode';
3084
-
3085
- export function convertChildrenToData(nodes: React.ReactNode): DataNode[] {
3086
- return toArray(nodes)
3087
- .map((node: React.ReactElement) => {
3088
- if (!React.isValidElement(node) || !node.type) {
3089
- return null;
3090
- }
3091
-
3092
- const {
3093
- key,
3094
- props: { children, value, ...restProps },
3095
- } = node as React.ReactElement;
3096
-
3097
- const data = {
3098
- key,
3099
- value,
3100
- ...restProps,
3101
- };
3102
-
3103
- const childData = convertChildrenToData(children);
3104
- if (childData.length) {
3105
- data.children = childData;
3106
- }
3107
-
3108
- return data;
3109
- })
3110
- .filter(data => data);
3111
- }
3112
-
3113
- export function fillLegacyProps(dataNode: DataNode) {
3114
- if (!dataNode) {
3115
- return dataNode;
3116
- }
3117
-
3118
- const cloneNode = { ...dataNode };
3119
-
3120
- if (!('props' in cloneNode)) {
3121
- Object.defineProperty(cloneNode, 'props', {
3122
- get() {
3123
- warning(
3124
- false,
3125
- 'New \`rc-tree-select\` not support return node instance as argument anymore. Please consider to remove \`props\` access.',
3126
- );
3127
- return cloneNode;
3128
- },
3129
- });
3130
- }
3131
-
3132
- return cloneNode;
3133
- }
3134
-
3135
- export function fillAdditionalInfo(
3136
- extra: ChangeEventExtra,
3137
- triggerValue: SafeKey,
3138
- checkedValues: SafeKey[],
3139
- treeData: DataNode[],
3140
- showPosition: boolean,
3141
- fieldNames: FieldNames,
3142
- ) {
3143
- let triggerNode: React.ReactNode = null;
3144
- let nodeList: LegacyCheckedNode[] = null;
3145
-
3146
- function generateMap() {
3147
- function dig(list: DataNode[], level = '0', parentIncluded = false) {
3148
- return list
3149
- .map((option, index) => {
3150
- const pos = \`\${level}-\${index}\`;
3151
- const value = option[fieldNames.value];
3152
- const included = checkedValues.includes(value);
3153
- const children = dig(option[fieldNames.children] || [], pos, included);
3154
- const node = (
3155
- <TreeNode {...(option as Required<DataNode>)}>
3156
- {children.map(child => child.node)}
3157
- </TreeNode>
3158
- );
3159
-
3160
- // Link with trigger node
3161
- if (triggerValue === value) {
3162
- triggerNode = node;
3163
- }
3164
-
3165
- if (included) {
3166
- const checkedNode: LegacyCheckedNode = {
3167
- pos,
3168
- node,
3169
- children,
3170
- };
3171
-
3172
- if (!parentIncluded) {
3173
- nodeList.push(checkedNode);
3174
- }
3175
-
3176
- return checkedNode;
3177
- }
3178
- return null;
3179
- })
3180
- .filter(node => node);
3181
- }
3182
-
3183
- if (!nodeList) {
3184
- nodeList = [];
3185
-
3186
- dig(treeData);
3187
-
3188
- // Sort to keep the checked node length
3189
- nodeList.sort(
3190
- (
3191
- {
3192
- node: {
3193
- props: { value: val1 },
3194
- },
3195
- },
3196
- {
3197
- node: {
3198
- props: { value: val2 },
3199
- },
3200
- },
3201
- ) => {
3202
- const index1 = checkedValues.indexOf(val1);
3203
- const index2 = checkedValues.indexOf(val2);
3204
- return index1 - index2;
3205
- },
3206
- );
3207
- }
3208
- }
3209
-
3210
- Object.defineProperty(extra, 'triggerNode', {
3211
- get() {
3212
- warning(false, '\`triggerNode\` is deprecated. Please consider decoupling data with node.');
3213
- generateMap();
3214
-
3215
- return triggerNode;
3216
- },
3217
- });
3218
- Object.defineProperty(extra, 'allCheckedNodes', {
3219
- get() {
3220
- warning(false, '\`allCheckedNodes\` is deprecated. Please consider decoupling data with node.');
3221
- generateMap();
3222
-
3223
- if (showPosition) {
3224
- return nodeList;
3225
- }
3226
-
3227
- return nodeList.map(({ node }) => node);
3228
- },
3229
- });
3230
- }
3231
- `},76742:function(v,t){t.Z=`import type { DataEntity } from 'rc-tree/lib/interface';
3232
- import type { SafeKey, FieldNames } from '../interface';
3233
- import { isCheckDisabled } from './valueUtil';
3234
-
3235
- export const SHOW_ALL = 'SHOW_ALL';
3236
- export const SHOW_PARENT = 'SHOW_PARENT';
3237
- export const SHOW_CHILD = 'SHOW_CHILD';
3238
-
3239
- export type CheckedStrategy = typeof SHOW_ALL | typeof SHOW_PARENT | typeof SHOW_CHILD;
3240
-
3241
- export function formatStrategyValues(
3242
- values: SafeKey[],
3243
- strategy: CheckedStrategy,
3244
- keyEntities: Record<SafeKey, DataEntity>,
3245
- fieldNames: FieldNames,
3246
- ): SafeKey[] {
3247
- const valueSet = new Set(values);
3248
-
3249
- if (strategy === SHOW_CHILD) {
3250
- return values.filter(key => {
3251
- const entity = keyEntities[key];
3252
- return (
3253
- !entity ||
3254
- !entity.children ||
3255
- !entity.children.some(({ node }) => valueSet.has(node[fieldNames.value])) ||
3256
- !entity.children.every(
3257
- ({ node }) => isCheckDisabled(node) || valueSet.has(node[fieldNames.value]),
3258
- )
3259
- );
3260
- });
3261
- }
3262
- if (strategy === SHOW_PARENT) {
3263
- return values.filter(key => {
3264
- const entity = keyEntities[key];
3265
- const parent = entity ? entity.parent : null;
3266
- return !parent || isCheckDisabled(parent.node) || !valueSet.has(parent.key as SafeKey);
3267
- });
3268
- }
3269
- return values;
3270
- }
3271
- `},4370:function(v,t){t.Z=`import type { DataNode, FieldNames, SafeKey } from '../interface';
3272
-
3273
- export const toArray = <T>(value: T | T[]): T[] =>
3274
- Array.isArray(value) ? value : value !== undefined ? [value] : [];
3275
-
3276
- export const fillFieldNames = (fieldNames?: FieldNames) => {
3277
- const { label, value, children } = fieldNames || {};
3278
- return {
3279
- _title: label ? [label] : ['title', 'label'],
3280
- value: value || 'value',
3281
- key: value || 'value',
3282
- children: children || 'children',
3283
- };
3284
- };
3285
-
3286
- export const isCheckDisabled = (node: DataNode): boolean =>
3287
- !node || node.disabled || node.disableCheckbox || node.checkable === false;
3288
-
3289
- export const getAllKeys = (treeData: DataNode[], fieldNames: FieldNames): SafeKey[] => {
3290
- const keys: SafeKey[] = [];
3291
-
3292
- const dig = (list: DataNode[]): void => {
3293
- list.forEach(item => {
3294
- const children = item[fieldNames.children];
3295
- if (children) {
3296
- keys.push(item[fieldNames.value]);
3297
- dig(children);
3298
- }
3299
- });
3300
- };
3301
-
3302
- dig(treeData);
3303
-
3304
- return keys;
3305
- };
3306
-
3307
- export const isNil = (val: any): boolean => val === null || val === undefined;
3308
- `},29162:function(v,t){t.Z=`import warning from '@rc-component/util/lib/warning';
3309
- import type { TreeSelectProps } from '../TreeSelect';
3310
- import { toArray } from './valueUtil';
3311
-
3312
- function warningProps(props: TreeSelectProps & { searchPlaceholder?: string }) {
3313
- const {
3314
- searchPlaceholder,
3315
- treeCheckStrictly,
3316
- treeCheckable,
3317
- labelInValue,
3318
- value,
3319
- multiple,
3320
- showCheckedStrategy,
3321
- maxCount,
3322
- } = props;
3323
-
3324
- warning(!searchPlaceholder, '\`searchPlaceholder\` has been removed.');
3325
-
3326
- if (treeCheckStrictly && labelInValue === false) {
3327
- warning(false, '\`treeCheckStrictly\` will force set \`labelInValue\` to \`true\`.');
3328
- }
3329
-
3330
- if (labelInValue || treeCheckStrictly) {
3331
- warning(
3332
- toArray(value).every(val => val && typeof val === 'object' && 'value' in val),
3333
- 'Invalid prop \`value\` supplied to \`TreeSelect\`. You should use { label: string, value: string | number } or [{ label: string, value: string | number }] instead.',
3334
- );
3335
- }
3336
-
3337
- if (treeCheckStrictly || multiple || treeCheckable) {
3338
- warning(
3339
- !value || Array.isArray(value),
3340
- '\`value\` should be an array when \`TreeSelect\` is checkable or multiple.',
3341
- );
3342
- } else {
3343
- warning(!Array.isArray(value), '\`value\` should not be array when \`TreeSelect\` is single mode.');
3344
- }
3345
-
3346
- if (
3347
- maxCount &&
3348
- ((showCheckedStrategy === 'SHOW_ALL' && !treeCheckStrictly) ||
3349
- showCheckedStrategy === 'SHOW_PARENT')
3350
- ) {
3351
- warning(
3352
- false,
3353
- '\`maxCount\` not work with \`showCheckedStrategy=SHOW_ALL\` (when \`treeCheckStrictly=false\`) or \`showCheckedStrategy=SHOW_PARENT\`.',
3354
- );
3355
- }
3356
- }
3357
-
3358
- export default warningProps;
3359
- `}}]);