tntd 2.0.13 → 2.0.14

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 (431) hide show
  1. package/es/array-input/index.js +31 -6
  2. package/es/columns/index.js +12 -6
  3. package/es/development-login/LoginModal.js +10 -4
  4. package/es/drawer/drawer.js +8 -4
  5. package/es/ellipsis/index.js +25 -14
  6. package/es/empty/empty.js +13 -9
  7. package/es/handle/index.js +27 -14
  8. package/es/img/Contain.js +19 -13
  9. package/es/img/Cover.js +24 -13
  10. package/es/img/index.js +21 -14
  11. package/es/index.js +1 -0
  12. package/es/loading-button/index.js +13 -6
  13. package/es/locale/default.js +2 -0
  14. package/es/locale/en_US.js +2 -0
  15. package/es/locale/zh_CN.js +2 -0
  16. package/es/page/Box.js +28 -19
  17. package/es/page/index.js +38 -22
  18. package/es/page/utils.js +5 -0
  19. package/es/prev-locale.js +3 -0
  20. package/es/query-form/Field/Checkbox.js +8 -4
  21. package/es/query-form/Field/Select.js +17 -10
  22. package/es/query-form/Field/SelectInput.js +18 -4
  23. package/es/query-form/Field/fieldsMap.js +1 -0
  24. package/es/query-form/Field/index.js +11 -2
  25. package/es/query-form/createActions.js +8 -0
  26. package/es/query-form/index.js +34 -2
  27. package/es/query-list-scene/List.js +39 -18
  28. package/es/query-list-scene/QueryForm.js +19 -10
  29. package/es/query-list-scene/QueryListScene.js +2 -0
  30. package/es/query-list-scene/Toolbar.js +10 -6
  31. package/es/query-list-scene/createActions.js +3 -0
  32. package/es/render-empty/render-empty.js +2 -0
  33. package/es/steps/steps.js +17 -9
  34. package/es/steps/style/nav.less +3 -1
  35. package/es/svg-components/illustration-403.js +2 -0
  36. package/es/svg-components/illustration-404.js +2 -0
  37. package/es/svg-components/illustration-500.js +2 -0
  38. package/es/svg-components/illustration-empty.js +2 -0
  39. package/es/svg-components/illustration-failure.js +2 -0
  40. package/es/svg-components/illustration-no-access.js +2 -0
  41. package/es/svg-components/illustration-no-chart.js +2 -0
  42. package/es/svg-components/illustration-no-result.js +2 -0
  43. package/es/svg-components/illustration-offline.js +2 -0
  44. package/es/svg-components/illustration-success.js +2 -0
  45. package/es/table/assets/image-loading-background.js +2 -0
  46. package/es/table/assets/image-loading.js +2 -0
  47. package/es/table/hooks/use-column-setting.js +1 -0
  48. package/es/table/table.js +19 -14
  49. package/es/table/table.stories.js +2 -0
  50. package/es/table/utils.js +6 -2
  51. package/es/title/index.js +14 -10
  52. package/es/tntd-cascader/AntdCascader/component/context.js +4 -2
  53. package/es/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js +2 -0
  54. package/es/tntd-cascader/AntdCascader/component/getIcons.js +15 -6
  55. package/es/tntd-cascader/AntdCascader/config/utils.js +2 -0
  56. package/es/tntd-cascader/AntdCascader/config/warning.js +8 -4
  57. package/es/tntd-cascader/AntdCascader/index.js +73 -51
  58. package/es/tntd-cascader/rc-cascader/Cascader.js +113 -86
  59. package/es/tntd-cascader/rc-cascader/OptionList/Column.js +26 -16
  60. package/es/tntd-cascader/rc-cascader/OptionList/index.js +43 -26
  61. package/es/tntd-cascader/rc-cascader/OptionList/useActive.js +7 -5
  62. package/es/tntd-cascader/rc-cascader/OptionList/useKeyboard.js +41 -12
  63. package/es/tntd-cascader/rc-cascader/hooks/useDisplayValues.js +10 -4
  64. package/es/tntd-cascader/rc-cascader/hooks/useEntities.js +4 -2
  65. package/es/tntd-cascader/rc-cascader/hooks/useMissingValues.js +1 -0
  66. package/es/tntd-cascader/rc-cascader/hooks/useRefFunc.js +1 -0
  67. package/es/tntd-cascader/rc-cascader/hooks/useSearchConfig.js +7 -2
  68. package/es/tntd-cascader/rc-cascader/hooks/useSearchOptions.js +15 -8
  69. package/es/tntd-cascader/rc-cascader/utils/commonUtil.js +6 -2
  70. package/es/tntd-cascader/rc-cascader/utils/treeUtil.js +4 -2
  71. package/es/tntd-cascader/rc-cascader/utils/warningPropsUtil.js +7 -2
  72. package/es/tntd-icon/fonts/iconfont.js +12 -7
  73. package/es/tntd-icon/index.js +9 -5
  74. package/es/tntd-layout/ActionsContext.js +2 -2
  75. package/es/tntd-layout/AppList.js +14 -2
  76. package/es/tntd-layout/Application.js +4 -0
  77. package/es/tntd-layout/Avatar.js +4 -0
  78. package/es/tntd-layout/CompatibleLanguage.js +13 -0
  79. package/es/tntd-layout/EnterpriseLayout/Avatar.js +4 -0
  80. package/es/tntd-layout/EnterpriseLayout/Language.js +6 -0
  81. package/es/tntd-layout/EnterpriseLayout/Theme.js +4 -0
  82. package/es/tntd-layout/EnterpriseLayout/index.js +2 -2
  83. package/es/tntd-layout/GlobalNavigation/NavigationPopup.js +33 -2
  84. package/es/tntd-layout/GlobalNavigation/index.js +6 -0
  85. package/es/tntd-layout/HeaderActions.js +32 -28
  86. package/es/tntd-layout/HeaderNavs.js +14 -6
  87. package/es/tntd-layout/HeaderTabs.js +35 -14
  88. package/es/tntd-layout/Language.js +6 -0
  89. package/es/tntd-layout/Layout.js +7 -2
  90. package/es/tntd-layout/Logo.js +11 -4
  91. package/es/tntd-layout/OrgAppList.js +39 -22
  92. package/es/tntd-layout/SideMenu.js +45 -8
  93. package/es/tntd-layout/Theme.js +6 -0
  94. package/es/tntd-layout/index.js +17 -9
  95. package/es/tntd-layout/paaslayout/CompactSideMenu.js +15 -0
  96. package/es/tntd-layout/paaslayout/SideMenu.js +15 -0
  97. package/es/tntd-layout/paaslayout/index.js +13 -4
  98. package/es/tntd-layout/storage.js +2 -2
  99. package/es/tntd-modal/index.js +18 -12
  100. package/es/tntd-second-page/index.js +3 -0
  101. package/es/tntd-select/DropDownWrap.js +8 -4
  102. package/es/tntd-select/index.js +118 -74
  103. package/es/utils/checkAuth.js +1 -0
  104. package/es/utils/findMenuInfoByPath.js +3 -0
  105. package/es/utils/index.js +11 -2
  106. package/lib/affix/index.js +10 -4
  107. package/lib/alert/index.js +10 -4
  108. package/lib/anchor/index.js +10 -4
  109. package/lib/array-input/icon.js +7 -1
  110. package/lib/array-input/index.js +91 -41
  111. package/lib/auth-context/index.js +3 -0
  112. package/lib/auto-complete/index.js +10 -4
  113. package/lib/avatar/index.js +10 -4
  114. package/lib/back-top/index.js +10 -4
  115. package/lib/badge/index.js +10 -4
  116. package/lib/breadcrumb/index.js +10 -4
  117. package/lib/button/index.js +10 -4
  118. package/lib/calendar/index.js +10 -4
  119. package/lib/card/index.js +10 -4
  120. package/lib/carousel/index.js +10 -4
  121. package/lib/cascader/index.js +10 -4
  122. package/lib/checkbox/index.js +10 -4
  123. package/lib/col/index.js +10 -4
  124. package/lib/collapse/index.js +11 -4
  125. package/lib/columns/index.js +28 -14
  126. package/lib/comment/index.js +10 -4
  127. package/lib/config-provider/config-provider.js +2 -0
  128. package/lib/config-provider/index.js +10 -4
  129. package/lib/date-picker/index.js +10 -4
  130. package/lib/descriptions/index.js +10 -4
  131. package/lib/development-login/LoginModal.js +50 -25
  132. package/lib/development-login/index.js +22 -11
  133. package/lib/divider/index.js +10 -4
  134. package/lib/drawer/drawer.js +16 -6
  135. package/lib/drawer/index.js +5 -1
  136. package/lib/dropdown/index.js +10 -4
  137. package/lib/ellipsis/Svg/CopySVG.js +4 -0
  138. package/lib/ellipsis/Svg/TickSVG.js +4 -0
  139. package/lib/ellipsis/index.js +73 -42
  140. package/lib/empty/empty.js +30 -14
  141. package/lib/empty/empty.stories.js +21 -3
  142. package/lib/empty/index.js +5 -1
  143. package/lib/exception/exception.js +14 -7
  144. package/lib/exception/index.js +4 -1
  145. package/lib/form/index.js +10 -4
  146. package/lib/handle/index.js +46 -19
  147. package/lib/icon/index.js +10 -4
  148. package/lib/img/Contain.js +23 -12
  149. package/lib/img/Cover.js +53 -31
  150. package/lib/img/index.js +47 -29
  151. package/lib/index.js +187 -100
  152. package/lib/input/index.js +10 -4
  153. package/lib/input-number/index.js +10 -4
  154. package/lib/layout/index.js +10 -4
  155. package/lib/list/index.js +10 -4
  156. package/lib/loading-button/index.js +32 -15
  157. package/lib/locale/default.js +5 -0
  158. package/lib/locale/en_US.js +4 -0
  159. package/lib/locale/index.js +6 -3
  160. package/lib/locale/zh_CN.js +4 -0
  161. package/lib/locale-provider/index.js +10 -4
  162. package/lib/mention/index.js +10 -4
  163. package/lib/mentions/index.js +10 -4
  164. package/lib/menu/index.js +10 -4
  165. package/lib/message/index.js +11 -4
  166. package/lib/modal/index.js +11 -4
  167. package/lib/notification/index.js +10 -4
  168. package/lib/page/Box.js +37 -24
  169. package/lib/page/index.js +66 -37
  170. package/lib/page/utils.js +9 -1
  171. package/lib/page-header/index.js +10 -4
  172. package/lib/pagination/index.js +10 -4
  173. package/lib/popconfirm/index.js +10 -4
  174. package/lib/popover/index.js +10 -4
  175. package/lib/prev-locale.js +10 -1
  176. package/lib/progress/index.js +10 -4
  177. package/lib/query-form/Field/Checkbox.js +11 -2
  178. package/lib/query-form/Field/Select.js +45 -27
  179. package/lib/query-form/Field/SelectInput.js +46 -21
  180. package/lib/query-form/Field/fieldsMap.js +12 -1
  181. package/lib/query-form/Field/index.js +70 -38
  182. package/lib/query-form/createActions.js +7 -0
  183. package/lib/query-form/index.js +121 -52
  184. package/lib/query-form/useForm.js +4 -0
  185. package/lib/query-list-scene/List.js +111 -58
  186. package/lib/query-list-scene/QueryForm.js +67 -37
  187. package/lib/query-list-scene/QueryListScene.js +42 -21
  188. package/lib/query-list-scene/Title.js +5 -1
  189. package/lib/query-list-scene/Toolbar.js +15 -8
  190. package/lib/query-list-scene/createActions.js +6 -0
  191. package/lib/query-list-scene/index.js +10 -0
  192. package/lib/query-list-scene/useActions.js +4 -0
  193. package/lib/radio/index.js +10 -4
  194. package/lib/rate/index.js +10 -4
  195. package/lib/render-empty/index.js +2 -0
  196. package/lib/render-empty/render-empty.js +8 -0
  197. package/lib/result/index.js +10 -4
  198. package/lib/row/index.js +10 -4
  199. package/lib/select/index.js +10 -4
  200. package/lib/skeleton/index.js +10 -4
  201. package/lib/slider/index.js +10 -4
  202. package/lib/spin/index.js +10 -4
  203. package/lib/statistic/index.js +10 -4
  204. package/lib/steps/index.js +5 -1
  205. package/lib/steps/steps.js +29 -12
  206. package/lib/steps/style/nav.less +3 -1
  207. package/lib/svg-components/illustration-403.js +9 -3
  208. package/lib/svg-components/illustration-404.js +9 -3
  209. package/lib/svg-components/illustration-500.js +9 -3
  210. package/lib/svg-components/illustration-empty.js +9 -3
  211. package/lib/svg-components/illustration-failure.js +9 -3
  212. package/lib/svg-components/illustration-no-access.js +9 -3
  213. package/lib/svg-components/illustration-no-chart.js +9 -3
  214. package/lib/svg-components/illustration-no-result.js +9 -3
  215. package/lib/svg-components/illustration-offline.js +9 -3
  216. package/lib/svg-components/illustration-success.js +9 -3
  217. package/lib/svg-components/index.js +11 -0
  218. package/lib/switch/index.js +10 -4
  219. package/lib/table/assets/image-loading-background.js +9 -3
  220. package/lib/table/assets/image-loading.js +9 -3
  221. package/lib/table/context.js +2 -0
  222. package/lib/table/hooks/index.js +2 -1
  223. package/lib/table/hooks/use-column-setting.js +16 -8
  224. package/lib/table/index.js +5 -1
  225. package/lib/table/table.js +63 -34
  226. package/lib/table/table.stories.js +11 -2
  227. package/lib/table/utils.js +11 -2
  228. package/lib/tabs/index.js +10 -4
  229. package/lib/tag/index.js +10 -4
  230. package/lib/time-picker/index.js +10 -4
  231. package/lib/timeline/index.js +10 -4
  232. package/lib/title/index.js +20 -10
  233. package/lib/tntd-cascader/AntdCascader/component/DisabledContext.js +11 -4
  234. package/lib/tntd-cascader/AntdCascader/component/FormItemInputContext.js +8 -3
  235. package/lib/tntd-cascader/AntdCascader/component/SizeContext.js +8 -3
  236. package/lib/tntd-cascader/AntdCascader/component/context.js +9 -3
  237. package/lib/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js +12 -4
  238. package/lib/tntd-cascader/AntdCascader/component/getIcons.js +37 -19
  239. package/lib/tntd-cascader/AntdCascader/component/useCompactItemContext.js +17 -8
  240. package/lib/tntd-cascader/AntdCascader/config/utils.js +15 -6
  241. package/lib/tntd-cascader/AntdCascader/config/warning.js +15 -7
  242. package/lib/tntd-cascader/AntdCascader/index.js +133 -80
  243. package/lib/tntd-cascader/AntdCascader/interface.js +3 -0
  244. package/lib/tntd-cascader/index.js +2 -0
  245. package/lib/tntd-cascader/rc-cascader/Cascader.js +188 -123
  246. package/lib/tntd-cascader/rc-cascader/OptionList/Checkbox.js +21 -11
  247. package/lib/tntd-cascader/rc-cascader/OptionList/Column.js +88 -60
  248. package/lib/tntd-cascader/rc-cascader/OptionList/index.js +109 -65
  249. package/lib/tntd-cascader/rc-cascader/OptionList/useActive.js +33 -18
  250. package/lib/tntd-cascader/rc-cascader/OptionList/useKeyboard.js +106 -56
  251. package/lib/tntd-cascader/rc-cascader/context.js +8 -3
  252. package/lib/tntd-cascader/rc-cascader/hooks/useDisplayValues.js +31 -14
  253. package/lib/tntd-cascader/rc-cascader/hooks/useEntities.js +15 -5
  254. package/lib/tntd-cascader/rc-cascader/hooks/useMissingValues.js +11 -3
  255. package/lib/tntd-cascader/rc-cascader/hooks/useRefFunc.js +8 -3
  256. package/lib/tntd-cascader/rc-cascader/hooks/useSearchConfig.js +15 -3
  257. package/lib/tntd-cascader/rc-cascader/hooks/useSearchOptions.js +41 -26
  258. package/lib/tntd-cascader/rc-cascader/index.js +3 -0
  259. package/lib/tntd-cascader/rc-cascader/utils/commonUtil.js +20 -9
  260. package/lib/tntd-cascader/rc-cascader/utils/treeUtil.js +8 -0
  261. package/lib/tntd-cascader/rc-cascader/utils/warningPropsUtil.js +14 -7
  262. package/lib/tntd-icon/fonts/iconfont.js +12 -7
  263. package/lib/tntd-icon/index.js +17 -6
  264. package/lib/tntd-layout/ActionsContext.js +3 -0
  265. package/lib/tntd-layout/AppList.js +105 -30
  266. package/lib/tntd-layout/Application.js +84 -22
  267. package/lib/tntd-layout/Avatar.js +72 -18
  268. package/lib/tntd-layout/CompatibleLanguage.js +105 -32
  269. package/lib/tntd-layout/EnterpriseLayout/Avatar.js +80 -24
  270. package/lib/tntd-layout/EnterpriseLayout/Language.js +45 -14
  271. package/lib/tntd-layout/EnterpriseLayout/Theme.js +46 -16
  272. package/lib/tntd-layout/EnterpriseLayout/index.js +12 -4
  273. package/lib/tntd-layout/GlobalNavigation/NavigationPopup.js +174 -45
  274. package/lib/tntd-layout/GlobalNavigation/index.js +70 -19
  275. package/lib/tntd-layout/Header.js +54 -20
  276. package/lib/tntd-layout/HeaderActions.js +64 -33
  277. package/lib/tntd-layout/HeaderNavs.js +59 -19
  278. package/lib/tntd-layout/HeaderTabs.js +111 -43
  279. package/lib/tntd-layout/Iconfont.js +5 -0
  280. package/lib/tntd-layout/Language.js +45 -14
  281. package/lib/tntd-layout/Layout.js +113 -74
  282. package/lib/tntd-layout/Logo.js +41 -14
  283. package/lib/tntd-layout/OrgAppList.js +119 -51
  284. package/lib/tntd-layout/SideMenu.js +120 -42
  285. package/lib/tntd-layout/Theme.js +71 -19
  286. package/lib/tntd-layout/createActions.js +5 -0
  287. package/lib/tntd-layout/images/index.js +28 -0
  288. package/lib/tntd-layout/index.js +49 -21
  289. package/lib/tntd-layout/paaslayout/CompactSideMenu.js +81 -29
  290. package/lib/tntd-layout/paaslayout/Header.js +47 -14
  291. package/lib/tntd-layout/paaslayout/Logo.js +19 -2
  292. package/lib/tntd-layout/paaslayout/SideMenu.js +82 -31
  293. package/lib/tntd-layout/paaslayout/index.js +108 -62
  294. package/lib/tntd-layout/storage.d.ts +1 -1
  295. package/lib/tntd-layout/storage.d.ts.map +1 -1
  296. package/lib/tntd-layout/storage.js +33 -3
  297. package/lib/tntd-modal/index.js +51 -32
  298. package/lib/tntd-second-page/index.js +24 -14
  299. package/lib/tntd-select/DropDownWrap.js +45 -24
  300. package/lib/tntd-select/index.js +206 -117
  301. package/lib/tooltip/index.js +10 -4
  302. package/lib/transfer/index.js +10 -4
  303. package/lib/tree/index.js +10 -4
  304. package/lib/tree-select/index.js +10 -4
  305. package/lib/typography/index.js +10 -4
  306. package/lib/upload/index.js +10 -4
  307. package/lib/utils/checkAuth.js +10 -4
  308. package/lib/utils/findMenuInfoByPath.js +7 -1
  309. package/lib/utils/index.js +41 -13
  310. package/lib/version/index.js +10 -4
  311. package/package.json +1 -1
  312. package/es/array-input/style/index.js +0 -1
  313. package/es/array-input/style/index.js.map +0 -1
  314. package/es/auth-context/style/index.js +0 -1
  315. package/es/auth-context/style/index.js.map +0 -1
  316. package/es/development-login/style/index.js +0 -1
  317. package/es/development-login/style/index.js.map +0 -1
  318. package/es/ellipsis/style/index.js +0 -1
  319. package/es/ellipsis/style/index.js.map +0 -1
  320. package/es/empty/render-empty.js +0 -22
  321. package/es/empty/render-empty.js.map +0 -1
  322. package/es/empty/style/index.js +0 -2
  323. package/es/empty/style/index.js.map +0 -1
  324. package/es/handle/style/index.js +0 -1
  325. package/es/handle/style/index.js.map +0 -1
  326. package/es/icon-list/style/index.js +0 -1
  327. package/es/icon-list/style/index.js.map +0 -1
  328. package/es/img/style/index.js +0 -1
  329. package/es/img/style/index.js.map +0 -1
  330. package/es/loading-button/style/index.js +0 -1
  331. package/es/loading-button/style/index.js.map +0 -1
  332. package/es/page/style/index.js +0 -1
  333. package/es/page/style/index.js.map +0 -1
  334. package/es/query-form/style/index.js +0 -1
  335. package/es/query-form/style/index.js.map +0 -1
  336. package/es/query-list-scene/style/index.js +0 -1
  337. package/es/query-list-scene/style/index.js.map +0 -1
  338. package/es/render-empty/style/index.js +0 -1
  339. package/es/render-empty/style/index.js.map +0 -1
  340. package/es/table/style/index.js +0 -2
  341. package/es/table/style/index.js.map +0 -1
  342. package/es/title/style/index.js +0 -1
  343. package/es/title/style/index.js.map +0 -1
  344. package/es/tntd-icon/style/index.js +0 -1
  345. package/es/tntd-icon/style/index.js.map +0 -1
  346. package/es/tntd-layout/style/index.js +0 -1
  347. package/es/tntd-layout/style/index.js.map +0 -1
  348. package/es/tntd-modal/style/index.js +0 -1
  349. package/es/tntd-modal/style/index.js.map +0 -1
  350. package/es/tntd-select/style/index.js +0 -1
  351. package/es/tntd-select/style/index.js.map +0 -1
  352. package/lib/array-input/style/index.d.ts +0 -1
  353. package/lib/array-input/style/index.d.ts.map +0 -1
  354. package/lib/array-input/style/index.js +0 -1
  355. package/lib/array-input/style/index.js.map +0 -1
  356. package/lib/auth-context/style/index.d.ts +0 -1
  357. package/lib/auth-context/style/index.d.ts.map +0 -1
  358. package/lib/auth-context/style/index.js +0 -1
  359. package/lib/auth-context/style/index.js.map +0 -1
  360. package/lib/development-login/style/index.d.ts +0 -1
  361. package/lib/development-login/style/index.d.ts.map +0 -1
  362. package/lib/development-login/style/index.js +0 -1
  363. package/lib/development-login/style/index.js.map +0 -1
  364. package/lib/ellipsis/style/index.d.ts +0 -1
  365. package/lib/ellipsis/style/index.d.ts.map +0 -1
  366. package/lib/ellipsis/style/index.js +0 -1
  367. package/lib/ellipsis/style/index.js.map +0 -1
  368. package/lib/empty/render-empty.d.ts +0 -3
  369. package/lib/empty/render-empty.d.ts.map +0 -1
  370. package/lib/empty/render-empty.js +0 -32
  371. package/lib/empty/render-empty.js.map +0 -1
  372. package/lib/empty/style/index.d.ts +0 -3
  373. package/lib/empty/style/index.d.ts.map +0 -1
  374. package/lib/empty/style/index.js +0 -4
  375. package/lib/empty/style/index.js.map +0 -1
  376. package/lib/handle/style/index.d.ts +0 -1
  377. package/lib/handle/style/index.d.ts.map +0 -1
  378. package/lib/handle/style/index.js +0 -1
  379. package/lib/handle/style/index.js.map +0 -1
  380. package/lib/icon-list/style/index.d.ts +0 -3
  381. package/lib/icon-list/style/index.d.ts.map +0 -1
  382. package/lib/icon-list/style/index.js +0 -8
  383. package/lib/icon-list/style/index.js.map +0 -1
  384. package/lib/img/style/index.d.ts +0 -1
  385. package/lib/img/style/index.d.ts.map +0 -1
  386. package/lib/img/style/index.js +0 -1
  387. package/lib/img/style/index.js.map +0 -1
  388. package/lib/loading-button/style/index.d.ts +0 -1
  389. package/lib/loading-button/style/index.d.ts.map +0 -1
  390. package/lib/loading-button/style/index.js +0 -1
  391. package/lib/loading-button/style/index.js.map +0 -1
  392. package/lib/page/style/index.d.ts +0 -1
  393. package/lib/page/style/index.d.ts.map +0 -1
  394. package/lib/page/style/index.js +0 -1
  395. package/lib/page/style/index.js.map +0 -1
  396. package/lib/query-form/style/index.d.ts +0 -1
  397. package/lib/query-form/style/index.d.ts.map +0 -1
  398. package/lib/query-form/style/index.js +0 -1
  399. package/lib/query-form/style/index.js.map +0 -1
  400. package/lib/query-list-scene/style/index.d.ts +0 -1
  401. package/lib/query-list-scene/style/index.d.ts.map +0 -1
  402. package/lib/query-list-scene/style/index.js +0 -1
  403. package/lib/query-list-scene/style/index.js.map +0 -1
  404. package/lib/render-empty/style/index.d.ts +0 -2
  405. package/lib/render-empty/style/index.d.ts.map +0 -1
  406. package/lib/render-empty/style/index.js +0 -3
  407. package/lib/render-empty/style/index.js.map +0 -1
  408. package/lib/table/style/index.d.ts +0 -3
  409. package/lib/table/style/index.d.ts.map +0 -1
  410. package/lib/table/style/index.js +0 -4
  411. package/lib/table/style/index.js.map +0 -1
  412. package/lib/title/style/index.d.ts +0 -1
  413. package/lib/title/style/index.d.ts.map +0 -1
  414. package/lib/title/style/index.js +0 -1
  415. package/lib/title/style/index.js.map +0 -1
  416. package/lib/tntd-icon/style/index.d.ts +0 -1
  417. package/lib/tntd-icon/style/index.d.ts.map +0 -1
  418. package/lib/tntd-icon/style/index.js +0 -1
  419. package/lib/tntd-icon/style/index.js.map +0 -1
  420. package/lib/tntd-layout/style/index.d.ts +0 -1
  421. package/lib/tntd-layout/style/index.d.ts.map +0 -1
  422. package/lib/tntd-layout/style/index.js +0 -1
  423. package/lib/tntd-layout/style/index.js.map +0 -1
  424. package/lib/tntd-modal/style/index.d.ts +0 -1
  425. package/lib/tntd-modal/style/index.d.ts.map +0 -1
  426. package/lib/tntd-modal/style/index.js +0 -1
  427. package/lib/tntd-modal/style/index.js.map +0 -1
  428. package/lib/tntd-select/style/index.d.ts +0 -1
  429. package/lib/tntd-select/style/index.d.ts.map +0 -1
  430. package/lib/tntd-select/style/index.js +0 -1
  431. package/lib/tntd-select/style/index.js.map +0 -1
@@ -1,128 +1,170 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
3
+ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4
+
4
5
  Object.defineProperty(exports, "__esModule", {
5
6
  value: true
6
7
  });
7
8
  exports["default"] = void 0;
9
+
8
10
  var _rcSelect = require("rc-select");
11
+
9
12
  var _useId = _interopRequireDefault(require("rc-select/lib/hooks/useId"));
13
+
10
14
  var _conductUtil = require("rc-tree/lib/utils/conductUtil");
15
+
11
16
  var _useMergedState5 = _interopRequireDefault(require("rc-util/lib/hooks/useMergedState"));
17
+
12
18
  var React = _interopRequireWildcard(require("react"));
19
+
13
20
  var _context = _interopRequireDefault(require("./context"));
21
+
14
22
  var _useDisplayValues = _interopRequireDefault(require("./hooks/useDisplayValues"));
23
+
15
24
  var _useEntities = _interopRequireDefault(require("./hooks/useEntities"));
25
+
16
26
  var _useMissingValues = _interopRequireDefault(require("./hooks/useMissingValues"));
27
+
17
28
  var _useRefFunc = _interopRequireDefault(require("./hooks/useRefFunc"));
29
+
18
30
  var _useSearchConfig3 = _interopRequireDefault(require("./hooks/useSearchConfig"));
31
+
19
32
  var _useSearchOptions = _interopRequireDefault(require("./hooks/useSearchOptions"));
33
+
20
34
  var _OptionList = _interopRequireDefault(require("./OptionList"));
35
+
21
36
  var _commonUtil = require("./utils/commonUtil");
37
+
22
38
  var _treeUtil = require("./utils/treeUtil");
39
+
23
40
  var _warningPropsUtil = _interopRequireWildcard(require("./utils/warningPropsUtil"));
41
+
24
42
  require("./index.less");
25
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
26
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
43
+
44
+ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
45
+
46
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
47
+
27
48
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
28
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
29
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
30
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
31
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
32
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
33
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
34
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
35
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
36
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
49
+
50
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
51
+
52
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
53
+
54
+ function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
55
+
56
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
57
+
58
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
59
+
60
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
61
+
62
+ function _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
63
+
37
64
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
65
+
38
66
  var __rest = void 0 && (void 0).__rest || function (s, e) {
39
67
  var t = {};
68
+
40
69
  for (var p in s) {
41
70
  if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
42
71
  }
72
+
43
73
  if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
44
74
  if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
45
75
  }
46
76
  return t;
47
77
  };
78
+
48
79
  function isMultipleValue(value) {
49
80
  return Array.isArray(value) && Array.isArray(value[0]);
50
81
  }
82
+
51
83
  function toRawValues(value) {
52
84
  if (!value) {
53
85
  return [];
54
86
  }
87
+
55
88
  if (isMultipleValue(value)) {
56
89
  return value;
57
90
  }
91
+
58
92
  return (value.length === 0 ? [] : [value]).map(function (val) {
59
93
  return Array.isArray(val) ? val : [val];
60
94
  });
61
95
  }
96
+
62
97
  var Cascader = React.forwardRef(function (props, ref) {
63
98
  var id = props.id,
64
- _props$prefixCls = props.prefixCls,
65
- prefixCls = _props$prefixCls === void 0 ? 'rc-cascader' : _props$prefixCls,
66
- fieldNames = props.fieldNames,
67
- defaultValue = props.defaultValue,
68
- value = props.value,
69
- changeOnSelect = props.changeOnSelect,
70
- onChange = props.onChange,
71
- displayRender = props.displayRender,
72
- checkable = props.checkable,
73
- searchValue = props.searchValue,
74
- onSearch = props.onSearch,
75
- showSearch = props.showSearch,
76
- expandTrigger = props.expandTrigger,
77
- options = props.options,
78
- dropdownPrefixCls = props.dropdownPrefixCls,
79
- loadData = props.loadData,
80
- popupVisible = props.popupVisible,
81
- open = props.open,
82
- popupClassName = props.popupClassName,
83
- dropdownClassName = props.dropdownClassName,
84
- dropdownMenuColumnStyle = props.dropdownMenuColumnStyle,
85
- popupPlacement = props.popupPlacement,
86
- placement = props.placement,
87
- onDropdownVisibleChange = props.onDropdownVisibleChange,
88
- onPopupVisibleChange = props.onPopupVisibleChange,
89
- renderItem = props.renderItem,
90
- _props$expandIcon = props.expandIcon,
91
- expandIcon = _props$expandIcon === void 0 ? '>' : _props$expandIcon,
92
- loadingIcon = props.loadingIcon,
93
- children = props.children,
94
- _props$dropdownMatchS = props.dropdownMatchSelectWidth,
95
- dropdownMatchSelectWidth = _props$dropdownMatchS === void 0 ? false : _props$dropdownMatchS,
96
- _props$showCheckedStr = props.showCheckedStrategy,
97
- showCheckedStrategy = _props$showCheckedStr === void 0 ? _commonUtil.SHOW_PARENT : _props$showCheckedStr,
98
- restProps = __rest(props, ["id", "prefixCls", "fieldNames", "defaultValue", "value", "changeOnSelect", "onChange", "displayRender", "checkable", "searchValue", "onSearch", "showSearch", "expandTrigger", "options", "dropdownPrefixCls", "loadData", "popupVisible", "open", "popupClassName", "dropdownClassName", "dropdownMenuColumnStyle", "popupPlacement", "placement", "onDropdownVisibleChange", "onPopupVisibleChange", "renderItem", "expandIcon", "loadingIcon", "children", "dropdownMatchSelectWidth", "showCheckedStrategy"]);
99
+ _props$prefixCls = props.prefixCls,
100
+ prefixCls = _props$prefixCls === void 0 ? 'rc-cascader' : _props$prefixCls,
101
+ fieldNames = props.fieldNames,
102
+ defaultValue = props.defaultValue,
103
+ value = props.value,
104
+ changeOnSelect = props.changeOnSelect,
105
+ onChange = props.onChange,
106
+ displayRender = props.displayRender,
107
+ checkable = props.checkable,
108
+ searchValue = props.searchValue,
109
+ onSearch = props.onSearch,
110
+ showSearch = props.showSearch,
111
+ expandTrigger = props.expandTrigger,
112
+ options = props.options,
113
+ dropdownPrefixCls = props.dropdownPrefixCls,
114
+ loadData = props.loadData,
115
+ popupVisible = props.popupVisible,
116
+ open = props.open,
117
+ popupClassName = props.popupClassName,
118
+ dropdownClassName = props.dropdownClassName,
119
+ dropdownMenuColumnStyle = props.dropdownMenuColumnStyle,
120
+ popupPlacement = props.popupPlacement,
121
+ placement = props.placement,
122
+ onDropdownVisibleChange = props.onDropdownVisibleChange,
123
+ onPopupVisibleChange = props.onPopupVisibleChange,
124
+ renderItem = props.renderItem,
125
+ _props$expandIcon = props.expandIcon,
126
+ expandIcon = _props$expandIcon === void 0 ? '>' : _props$expandIcon,
127
+ loadingIcon = props.loadingIcon,
128
+ children = props.children,
129
+ _props$dropdownMatchS = props.dropdownMatchSelectWidth,
130
+ dropdownMatchSelectWidth = _props$dropdownMatchS === void 0 ? false : _props$dropdownMatchS,
131
+ _props$showCheckedStr = props.showCheckedStrategy,
132
+ showCheckedStrategy = _props$showCheckedStr === void 0 ? _commonUtil.SHOW_PARENT : _props$showCheckedStr,
133
+ restProps = __rest(props, ["id", "prefixCls", "fieldNames", "defaultValue", "value", "changeOnSelect", "onChange", "displayRender", "checkable", "searchValue", "onSearch", "showSearch", "expandTrigger", "options", "dropdownPrefixCls", "loadData", "popupVisible", "open", "popupClassName", "dropdownClassName", "dropdownMenuColumnStyle", "popupPlacement", "placement", "onDropdownVisibleChange", "onPopupVisibleChange", "renderItem", "expandIcon", "loadingIcon", "children", "dropdownMatchSelectWidth", "showCheckedStrategy"]);
134
+
99
135
  var mergedId = (0, _useId["default"])(id);
100
136
  var multiple = !!checkable;
137
+
101
138
  var _React$useState = React.useState(false),
102
- _React$useState2 = _slicedToArray(_React$useState, 2),
103
- dropdownVisible = _React$useState2[0],
104
- setDropdownVisible = _React$useState2[1];
105
- // =========================== Values ===========================
139
+ _React$useState2 = _slicedToArray(_React$useState, 2),
140
+ dropdownVisible = _React$useState2[0],
141
+ setDropdownVisible = _React$useState2[1]; // =========================== Values ===========================
142
+
143
+
106
144
  var _useMergedState = (0, _useMergedState5["default"])(defaultValue, {
107
- value: value,
108
- postState: toRawValues
109
- }),
110
- _useMergedState2 = _slicedToArray(_useMergedState, 2),
111
- rawValues = _useMergedState2[0],
112
- setRawValues = _useMergedState2[1];
113
- // ========================= FieldNames =========================
145
+ value: value,
146
+ postState: toRawValues
147
+ }),
148
+ _useMergedState2 = _slicedToArray(_useMergedState, 2),
149
+ rawValues = _useMergedState2[0],
150
+ setRawValues = _useMergedState2[1]; // ========================= FieldNames =========================
151
+
152
+
114
153
  var mergedFieldNames = React.useMemo(function () {
115
154
  return (0, _commonUtil.fillFieldNames)(fieldNames);
116
- }, /* eslint-disable react-hooks/exhaustive-deps */
155
+ },
156
+ /* eslint-disable react-hooks/exhaustive-deps */
117
157
  [JSON.stringify(fieldNames)]
118
- /* eslint-enable react-hooks/exhaustive-deps */);
119
- // =========================== Option ===========================
158
+ /* eslint-enable react-hooks/exhaustive-deps */
159
+ ); // =========================== Option ===========================
160
+
120
161
  var mergedOptions = React.useMemo(function () {
121
162
  return options || [];
122
- }, [options]);
123
- // Only used in multiple mode, this fn will not call in single mode
163
+ }, [options]); // Only used in multiple mode, this fn will not call in single mode
164
+
124
165
  var getPathKeyEntities = (0, _useEntities["default"])(mergedOptions, mergedFieldNames);
125
166
  /** Convert path key back to value format */
167
+
126
168
  var getValueByKeyPath = React.useCallback(function (pathKeys) {
127
169
  var keyPathEntities = getPathKeyEntities();
128
170
  return pathKeys.map(function (pathKey) {
@@ -131,61 +173,70 @@ var Cascader = React.forwardRef(function (props, ref) {
131
173
  return node[mergedFieldNames.value];
132
174
  });
133
175
  });
134
- }, [getPathKeyEntities, mergedFieldNames]);
135
- // =========================== Search ===========================
176
+ }, [getPathKeyEntities, mergedFieldNames]); // =========================== Search ===========================
177
+
136
178
  var _useMergedState3 = (0, _useMergedState5["default"])('', {
137
- value: searchValue,
138
- postState: function postState(search) {
139
- return search || '';
140
- }
141
- }),
142
- _useMergedState4 = _slicedToArray(_useMergedState3, 2),
143
- mergedSearchValue = _useMergedState4[0],
144
- setSearchValue = _useMergedState4[1];
179
+ value: searchValue,
180
+ postState: function postState(search) {
181
+ return search || '';
182
+ }
183
+ }),
184
+ _useMergedState4 = _slicedToArray(_useMergedState3, 2),
185
+ mergedSearchValue = _useMergedState4[0],
186
+ setSearchValue = _useMergedState4[1];
187
+
145
188
  var onInternalSearch = function onInternalSearch(searchText, info) {
146
189
  setSearchValue(searchText);
190
+
147
191
  if (info.source !== 'blur' && onSearch) {
148
192
  onSearch(searchText);
149
193
  }
150
194
  };
195
+
151
196
  var _useSearchConfig = (0, _useSearchConfig3["default"])(showSearch),
152
- _useSearchConfig2 = _slicedToArray(_useSearchConfig, 2),
153
- mergedShowSearch = _useSearchConfig2[0],
154
- searchConfig = _useSearchConfig2[1];
155
- var searchOptions = (0, _useSearchOptions["default"])(mergedSearchValue, mergedOptions, mergedFieldNames, dropdownPrefixCls || prefixCls, searchConfig, changeOnSelect);
156
- // =========================== Values ===========================
157
- var getMissingValues = (0, _useMissingValues["default"])(mergedOptions, mergedFieldNames);
158
- // Fill `rawValues` with checked conduction values
197
+ _useSearchConfig2 = _slicedToArray(_useSearchConfig, 2),
198
+ mergedShowSearch = _useSearchConfig2[0],
199
+ searchConfig = _useSearchConfig2[1];
200
+
201
+ var searchOptions = (0, _useSearchOptions["default"])(mergedSearchValue, mergedOptions, mergedFieldNames, dropdownPrefixCls || prefixCls, searchConfig, changeOnSelect); // =========================== Values ===========================
202
+
203
+ var getMissingValues = (0, _useMissingValues["default"])(mergedOptions, mergedFieldNames); // Fill `rawValues` with checked conduction values
204
+
159
205
  var _React$useMemo = React.useMemo(function () {
160
- var _getMissingValues = getMissingValues(rawValues),
206
+ var _getMissingValues = getMissingValues(rawValues),
161
207
  _getMissingValues2 = _slicedToArray(_getMissingValues, 2),
162
208
  existValues = _getMissingValues2[0],
163
209
  missingValues = _getMissingValues2[1];
164
- if (!multiple || !rawValues.length) {
165
- return [existValues, [], missingValues];
166
- }
167
- var keyPathValues = (0, _commonUtil.toPathKeys)(existValues);
168
- var keyPathEntities = getPathKeyEntities();
169
- var _conductCheck = (0, _conductUtil.conductCheck)(keyPathValues, true, keyPathEntities),
210
+
211
+ if (!multiple || !rawValues.length) {
212
+ return [existValues, [], missingValues];
213
+ }
214
+
215
+ var keyPathValues = (0, _commonUtil.toPathKeys)(existValues);
216
+ var keyPathEntities = getPathKeyEntities();
217
+
218
+ var _conductCheck = (0, _conductUtil.conductCheck)(keyPathValues, true, keyPathEntities),
170
219
  checkedKeys = _conductCheck.checkedKeys,
171
- halfCheckedKeys = _conductCheck.halfCheckedKeys;
172
- // Convert key back to value cells
173
- return [getValueByKeyPath(checkedKeys), getValueByKeyPath(halfCheckedKeys), missingValues];
174
- }, [multiple, rawValues, getPathKeyEntities, getValueByKeyPath, getMissingValues]),
175
- _React$useMemo2 = _slicedToArray(_React$useMemo, 3),
176
- checkedValues = _React$useMemo2[0],
177
- halfCheckedValues = _React$useMemo2[1],
178
- missingCheckedValues = _React$useMemo2[2];
220
+ halfCheckedKeys = _conductCheck.halfCheckedKeys; // Convert key back to value cells
221
+
222
+
223
+ return [getValueByKeyPath(checkedKeys), getValueByKeyPath(halfCheckedKeys), missingValues];
224
+ }, [multiple, rawValues, getPathKeyEntities, getValueByKeyPath, getMissingValues]),
225
+ _React$useMemo2 = _slicedToArray(_React$useMemo, 3),
226
+ checkedValues = _React$useMemo2[0],
227
+ halfCheckedValues = _React$useMemo2[1],
228
+ missingCheckedValues = _React$useMemo2[2];
229
+
179
230
  var deDuplicatedValues = React.useMemo(function () {
180
231
  var checkedKeys = (0, _commonUtil.toPathKeys)(checkedValues);
181
232
  var deduplicateKeys = (0, _treeUtil.formatStrategyValues)(checkedKeys, getPathKeyEntities, showCheckedStrategy);
182
233
  return [].concat(_toConsumableArray(missingCheckedValues), _toConsumableArray(getValueByKeyPath(deduplicateKeys)));
183
234
  }, [checkedValues, getPathKeyEntities, getValueByKeyPath, missingCheckedValues, showCheckedStrategy]);
184
- var displayValues = (0, _useDisplayValues["default"])(deDuplicatedValues, mergedOptions, mergedFieldNames, multiple, displayRender);
185
- // =========================== Change ===========================
235
+ var displayValues = (0, _useDisplayValues["default"])(deDuplicatedValues, mergedOptions, mergedFieldNames, multiple, displayRender); // =========================== Change ===========================
236
+
186
237
  var triggerChange = (0, _useRefFunc["default"])(function (nextValues) {
187
- setRawValues(nextValues);
188
- // Save perf if no need trigger event
238
+ setRawValues(nextValues); // Save perf if no need trigger event
239
+
189
240
  if (onChange) {
190
241
  var nextRawValues = toRawValues(nextValues);
191
242
  var valueOptions = nextRawValues.map(function (valueCells) {
@@ -197,10 +248,11 @@ var Cascader = React.forwardRef(function (props, ref) {
197
248
  var triggerOptions = multiple ? valueOptions : valueOptions[0];
198
249
  onChange(triggerValues, triggerOptions);
199
250
  }
200
- });
201
- // =========================== Select ===========================
251
+ }); // =========================== Select ===========================
252
+
202
253
  var onInternalSelect = (0, _useRefFunc["default"])(function (valuePath) {
203
254
  setSearchValue('');
255
+
204
256
  if (!multiple) {
205
257
  triggerChange(valuePath);
206
258
  } else {
@@ -211,10 +263,11 @@ var Cascader = React.forwardRef(function (props, ref) {
211
263
  var existInChecked = checkedPathKeys.includes(pathKey);
212
264
  var existInMissing = missingCheckedValues.some(function (valueCells) {
213
265
  return (0, _commonUtil.toPathKey)(valueCells) === pathKey;
214
- });
215
- // Do update
266
+ }); // Do update
267
+
216
268
  var nextCheckedValues = checkedValues;
217
269
  var nextMissingValues = missingCheckedValues;
270
+
218
271
  if (existInMissing && !existInChecked) {
219
272
  // Missing value only do filter
220
273
  nextMissingValues = missingCheckedValues.filter(function (valueCells) {
@@ -225,53 +278,65 @@ var Cascader = React.forwardRef(function (props, ref) {
225
278
  var nextRawCheckedKeys = existInChecked ? checkedPathKeys.filter(function (key) {
226
279
  return key !== pathKey;
227
280
  }) : [].concat(_toConsumableArray(checkedPathKeys), [pathKey]);
228
- var pathKeyEntities = getPathKeyEntities();
229
- // Conduction by selected or not
281
+ var pathKeyEntities = getPathKeyEntities(); // Conduction by selected or not
282
+
230
283
  var checkedKeys;
284
+
231
285
  if (existInChecked) {
232
286
  ;
287
+
233
288
  var _conductCheck2 = (0, _conductUtil.conductCheck)(nextRawCheckedKeys, {
234
289
  checked: false,
235
290
  halfCheckedKeys: halfCheckedPathKeys
236
291
  }, pathKeyEntities);
292
+
237
293
  checkedKeys = _conductCheck2.checkedKeys;
238
294
  } else {
239
295
  ;
296
+
240
297
  var _conductCheck3 = (0, _conductUtil.conductCheck)(nextRawCheckedKeys, true, pathKeyEntities);
298
+
241
299
  checkedKeys = _conductCheck3.checkedKeys;
242
- }
243
- // Roll up to parent level keys
300
+ } // Roll up to parent level keys
301
+
302
+
244
303
  var deDuplicatedKeys = (0, _treeUtil.formatStrategyValues)(checkedKeys, getPathKeyEntities, showCheckedStrategy);
245
304
  nextCheckedValues = getValueByKeyPath(deDuplicatedKeys);
246
305
  }
306
+
247
307
  triggerChange([].concat(_toConsumableArray(nextMissingValues), _toConsumableArray(nextCheckedValues)));
248
308
  }
249
- });
250
- // Display Value change logic
309
+ }); // Display Value change logic
310
+
251
311
  var onDisplayValuesChange = function onDisplayValuesChange(_, info) {
252
312
  if (info.type === 'clear') {
253
313
  triggerChange([]);
254
314
  return;
255
- }
256
- // Cascader do not support `add` type. Only support `remove`
315
+ } // Cascader do not support `add` type. Only support `remove`
316
+
317
+
257
318
  var valueCells = info.values[0].valueCells;
258
319
  onInternalSelect(valueCells);
259
- };
260
- // ============================ Open ============================
320
+ }; // ============================ Open ============================
321
+
322
+
261
323
  var mergedOpen = open !== undefined ? open : popupVisible;
262
324
  var mergedDropdownClassName = dropdownClassName || popupClassName;
263
325
  var mergedPlacement = placement || popupPlacement;
326
+
264
327
  var onInternalDropdownVisibleChange = function onInternalDropdownVisibleChange(nextVisible) {
265
328
  onDropdownVisibleChange === null || onDropdownVisibleChange === void 0 ? void 0 : onDropdownVisibleChange(nextVisible);
266
329
  onPopupVisibleChange === null || onPopupVisibleChange === void 0 ? void 0 : onPopupVisibleChange(nextVisible);
267
330
  setDropdownVisible(nextVisible);
268
- };
269
- // ========================== Warning ===========================
331
+ }; // ========================== Warning ===========================
332
+
333
+
270
334
  if (process.env.NODE_ENV !== 'production') {
271
335
  (0, _warningPropsUtil["default"])(props);
272
336
  (0, _warningPropsUtil.warningNullOptions)(mergedOptions, mergedFieldNames);
273
- }
274
- // ========================== Context ===========================
337
+ } // ========================== Context ===========================
338
+
339
+
275
340
  var cascaderContext = React.useMemo(function () {
276
341
  return {
277
342
  options: mergedOptions,
@@ -291,15 +356,13 @@ var Cascader = React.forwardRef(function (props, ref) {
291
356
  renderItem: renderItem,
292
357
  dropdownVisible: dropdownVisible
293
358
  };
294
- }, [mergedOptions, mergedFieldNames, checkedValues, halfCheckedValues, changeOnSelect, onInternalSelect, checkable, searchOptions, dropdownPrefixCls, loadData, expandTrigger, expandIcon, loadingIcon, dropdownMenuColumnStyle, renderItem, dropdownVisible]);
295
- // ==============================================================
359
+ }, [mergedOptions, mergedFieldNames, checkedValues, halfCheckedValues, changeOnSelect, onInternalSelect, checkable, searchOptions, dropdownPrefixCls, loadData, expandTrigger, expandIcon, loadingIcon, dropdownMenuColumnStyle, renderItem, dropdownVisible]); // ==============================================================
296
360
  // == Render ==
297
361
  // ==============================================================
362
+
298
363
  var emptyOptions = !(mergedSearchValue ? searchOptions : mergedOptions).length;
299
- var dropdownStyle =
300
- // Search to match width
301
- mergedSearchValue && searchConfig.matchInputWidth ||
302
- // Empty keep the width
364
+ var dropdownStyle = // Search to match width
365
+ mergedSearchValue && searchConfig.matchInputWidth || // Empty keep the width
303
366
  emptyOptions ? {} : {
304
367
  minWidth: 'auto'
305
368
  };
@@ -334,9 +397,11 @@ var Cascader = React.forwardRef(function (props, ref) {
334
397
  }
335
398
  })));
336
399
  });
400
+
337
401
  if (process.env.NODE_ENV !== 'production') {
338
402
  Cascader.displayName = 'Cascader';
339
403
  }
404
+
340
405
  Cascader.SHOW_PARENT = _commonUtil.SHOW_PARENT;
341
406
  Cascader.SHOW_CHILD = _commonUtil.SHOW_CHILD;
342
407
  var _default = Cascader;
@@ -1,29 +1,39 @@
1
1
  "use strict";
2
2
 
3
+ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
6
8
  exports["default"] = Checkbox;
9
+
7
10
  var React = _interopRequireWildcard(require("react"));
11
+
8
12
  var _classnames = _interopRequireDefault(require("classnames"));
13
+
9
14
  var _context = _interopRequireDefault(require("../context"));
15
+
10
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
11
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
12
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
13
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
14
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
15
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
16
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
17
+
18
+ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
19
+
20
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
21
+
22
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
23
+
17
24
  function Checkbox(_ref) {
18
25
  var _classNames;
26
+
19
27
  var prefixCls = _ref.prefixCls,
20
- checked = _ref.checked,
21
- halfChecked = _ref.halfChecked,
22
- disabled = _ref.disabled,
23
- onClick = _ref.onClick;
28
+ checked = _ref.checked,
29
+ halfChecked = _ref.halfChecked,
30
+ disabled = _ref.disabled,
31
+ onClick = _ref.onClick;
32
+
24
33
  // @ts-ignore
25
34
  var _React$useContext = React.useContext(_context["default"]),
26
- checkable = _React$useContext.checkable;
35
+ checkable = _React$useContext.checkable;
36
+
27
37
  var customCheckbox = typeof checkable !== 'boolean' ? checkable : null;
28
38
  return React.createElement("span", {
29
39
  className: (0, _classnames["default"])("".concat(prefixCls), (_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-checked"), checked), _defineProperty(_classNames, "".concat(prefixCls, "-indeterminate"), !checked && halfChecked), _defineProperty(_classNames, "".concat(prefixCls, "-disabled"), disabled), _classNames)),