tntd 2.0.12 → 2.0.13

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 (432) hide show
  1. package/es/array-input/index.js +6 -31
  2. package/es/array-input/style/index.js +1 -0
  3. package/es/array-input/style/index.js.map +1 -0
  4. package/es/auth-context/style/index.js +1 -0
  5. package/es/auth-context/style/index.js.map +1 -0
  6. package/es/columns/index.js +6 -12
  7. package/es/development-login/LoginModal.js +4 -10
  8. package/es/development-login/style/index.js +1 -0
  9. package/es/development-login/style/index.js.map +1 -0
  10. package/es/drawer/drawer.js +4 -8
  11. package/es/ellipsis/index.js +14 -25
  12. package/es/ellipsis/style/index.js +1 -0
  13. package/es/ellipsis/style/index.js.map +1 -0
  14. package/es/empty/empty.js +9 -14
  15. package/es/empty/empty.js.map +1 -1
  16. package/es/empty/render-empty.js +22 -0
  17. package/es/empty/render-empty.js.map +1 -0
  18. package/es/empty/style/index.js +2 -0
  19. package/es/empty/style/index.js.map +1 -0
  20. package/es/handle/index.js +14 -27
  21. package/es/handle/style/index.js +1 -0
  22. package/es/handle/style/index.js.map +1 -0
  23. package/es/icon-list/style/index.js +1 -0
  24. package/es/icon-list/style/index.js.map +1 -0
  25. package/es/img/Contain.js +13 -19
  26. package/es/img/Cover.js +13 -24
  27. package/es/img/index.js +14 -21
  28. package/es/img/style/index.js +1 -0
  29. package/es/img/style/index.js.map +1 -0
  30. package/es/index.js +0 -1
  31. package/es/loading-button/index.js +6 -13
  32. package/es/loading-button/style/index.js +1 -0
  33. package/es/loading-button/style/index.js.map +1 -0
  34. package/es/locale/default.js +0 -2
  35. package/es/locale/en_US.js +0 -2
  36. package/es/locale/zh_CN.js +0 -2
  37. package/es/page/Box.js +19 -28
  38. package/es/page/index.js +22 -38
  39. package/es/page/style/index.js +1 -0
  40. package/es/page/style/index.js.map +1 -0
  41. package/es/page/utils.js +0 -5
  42. package/es/prev-locale.js +0 -3
  43. package/es/query-form/Field/Checkbox.js +4 -8
  44. package/es/query-form/Field/Select.js +10 -17
  45. package/es/query-form/Field/SelectInput.js +4 -18
  46. package/es/query-form/Field/fieldsMap.js +0 -1
  47. package/es/query-form/Field/index.js +2 -11
  48. package/es/query-form/createActions.js +0 -8
  49. package/es/query-form/index.js +2 -34
  50. package/es/query-form/style/index.js +1 -0
  51. package/es/query-form/style/index.js.map +1 -0
  52. package/es/query-list-scene/List.js +18 -39
  53. package/es/query-list-scene/QueryForm.js +10 -19
  54. package/es/query-list-scene/QueryListScene.js +0 -2
  55. package/es/query-list-scene/Toolbar.js +6 -10
  56. package/es/query-list-scene/createActions.js +0 -3
  57. package/es/query-list-scene/style/index.js +1 -0
  58. package/es/query-list-scene/style/index.js.map +1 -0
  59. package/es/render-empty/render-empty.js +0 -2
  60. package/es/render-empty/style/index.js +1 -0
  61. package/es/render-empty/style/index.js.map +1 -0
  62. package/es/steps/steps.js +9 -17
  63. package/es/svg-components/illustration-403.js +0 -2
  64. package/es/svg-components/illustration-404.js +0 -2
  65. package/es/svg-components/illustration-500.js +0 -2
  66. package/es/svg-components/illustration-empty.js +0 -2
  67. package/es/svg-components/illustration-failure.js +0 -2
  68. package/es/svg-components/illustration-no-access.js +0 -2
  69. package/es/svg-components/illustration-no-chart.js +0 -2
  70. package/es/svg-components/illustration-no-result.js +0 -2
  71. package/es/svg-components/illustration-offline.js +0 -2
  72. package/es/svg-components/illustration-success.js +0 -2
  73. package/es/table/assets/image-loading-background.js +0 -2
  74. package/es/table/assets/image-loading.js +0 -2
  75. package/es/table/hooks/use-column-setting.js +0 -1
  76. package/es/table/style/index.js +2 -0
  77. package/es/table/style/index.js.map +1 -0
  78. package/es/table/table.js +14 -19
  79. package/es/table/table.stories.js +0 -2
  80. package/es/table/utils.js +2 -6
  81. package/es/title/index.js +10 -14
  82. package/es/title/style/index.js +1 -0
  83. package/es/title/style/index.js.map +1 -0
  84. package/es/tntd-cascader/AntdCascader/component/context.js +2 -4
  85. package/es/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js +0 -2
  86. package/es/tntd-cascader/AntdCascader/component/getIcons.js +6 -15
  87. package/es/tntd-cascader/AntdCascader/config/utils.js +0 -2
  88. package/es/tntd-cascader/AntdCascader/config/warning.js +4 -8
  89. package/es/tntd-cascader/AntdCascader/index.js +51 -73
  90. package/es/tntd-cascader/rc-cascader/Cascader.js +86 -113
  91. package/es/tntd-cascader/rc-cascader/OptionList/Column.js +16 -26
  92. package/es/tntd-cascader/rc-cascader/OptionList/index.js +26 -43
  93. package/es/tntd-cascader/rc-cascader/OptionList/useActive.js +5 -7
  94. package/es/tntd-cascader/rc-cascader/OptionList/useKeyboard.js +12 -41
  95. package/es/tntd-cascader/rc-cascader/hooks/useDisplayValues.js +4 -10
  96. package/es/tntd-cascader/rc-cascader/hooks/useEntities.js +2 -4
  97. package/es/tntd-cascader/rc-cascader/hooks/useMissingValues.js +0 -1
  98. package/es/tntd-cascader/rc-cascader/hooks/useRefFunc.js +0 -1
  99. package/es/tntd-cascader/rc-cascader/hooks/useSearchConfig.js +2 -7
  100. package/es/tntd-cascader/rc-cascader/hooks/useSearchOptions.js +8 -15
  101. package/es/tntd-cascader/rc-cascader/utils/commonUtil.js +2 -6
  102. package/es/tntd-cascader/rc-cascader/utils/treeUtil.js +2 -4
  103. package/es/tntd-cascader/rc-cascader/utils/warningPropsUtil.js +2 -7
  104. package/es/tntd-icon/fonts/iconfont.js +7 -12
  105. package/es/tntd-icon/index.js +5 -9
  106. package/es/tntd-icon/style/index.js +1 -0
  107. package/es/tntd-icon/style/index.js.map +1 -0
  108. package/es/tntd-layout/ActionsContext.js +2 -2
  109. package/es/tntd-layout/AppList.js +2 -14
  110. package/es/tntd-layout/Application.js +0 -4
  111. package/es/tntd-layout/Avatar.js +0 -4
  112. package/es/tntd-layout/CompatibleLanguage.js +0 -13
  113. package/es/tntd-layout/EnterpriseLayout/Avatar.js +0 -4
  114. package/es/tntd-layout/EnterpriseLayout/Language.js +0 -6
  115. package/es/tntd-layout/EnterpriseLayout/Theme.js +0 -4
  116. package/es/tntd-layout/EnterpriseLayout/index.js +2 -2
  117. package/es/tntd-layout/GlobalNavigation/NavigationPopup.js +2 -33
  118. package/es/tntd-layout/GlobalNavigation/index.js +0 -6
  119. package/es/tntd-layout/HeaderActions.js +28 -32
  120. package/es/tntd-layout/HeaderNavs.js +6 -14
  121. package/es/tntd-layout/HeaderTabs.js +14 -35
  122. package/es/tntd-layout/Language.js +0 -6
  123. package/es/tntd-layout/Layout.js +2 -7
  124. package/es/tntd-layout/Logo.js +4 -11
  125. package/es/tntd-layout/OrgAppList.js +22 -39
  126. package/es/tntd-layout/SideMenu.js +8 -45
  127. package/es/tntd-layout/Theme.js +0 -6
  128. package/es/tntd-layout/index.js +9 -17
  129. package/es/tntd-layout/paaslayout/CompactSideMenu.js +0 -15
  130. package/es/tntd-layout/paaslayout/SideMenu.js +0 -15
  131. package/es/tntd-layout/paaslayout/index.js +4 -13
  132. package/es/tntd-layout/storage.js +2 -2
  133. package/es/tntd-layout/style/index.js +1 -0
  134. package/es/tntd-layout/style/index.js.map +1 -0
  135. package/es/tntd-modal/index.js +12 -18
  136. package/es/tntd-modal/style/index.js +1 -0
  137. package/es/tntd-modal/style/index.js.map +1 -0
  138. package/es/tntd-second-page/index.js +0 -3
  139. package/es/tntd-select/DropDownWrap.js +4 -8
  140. package/es/tntd-select/index.js +74 -118
  141. package/es/tntd-select/style/index.js +1 -0
  142. package/es/tntd-select/style/index.js.map +1 -0
  143. package/es/utils/checkAuth.js +0 -1
  144. package/es/utils/findMenuInfoByPath.js +0 -3
  145. package/es/utils/index.js +2 -11
  146. package/lib/affix/index.js +4 -10
  147. package/lib/alert/index.js +4 -10
  148. package/lib/anchor/index.js +4 -10
  149. package/lib/array-input/icon.js +1 -7
  150. package/lib/array-input/index.js +41 -91
  151. package/lib/array-input/style/index.d.ts +1 -0
  152. package/lib/array-input/style/index.d.ts.map +1 -0
  153. package/lib/array-input/style/index.js +1 -0
  154. package/lib/array-input/style/index.js.map +1 -0
  155. package/lib/auth-context/index.js +0 -3
  156. package/lib/auth-context/style/index.d.ts +1 -0
  157. package/lib/auth-context/style/index.d.ts.map +1 -0
  158. package/lib/auth-context/style/index.js +1 -0
  159. package/lib/auth-context/style/index.js.map +1 -0
  160. package/lib/auto-complete/index.js +4 -10
  161. package/lib/avatar/index.js +4 -10
  162. package/lib/back-top/index.js +4 -10
  163. package/lib/badge/index.js +4 -10
  164. package/lib/breadcrumb/index.js +4 -10
  165. package/lib/button/index.js +4 -10
  166. package/lib/calendar/index.js +4 -10
  167. package/lib/card/index.js +4 -10
  168. package/lib/carousel/index.js +4 -10
  169. package/lib/cascader/index.js +4 -10
  170. package/lib/checkbox/index.js +4 -10
  171. package/lib/col/index.js +4 -10
  172. package/lib/collapse/index.js +4 -11
  173. package/lib/columns/index.js +14 -28
  174. package/lib/comment/index.js +4 -10
  175. package/lib/config-provider/config-provider.js +0 -2
  176. package/lib/config-provider/index.js +4 -10
  177. package/lib/date-picker/index.js +4 -10
  178. package/lib/descriptions/index.js +4 -10
  179. package/lib/development-login/LoginModal.js +25 -50
  180. package/lib/development-login/index.js +11 -22
  181. package/lib/development-login/style/index.d.ts +1 -0
  182. package/lib/development-login/style/index.d.ts.map +1 -0
  183. package/lib/development-login/style/index.js +1 -0
  184. package/lib/development-login/style/index.js.map +1 -0
  185. package/lib/divider/index.js +4 -10
  186. package/lib/drawer/drawer.js +6 -16
  187. package/lib/drawer/index.js +1 -5
  188. package/lib/dropdown/index.js +4 -10
  189. package/lib/ellipsis/Svg/CopySVG.js +0 -4
  190. package/lib/ellipsis/Svg/TickSVG.js +0 -4
  191. package/lib/ellipsis/index.js +42 -73
  192. package/lib/ellipsis/style/index.d.ts +1 -0
  193. package/lib/ellipsis/style/index.d.ts.map +1 -0
  194. package/lib/ellipsis/style/index.js +1 -0
  195. package/lib/ellipsis/style/index.js.map +1 -0
  196. package/lib/empty/empty.d.ts.map +1 -1
  197. package/lib/empty/empty.js +14 -31
  198. package/lib/empty/empty.js.map +1 -1
  199. package/lib/empty/empty.stories.js +3 -21
  200. package/lib/empty/index.js +1 -5
  201. package/lib/empty/render-empty.d.ts +3 -0
  202. package/lib/empty/render-empty.d.ts.map +1 -0
  203. package/lib/empty/render-empty.js +32 -0
  204. package/lib/empty/render-empty.js.map +1 -0
  205. package/lib/empty/style/index.d.ts +3 -0
  206. package/lib/empty/style/index.d.ts.map +1 -0
  207. package/lib/empty/style/index.js +4 -0
  208. package/lib/empty/style/index.js.map +1 -0
  209. package/lib/exception/exception.js +7 -14
  210. package/lib/exception/index.js +1 -4
  211. package/lib/form/index.js +4 -10
  212. package/lib/handle/index.js +19 -46
  213. package/lib/handle/style/index.d.ts +1 -0
  214. package/lib/handle/style/index.d.ts.map +1 -0
  215. package/lib/handle/style/index.js +1 -0
  216. package/lib/handle/style/index.js.map +1 -0
  217. package/lib/icon/index.js +4 -10
  218. package/lib/icon-list/style/index.d.ts +3 -0
  219. package/lib/icon-list/style/index.d.ts.map +1 -0
  220. package/lib/icon-list/style/index.js +8 -0
  221. package/lib/icon-list/style/index.js.map +1 -0
  222. package/lib/img/Contain.js +12 -23
  223. package/lib/img/Cover.js +31 -53
  224. package/lib/img/index.js +29 -47
  225. package/lib/img/style/index.d.ts +1 -0
  226. package/lib/img/style/index.d.ts.map +1 -0
  227. package/lib/img/style/index.js +1 -0
  228. package/lib/img/style/index.js.map +1 -0
  229. package/lib/index.js +100 -187
  230. package/lib/input/index.js +4 -10
  231. package/lib/input-number/index.js +4 -10
  232. package/lib/layout/index.js +4 -10
  233. package/lib/list/index.js +4 -10
  234. package/lib/loading-button/index.js +15 -32
  235. package/lib/loading-button/style/index.d.ts +1 -0
  236. package/lib/loading-button/style/index.d.ts.map +1 -0
  237. package/lib/loading-button/style/index.js +1 -0
  238. package/lib/loading-button/style/index.js.map +1 -0
  239. package/lib/locale/default.js +0 -5
  240. package/lib/locale/en_US.js +0 -4
  241. package/lib/locale/index.js +3 -6
  242. package/lib/locale/zh_CN.js +0 -4
  243. package/lib/locale-provider/index.js +4 -10
  244. package/lib/mention/index.js +4 -10
  245. package/lib/mentions/index.js +4 -10
  246. package/lib/menu/index.js +4 -10
  247. package/lib/message/index.js +4 -11
  248. package/lib/modal/index.js +4 -11
  249. package/lib/notification/index.js +4 -10
  250. package/lib/page/Box.js +24 -37
  251. package/lib/page/index.js +37 -66
  252. package/lib/page/style/index.d.ts +1 -0
  253. package/lib/page/style/index.d.ts.map +1 -0
  254. package/lib/page/style/index.js +1 -0
  255. package/lib/page/style/index.js.map +1 -0
  256. package/lib/page/utils.js +1 -9
  257. package/lib/page-header/index.js +4 -10
  258. package/lib/pagination/index.js +4 -10
  259. package/lib/popconfirm/index.js +4 -10
  260. package/lib/popover/index.js +4 -10
  261. package/lib/prev-locale.js +1 -10
  262. package/lib/progress/index.js +4 -10
  263. package/lib/query-form/Field/Checkbox.js +2 -11
  264. package/lib/query-form/Field/Select.js +27 -45
  265. package/lib/query-form/Field/SelectInput.js +21 -46
  266. package/lib/query-form/Field/fieldsMap.js +1 -12
  267. package/lib/query-form/Field/index.js +38 -70
  268. package/lib/query-form/createActions.js +0 -7
  269. package/lib/query-form/index.js +52 -121
  270. package/lib/query-form/style/index.d.ts +1 -0
  271. package/lib/query-form/style/index.d.ts.map +1 -0
  272. package/lib/query-form/style/index.js +1 -0
  273. package/lib/query-form/style/index.js.map +1 -0
  274. package/lib/query-form/useForm.js +0 -4
  275. package/lib/query-list-scene/List.js +58 -111
  276. package/lib/query-list-scene/QueryForm.js +37 -67
  277. package/lib/query-list-scene/QueryListScene.js +21 -42
  278. package/lib/query-list-scene/Title.js +1 -5
  279. package/lib/query-list-scene/Toolbar.js +8 -15
  280. package/lib/query-list-scene/createActions.js +0 -6
  281. package/lib/query-list-scene/index.js +0 -10
  282. package/lib/query-list-scene/style/index.d.ts +1 -0
  283. package/lib/query-list-scene/style/index.d.ts.map +1 -0
  284. package/lib/query-list-scene/style/index.js +1 -0
  285. package/lib/query-list-scene/style/index.js.map +1 -0
  286. package/lib/query-list-scene/useActions.js +0 -4
  287. package/lib/radio/index.js +4 -10
  288. package/lib/rate/index.js +4 -10
  289. package/lib/render-empty/index.js +0 -2
  290. package/lib/render-empty/render-empty.js +0 -8
  291. package/lib/render-empty/style/index.d.ts +2 -0
  292. package/lib/render-empty/style/index.d.ts.map +1 -0
  293. package/lib/render-empty/style/index.js +3 -0
  294. package/lib/render-empty/style/index.js.map +1 -0
  295. package/lib/result/index.js +4 -10
  296. package/lib/row/index.js +4 -10
  297. package/lib/select/index.js +4 -10
  298. package/lib/skeleton/index.js +4 -10
  299. package/lib/slider/index.js +4 -10
  300. package/lib/spin/index.js +4 -10
  301. package/lib/statistic/index.js +4 -10
  302. package/lib/steps/index.js +1 -5
  303. package/lib/steps/steps.js +12 -29
  304. package/lib/svg-components/illustration-403.js +3 -9
  305. package/lib/svg-components/illustration-404.js +3 -9
  306. package/lib/svg-components/illustration-500.js +3 -9
  307. package/lib/svg-components/illustration-empty.js +3 -9
  308. package/lib/svg-components/illustration-failure.js +3 -9
  309. package/lib/svg-components/illustration-no-access.js +3 -9
  310. package/lib/svg-components/illustration-no-chart.js +3 -9
  311. package/lib/svg-components/illustration-no-result.js +3 -9
  312. package/lib/svg-components/illustration-offline.js +3 -9
  313. package/lib/svg-components/illustration-success.js +3 -9
  314. package/lib/svg-components/index.js +0 -11
  315. package/lib/switch/index.js +4 -10
  316. package/lib/table/assets/image-loading-background.js +3 -9
  317. package/lib/table/assets/image-loading.js +3 -9
  318. package/lib/table/context.js +0 -2
  319. package/lib/table/hooks/index.js +1 -2
  320. package/lib/table/hooks/use-column-setting.js +8 -16
  321. package/lib/table/index.js +1 -5
  322. package/lib/table/style/index.d.ts +3 -0
  323. package/lib/table/style/index.d.ts.map +1 -0
  324. package/lib/table/style/index.js +4 -0
  325. package/lib/table/style/index.js.map +1 -0
  326. package/lib/table/table.js +34 -63
  327. package/lib/table/table.stories.js +2 -11
  328. package/lib/table/utils.js +2 -11
  329. package/lib/tabs/index.js +4 -10
  330. package/lib/tag/index.js +4 -10
  331. package/lib/time-picker/index.js +4 -10
  332. package/lib/timeline/index.js +4 -10
  333. package/lib/title/index.js +10 -20
  334. package/lib/title/style/index.d.ts +1 -0
  335. package/lib/title/style/index.d.ts.map +1 -0
  336. package/lib/title/style/index.js +1 -0
  337. package/lib/title/style/index.js.map +1 -0
  338. package/lib/tntd-cascader/AntdCascader/component/DisabledContext.js +4 -11
  339. package/lib/tntd-cascader/AntdCascader/component/FormItemInputContext.js +3 -8
  340. package/lib/tntd-cascader/AntdCascader/component/SizeContext.js +3 -8
  341. package/lib/tntd-cascader/AntdCascader/component/context.js +3 -9
  342. package/lib/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js +4 -12
  343. package/lib/tntd-cascader/AntdCascader/component/getIcons.js +19 -37
  344. package/lib/tntd-cascader/AntdCascader/component/useCompactItemContext.js +8 -17
  345. package/lib/tntd-cascader/AntdCascader/config/utils.js +6 -15
  346. package/lib/tntd-cascader/AntdCascader/config/warning.js +7 -15
  347. package/lib/tntd-cascader/AntdCascader/index.js +80 -133
  348. package/lib/tntd-cascader/AntdCascader/interface.js +0 -3
  349. package/lib/tntd-cascader/index.js +0 -2
  350. package/lib/tntd-cascader/rc-cascader/Cascader.js +123 -188
  351. package/lib/tntd-cascader/rc-cascader/OptionList/Checkbox.js +11 -21
  352. package/lib/tntd-cascader/rc-cascader/OptionList/Column.js +60 -88
  353. package/lib/tntd-cascader/rc-cascader/OptionList/index.js +65 -109
  354. package/lib/tntd-cascader/rc-cascader/OptionList/useActive.js +18 -33
  355. package/lib/tntd-cascader/rc-cascader/OptionList/useKeyboard.js +56 -106
  356. package/lib/tntd-cascader/rc-cascader/context.js +3 -8
  357. package/lib/tntd-cascader/rc-cascader/hooks/useDisplayValues.js +14 -31
  358. package/lib/tntd-cascader/rc-cascader/hooks/useEntities.js +5 -15
  359. package/lib/tntd-cascader/rc-cascader/hooks/useMissingValues.js +3 -11
  360. package/lib/tntd-cascader/rc-cascader/hooks/useRefFunc.js +3 -8
  361. package/lib/tntd-cascader/rc-cascader/hooks/useSearchConfig.js +3 -15
  362. package/lib/tntd-cascader/rc-cascader/hooks/useSearchOptions.js +26 -41
  363. package/lib/tntd-cascader/rc-cascader/index.js +0 -3
  364. package/lib/tntd-cascader/rc-cascader/utils/commonUtil.js +9 -20
  365. package/lib/tntd-cascader/rc-cascader/utils/treeUtil.js +0 -8
  366. package/lib/tntd-cascader/rc-cascader/utils/warningPropsUtil.js +7 -14
  367. package/lib/tntd-icon/fonts/iconfont.js +7 -12
  368. package/lib/tntd-icon/index.js +6 -17
  369. package/lib/tntd-icon/style/index.d.ts +1 -0
  370. package/lib/tntd-icon/style/index.d.ts.map +1 -0
  371. package/lib/tntd-icon/style/index.js +1 -0
  372. package/lib/tntd-icon/style/index.js.map +1 -0
  373. package/lib/tntd-layout/ActionsContext.js +0 -3
  374. package/lib/tntd-layout/AppList.js +30 -105
  375. package/lib/tntd-layout/Application.js +22 -84
  376. package/lib/tntd-layout/Avatar.js +18 -72
  377. package/lib/tntd-layout/CompatibleLanguage.js +32 -105
  378. package/lib/tntd-layout/EnterpriseLayout/Avatar.js +24 -80
  379. package/lib/tntd-layout/EnterpriseLayout/Language.js +14 -45
  380. package/lib/tntd-layout/EnterpriseLayout/Theme.js +16 -46
  381. package/lib/tntd-layout/EnterpriseLayout/index.js +4 -12
  382. package/lib/tntd-layout/GlobalNavigation/NavigationPopup.js +45 -174
  383. package/lib/tntd-layout/GlobalNavigation/index.js +19 -70
  384. package/lib/tntd-layout/Header.js +20 -54
  385. package/lib/tntd-layout/HeaderActions.js +33 -64
  386. package/lib/tntd-layout/HeaderNavs.js +19 -59
  387. package/lib/tntd-layout/HeaderTabs.js +43 -111
  388. package/lib/tntd-layout/Iconfont.js +0 -5
  389. package/lib/tntd-layout/Language.js +14 -45
  390. package/lib/tntd-layout/Layout.js +74 -113
  391. package/lib/tntd-layout/Logo.js +14 -41
  392. package/lib/tntd-layout/OrgAppList.js +51 -119
  393. package/lib/tntd-layout/SideMenu.js +42 -120
  394. package/lib/tntd-layout/Theme.js +19 -71
  395. package/lib/tntd-layout/createActions.js +0 -5
  396. package/lib/tntd-layout/images/index.js +0 -28
  397. package/lib/tntd-layout/index.js +21 -49
  398. package/lib/tntd-layout/paaslayout/CompactSideMenu.js +29 -81
  399. package/lib/tntd-layout/paaslayout/Header.js +14 -47
  400. package/lib/tntd-layout/paaslayout/Logo.js +2 -19
  401. package/lib/tntd-layout/paaslayout/SideMenu.js +31 -82
  402. package/lib/tntd-layout/paaslayout/index.js +62 -108
  403. package/lib/tntd-layout/storage.d.ts +1 -1
  404. package/lib/tntd-layout/storage.d.ts.map +1 -1
  405. package/lib/tntd-layout/storage.js +3 -33
  406. package/lib/tntd-layout/style/index.d.ts +1 -0
  407. package/lib/tntd-layout/style/index.d.ts.map +1 -0
  408. package/lib/tntd-layout/style/index.js +1 -0
  409. package/lib/tntd-layout/style/index.js.map +1 -0
  410. package/lib/tntd-modal/index.js +32 -51
  411. package/lib/tntd-modal/style/index.d.ts +1 -0
  412. package/lib/tntd-modal/style/index.d.ts.map +1 -0
  413. package/lib/tntd-modal/style/index.js +1 -0
  414. package/lib/tntd-modal/style/index.js.map +1 -0
  415. package/lib/tntd-second-page/index.js +14 -24
  416. package/lib/tntd-select/DropDownWrap.js +24 -45
  417. package/lib/tntd-select/index.js +117 -206
  418. package/lib/tntd-select/style/index.d.ts +1 -0
  419. package/lib/tntd-select/style/index.d.ts.map +1 -0
  420. package/lib/tntd-select/style/index.js +1 -0
  421. package/lib/tntd-select/style/index.js.map +1 -0
  422. package/lib/tooltip/index.js +4 -10
  423. package/lib/transfer/index.js +4 -10
  424. package/lib/tree/index.js +4 -10
  425. package/lib/tree-select/index.js +4 -10
  426. package/lib/typography/index.js +4 -10
  427. package/lib/upload/index.js +4 -10
  428. package/lib/utils/checkAuth.js +4 -10
  429. package/lib/utils/findMenuInfoByPath.js +1 -7
  430. package/lib/utils/index.js +13 -41
  431. package/lib/version/index.js +4 -10
  432. package/package.json +7 -4
@@ -39,47 +39,42 @@ export default function Column({
39
39
  } = React.useContext(CascaderContext);
40
40
  const hoverOpen = expandTrigger === 'hover';
41
41
  /** 单选情况下滚动到相应的位置 */
42
-
43
42
  React.useEffect(() => {
44
43
  let timer = null;
45
-
46
44
  if (ref.current && ref.current.scrollTo && !multiple && dropdownVisible) {
47
45
  const index = options.findIndex(it => it[fieldNames.value] === activeValue);
48
-
49
46
  if (index > 0 && !isNaN(index)) {
50
47
  timer = window.setTimeout(() => {
51
48
  ref.current.scrollTo((optionHeight || 36) * index);
52
49
  }, 5);
53
50
  }
54
51
  }
55
-
56
52
  return () => {
57
53
  if (timer) {
58
54
  window.clearTimeout(timer);
59
55
  }
60
-
61
56
  timer = null;
62
57
  };
63
- }, [multiple, activeValue, options, fieldNames, dropdownVisible, optionHeight]); // ============================ Option ============================
64
-
58
+ }, [multiple, activeValue, options, fieldNames, dropdownVisible, optionHeight]);
59
+ // ============================ Option ============================
65
60
  const optionInfoList = React.useMemo(() => options.map(option => {
66
61
  var _a;
67
-
68
62
  const {
69
63
  disabled
70
64
  } = option;
71
65
  const searchOptions = option[SEARCH_MARK];
72
66
  const label = (_a = option[FIX_LABEL]) !== null && _a !== void 0 ? _a : option[fieldNames.label];
73
67
  const value = option[fieldNames.value];
74
- const isMergedLeaf = isLeaf(option, fieldNames); // Get real value of option. Search option is different way.
75
-
76
- const fullPath = searchOptions ? // @ts-ignore
68
+ const isMergedLeaf = isLeaf(option, fieldNames);
69
+ // Get real value of option. Search option is different way.
70
+ const fullPath = searchOptions ?
71
+ // @ts-ignore
77
72
  searchOptions.map(opt => opt[fieldNames.value]) : [...prevValuePath, value];
78
73
  const fullPathKey = toPathKey(fullPath);
79
- const isLoading = loadingKeys.includes(fullPathKey); // >>>>> checked
80
-
81
- const checked = checkedSet.has(fullPathKey); // >>>>> halfChecked
82
-
74
+ const isLoading = loadingKeys.includes(fullPathKey);
75
+ // >>>>> checked
76
+ const checked = checkedSet.has(fullPathKey);
77
+ // >>>>> halfChecked
83
78
  const halfChecked = halfCheckedSet.has(fullPathKey);
84
79
  return {
85
80
  disabled,
@@ -93,8 +88,8 @@ export default function Column({
93
88
  fullPath,
94
89
  fullPathKey
95
90
  };
96
- }), [options, checkedSet, fieldNames, halfCheckedSet, loadingKeys, prevValuePath]); // ============================ Render ============================
97
-
91
+ }), [options, checkedSet, fieldNames, halfCheckedSet, loadingKeys, prevValuePath]);
92
+ // ============================ Render ============================
98
93
  return React.createElement("ul", {
99
94
  className: menuPrefixCls,
100
95
  role: "menu"
@@ -122,24 +117,20 @@ export default function Column({
122
117
  if (!disabled && (!hoverOpen || !isMergedLeaf)) {
123
118
  onActive(fullPath);
124
119
  }
125
- }; // >>>>> Selection
126
-
127
-
120
+ };
121
+ // >>>>> Selection
128
122
  const triggerSelect = () => {
129
123
  if (isSelectable(option)) {
130
124
  onSelect(fullPath, isMergedLeaf);
131
125
  }
132
- }; // >>>>> Title
133
-
134
-
126
+ };
127
+ // >>>>> Title
135
128
  let title;
136
-
137
129
  if (typeof option.title === 'string') {
138
130
  title = option.title;
139
131
  } else if (typeof label === 'string') {
140
132
  title = label;
141
133
  }
142
-
143
134
  return React.createElement("li", {
144
135
  key: fullPathKey,
145
136
  className: classNames(menuItemPrefixCls, {
@@ -156,7 +147,6 @@ export default function Column({
156
147
  "data-path-key": fullPathKey,
157
148
  onClick: () => {
158
149
  triggerOpenPath();
159
-
160
150
  if (!multiple || isMergedLeaf) {
161
151
  triggerSelect();
162
152
  }
@@ -11,7 +11,6 @@ import useActive from './useActive';
11
11
  import useKeyboard from './useKeyboard';
12
12
  const RefOptionList = React.forwardRef((props, ref) => {
13
13
  var _a, _b;
14
-
15
14
  const {
16
15
  prefixCls,
17
16
  multiple,
@@ -37,30 +36,26 @@ const RefOptionList = React.forwardRef((props, ref) => {
37
36
  renderItem,
38
37
  dropdownVisible
39
38
  } = React.useContext(CascaderContext);
40
- const mergedPrefixCls = dropdownPrefixCls || prefixCls; // ========================= loadData =========================
41
-
39
+ const mergedPrefixCls = dropdownPrefixCls || prefixCls;
40
+ // ========================= loadData =========================
42
41
  const [loadingKeys, setLoadingKeys] = React.useState([]);
43
-
44
42
  const internalLoadData = valueCells => {
45
43
  // Do not load when search
46
44
  if (!loadData || searchValue) {
47
45
  return;
48
46
  }
49
-
50
47
  const optionList = toPathOptions(valueCells, options, fieldNames);
51
48
  const rawOptions = optionList.map(({
52
49
  option
53
50
  }) => option);
54
51
  const lastOption = rawOptions[rawOptions.length - 1];
55
-
56
52
  if (lastOption && !isLeaf(lastOption, fieldNames)) {
57
53
  const pathKey = toPathKey(valueCells);
58
54
  setLoadingKeys(keys => [...keys, pathKey]);
59
55
  loadData(rawOptions);
60
56
  }
61
- }; // zombieJ: This is bad. We should make this same as `rc-tree` to use Promise instead.
62
-
63
-
57
+ };
58
+ // zombieJ: This is bad. We should make this same as `rc-tree` to use Promise instead.
64
59
  React.useEffect(() => {
65
60
  if (loadingKeys.length) {
66
61
  loadingKeys.forEach(loadingKey => {
@@ -69,25 +64,23 @@ const RefOptionList = React.forwardRef((props, ref) => {
69
64
  option
70
65
  }) => option);
71
66
  const lastOption = optionList[optionList.length - 1];
72
-
73
67
  if (!lastOption || lastOption[fieldNames.children] || isLeaf(lastOption, fieldNames)) {
74
68
  setLoadingKeys(keys => keys.filter(key => key !== loadingKey));
75
69
  }
76
70
  });
77
71
  }
78
- }, [options, loadingKeys, fieldNames]); // ========================== Values ==========================
79
-
72
+ }, [options, loadingKeys, fieldNames]);
73
+ // ========================== Values ==========================
80
74
  const checkedSet = React.useMemo(() => new Set(toPathKeys(values)), [values]);
81
- const halfCheckedSet = React.useMemo(() => new Set(toPathKeys(halfValues)), [halfValues]); // ====================== Accessibility =======================
82
-
83
- const [activeValueCells, setActiveValueCells] = useActive(); // =========================== Path ===========================
84
-
75
+ const halfCheckedSet = React.useMemo(() => new Set(toPathKeys(halfValues)), [halfValues]);
76
+ // ====================== Accessibility =======================
77
+ const [activeValueCells, setActiveValueCells] = useActive();
78
+ // =========================== Path ===========================
85
79
  const onPathOpen = nextValueCells => {
86
- setActiveValueCells(nextValueCells); // Trigger loadData
87
-
80
+ setActiveValueCells(nextValueCells);
81
+ // Trigger loadData
88
82
  internalLoadData(nextValueCells);
89
83
  };
90
-
91
84
  const isSelectable = option => {
92
85
  const {
93
86
  disabled
@@ -95,59 +88,49 @@ const RefOptionList = React.forwardRef((props, ref) => {
95
88
  const isMergedLeaf = isLeaf(option, fieldNames);
96
89
  return !disabled && (isMergedLeaf || changeOnSelect || multiple);
97
90
  };
98
-
99
91
  const onPathSelect = (valuePath, leaf, fromKeyboard = false) => {
100
92
  onSelect(valuePath);
101
-
102
93
  if (!multiple && (leaf || changeOnSelect && (expandTrigger === 'hover' || fromKeyboard))) {
103
94
  toggleOpen(false);
104
95
  }
105
- }; // ========================== Option ==========================
106
-
107
-
96
+ };
97
+ // ========================== Option ==========================
108
98
  const mergedOptions = React.useMemo(() => {
109
99
  if (searchValue) {
110
100
  return searchOptions;
111
101
  }
112
-
113
102
  return options;
114
- }, [searchValue, searchOptions, options]); // ========================== Column ==========================
115
-
103
+ }, [searchValue, searchOptions, options]);
104
+ // ========================== Column ==========================
116
105
  const optionColumns = React.useMemo(() => {
117
106
  const optionList = [{
118
107
  options: mergedOptions
119
108
  }];
120
109
  let currentList = mergedOptions;
121
-
122
110
  for (let i = 0; i < activeValueCells.length; i += 1) {
123
111
  const activeValueCell = activeValueCells[i];
124
112
  const currentOption = currentList.find(option => option[fieldNames.value] === activeValueCell);
125
113
  const subOptions = currentOption === null || currentOption === void 0 ? void 0 : currentOption[fieldNames.children];
126
-
127
114
  if (!(subOptions === null || subOptions === void 0 ? void 0 : subOptions.length)) {
128
115
  break;
129
116
  }
130
-
131
117
  currentList = subOptions;
132
118
  optionList.push({
133
119
  options: subOptions
134
120
  });
135
121
  }
136
-
137
122
  return optionList;
138
- }, [mergedOptions, activeValueCells, fieldNames]); // ========================= Keyboard =========================
139
-
123
+ }, [mergedOptions, activeValueCells, fieldNames]);
124
+ // ========================= Keyboard =========================
140
125
  const onKeyboardSelect = (selectValueCells, option) => {
141
126
  if (isSelectable(option)) {
142
127
  onPathSelect(selectValueCells, isLeaf(option, fieldNames), true);
143
128
  }
144
129
  };
145
-
146
- useKeyboard(ref, mergedOptions, fieldNames, activeValueCells, onPathOpen, onKeyboardSelect); // >>>>> Active Scroll
147
-
130
+ useKeyboard(ref, mergedOptions, fieldNames, activeValueCells, onPathOpen, onKeyboardSelect);
131
+ // >>>>> Active Scroll
148
132
  React.useEffect(() => {
149
133
  var _a;
150
-
151
134
  for (let i = 0; i < activeValueCells.length; i += 1) {
152
135
  const cellPath = activeValueCells.slice(0, i + 1);
153
136
  const cellKeyPath = toPathKey(cellPath);
@@ -158,9 +141,9 @@ const RefOptionList = React.forwardRef((props, ref) => {
158
141
  scrollIntoParentView(ele);
159
142
  }
160
143
  }
161
- }, [activeValueCells]); // ========================== Render ==========================
144
+ }, [activeValueCells]);
145
+ // ========================== Render ==========================
162
146
  // >>>>> Empty
163
-
164
147
  const isEmpty = !((_b = (_a = optionColumns[0]) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.length);
165
148
  const emptyList = [{
166
149
  [fieldNames.value]: '__EMPTY__',
@@ -176,8 +159,8 @@ const RefOptionList = React.forwardRef((props, ref) => {
176
159
  halfCheckedSet,
177
160
  loadingKeys,
178
161
  isSelectable
179
- }); // >>>>> Columns
180
-
162
+ });
163
+ // >>>>> Columns
181
164
  const mergedOptionColumns = isEmpty ? [{
182
165
  options: emptyList
183
166
  }] : optionColumns;
@@ -197,8 +180,8 @@ const RefOptionList = React.forwardRef((props, ref) => {
197
180
  activeValue: activeValue,
198
181
  renderItem: renderItem
199
182
  }));
200
- }); // >>>>> Render
201
-
183
+ });
184
+ // >>>>> Render
202
185
  return React.createElement("div", {
203
186
  className: classNames(`${mergedPrefixCls}-menus`, {
204
187
  [`${mergedPrefixCls}-menu-empty`]: isEmpty,
@@ -5,7 +5,6 @@ import { useBaseProps } from 'rc-select';
5
5
  /**
6
6
  * Control the active open options path.
7
7
  */
8
-
9
8
  export default (() => {
10
9
  const {
11
10
  multiple,
@@ -13,19 +12,18 @@ export default (() => {
13
12
  } = useBaseProps();
14
13
  const {
15
14
  values
16
- } = React.useContext(CascaderContext); // Record current dropdown active options
15
+ } = React.useContext(CascaderContext);
16
+ // Record current dropdown active options
17
17
  // This also control the open status
18
-
19
18
  const [activeValueCells, setActiveValueCells] = React.useState([]);
20
19
  React.useEffect(() => {
21
20
  if (open && !multiple) {
22
21
  const firstValueCells = values[0];
23
22
  setActiveValueCells(firstValueCells || []);
24
23
  }
25
- },
26
- /* eslint-disable react-hooks/exhaustive-deps */
24
+ }, /* eslint-disable react-hooks/exhaustive-deps */
27
25
  [open]
28
- /* eslint-enable react-hooks/exhaustive-deps */
29
- );
26
+ /* eslint-enable react-hooks/exhaustive-deps */);
27
+
30
28
  return [activeValueCells, setActiveValueCells];
31
29
  });
@@ -15,49 +15,40 @@ export default ((ref, options, fieldNames, activeValueCells, setActiveValueCells
15
15
  let currentOptions = options;
16
16
  const mergedActiveIndexes = [];
17
17
  const mergedActiveValueCells = [];
18
- const len = activeValueCells.length; // Fill validate active value cells and index
19
-
18
+ const len = activeValueCells.length;
19
+ // Fill validate active value cells and index
20
20
  for (let i = 0; i < len && currentOptions; i += 1) {
21
21
  // Mark the active index for current options
22
22
  const nextActiveIndex = currentOptions.findIndex(option => option[fieldNames.value] === activeValueCells[i]);
23
-
24
23
  if (nextActiveIndex === -1) {
25
24
  break;
26
25
  }
27
-
28
26
  activeIndex = nextActiveIndex;
29
27
  mergedActiveIndexes.push(activeIndex);
30
28
  mergedActiveValueCells.push(activeValueCells[i]);
31
29
  currentOptions = currentOptions[activeIndex][fieldNames.children];
32
- } // Fill last active options
33
-
34
-
30
+ }
31
+ // Fill last active options
35
32
  let activeOptions = options;
36
-
37
33
  for (let i = 0; i < mergedActiveIndexes.length - 1; i += 1) {
38
34
  activeOptions = activeOptions[mergedActiveIndexes[i]][fieldNames.children];
39
35
  }
40
-
41
36
  return [mergedActiveValueCells, activeIndex, activeOptions];
42
- }, [activeValueCells, fieldNames, options]); // Update active value cells and scroll to target element
43
-
37
+ }, [activeValueCells, fieldNames, options]);
38
+ // Update active value cells and scroll to target element
44
39
  const internalSetActiveValueCells = next => {
45
40
  setActiveValueCells(next);
46
- }; // Same options offset
47
-
48
-
41
+ };
42
+ // Same options offset
49
43
  const offsetActiveOption = offset => {
50
44
  const len = lastActiveOptions.length;
51
45
  let currentIndex = lastActiveIndex;
52
-
53
46
  if (currentIndex === -1 && offset < 0) {
54
47
  currentIndex = len;
55
48
  }
56
-
57
49
  for (let i = 0; i < len; i += 1) {
58
50
  currentIndex = (currentIndex + offset + len) % len;
59
51
  const option = lastActiveOptions[currentIndex];
60
-
61
52
  if (option && !option.disabled) {
62
53
  const value = option[fieldNames.value];
63
54
  const nextActiveCells = validActiveValueCells.slice(0, -1).concat(value);
@@ -65,9 +56,8 @@ export default ((ref, options, fieldNames, activeValueCells, setActiveValueCells
65
56
  return;
66
57
  }
67
58
  }
68
- }; // Different options offset
69
-
70
-
59
+ };
60
+ // Different options offset
71
61
  const prevColumn = () => {
72
62
  if (validActiveValueCells.length > 1) {
73
63
  const nextActiveCells = validActiveValueCells.slice(0, -1);
@@ -76,46 +66,37 @@ export default ((ref, options, fieldNames, activeValueCells, setActiveValueCells
76
66
  toggleOpen(false);
77
67
  }
78
68
  };
79
-
80
69
  const nextColumn = () => {
81
70
  var _a;
82
-
83
71
  const nextOptions = ((_a = lastActiveOptions[lastActiveIndex]) === null || _a === void 0 ? void 0 : _a[fieldNames.children]) || [];
84
72
  const nextOption = nextOptions.find(option => !option.disabled);
85
-
86
73
  if (nextOption) {
87
74
  const nextActiveCells = [...validActiveValueCells, nextOption[fieldNames.value]];
88
75
  internalSetActiveValueCells(nextActiveCells);
89
76
  }
90
77
  };
91
-
92
78
  React.useImperativeHandle(ref, () => ({
93
79
  // scrollTo: treeRef.current?.scrollTo,
94
80
  onKeyDown: event => {
95
81
  const {
96
82
  which
97
83
  } = event;
98
-
99
84
  switch (which) {
100
85
  // >>> Arrow keys
101
86
  case KeyCode.UP:
102
87
  case KeyCode.DOWN:
103
88
  {
104
89
  let offset = 0;
105
-
106
90
  if (which === KeyCode.UP) {
107
91
  offset = -1;
108
92
  } else if (which === KeyCode.DOWN) {
109
93
  offset = 1;
110
94
  }
111
-
112
95
  if (offset !== 0) {
113
96
  offsetActiveOption(offset);
114
97
  }
115
-
116
98
  break;
117
99
  }
118
-
119
100
  case KeyCode.LEFT:
120
101
  {
121
102
  if (rtl) {
@@ -123,10 +104,8 @@ export default ((ref, options, fieldNames, activeValueCells, setActiveValueCells
123
104
  } else {
124
105
  prevColumn();
125
106
  }
126
-
127
107
  break;
128
108
  }
129
-
130
109
  case KeyCode.RIGHT:
131
110
  {
132
111
  if (rtl) {
@@ -134,42 +113,34 @@ export default ((ref, options, fieldNames, activeValueCells, setActiveValueCells
134
113
  } else {
135
114
  nextColumn();
136
115
  }
137
-
138
116
  break;
139
117
  }
140
-
141
118
  case KeyCode.BACKSPACE:
142
119
  {
143
120
  if (!searchValue) {
144
121
  prevColumn();
145
122
  }
146
-
147
123
  break;
148
124
  }
149
125
  // >>> Select
150
-
151
126
  case KeyCode.ENTER:
152
127
  {
153
128
  if (validActiveValueCells.length) {
154
- const option = lastActiveOptions[lastActiveIndex]; // Search option should revert back of origin options
155
-
129
+ const option = lastActiveOptions[lastActiveIndex];
130
+ // Search option should revert back of origin options
156
131
  const originOptions = (option === null || option === void 0 ? void 0 : option[SEARCH_MARK]) || [];
157
-
158
132
  if (originOptions.length) {
159
133
  onKeyBoardSelect(originOptions.map(opt => opt[fieldNames.value]), originOptions[originOptions.length - 1]);
160
134
  } else {
161
135
  onKeyBoardSelect(validActiveValueCells, lastActiveOptions[lastActiveIndex]);
162
136
  }
163
137
  }
164
-
165
138
  break;
166
139
  }
167
140
  // >>> Close
168
-
169
141
  case KeyCode.ESC:
170
142
  {
171
143
  toggleOpen(false);
172
-
173
144
  if (open) {
174
145
  event.stopPropagation();
175
146
  }
@@ -4,39 +4,33 @@ import * as React from 'react';
4
4
  import { toPathKey } from '../utils/commonUtil';
5
5
  export default ((rawValues, options, fieldNames, multiple, displayRender) => {
6
6
  return React.useMemo(() => {
7
- const mergedDisplayRender = displayRender || ( // Default displayRender
7
+ const mergedDisplayRender = displayRender || (
8
+ // Default displayRender
8
9
  labels => {
9
10
  const mergedLabels = multiple ? labels.slice(-1) : labels;
10
11
  const SPLIT = ' / ';
11
-
12
12
  if (mergedLabels.every(label => ['string', 'number'].includes(typeof label))) {
13
13
  return mergedLabels.join(SPLIT);
14
- } // If exist non-string value, use ReactNode instead
15
-
16
-
14
+ }
15
+ // If exist non-string value, use ReactNode instead
17
16
  return mergedLabels.reduce((list, label, index) => {
18
17
  const keyedLabel = React.isValidElement(label) ? React.cloneElement(label, {
19
18
  key: index
20
19
  }) : label;
21
-
22
20
  if (index === 0) {
23
21
  return [keyedLabel];
24
22
  }
25
-
26
23
  return [...list, SPLIT, keyedLabel];
27
24
  }, []);
28
25
  });
29
-
30
26
  return rawValues.map(valueCells => {
31
27
  var _a, _b;
32
-
33
28
  const valueOptions = toPathOptions(valueCells, options, fieldNames);
34
29
  const label = mergedDisplayRender(valueOptions.map(({
35
30
  option,
36
31
  value
37
32
  }) => {
38
33
  var _a;
39
-
40
34
  return (_a = option === null || option === void 0 ? void 0 : option[fieldNames.label]) !== null && _a !== void 0 ? _a : value;
41
35
  }), valueOptions.map(({
42
36
  option
@@ -3,7 +3,6 @@ import * as React from 'react';
3
3
  import { convertDataToEntities } from 'rc-tree/lib/utils/treeUtil';
4
4
  import { VALUE_SPLIT } from '../utils/commonUtil';
5
5
  /** Lazy parse options data into conduct-able info to avoid perf issue in single mode */
6
-
7
6
  export default ((options, fieldNames) => {
8
7
  const cacheRef = React.useRef({
9
8
  options: null,
@@ -19,14 +18,13 @@ export default ((options, fieldNames) => {
19
18
  }),
20
19
  processEntity: (entity, wrapper) => {
21
20
  const pathKey = entity.nodes.map(node => node[fieldNames.value]).join(VALUE_SPLIT);
22
- wrapper.pathKeyEntities[pathKey] = entity; // Overwrite origin key.
21
+ wrapper.pathKeyEntities[pathKey] = entity;
22
+ // Overwrite origin key.
23
23
  // this is very hack but we need let conduct logic work with connect path
24
-
25
24
  entity.key = pathKey;
26
25
  }
27
26
  });
28
27
  }
29
-
30
28
  return cacheRef.current.info.pathKeyEntities;
31
29
  }, [fieldNames, options]);
32
30
  return getEntities;
@@ -6,7 +6,6 @@ export default ((options, fieldNames) => {
6
6
  const existsValues = [];
7
7
  rawValues.forEach(valueCell => {
8
8
  const pathOptions = toPathOptions(valueCell, options, fieldNames);
9
-
10
9
  if (pathOptions.every(opt => opt.option)) {
11
10
  existsValues.push(valueCell);
12
11
  } else {
@@ -4,7 +4,6 @@ import * as React from 'react';
4
4
  * Same as `React.useCallback` but always return a memoized function
5
5
  * but redirect to real function.
6
6
  */
7
-
8
7
  export default function useRefFunc(callback) {
9
8
  const funcRef = React.useRef();
10
9
  funcRef.current = callback;
@@ -1,30 +1,25 @@
1
1
  // @ts-nocheck
2
2
  import * as React from 'react';
3
- import warning from 'rc-util/lib/warning'; // Convert `showSearch` to unique config
4
-
3
+ import warning from 'rc-util/lib/warning';
4
+ // Convert `showSearch` to unique config
5
5
  export default function useSearchConfig(showSearch) {
6
6
  return React.useMemo(() => {
7
7
  if (!showSearch) {
8
8
  return [false, {}];
9
9
  }
10
-
11
10
  let searchConfig = {
12
11
  matchInputWidth: true,
13
12
  limit: 50
14
13
  };
15
-
16
14
  if (showSearch && typeof showSearch === 'object') {
17
15
  searchConfig = Object.assign(Object.assign({}, searchConfig), showSearch);
18
16
  }
19
-
20
17
  if (searchConfig.limit <= 0) {
21
18
  delete searchConfig.limit;
22
-
23
19
  if (process.env.NODE_ENV !== 'production') {
24
20
  warning(false, "'limit' of showSearch should be positive number or false.");
25
21
  }
26
22
  }
27
-
28
23
  return [true, searchConfig];
29
24
  }, [showSearch]);
30
25
  }
@@ -1,12 +1,9 @@
1
1
  import * as React from 'react';
2
2
  export const SEARCH_MARK = '__rc_cascader_search_mark__';
3
-
4
3
  const defaultFilter = (search, options, {
5
4
  label
6
5
  }) => options.some(opt => String(opt[label]).toLowerCase().includes(search.toLowerCase()));
7
-
8
6
  const defaultRender = (inputValue, path, prefixCls, fieldNames) => path.map(opt => opt[fieldNames.label]).join(' / ');
9
-
10
7
  export default ((search, options, fieldNames, prefixCls, config, changeOnSelect) => {
11
8
  const {
12
9
  filter = defaultFilter,
@@ -16,23 +13,22 @@ export default ((search, options, fieldNames, prefixCls, config, changeOnSelect)
16
13
  } = config;
17
14
  return React.useMemo(() => {
18
15
  const filteredOptions = [];
19
-
20
16
  if (!search) {
21
17
  return [];
22
18
  }
23
-
24
19
  function dig(list, pathOptions) {
25
20
  list.forEach(option => {
26
21
  // Perf saving when `sort` is disabled and `limit` is provided
27
22
  if (!sort && limit > 0 && filteredOptions.length >= limit) {
28
23
  return;
29
24
  }
30
-
31
25
  const connectedPathOptions = [...pathOptions, option];
32
- const children = option[fieldNames.children]; // If current option is filterable
33
-
34
- if ( // If is leaf option
35
- !children || children.length === 0 || // If is changeOnSelect
26
+ const children = option[fieldNames.children];
27
+ // If current option is filterable
28
+ if (
29
+ // If is leaf option
30
+ !children || children.length === 0 ||
31
+ // If is changeOnSelect
36
32
  changeOnSelect) {
37
33
  if (filter(search, connectedPathOptions, {
38
34
  label: fieldNames.label
@@ -43,21 +39,18 @@ export default ((search, options, fieldNames, prefixCls, config, changeOnSelect)
43
39
  }));
44
40
  }
45
41
  }
46
-
47
42
  if (children) {
48
43
  dig(option[fieldNames.children], connectedPathOptions);
49
44
  }
50
45
  });
51
46
  }
52
-
53
- dig(options, []); // Do sort
54
-
47
+ dig(options, []);
48
+ // Do sort
55
49
  if (sort) {
56
50
  filteredOptions.sort((a, b) => {
57
51
  return sort(a[SEARCH_MARK], b[SEARCH_MARK], search, fieldNames);
58
52
  });
59
53
  }
60
-
61
54
  return limit > 0 ? filteredOptions.slice(0, limit) : filteredOptions;
62
55
  }, [search, options, fieldNames, prefixCls, render, changeOnSelect, filter, sort, limit]);
63
56
  });