tntd 2.0.14 → 2.0.15

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 (447) 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 +5 -9
  11. package/es/drawer/drawer.js.map +1 -1
  12. package/es/drawer/drawer.less +13 -11
  13. package/es/ellipsis/index.js +14 -25
  14. package/es/ellipsis/style/index.js +1 -0
  15. package/es/ellipsis/style/index.js.map +1 -0
  16. package/es/empty/empty.js +9 -13
  17. package/es/empty/render-empty.js +22 -0
  18. package/es/empty/render-empty.js.map +1 -0
  19. package/es/empty/style/index.js +2 -0
  20. package/es/empty/style/index.js.map +1 -0
  21. package/es/handle/index.js +14 -27
  22. package/es/handle/style/index.js +1 -0
  23. package/es/handle/style/index.js.map +1 -0
  24. package/es/icon-list/style/index.js +1 -0
  25. package/es/icon-list/style/index.js.map +1 -0
  26. package/es/img/Contain.js +13 -19
  27. package/es/img/Cover.js +13 -24
  28. package/es/img/index.js +14 -21
  29. package/es/img/style/index.js +1 -0
  30. package/es/img/style/index.js.map +1 -0
  31. package/es/index.js +0 -1
  32. package/es/loading-button/index.js +6 -13
  33. package/es/loading-button/style/index.js +1 -0
  34. package/es/loading-button/style/index.js.map +1 -0
  35. package/es/locale/default.js +0 -2
  36. package/es/locale/en_US.js +0 -2
  37. package/es/locale/zh_CN.js +0 -2
  38. package/es/modal/index.js +11 -2
  39. package/es/modal/index.js.map +1 -1
  40. package/es/modal/modal.js +44 -0
  41. package/es/modal/modal.js.map +1 -0
  42. package/es/modal/modal.less +27 -25
  43. package/es/page/Box.js +19 -28
  44. package/es/page/index.js +22 -38
  45. package/es/page/style/index.js +1 -0
  46. package/es/page/style/index.js.map +1 -0
  47. package/es/page/utils.js +0 -5
  48. package/es/prev-locale.js +0 -3
  49. package/es/query-form/Field/Checkbox.js +4 -8
  50. package/es/query-form/Field/Select.js +10 -17
  51. package/es/query-form/Field/SelectInput.js +4 -18
  52. package/es/query-form/Field/fieldsMap.js +0 -1
  53. package/es/query-form/Field/index.js +2 -11
  54. package/es/query-form/createActions.js +0 -8
  55. package/es/query-form/index.js +2 -34
  56. package/es/query-form/style/index.js +1 -0
  57. package/es/query-form/style/index.js.map +1 -0
  58. package/es/query-list-scene/List.js +18 -39
  59. package/es/query-list-scene/QueryForm.js +10 -19
  60. package/es/query-list-scene/QueryListScene.js +0 -2
  61. package/es/query-list-scene/Toolbar.js +6 -10
  62. package/es/query-list-scene/createActions.js +0 -3
  63. package/es/query-list-scene/style/index.js +1 -0
  64. package/es/query-list-scene/style/index.js.map +1 -0
  65. package/es/render-empty/render-empty.js +0 -2
  66. package/es/render-empty/style/index.js +1 -0
  67. package/es/render-empty/style/index.js.map +1 -0
  68. package/es/steps/steps.js +9 -17
  69. package/es/svg-components/illustration-403.js +0 -2
  70. package/es/svg-components/illustration-404.js +0 -2
  71. package/es/svg-components/illustration-500.js +0 -2
  72. package/es/svg-components/illustration-empty.js +0 -2
  73. package/es/svg-components/illustration-failure.js +0 -2
  74. package/es/svg-components/illustration-no-access.js +0 -2
  75. package/es/svg-components/illustration-no-chart.js +0 -2
  76. package/es/svg-components/illustration-no-result.js +0 -2
  77. package/es/svg-components/illustration-offline.js +0 -2
  78. package/es/svg-components/illustration-success.js +0 -2
  79. package/es/table/assets/image-loading-background.js +0 -2
  80. package/es/table/assets/image-loading.js +0 -2
  81. package/es/table/hooks/use-column-setting.js +0 -1
  82. package/es/table/style/index.js +2 -0
  83. package/es/table/style/index.js.map +1 -0
  84. package/es/table/table.js +14 -19
  85. package/es/table/table.stories.js +0 -2
  86. package/es/table/utils.js +2 -6
  87. package/es/title/index.js +10 -14
  88. package/es/title/style/index.js +1 -0
  89. package/es/title/style/index.js.map +1 -0
  90. package/es/tntd-cascader/AntdCascader/component/context.js +2 -4
  91. package/es/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js +0 -2
  92. package/es/tntd-cascader/AntdCascader/component/getIcons.js +6 -15
  93. package/es/tntd-cascader/AntdCascader/config/utils.js +0 -2
  94. package/es/tntd-cascader/AntdCascader/config/warning.js +4 -8
  95. package/es/tntd-cascader/AntdCascader/index.js +51 -73
  96. package/es/tntd-cascader/rc-cascader/Cascader.js +86 -113
  97. package/es/tntd-cascader/rc-cascader/OptionList/Column.js +16 -26
  98. package/es/tntd-cascader/rc-cascader/OptionList/index.js +26 -43
  99. package/es/tntd-cascader/rc-cascader/OptionList/useActive.js +5 -7
  100. package/es/tntd-cascader/rc-cascader/OptionList/useKeyboard.js +12 -41
  101. package/es/tntd-cascader/rc-cascader/hooks/useDisplayValues.js +4 -10
  102. package/es/tntd-cascader/rc-cascader/hooks/useEntities.js +2 -4
  103. package/es/tntd-cascader/rc-cascader/hooks/useMissingValues.js +0 -1
  104. package/es/tntd-cascader/rc-cascader/hooks/useRefFunc.js +0 -1
  105. package/es/tntd-cascader/rc-cascader/hooks/useSearchConfig.js +2 -7
  106. package/es/tntd-cascader/rc-cascader/hooks/useSearchOptions.js +8 -15
  107. package/es/tntd-cascader/rc-cascader/utils/commonUtil.js +2 -6
  108. package/es/tntd-cascader/rc-cascader/utils/treeUtil.js +2 -4
  109. package/es/tntd-cascader/rc-cascader/utils/warningPropsUtil.js +2 -7
  110. package/es/tntd-icon/fonts/iconfont.js +7 -12
  111. package/es/tntd-icon/index.js +5 -9
  112. package/es/tntd-icon/style/index.js +1 -0
  113. package/es/tntd-icon/style/index.js.map +1 -0
  114. package/es/tntd-layout/ActionsContext.js +2 -2
  115. package/es/tntd-layout/AppList.js +2 -14
  116. package/es/tntd-layout/Application.js +0 -4
  117. package/es/tntd-layout/Avatar.js +0 -4
  118. package/es/tntd-layout/CompatibleLanguage.js +0 -13
  119. package/es/tntd-layout/EnterpriseLayout/Avatar.js +0 -4
  120. package/es/tntd-layout/EnterpriseLayout/Language.js +0 -6
  121. package/es/tntd-layout/EnterpriseLayout/Theme.js +0 -4
  122. package/es/tntd-layout/EnterpriseLayout/index.js +2 -2
  123. package/es/tntd-layout/GlobalNavigation/NavigationPopup.js +2 -33
  124. package/es/tntd-layout/GlobalNavigation/index.js +0 -6
  125. package/es/tntd-layout/HeaderActions.js +28 -32
  126. package/es/tntd-layout/HeaderNavs.js +6 -14
  127. package/es/tntd-layout/HeaderTabs.js +14 -35
  128. package/es/tntd-layout/Language.js +0 -6
  129. package/es/tntd-layout/Layout.js +2 -7
  130. package/es/tntd-layout/Logo.js +4 -11
  131. package/es/tntd-layout/OrgAppList.js +22 -39
  132. package/es/tntd-layout/SideMenu.js +8 -45
  133. package/es/tntd-layout/Theme.js +0 -6
  134. package/es/tntd-layout/index.js +9 -17
  135. package/es/tntd-layout/paaslayout/CompactSideMenu.js +0 -15
  136. package/es/tntd-layout/paaslayout/SideMenu.js +0 -15
  137. package/es/tntd-layout/paaslayout/index.js +4 -13
  138. package/es/tntd-layout/storage.js +2 -2
  139. package/es/tntd-layout/style/index.js +1 -0
  140. package/es/tntd-layout/style/index.js.map +1 -0
  141. package/es/tntd-modal/index.js +12 -18
  142. package/es/tntd-modal/style/index.js +1 -0
  143. package/es/tntd-modal/style/index.js.map +1 -0
  144. package/es/tntd-second-page/index.js +0 -3
  145. package/es/tntd-select/DropDownWrap.js +4 -8
  146. package/es/tntd-select/index.js +74 -118
  147. package/es/tntd-select/style/index.js +1 -0
  148. package/es/tntd-select/style/index.js.map +1 -0
  149. package/es/utils/checkAuth.js +0 -1
  150. package/es/utils/findMenuInfoByPath.js +0 -3
  151. package/es/utils/index.js +2 -11
  152. package/lib/affix/index.js +4 -10
  153. package/lib/alert/index.js +4 -10
  154. package/lib/anchor/index.js +4 -10
  155. package/lib/array-input/icon.js +1 -7
  156. package/lib/array-input/index.js +41 -91
  157. package/lib/array-input/style/index.d.ts +1 -0
  158. package/lib/array-input/style/index.d.ts.map +1 -0
  159. package/lib/array-input/style/index.js +1 -0
  160. package/lib/array-input/style/index.js.map +1 -0
  161. package/lib/auth-context/index.js +0 -3
  162. package/lib/auth-context/style/index.d.ts +1 -0
  163. package/lib/auth-context/style/index.d.ts.map +1 -0
  164. package/lib/auth-context/style/index.js +1 -0
  165. package/lib/auth-context/style/index.js.map +1 -0
  166. package/lib/auto-complete/index.js +4 -10
  167. package/lib/avatar/index.js +4 -10
  168. package/lib/back-top/index.js +4 -10
  169. package/lib/badge/index.js +4 -10
  170. package/lib/breadcrumb/index.js +4 -10
  171. package/lib/button/index.js +4 -10
  172. package/lib/calendar/index.js +4 -10
  173. package/lib/card/index.js +4 -10
  174. package/lib/carousel/index.js +4 -10
  175. package/lib/cascader/index.js +4 -10
  176. package/lib/checkbox/index.js +4 -10
  177. package/lib/col/index.js +4 -10
  178. package/lib/collapse/index.js +4 -11
  179. package/lib/columns/index.js +14 -28
  180. package/lib/comment/index.js +4 -10
  181. package/lib/config-provider/config-provider.js +0 -2
  182. package/lib/config-provider/index.js +4 -10
  183. package/lib/date-picker/index.js +4 -10
  184. package/lib/descriptions/index.js +4 -10
  185. package/lib/development-login/LoginModal.js +25 -50
  186. package/lib/development-login/index.js +11 -22
  187. package/lib/development-login/style/index.d.ts +1 -0
  188. package/lib/development-login/style/index.d.ts.map +1 -0
  189. package/lib/development-login/style/index.js +1 -0
  190. package/lib/development-login/style/index.js.map +1 -0
  191. package/lib/divider/index.js +4 -10
  192. package/lib/drawer/drawer.d.ts.map +1 -1
  193. package/lib/drawer/drawer.js +7 -17
  194. package/lib/drawer/drawer.js.map +1 -1
  195. package/lib/drawer/drawer.less +13 -11
  196. package/lib/drawer/index.js +1 -5
  197. package/lib/dropdown/index.js +4 -10
  198. package/lib/ellipsis/Svg/CopySVG.js +0 -4
  199. package/lib/ellipsis/Svg/TickSVG.js +0 -4
  200. package/lib/ellipsis/index.js +42 -73
  201. package/lib/ellipsis/style/index.d.ts +1 -0
  202. package/lib/ellipsis/style/index.d.ts.map +1 -0
  203. package/lib/ellipsis/style/index.js +1 -0
  204. package/lib/ellipsis/style/index.js.map +1 -0
  205. package/lib/empty/empty.js +14 -30
  206. package/lib/empty/empty.stories.js +3 -21
  207. package/lib/empty/index.js +1 -5
  208. package/lib/empty/render-empty.d.ts +3 -0
  209. package/lib/empty/render-empty.d.ts.map +1 -0
  210. package/lib/empty/render-empty.js +32 -0
  211. package/lib/empty/render-empty.js.map +1 -0
  212. package/lib/empty/style/index.d.ts +3 -0
  213. package/lib/empty/style/index.d.ts.map +1 -0
  214. package/lib/empty/style/index.js +4 -0
  215. package/lib/empty/style/index.js.map +1 -0
  216. package/lib/exception/exception.js +7 -14
  217. package/lib/exception/index.js +1 -4
  218. package/lib/form/index.js +4 -10
  219. package/lib/handle/index.js +19 -46
  220. package/lib/handle/style/index.d.ts +1 -0
  221. package/lib/handle/style/index.d.ts.map +1 -0
  222. package/lib/handle/style/index.js +1 -0
  223. package/lib/handle/style/index.js.map +1 -0
  224. package/lib/icon/index.js +4 -10
  225. package/lib/icon-list/style/index.d.ts +3 -0
  226. package/lib/icon-list/style/index.d.ts.map +1 -0
  227. package/lib/icon-list/style/index.js +8 -0
  228. package/lib/icon-list/style/index.js.map +1 -0
  229. package/lib/img/Contain.js +12 -23
  230. package/lib/img/Cover.js +31 -53
  231. package/lib/img/index.js +29 -47
  232. package/lib/img/style/index.d.ts +1 -0
  233. package/lib/img/style/index.d.ts.map +1 -0
  234. package/lib/img/style/index.js +1 -0
  235. package/lib/img/style/index.js.map +1 -0
  236. package/lib/index.js +100 -187
  237. package/lib/input/index.js +4 -10
  238. package/lib/input-number/index.js +4 -10
  239. package/lib/layout/index.js +4 -10
  240. package/lib/list/index.js +4 -10
  241. package/lib/loading-button/index.js +15 -32
  242. package/lib/loading-button/style/index.d.ts +1 -0
  243. package/lib/loading-button/style/index.d.ts.map +1 -0
  244. package/lib/loading-button/style/index.js +1 -0
  245. package/lib/loading-button/style/index.js.map +1 -0
  246. package/lib/locale/default.js +0 -5
  247. package/lib/locale/en_US.js +0 -4
  248. package/lib/locale/index.js +3 -6
  249. package/lib/locale/zh_CN.js +0 -4
  250. package/lib/locale-provider/index.js +4 -10
  251. package/lib/mention/index.js +4 -10
  252. package/lib/mentions/index.js +4 -10
  253. package/lib/menu/index.js +4 -10
  254. package/lib/message/index.js +4 -11
  255. package/lib/modal/index.d.ts +2 -2
  256. package/lib/modal/index.d.ts.map +1 -1
  257. package/lib/modal/index.js +13 -14
  258. package/lib/modal/index.js.map +1 -1
  259. package/lib/modal/modal.d.ts +15 -0
  260. package/lib/modal/modal.d.ts.map +1 -0
  261. package/lib/modal/modal.js +66 -0
  262. package/lib/modal/modal.js.map +1 -0
  263. package/lib/modal/modal.less +27 -25
  264. package/lib/notification/index.js +4 -10
  265. package/lib/page/Box.js +24 -37
  266. package/lib/page/index.js +37 -66
  267. package/lib/page/style/index.d.ts +1 -0
  268. package/lib/page/style/index.d.ts.map +1 -0
  269. package/lib/page/style/index.js +1 -0
  270. package/lib/page/style/index.js.map +1 -0
  271. package/lib/page/utils.js +1 -9
  272. package/lib/page-header/index.js +4 -10
  273. package/lib/pagination/index.js +4 -10
  274. package/lib/popconfirm/index.js +4 -10
  275. package/lib/popover/index.js +4 -10
  276. package/lib/prev-locale.js +1 -10
  277. package/lib/progress/index.js +4 -10
  278. package/lib/query-form/Field/Checkbox.js +2 -11
  279. package/lib/query-form/Field/Select.js +27 -45
  280. package/lib/query-form/Field/SelectInput.js +21 -46
  281. package/lib/query-form/Field/fieldsMap.js +1 -12
  282. package/lib/query-form/Field/index.js +38 -70
  283. package/lib/query-form/createActions.js +0 -7
  284. package/lib/query-form/index.js +52 -121
  285. package/lib/query-form/style/index.d.ts +1 -0
  286. package/lib/query-form/style/index.d.ts.map +1 -0
  287. package/lib/query-form/style/index.js +1 -0
  288. package/lib/query-form/style/index.js.map +1 -0
  289. package/lib/query-form/useForm.js +0 -4
  290. package/lib/query-list-scene/List.js +58 -111
  291. package/lib/query-list-scene/QueryForm.js +37 -67
  292. package/lib/query-list-scene/QueryListScene.js +21 -42
  293. package/lib/query-list-scene/Title.js +1 -5
  294. package/lib/query-list-scene/Toolbar.js +8 -15
  295. package/lib/query-list-scene/createActions.js +0 -6
  296. package/lib/query-list-scene/index.js +0 -10
  297. package/lib/query-list-scene/style/index.d.ts +1 -0
  298. package/lib/query-list-scene/style/index.d.ts.map +1 -0
  299. package/lib/query-list-scene/style/index.js +1 -0
  300. package/lib/query-list-scene/style/index.js.map +1 -0
  301. package/lib/query-list-scene/useActions.js +0 -4
  302. package/lib/radio/index.js +4 -10
  303. package/lib/rate/index.js +4 -10
  304. package/lib/render-empty/index.js +0 -2
  305. package/lib/render-empty/render-empty.js +0 -8
  306. package/lib/render-empty/style/index.d.ts +2 -0
  307. package/lib/render-empty/style/index.d.ts.map +1 -0
  308. package/lib/render-empty/style/index.js +3 -0
  309. package/lib/render-empty/style/index.js.map +1 -0
  310. package/lib/result/index.js +4 -10
  311. package/lib/row/index.js +4 -10
  312. package/lib/select/index.js +4 -10
  313. package/lib/skeleton/index.js +4 -10
  314. package/lib/slider/index.js +4 -10
  315. package/lib/spin/index.js +4 -10
  316. package/lib/statistic/index.js +4 -10
  317. package/lib/steps/index.js +1 -5
  318. package/lib/steps/steps.js +12 -29
  319. package/lib/svg-components/illustration-403.js +3 -9
  320. package/lib/svg-components/illustration-404.js +3 -9
  321. package/lib/svg-components/illustration-500.js +3 -9
  322. package/lib/svg-components/illustration-empty.js +3 -9
  323. package/lib/svg-components/illustration-failure.js +3 -9
  324. package/lib/svg-components/illustration-no-access.js +3 -9
  325. package/lib/svg-components/illustration-no-chart.js +3 -9
  326. package/lib/svg-components/illustration-no-result.js +3 -9
  327. package/lib/svg-components/illustration-offline.js +3 -9
  328. package/lib/svg-components/illustration-success.js +3 -9
  329. package/lib/svg-components/index.js +0 -11
  330. package/lib/switch/index.js +4 -10
  331. package/lib/table/assets/image-loading-background.js +3 -9
  332. package/lib/table/assets/image-loading.js +3 -9
  333. package/lib/table/context.js +0 -2
  334. package/lib/table/hooks/index.js +1 -2
  335. package/lib/table/hooks/use-column-setting.js +8 -16
  336. package/lib/table/index.js +1 -5
  337. package/lib/table/style/index.d.ts +3 -0
  338. package/lib/table/style/index.d.ts.map +1 -0
  339. package/lib/table/style/index.js +4 -0
  340. package/lib/table/style/index.js.map +1 -0
  341. package/lib/table/table.js +34 -63
  342. package/lib/table/table.stories.js +2 -11
  343. package/lib/table/utils.js +2 -11
  344. package/lib/tabs/index.js +4 -10
  345. package/lib/tag/index.js +4 -10
  346. package/lib/time-picker/index.js +4 -10
  347. package/lib/timeline/index.js +4 -10
  348. package/lib/title/index.js +10 -20
  349. package/lib/title/style/index.d.ts +1 -0
  350. package/lib/title/style/index.d.ts.map +1 -0
  351. package/lib/title/style/index.js +1 -0
  352. package/lib/title/style/index.js.map +1 -0
  353. package/lib/tntd-cascader/AntdCascader/component/DisabledContext.js +4 -11
  354. package/lib/tntd-cascader/AntdCascader/component/FormItemInputContext.js +3 -8
  355. package/lib/tntd-cascader/AntdCascader/component/SizeContext.js +3 -8
  356. package/lib/tntd-cascader/AntdCascader/component/context.js +3 -9
  357. package/lib/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js +4 -12
  358. package/lib/tntd-cascader/AntdCascader/component/getIcons.js +19 -37
  359. package/lib/tntd-cascader/AntdCascader/component/useCompactItemContext.js +8 -17
  360. package/lib/tntd-cascader/AntdCascader/config/utils.js +6 -15
  361. package/lib/tntd-cascader/AntdCascader/config/warning.js +7 -15
  362. package/lib/tntd-cascader/AntdCascader/index.js +80 -133
  363. package/lib/tntd-cascader/AntdCascader/interface.js +0 -3
  364. package/lib/tntd-cascader/index.js +0 -2
  365. package/lib/tntd-cascader/rc-cascader/Cascader.js +123 -188
  366. package/lib/tntd-cascader/rc-cascader/OptionList/Checkbox.js +11 -21
  367. package/lib/tntd-cascader/rc-cascader/OptionList/Column.js +60 -88
  368. package/lib/tntd-cascader/rc-cascader/OptionList/index.js +65 -109
  369. package/lib/tntd-cascader/rc-cascader/OptionList/useActive.js +18 -33
  370. package/lib/tntd-cascader/rc-cascader/OptionList/useKeyboard.js +56 -106
  371. package/lib/tntd-cascader/rc-cascader/context.js +3 -8
  372. package/lib/tntd-cascader/rc-cascader/hooks/useDisplayValues.js +14 -31
  373. package/lib/tntd-cascader/rc-cascader/hooks/useEntities.js +5 -15
  374. package/lib/tntd-cascader/rc-cascader/hooks/useMissingValues.js +3 -11
  375. package/lib/tntd-cascader/rc-cascader/hooks/useRefFunc.js +3 -8
  376. package/lib/tntd-cascader/rc-cascader/hooks/useSearchConfig.js +3 -15
  377. package/lib/tntd-cascader/rc-cascader/hooks/useSearchOptions.js +26 -41
  378. package/lib/tntd-cascader/rc-cascader/index.js +0 -3
  379. package/lib/tntd-cascader/rc-cascader/utils/commonUtil.js +9 -20
  380. package/lib/tntd-cascader/rc-cascader/utils/treeUtil.js +0 -8
  381. package/lib/tntd-cascader/rc-cascader/utils/warningPropsUtil.js +7 -14
  382. package/lib/tntd-icon/fonts/iconfont.js +7 -12
  383. package/lib/tntd-icon/index.js +6 -17
  384. package/lib/tntd-icon/style/index.d.ts +1 -0
  385. package/lib/tntd-icon/style/index.d.ts.map +1 -0
  386. package/lib/tntd-icon/style/index.js +1 -0
  387. package/lib/tntd-icon/style/index.js.map +1 -0
  388. package/lib/tntd-layout/ActionsContext.js +0 -3
  389. package/lib/tntd-layout/AppList.js +30 -105
  390. package/lib/tntd-layout/Application.js +22 -84
  391. package/lib/tntd-layout/Avatar.js +18 -72
  392. package/lib/tntd-layout/CompatibleLanguage.js +32 -105
  393. package/lib/tntd-layout/EnterpriseLayout/Avatar.js +24 -80
  394. package/lib/tntd-layout/EnterpriseLayout/Language.js +14 -45
  395. package/lib/tntd-layout/EnterpriseLayout/Theme.js +16 -46
  396. package/lib/tntd-layout/EnterpriseLayout/index.js +4 -12
  397. package/lib/tntd-layout/GlobalNavigation/NavigationPopup.js +45 -174
  398. package/lib/tntd-layout/GlobalNavigation/index.js +19 -70
  399. package/lib/tntd-layout/Header.js +20 -54
  400. package/lib/tntd-layout/HeaderActions.js +33 -64
  401. package/lib/tntd-layout/HeaderNavs.js +19 -59
  402. package/lib/tntd-layout/HeaderTabs.js +43 -111
  403. package/lib/tntd-layout/Iconfont.js +0 -5
  404. package/lib/tntd-layout/Language.js +14 -45
  405. package/lib/tntd-layout/Layout.js +74 -113
  406. package/lib/tntd-layout/Logo.js +14 -41
  407. package/lib/tntd-layout/OrgAppList.js +51 -119
  408. package/lib/tntd-layout/SideMenu.js +42 -120
  409. package/lib/tntd-layout/Theme.js +19 -71
  410. package/lib/tntd-layout/createActions.js +0 -5
  411. package/lib/tntd-layout/images/index.js +0 -28
  412. package/lib/tntd-layout/index.js +21 -49
  413. package/lib/tntd-layout/paaslayout/CompactSideMenu.js +29 -81
  414. package/lib/tntd-layout/paaslayout/Header.js +14 -47
  415. package/lib/tntd-layout/paaslayout/Logo.js +2 -19
  416. package/lib/tntd-layout/paaslayout/SideMenu.js +31 -82
  417. package/lib/tntd-layout/paaslayout/index.js +62 -108
  418. package/lib/tntd-layout/storage.d.ts +1 -1
  419. package/lib/tntd-layout/storage.d.ts.map +1 -1
  420. package/lib/tntd-layout/storage.js +3 -33
  421. package/lib/tntd-layout/style/index.d.ts +1 -0
  422. package/lib/tntd-layout/style/index.d.ts.map +1 -0
  423. package/lib/tntd-layout/style/index.js +1 -0
  424. package/lib/tntd-layout/style/index.js.map +1 -0
  425. package/lib/tntd-modal/index.js +32 -51
  426. package/lib/tntd-modal/style/index.d.ts +1 -0
  427. package/lib/tntd-modal/style/index.d.ts.map +1 -0
  428. package/lib/tntd-modal/style/index.js +1 -0
  429. package/lib/tntd-modal/style/index.js.map +1 -0
  430. package/lib/tntd-second-page/index.js +14 -24
  431. package/lib/tntd-select/DropDownWrap.js +24 -45
  432. package/lib/tntd-select/index.js +117 -206
  433. package/lib/tntd-select/style/index.d.ts +1 -0
  434. package/lib/tntd-select/style/index.d.ts.map +1 -0
  435. package/lib/tntd-select/style/index.js +1 -0
  436. package/lib/tntd-select/style/index.js.map +1 -0
  437. package/lib/tooltip/index.js +4 -10
  438. package/lib/transfer/index.js +4 -10
  439. package/lib/tree/index.js +4 -10
  440. package/lib/tree-select/index.js +4 -10
  441. package/lib/typography/index.js +4 -10
  442. package/lib/upload/index.js +4 -10
  443. package/lib/utils/checkAuth.js +4 -10
  444. package/lib/utils/findMenuInfoByPath.js +1 -7
  445. package/lib/utils/index.js +13 -41
  446. package/lib/version/index.js +4 -10
  447. package/package.json +1 -1
@@ -4,55 +4,39 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports["default"] = void 0;
7
-
8
7
  var _react = _interopRequireWildcard(require("react"));
9
-
10
8
  var _select = _interopRequireDefault(require("../select"));
11
-
12
9
  var _empty = _interopRequireDefault(require("../empty"));
13
-
14
10
  var _DropDownWrap = _interopRequireDefault(require("./DropDownWrap"));
15
-
16
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
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 _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); }
23
-
12
+ 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); }
13
+ 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; }
14
+ 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); }
24
15
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
25
-
26
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
27
-
28
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
29
-
30
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
31
-
32
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
33
-
16
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
17
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
18
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
19
+ 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); }
20
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
21
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
22
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
23
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
34
24
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
35
-
36
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
37
-
38
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
39
-
25
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
26
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
40
27
  var __rest = void 0 && (void 0).__rest || function (s, e) {
41
28
  var t = {};
42
-
43
29
  for (var p in s) {
44
30
  if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
45
31
  }
46
-
47
32
  if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
48
33
  if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
49
34
  }
50
35
  return t;
51
36
  };
52
-
53
37
  // 页面实际渲染的下拉菜单数量,实际为 2 * ITEM_ELEMENT_NUMBER
54
- var ITEM_ELEMENT_NUMBER = 30; // Select size 配置
55
-
38
+ var ITEM_ELEMENT_NUMBER = 30;
39
+ // Select size 配置
56
40
  var ITEM_HEIGHT_CFG = {
57
41
  small: 24,
58
42
  large: 40,
@@ -64,18 +48,13 @@ var ARROW_CODE = {
64
48
  };
65
49
  var DROPDOWN_HEIGHT = 224;
66
50
  var Option = _select["default"].Option;
67
-
68
- var SuperSelect =
69
- /*#__PURE__*/
70
- function (_PureComponent) {
51
+ var SuperSelect = /*#__PURE__*/function (_PureComponent) {
71
52
  _inherits(SuperSelect, _PureComponent);
72
-
53
+ var _super = _createSuper(SuperSelect);
73
54
  function SuperSelect(props) {
74
55
  var _this;
75
-
76
56
  _classCallCheck(this, SuperSelect);
77
-
78
- _this = _possibleConstructorReturn(this, _getPrototypeOf(SuperSelect).call(this, props));
57
+ _this = _super.call(this, props);
79
58
  Object.defineProperty(_assertThisInitialized(_this), "turnChildren", {
80
59
  enumerable: true,
81
60
  configurable: true,
@@ -83,7 +62,6 @@ function (_PureComponent) {
83
62
  value: function value(children) {
84
63
  if (!children) return [];
85
64
  var arr = [];
86
-
87
65
  if (children && children.props) {
88
66
  arr.push(children);
89
67
  } else {
@@ -97,7 +75,6 @@ function (_PureComponent) {
97
75
  }
98
76
  });
99
77
  }
100
-
101
78
  return arr;
102
79
  }
103
80
  });
@@ -108,42 +85,35 @@ function (_PureComponent) {
108
85
  value: function value() {
109
86
  // 获取dom设置宽度
110
87
  var _this$props = _this.props,
111
- arr2 = _this$props.children,
112
- _this$props$dropdownM = _this$props.dropdownMatchSelectWidth,
113
- dropdownMatchSelectWidth = _this$props$dropdownM === void 0 ? true : _this$props$dropdownM,
114
- maxWidth = _this$props.maxWidth;
88
+ arr2 = _this$props.children,
89
+ _this$props$dropdownM = _this$props.dropdownMatchSelectWidth,
90
+ dropdownMatchSelectWidth = _this$props$dropdownM === void 0 ? true : _this$props$dropdownM,
91
+ maxWidth = _this$props.maxWidth;
115
92
  var selectDom = document.getElementById(_this.id);
116
93
  var selectWidth = selectDom.clientWidth || selectDom.offsetWidth;
117
94
  var arr = [];
118
95
  var formulaMaxWidth = 10;
119
-
120
96
  if (!dropdownMatchSelectWidth) {
121
97
  formulaMaxWidth = maxWidth || 10;
122
98
  }
123
-
124
99
  if (!dropdownMatchSelectWidth && !maxWidth) {
125
100
  var _children = _this.turnChildren(arr2);
126
-
127
101
  for (var i = 0; i < _children.length; i++) {
128
102
  var val = _children[i].props.children;
129
-
130
103
  var textWidth = _this.getTextPixelWith(val);
131
-
132
104
  arr.push(textWidth.toFixed(2));
133
105
  }
134
-
135
106
  if (arr.length > 0) {
136
107
  formulaMaxWidth = Math.max.apply(Math, arr);
137
108
  }
138
109
  }
139
-
140
110
  _this.setState({
141
111
  selectWidth: selectWidth,
142
112
  maxWidth: formulaMaxWidth
143
113
  });
144
114
  }
145
- }); // 获取单行文本的像素宽度
146
-
115
+ });
116
+ // 获取单行文本的像素宽度
147
117
  Object.defineProperty(_assertThisInitialized(_this), "getTextPixelWith", {
148
118
  enumerable: true,
149
119
  configurable: true,
@@ -151,13 +121,9 @@ function (_PureComponent) {
151
121
  value: function value(text) {
152
122
  var fontStyle = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '14px';
153
123
  var canvas = document.createElement('canvas'); // 创建 canvas 画布
154
-
155
124
  var context = canvas.getContext('2d'); // 获取 canvas 绘图上下文环境
156
-
157
125
  context.font = fontStyle; // 设置字体样式,使用前设置好对应的 font 样式才能准确获取文字的像素长度
158
-
159
126
  var dimension = context.measureText(text); // 测量文字
160
-
161
127
  return dimension.width;
162
128
  }
163
129
  });
@@ -179,58 +145,48 @@ function (_PureComponent) {
179
145
  configurable: true,
180
146
  writable: true,
181
147
  value: function value() {
182
- _this.scrollEle = document.querySelector(".".concat(_this.dropdownClassName)); // 下拉菜单未展开时元素不存在
183
-
148
+ _this.scrollEle = document.querySelector(".".concat(_this.dropdownClassName));
149
+ // 下拉菜单未展开时元素不存在
184
150
  if (!_this.scrollEle) return;
185
-
186
151
  _this.scrollEle.addEventListener('scroll', _this.onScroll, false);
187
-
188
152
  _this.inputEle = document.querySelector("#".concat(_this.id));
189
153
  if (!_this.inputEle) return;
190
-
191
154
  _this.inputEle.addEventListener('keydown', _this.onKeyDown, false);
192
155
  }
193
- }); // 模拟 antd select 按下 上下箭头 键时滚动列表
194
-
156
+ });
157
+ // 模拟 antd select 按下 上下箭头 键时滚动列表
195
158
  Object.defineProperty(_assertThisInitialized(_this), "onKeyDown", {
196
159
  enumerable: true,
197
160
  configurable: true,
198
161
  writable: true,
199
162
  value: function value(e) {
200
163
  var _ref = e || {},
201
- keyCode = _ref.keyCode;
202
-
164
+ keyCode = _ref.keyCode;
203
165
  setTimeout(function () {
204
166
  var activeItem = document.querySelector(".".concat(_this.dropdownClassName, " .ant-select-dropdown-menu-item-active"));
205
167
  if (!activeItem) return;
206
168
  var offsetTop = activeItem.offsetTop;
207
169
  var isUp = ARROW_CODE[keyCode] === 'up';
208
- var isDown = ARROW_CODE[keyCode] === 'down'; // 在所有列表第一行按上键
209
-
170
+ var isDown = ARROW_CODE[keyCode] === 'down';
171
+ // 在所有列表第一行按上键
210
172
  if (offsetTop - _this.prevTop > DROPDOWN_HEIGHT && isUp) {
211
173
  _this.scrollEle.scrollTo(0, _this.allHeight - DROPDOWN_HEIGHT);
212
-
213
174
  _this.prevTop = _this.allHeight;
214
175
  return;
215
- } // 在所有列表中最后一行按下键
216
-
217
-
176
+ }
177
+ // 在所有列表中最后一行按下键
218
178
  if (_this.prevTop > offsetTop + DROPDOWN_HEIGHT && isDown) {
219
179
  _this.scrollEle.scrollTo(0, 0);
220
-
221
180
  _this.prevTop = 0;
222
181
  return;
223
182
  }
224
-
225
- _this.prevTop = offsetTop; // 向下滚动到下拉框最后一行时,向下滚动一行的高度
226
-
183
+ _this.prevTop = offsetTop;
184
+ // 向下滚动到下拉框最后一行时,向下滚动一行的高度
227
185
  if (offsetTop > _this.scrollEle.scrollTop + DROPDOWN_HEIGHT - _this.ITEM_HEIGHT + 10 && isDown) {
228
186
  _this.scrollEle.scrollTo(0, _this.scrollTop + _this.ITEM_HEIGHT);
229
-
230
187
  return;
231
- } // 向上滚动到下拉框第一一行时,向上滚动一行的高度
232
-
233
-
188
+ }
189
+ // 向上滚动到下拉框第一一行时,向上滚动一行的高度
234
190
  if (offsetTop < _this.scrollEle.scrollTop && isUp) {
235
191
  _this.scrollEle.scrollTo(0, _this.scrollTop - _this.ITEM_HEIGHT);
236
192
  }
@@ -251,15 +207,12 @@ function (_PureComponent) {
251
207
  writable: true,
252
208
  value: function value() {
253
209
  _this.allList = _this.getUseChildrenList();
254
-
255
210
  var _this$getStartAndEndI = _this.getStartAndEndIndex(),
256
- startIndex = _this$getStartAndEndI.startIndex,
257
- endIndex = _this$getStartAndEndI.endIndex;
258
-
259
- _this.prevScrollTop = _this.scrollTop; // 重新渲染列表组件 Wrap
260
-
211
+ startIndex = _this$getStartAndEndI.startIndex,
212
+ endIndex = _this$getStartAndEndI.endIndex;
213
+ _this.prevScrollTop = _this.scrollTop;
214
+ // 重新渲染列表组件 Wrap
261
215
  var allHeight = _this.allList.length * _this.ITEM_HEIGHT || 100;
262
-
263
216
  _this.wrap.reactList(allHeight, startIndex, endIndex);
264
217
  }
265
218
  });
@@ -268,14 +221,14 @@ function (_PureComponent) {
268
221
  configurable: true,
269
222
  writable: true,
270
223
  value: function value() {
271
- _this.scrollTop = _this.scrollEle.scrollTop; // 滚动的高度
272
-
224
+ _this.scrollTop = _this.scrollEle.scrollTop;
225
+ // 滚动的高度
273
226
  var delta = _this.prevScrollTop - _this.scrollTop;
274
227
  delta = delta < 0 ? 0 - delta : delta;
275
228
  delta > _this.reactDelta && _this.onScrollReal();
276
229
  }
277
- }); // 列表可展示所有 children
278
-
230
+ });
231
+ // 列表可展示所有 children
279
232
  Object.defineProperty(_assertThisInitialized(_this), "getUseChildrenList", {
280
233
  enumerable: true,
281
234
  configurable: true,
@@ -298,8 +251,8 @@ function (_PureComponent) {
298
251
  endIndex: endIndex
299
252
  };
300
253
  }
301
- }); // 须使用 setTimeout 确保在 dom 加载完成之后添加事件
302
-
254
+ });
255
+ // 须使用 setTimeout 确保在 dom 加载完成之后添加事件
303
256
  Object.defineProperty(_assertThisInitialized(_this), "setSuperDrowDownMenu", {
304
257
  enumerable: true,
305
258
  configurable: true,
@@ -307,18 +260,16 @@ function (_PureComponent) {
307
260
  value: function value(visible) {
308
261
  if (!visible) return;
309
262
  _this.allList = _this.getUseChildrenList();
310
-
311
263
  if (!_this.eventTimer || !_this.scrollEle) {
312
264
  _this.eventTimer = setTimeout(function () {
313
265
  return _this.addEvent();
314
266
  }, 0);
315
267
  } else {
316
- var allHeight = _this.allList.length * _this.ITEM_HEIGHT || 100; // 下拉列表单独重新渲染
317
-
268
+ var allHeight = _this.allList.length * _this.ITEM_HEIGHT || 100;
269
+ // 下拉列表单独重新渲染
318
270
  var _this$getStartAndEndI2 = _this.getStartAndEndIndex(),
319
- startIndex = _this$getStartAndEndI2.startIndex,
320
- endIndex = _this$getStartAndEndI2.endIndex;
321
-
271
+ startIndex = _this$getStartAndEndI2.startIndex,
272
+ endIndex = _this$getStartAndEndI2.endIndex;
322
273
  setTimeout(function () {
323
274
  _this.wrap && _this.wrap.reactList(allHeight, startIndex, endIndex);
324
275
  }, 0);
@@ -333,30 +284,28 @@ function (_PureComponent) {
333
284
  var onDropdownVisibleChange = _this.props.onDropdownVisibleChange;
334
285
  onDropdownVisibleChange && onDropdownVisibleChange(visible);
335
286
  var _this$state = _this.state,
336
- value = _this$state.value,
337
- children = _this$state.children; // 关闭下拉框前清空筛选条件,防止下次打开任然显示筛选后的 options
338
-
287
+ value = _this$state.value,
288
+ children = _this$state.children;
289
+ // 关闭下拉框前清空筛选条件,防止下次打开任然显示筛选后的 options
339
290
  if (!visible) {
340
291
  // 定时器确保关闭后再设置 filterChildren,防止列表刷新闪烁
341
292
  setTimeout(function () {
342
293
  _this.setState({
343
294
  filterChildren: null
344
295
  });
345
-
346
296
  _this.setDefaultScrollTop(value);
347
- }, 100); // this.removeEvent();
297
+ }, 100);
298
+ // this.removeEvent();
348
299
  } else {
349
300
  // this.addEvent();
350
301
  if (value) {
351
302
  // 如果已有 value, 设置默认滚动位置
352
- _this.setDefaultScrollTop(); // 设置下拉列表显示数据
353
-
354
-
303
+ _this.setDefaultScrollTop();
304
+ // 设置下拉列表显示数据
355
305
  _this.setSuperDrowDownMenu(visible);
356
306
  } else if (!value && value !== 0 && children && children.length > 0) {
357
307
  // 无数据时,下拉回归至第一个
358
308
  var val = children[0].props.value;
359
-
360
309
  _this.setDefaultScrollTop(val);
361
310
  }
362
311
  }
@@ -370,20 +319,19 @@ function (_PureComponent) {
370
319
  var onDeselect = _this.props.onDeselect;
371
320
  onDeselect && onDeselect(_value);
372
321
  }
373
- }); // 在搜索重新计算下拉滚动条高度
374
-
322
+ });
323
+ // 在搜索重新计算下拉滚动条高度
375
324
  Object.defineProperty(_assertThisInitialized(_this), "onChange", {
376
325
  enumerable: true,
377
326
  configurable: true,
378
327
  writable: true,
379
328
  value: function value(_value2, opt) {
380
329
  var _this$props2 = _this.props,
381
- showSearch = _this$props2.showSearch,
382
- onChange = _this$props2.onChange,
383
- autoClearSearchValue = _this$props2.autoClearSearchValue,
384
- maxCount = _this$props2.maxCount,
385
- mode = _this$props2.mode;
386
-
330
+ showSearch = _this$props2.showSearch,
331
+ onChange = _this$props2.onChange,
332
+ autoClearSearchValue = _this$props2.autoClearSearchValue,
333
+ maxCount = _this$props2.maxCount,
334
+ mode = _this$props2.mode;
387
335
  if (showSearch || _this.isMultiple) {
388
336
  // 搜索模式下选择后是否需要重置搜索状态
389
337
  if (autoClearSearchValue !== false) {
@@ -395,7 +343,6 @@ function (_PureComponent) {
395
343
  });
396
344
  }
397
345
  }
398
-
399
346
  if (mode === 'multiple') {
400
347
  if (_value2.length <= maxCount) {
401
348
  _this.setState({
@@ -407,9 +354,7 @@ function (_PureComponent) {
407
354
  value: _value2
408
355
  });
409
356
  }
410
-
411
357
  onChange && onChange(_value2, opt);
412
-
413
358
  if (mode !== 'multiple') {
414
359
  _this.select && _this.select.blur();
415
360
  }
@@ -421,17 +366,14 @@ function (_PureComponent) {
421
366
  writable: true,
422
367
  value: function value(v) {
423
368
  var _this$props3 = _this.props,
424
- showSearch = _this$props3.showSearch,
425
- onSearch = _this$props3.onSearch,
426
- filterOption = _this$props3.filterOption,
427
- arr = _this$props3.children;
428
-
369
+ showSearch = _this$props3.showSearch,
370
+ onSearch = _this$props3.onSearch,
371
+ filterOption = _this$props3.filterOption,
372
+ arr = _this$props3.children;
429
373
  var children = _this.turnChildren(arr);
430
-
431
374
  if (showSearch && filterOption !== false) {
432
375
  // 须根据 filterOption(如有该自定义函数)手动 filter 搜索匹配的列表
433
376
  var filterChildren = null;
434
-
435
377
  if (typeof filterOption === 'function') {
436
378
  filterChildren = children.filter(function (item) {
437
379
  return filterOption(v, item);
@@ -440,17 +382,16 @@ function (_PureComponent) {
440
382
  filterChildren = children.filter(function (item) {
441
383
  return _this.filterOption(v, item);
442
384
  });
443
- } // 搜索框有值,去除disabled=true的children
444
-
445
-
385
+ }
386
+ // 搜索框有值,去除disabled=true的children
446
387
  var newFilterChild = [];
447
388
  filterChildren && filterChildren.forEach(function (item, index) {
448
389
  if (!item.props.disabled) {
449
390
  newFilterChild.push(item);
450
391
  }
451
392
  });
452
- filterChildren = newFilterChild; // 设置下拉列表显示数据
453
-
393
+ filterChildren = newFilterChild;
394
+ // 设置下拉列表显示数据
454
395
  _this.setState({
455
396
  filterChildren: v === '' ? null : filterChildren
456
397
  }, function () {
@@ -458,16 +399,13 @@ function (_PureComponent) {
458
399
  // 搜索后需要重置滚动位置到0,防止上次 scrollTop 位置无数据
459
400
  if (filterChildren) {
460
401
  _this.scrollTop = 0;
461
-
462
402
  _this.scrollEle.scrollTo(0, 0);
463
- } // 搜索成功后需要重新设置列表的总高度
464
-
465
-
403
+ }
404
+ // 搜索成功后需要重新设置列表的总高度
466
405
  _this.setSuperDrowDownMenu(true);
467
406
  }, 0);
468
407
  });
469
408
  }
470
-
471
409
  onSearch && onSearch(v);
472
410
  }
473
411
  });
@@ -488,15 +426,11 @@ function (_PureComponent) {
488
426
  value: function value(data) {
489
427
  var value = _this.state.value;
490
428
  var arr = _this.props.children;
491
-
492
429
  var children = _this.turnChildren(arr);
493
-
494
430
  var val = data || data === 0 ? data : value;
495
-
496
431
  for (var i = 0; i < children.length; i++) {
497
432
  var item = children[i];
498
433
  var itemValue = item.props.value;
499
-
500
434
  if (itemValue === val || Array.isArray(val) && val.includes(itemValue)) {
501
435
  var _ret = function () {
502
436
  var targetScrollTop = i * _this.ITEM_HEIGHT;
@@ -504,14 +438,12 @@ function (_PureComponent) {
504
438
  if (!_this.scrollEle) {
505
439
  _this.addEvent();
506
440
  }
507
-
508
441
  _this.scrollEle && _this.scrollEle.scrollTo(0, targetScrollTop);
509
442
  }, 100);
510
443
  return {
511
444
  v: void 0
512
445
  };
513
446
  }();
514
-
515
447
  if (_typeof(_ret) === "object") return _ret.v;
516
448
  }
517
449
  }
@@ -523,24 +455,19 @@ function (_PureComponent) {
523
455
  writable: true,
524
456
  value: function value() {
525
457
  if (!_this.scrollEle) return;
526
-
527
458
  _this.scrollEle.removeEventListener('scroll', _this.onScroll, false);
528
-
529
459
  if (!_this.inputEle) return;
530
-
531
460
  _this.inputEle.removeEventListener('keydown', _this.onKeyDown, false);
532
461
  }
533
462
  });
534
463
  var mode = props.mode,
535
- defaultValue = props.defaultValue,
536
- value = props.value,
537
- optionHeight = props.optionHeight,
538
- arr = props.children;
464
+ defaultValue = props.defaultValue,
465
+ value = props.value,
466
+ optionHeight = props.optionHeight,
467
+ arr = props.children;
539
468
  _this.isMultiple = ['tags', 'multiple'].includes(mode);
540
-
541
- var children = _this.turnChildren(arr); // 设置默认 value
542
-
543
-
469
+ var children = _this.turnChildren(arr);
470
+ // 设置默认 value
544
471
  var defaultV = _this.isMultiple ? [] : '';
545
472
  defaultV = value || defaultValue || defaultV;
546
473
  _this.state = {
@@ -549,62 +476,58 @@ function (_PureComponent) {
549
476
  value: defaultV,
550
477
  maxWidth: null,
551
478
  selectWidth: null
552
- }; // 下拉菜单项行高
553
-
554
- _this.ITEM_HEIGHT = optionHeight || ITEM_HEIGHT_CFG[props.size || 'default']; // 可视区 dom 高度
555
-
556
- _this.visibleDomHeight = _this.ITEM_HEIGHT * ITEM_ELEMENT_NUMBER; // 滚动时重新渲染的 scrollTop 判断值,大于 reactDelta 则刷新下拉列表
557
-
558
- _this.reactDelta = _this.visibleDomHeight / 3; // 是否拖动滚动条快速滚动状态
559
-
560
- _this.isStopReact = false; // 上一次滚动的 scrollTop 值
561
-
562
- _this.prevScrollTop = 0; // 上一次按下方向键时 scrollTop 值
563
-
479
+ };
480
+ // 下拉菜单项行高
481
+ _this.ITEM_HEIGHT = optionHeight || ITEM_HEIGHT_CFG[props.size || 'default'];
482
+ // 可视区 dom 高度
483
+ _this.visibleDomHeight = _this.ITEM_HEIGHT * ITEM_ELEMENT_NUMBER;
484
+ // 滚动时重新渲染的 scrollTop 判断值,大于 reactDelta 则刷新下拉列表
485
+ _this.reactDelta = _this.visibleDomHeight / 3;
486
+ // 是否拖动滚动条快速滚动状态
487
+ _this.isStopReact = false;
488
+ // 上一次滚动的 scrollTop 值
489
+ _this.prevScrollTop = 0;
490
+ // 上一次按下方向键时 scrollTop 值
564
491
  _this.prevTop = 0;
565
- _this.scrollTop = 0; // className
566
-
492
+ _this.scrollTop = 0;
493
+ // className
567
494
  _this.dropdownClassName = "dc".concat(+new Date());
568
495
  _this.id = "sid".concat(+new Date());
569
496
  return _this;
570
497
  }
571
-
572
498
  _createClass(SuperSelect, [{
573
499
  key: "componentDidMount",
574
500
  value: function componentDidMount() {
575
501
  var _this2 = this;
576
-
577
502
  // defaultOpens=true 时添加滚动事件
578
503
  setTimeout(function () {
579
504
  _this2.addEvent();
580
505
  }, 500);
581
506
  var arr = this.props.children;
582
- var children = this.turnChildren(arr); // if (children && children.length > 0) {
583
-
584
- this.formulaWidth(); // }
507
+ var children = this.turnChildren(arr);
508
+ // if (children && children.length > 0) {
509
+ this.formulaWidth();
510
+ // }
585
511
  }
586
512
  }, {
587
513
  key: "componentDidUpdate",
588
514
  value: function componentDidUpdate(prevProps) {
589
515
  var _this$props4 = this.props,
590
- mode = _this$props4.mode,
591
- defaultValue = _this$props4.defaultValue,
592
- value = _this$props4.value,
593
- children = _this$props4.children;
516
+ mode = _this$props4.mode,
517
+ defaultValue = _this$props4.defaultValue,
518
+ value = _this$props4.value,
519
+ children = _this$props4.children;
594
520
  var arr = this.turnChildren(children);
595
-
596
521
  if (prevProps.children !== children) {
597
522
  this.isMultiple = ['tags', 'multiple'].includes(mode);
598
523
  this.setState({
599
524
  children: arr || [],
600
525
  filterChildren: null
601
526
  });
602
-
603
527
  if (arr && arr.length > 0) {
604
528
  this.formulaWidth();
605
529
  }
606
530
  }
607
-
608
531
  if (prevProps.value !== value) {
609
532
  // 更新时设置默认 value
610
533
  var defaultV = this.isMultiple ? [] : '';
@@ -623,30 +546,23 @@ function (_PureComponent) {
623
546
  key: "render",
624
547
  value: function render() {
625
548
  var _this3 = this;
626
-
627
549
  var _this$state2 = this.state,
628
- maxWidth = _this$state2.maxWidth,
629
- selectWidth = _this$state2.selectWidth;
630
-
550
+ maxWidth = _this$state2.maxWidth,
551
+ selectWidth = _this$state2.selectWidth;
631
552
  var _a = this.props,
632
- dropdownStyle = _a.dropdownStyle,
633
- optionLabelProp = _a.optionLabelProp,
634
- dropdownClassName = _a.dropdownClassName,
635
- props = __rest(_a, ["dropdownStyle", "optionLabelProp", "dropdownClassName"]);
636
-
553
+ dropdownStyle = _a.dropdownStyle,
554
+ optionLabelProp = _a.optionLabelProp,
555
+ dropdownClassName = _a.dropdownClassName,
556
+ props = __rest(_a, ["dropdownStyle", "optionLabelProp", "dropdownClassName"]);
637
557
  this.allList = this.getUseChildrenList();
638
558
  this.allHeight = this.allList.length * this.ITEM_HEIGHT || 100;
639
-
640
559
  var _this$getStartAndEndI3 = this.getStartAndEndIndex(),
641
- startIndex = _this$getStartAndEndI3.startIndex,
642
- endIndex = _this$getStartAndEndI3.endIndex;
643
-
560
+ startIndex = _this$getStartAndEndI3.startIndex,
561
+ endIndex = _this$getStartAndEndI3.endIndex;
644
562
  var dynamicWidth = maxWidth;
645
-
646
563
  if (this.allList.length === 0 || maxWidth < selectWidth) {
647
564
  dynamicWidth = selectWidth;
648
565
  }
649
-
650
566
  dropdownStyle = Object.assign(Object.assign({
651
567
  maxHeight: "".concat(DROPDOWN_HEIGHT, "px")
652
568
  }, dropdownStyle), {
@@ -654,19 +570,17 @@ function (_PureComponent) {
654
570
  position: 'relative',
655
571
  maxWidth: dynamicWidth
656
572
  });
657
- var value = this.state.value; // 判断处于 antd Form 中时不自动设置 value
658
-
659
- var _props = Object.assign({}, props); // 先删除 value,再手动赋值,防止空 value 影响 placeholder
660
-
661
-
662
- delete _props.value; // value 为空字符会隐藏 placeholder,改为 undefined
663
-
573
+ var value = this.state.value;
574
+ // 判断处于 antd Form 中时不自动设置 value
575
+ var _props = Object.assign({}, props);
576
+ // 先删除 value,再手动赋值,防止空 value 影响 placeholder
577
+ delete _props.value;
578
+ // value 为空字符会隐藏 placeholder,改为 undefined
664
579
  if (typeof value === 'string' && !value) {
665
580
  _props.value = undefined;
666
581
  } else {
667
582
  _props.value = value;
668
583
  }
669
-
670
584
  optionLabelProp = optionLabelProp || 'children';
671
585
  return _react["default"].createElement(_select["default"], Object.assign({}, _props, {
672
586
  id: this.id,
@@ -690,7 +604,6 @@ function (_PureComponent) {
690
604
  image: _empty["default"].PRESENTED_IMAGE_SIMPLE
691
605
  }));
692
606
  }
693
-
694
607
  return _react["default"].createElement(_DropDownWrap["default"], Object.assign({}, {
695
608
  startIndex: startIndex,
696
609
  endIndex: endIndex,
@@ -706,10 +619,8 @@ function (_PureComponent) {
706
619
  }), this.allList);
707
620
  }
708
621
  }]);
709
-
710
622
  return SuperSelect;
711
623
  }(_react.PureComponent);
712
-
713
624
  SuperSelect.Option = Option;
714
625
  var _default = SuperSelect;
715
626
  exports["default"] = _default;