tntd 2.7.27 → 2.7.29

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 (1248) hide show
  1. package/es/_util/context.js +12 -0
  2. package/es/_util/context.js.map +1 -0
  3. package/es/_util/defaultRenderEmpty.js +31 -0
  4. package/es/_util/defaultRenderEmpty.js.map +1 -0
  5. package/es/_util/hooks/useFlexGapSupport.js +9 -0
  6. package/es/_util/hooks/useFlexGapSupport.js.map +1 -0
  7. package/es/_util/hooks/useForceUpdate.js +5 -0
  8. package/es/_util/hooks/useForceUpdate.js.map +1 -0
  9. package/es/_util/motion.js +41 -10
  10. package/es/_util/motion.js.map +1 -1
  11. package/es/_util/reactNode.js +16 -0
  12. package/es/_util/reactNode.js.map +1 -0
  13. package/es/_util/responsiveObserve.js +59 -0
  14. package/es/_util/responsiveObserve.js.map +1 -0
  15. package/es/_util/styleChecker.js +26 -0
  16. package/es/_util/styleChecker.js.map +1 -0
  17. package/es/_util/type.js +1 -2
  18. package/es/_util/type.js.map +1 -1
  19. package/es/_util/warning.js +3 -4
  20. package/es/_util/warning.js.map +1 -1
  21. package/es/actions/index.js +22 -8
  22. package/es/affix/index.js +1 -2
  23. package/es/alert/index.js +1 -2
  24. package/es/anchor/index.js +1 -2
  25. package/es/array-input/icon.js +24 -6
  26. package/es/array-input/index.js +203 -119
  27. package/es/auth-context/index.js +1 -2
  28. package/es/auto-complete/index.js +1 -2
  29. package/es/avatar/index.js +1 -2
  30. package/es/back-top/index.js +1 -2
  31. package/es/badge/index.js +1 -2
  32. package/es/breadcrumb/index.js +1 -2
  33. package/es/button/button.js +29 -36
  34. package/es/button/button.js.map +1 -1
  35. package/es/button/index.js +1 -2
  36. package/es/calendar/index.js +1 -2
  37. package/es/card/card.js +19 -15
  38. package/es/card/index.js +1 -2
  39. package/es/carousel/index.js +1 -2
  40. package/es/cascader/index.js +1 -2
  41. package/es/check-card/group.js +186 -138
  42. package/es/check-card/index.js +150 -107
  43. package/es/checkbox/checkbox-group.js +1 -2
  44. package/es/checkbox/index.js +1 -2
  45. package/es/col/index.js +1 -2
  46. package/es/collapse/index.js +1 -2
  47. package/es/color-picker/ColorPicker.js +126 -80
  48. package/es/color-picker/index.js +8 -5
  49. package/es/columns/index.js +66 -30
  50. package/es/columns/style/index.js +1 -2
  51. package/es/comment/index.js +1 -2
  52. package/es/config-provider/DisabledContext.js +9 -5
  53. package/es/config-provider/SizeContext.js +7 -3
  54. package/es/config-provider/config-provider.js +1 -2
  55. package/es/config-provider/index.js +1 -2
  56. package/es/connect/index.js +23 -20
  57. package/es/date-picker/index.js +9 -6
  58. package/es/descriptions/descriptions.js +38 -30
  59. package/es/descriptions/index.js +1 -2
  60. package/es/development-login/LoginModal.js +81 -46
  61. package/es/development-login/index.js +17 -8
  62. package/es/divider/index.js +1 -2
  63. package/es/drawer/drawer.js +27 -20
  64. package/es/drawer/index.js +1 -2
  65. package/es/dropdown/index.js +1 -2
  66. package/es/ellipsis/Svg/CopySVG.js +63 -16
  67. package/es/ellipsis/Svg/TickSVG.js +41 -11
  68. package/es/ellipsis/index.js +137 -99
  69. package/es/empty/empty.js +58 -48
  70. package/es/empty/empty.stories.js +5 -6
  71. package/es/empty/index.js +1 -2
  72. package/es/exception/exception.js +32 -19
  73. package/es/exception/index.js +1 -2
  74. package/es/form/form.js +63 -55
  75. package/es/form/index.js +1 -2
  76. package/es/grid/RowContext.js +3 -0
  77. package/es/grid/RowContext.js.map +1 -0
  78. package/es/grid/col.js +103 -0
  79. package/es/grid/col.js.map +1 -0
  80. package/es/grid/hooks/useBreakpoint.js +18 -0
  81. package/es/grid/hooks/useBreakpoint.js.map +1 -0
  82. package/es/grid/index.js +14 -0
  83. package/es/grid/index.js.map +1 -0
  84. package/es/grid/row.js +154 -0
  85. package/es/grid/row.js.map +1 -0
  86. package/es/grid/style/index.js +2 -0
  87. package/es/grid/style/index.js.map +1 -0
  88. package/es/grid/style/index.less +124 -0
  89. package/es/grid/style/mixin.less +57 -0
  90. package/es/grid/style/rtl.less +69 -0
  91. package/es/handle/index.js +131 -116
  92. package/es/handle/index.js.map +1 -1
  93. package/es/icon/index.js +1 -2
  94. package/es/icon-list/index.js +1 -120
  95. package/es/img/Contain.js +60 -39
  96. package/es/img/Cover.js +98 -72
  97. package/es/img/index.js +48 -32
  98. package/es/index.js +3 -2
  99. package/es/index.js.map +1 -1
  100. package/es/input/index.js +1 -2
  101. package/es/input/input.js +93 -46
  102. package/es/input-number/index.js +1 -2
  103. package/es/label/index.js +115 -98
  104. package/es/layout/index.js +1 -2
  105. package/es/list/index.js +1 -2
  106. package/es/loading-button/index.js +33 -28
  107. package/es/locale/default.js +3 -4
  108. package/es/locale/en_US.js +41 -42
  109. package/es/locale/index.js +1 -2
  110. package/es/locale/zh_CN.js +34 -35
  111. package/es/locale-provider/index.js +2 -3
  112. package/es/mentions/index.js +1 -2
  113. package/es/menu/index.js +1 -2
  114. package/es/message/index.js +1 -2
  115. package/es/modal/index.js +1 -2
  116. package/es/modal/modal.js +24 -15
  117. package/es/modal/modal.js.map +1 -1
  118. package/es/notification/index.js +1 -2
  119. package/es/page/Box.js +49 -33
  120. package/es/page/index.js +120 -84
  121. package/es/page/utils.js +12 -14
  122. package/es/page-header/index.js +1 -2
  123. package/es/pagination/index.js +1 -2
  124. package/es/popconfirm/index.js +1 -2
  125. package/es/popover/index.js +1 -2
  126. package/es/prev-locale.js +49 -47
  127. package/es/preview-text/index.js +247 -177
  128. package/es/progress/index.js +1 -2
  129. package/es/query-form/Field/Checkbox.js +20 -17
  130. package/es/query-form/Field/Select.js +54 -39
  131. package/es/query-form/Field/SelectInput.js +65 -45
  132. package/es/query-form/Field/fieldsMap.js +19 -20
  133. package/es/query-form/Field/index.js +108 -67
  134. package/es/query-form/createActions.js +46 -46
  135. package/es/query-form/index.js +327 -247
  136. package/es/query-form/useForm.js +3 -4
  137. package/es/query-list-scene/List.js +321 -255
  138. package/es/query-list-scene/QueryForm.js +132 -94
  139. package/es/query-list-scene/QueryListScene.js +29 -21
  140. package/es/query-list-scene/Title.js +6 -4
  141. package/es/query-list-scene/Toolbar.js +21 -15
  142. package/es/query-list-scene/createActions.js +60 -60
  143. package/es/query-list-scene/index.js +1 -2
  144. package/es/query-list-scene/useActions.js +3 -4
  145. package/es/radio/index.js +1 -2
  146. package/es/radio/radio-group.js +1 -2
  147. package/es/rate/index.js +1 -2
  148. package/es/render-empty/index.js +1 -2
  149. package/es/render-empty/render-empty.js +19 -16
  150. package/es/result/index.js +1 -2
  151. package/es/row/index.js +1 -2
  152. package/es/segmented/index.js +55 -38
  153. package/es/select/index.js +1 -2
  154. package/es/select/select.js +43 -27
  155. package/es/skeleton/index.js +1 -2
  156. package/es/slider/index.js +1 -2
  157. package/es/spin/index.js +1 -2
  158. package/es/statistic/index.js +1 -2
  159. package/es/steps/index.js +1 -2
  160. package/es/steps/steps.js +51 -35
  161. package/es/svg-components/illustration-403.js +206 -58
  162. package/es/svg-components/illustration-404.js +290 -75
  163. package/es/svg-components/illustration-500.js +321 -83
  164. package/es/svg-components/illustration-empty.js +54 -15
  165. package/es/svg-components/illustration-failure.js +112 -36
  166. package/es/svg-components/illustration-no-access.js +114 -35
  167. package/es/svg-components/illustration-no-chart.js +134 -37
  168. package/es/svg-components/illustration-no-result.js +92 -32
  169. package/es/svg-components/illustration-offline.js +131 -43
  170. package/es/svg-components/illustration-success.js +137 -43
  171. package/es/svg-components/index.js +1 -2
  172. package/es/switch/index.js +1 -2
  173. package/es/switch/switch.js +4 -3
  174. package/es/table/assets/image-loading-background.js +45 -17
  175. package/es/table/assets/image-loading.js +26 -5
  176. package/es/table/constants.js +1 -55
  177. package/es/table/constants.js.map +1 -1
  178. package/es/table/context.js +1 -2
  179. package/es/table/hooks/index.js +1 -2
  180. package/es/table/hooks/use-column-setting.js +13 -16
  181. package/es/table/index.js +1 -2
  182. package/es/table/table.js +163 -170
  183. package/es/table/table.js.map +1 -1
  184. package/es/table/table.stories.js +148 -139
  185. package/es/table/total-shower.js +8 -4
  186. package/es/table/utils.js +17 -18
  187. package/es/tabs/index.js +1 -2
  188. package/es/tabs/tabPane.js +1 -2
  189. package/es/tabs/tabs.js +35 -27
  190. package/es/tag/index.js +1 -2
  191. package/es/time-picker/index.js +1 -2
  192. package/es/timeline/index.js +1 -2
  193. package/es/title/index.js +32 -20
  194. package/es/tntd-cascader/AntdCascader/component/DisabledContext.js +9 -5
  195. package/es/tntd-cascader/AntdCascader/component/FormItemInputContext.js +1 -2
  196. package/es/tntd-cascader/AntdCascader/component/SizeContext.js +1 -2
  197. package/es/tntd-cascader/AntdCascader/component/context.js +5 -7
  198. package/es/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js +22 -10
  199. package/es/tntd-cascader/AntdCascader/component/getIcons.js +72 -50
  200. package/es/tntd-cascader/AntdCascader/component/useCompactItemContext.js +22 -20
  201. package/es/tntd-cascader/AntdCascader/config/utils.js +17 -18
  202. package/es/tntd-cascader/AntdCascader/config/warning.js +9 -10
  203. package/es/tntd-cascader/AntdCascader/index.js +189 -118
  204. package/es/tntd-cascader/AntdCascader/interface.js +1 -2
  205. package/es/tntd-cascader/index.js +1 -2
  206. package/es/tntd-cascader/rc-cascader/Cascader.js +256 -239
  207. package/es/tntd-cascader/rc-cascader/OptionList/Checkbox.js +21 -11
  208. package/es/tntd-cascader/rc-cascader/OptionList/Column.js +175 -116
  209. package/es/tntd-cascader/rc-cascader/OptionList/index.js +180 -128
  210. package/es/tntd-cascader/rc-cascader/OptionList/useActive.js +22 -19
  211. package/es/tntd-cascader/rc-cascader/OptionList/useKeyboard.js +144 -137
  212. package/es/tntd-cascader/rc-cascader/context.js +1 -2
  213. package/es/tntd-cascader/rc-cascader/hooks/useDisplayValues.js +44 -37
  214. package/es/tntd-cascader/rc-cascader/hooks/useEntities.js +25 -24
  215. package/es/tntd-cascader/rc-cascader/hooks/useMissingValues.js +15 -17
  216. package/es/tntd-cascader/rc-cascader/hooks/useRefFunc.js +7 -8
  217. package/es/tntd-cascader/rc-cascader/hooks/useSearchConfig.js +20 -21
  218. package/es/tntd-cascader/rc-cascader/hooks/useSearchOptions.js +51 -41
  219. package/es/tntd-cascader/rc-cascader/index.js +1 -2
  220. package/es/tntd-cascader/rc-cascader/utils/commonUtil.js +33 -27
  221. package/es/tntd-cascader/rc-cascader/utils/treeUtil.js +29 -32
  222. package/es/tntd-cascader/rc-cascader/utils/warningPropsUtil.js +26 -23
  223. package/es/tntd-form/ErrorList.js +76 -42
  224. package/es/tntd-form/ErrorList.js.map +1 -1
  225. package/es/tntd-form/Form.js +118 -97
  226. package/es/tntd-form/FormItem/ItemHolder.js +127 -118
  227. package/es/tntd-form/FormItem/ItemHolder.js.map +1 -1
  228. package/es/tntd-form/FormItem/index.js +235 -209
  229. package/es/tntd-form/FormItem/index.js.map +1 -1
  230. package/es/tntd-form/FormItemInput.js +73 -32
  231. package/es/tntd-form/FormItemInput.js.map +1 -1
  232. package/es/tntd-form/FormItemLabel.js +88 -63
  233. package/es/tntd-form/FormItemLabel.js.map +1 -1
  234. package/es/tntd-form/FormList.js +34 -28
  235. package/es/tntd-form/FormList.js.map +1 -1
  236. package/es/tntd-form/_util/context.js +12 -0
  237. package/es/tntd-form/_util/context.js.map +1 -0
  238. package/es/tntd-form/_util/defaultRenderEmpty.js +31 -0
  239. package/es/tntd-form/_util/defaultRenderEmpty.js.map +1 -0
  240. package/es/tntd-form/_util/hooks/useFlexGapSupport.js +9 -0
  241. package/es/tntd-form/_util/hooks/useFlexGapSupport.js.map +1 -0
  242. package/es/tntd-form/_util/hooks/useForceUpdate.js +5 -0
  243. package/es/tntd-form/_util/hooks/useForceUpdate.js.map +1 -0
  244. package/es/tntd-form/_util/motion.js +36 -27
  245. package/es/tntd-form/_util/reactNode.js +10 -9
  246. package/es/tntd-form/_util/responsiveObserve.js +59 -0
  247. package/es/tntd-form/_util/responsiveObserve.js.map +1 -0
  248. package/es/tntd-form/_util/scrollTo.js +2 -2
  249. package/es/tntd-form/_util/styleChecker.js +26 -0
  250. package/es/tntd-form/_util/styleChecker.js.map +1 -0
  251. package/es/tntd-form/_util/type.js +1 -2
  252. package/es/tntd-form/_util/warning.js +3 -4
  253. package/es/tntd-form/_util/wave.js +2 -2
  254. package/es/tntd-form/context.js +29 -24
  255. package/es/tntd-form/grid/RowContext.js +3 -0
  256. package/es/tntd-form/grid/RowContext.js.map +1 -0
  257. package/es/tntd-form/grid/col.js +104 -0
  258. package/es/tntd-form/grid/col.js.map +1 -0
  259. package/es/tntd-form/grid/hooks/useBreakpoint.js +18 -0
  260. package/es/tntd-form/grid/hooks/useBreakpoint.js.map +1 -0
  261. package/es/tntd-form/grid/index.js +14 -0
  262. package/es/tntd-form/grid/index.js.map +1 -0
  263. package/es/tntd-form/grid/row.js +153 -0
  264. package/es/tntd-form/grid/row.js.map +1 -0
  265. package/es/tntd-form/grid/style/index.js +2 -0
  266. package/es/tntd-form/grid/style/index.js.map +1 -0
  267. package/es/tntd-form/hooks/useDebounce.js +11 -12
  268. package/es/tntd-form/hooks/useForm.js +33 -28
  269. package/es/tntd-form/hooks/useFormInstance.js +5 -4
  270. package/es/tntd-form/hooks/useFormItemStatus.js +9 -6
  271. package/es/tntd-form/hooks/useFormItemStatus.js.map +1 -1
  272. package/es/tntd-form/hooks/useFrameState.js +32 -33
  273. package/es/tntd-form/hooks/useItemRef.js +15 -14
  274. package/es/tntd-form/index.js +1 -3
  275. package/es/tntd-form/index.js.map +1 -1
  276. package/es/tntd-form/interface.js +1 -2
  277. package/es/tntd-form/style/index.js +1 -2
  278. package/es/tntd-form/tntd-form.stories.js +781 -383
  279. package/es/tntd-form/util.js +10 -13
  280. package/es/tntd-form/validateMessagesContext.js +1 -2
  281. package/es/tntd-icon/fonts/iconfont.js +36 -53
  282. package/es/tntd-icon/index.js +23 -17
  283. package/es/tntd-layout/ActionsContext.js +1 -2
  284. package/es/tntd-layout/AppList.js +135 -77
  285. package/es/tntd-layout/Application.js +42 -29
  286. package/es/tntd-layout/Avatar.js +80 -42
  287. package/es/tntd-layout/CompatibleLanguage.js +93 -56
  288. package/es/tntd-layout/EnterpriseLayout/Avatar.js +93 -47
  289. package/es/tntd-layout/EnterpriseLayout/Language.js +56 -34
  290. package/es/tntd-layout/EnterpriseLayout/Theme.js +45 -24
  291. package/es/tntd-layout/EnterpriseLayout/index.js +17 -9
  292. package/es/tntd-layout/GlobalNavigation/NavigationPopup.js +212 -153
  293. package/es/tntd-layout/GlobalNavigation/index.js +84 -50
  294. package/es/tntd-layout/Header.js +59 -26
  295. package/es/tntd-layout/HeaderActions.js +84 -34
  296. package/es/tntd-layout/HeaderNavs.js +46 -35
  297. package/es/tntd-layout/HeaderTabs.js +176 -140
  298. package/es/tntd-layout/Iconfont.js +1 -2
  299. package/es/tntd-layout/Language.js +55 -33
  300. package/es/tntd-layout/Layout.js +176 -78
  301. package/es/tntd-layout/Logo.js +52 -40
  302. package/es/tntd-layout/OrgAppList.js +208 -139
  303. package/es/tntd-layout/SideMenu.js +230 -160
  304. package/es/tntd-layout/Theme.js +47 -29
  305. package/es/tntd-layout/createActions.js +28 -29
  306. package/es/tntd-layout/images/index.js +31 -32
  307. package/es/tntd-layout/index.js +92 -60
  308. package/es/tntd-layout/paaslayout/CompactSideMenu.js +109 -65
  309. package/es/tntd-layout/paaslayout/Header.js +37 -14
  310. package/es/tntd-layout/paaslayout/Logo.js +2 -3
  311. package/es/tntd-layout/paaslayout/SideMenu.js +109 -63
  312. package/es/tntd-layout/paaslayout/index.js +159 -79
  313. package/es/tntd-layout/storage.js +18 -11
  314. package/es/tntd-modal/index.js +73 -32
  315. package/es/tntd-rc-select/_util/DisabledContext.js +9 -5
  316. package/es/tntd-rc-select/_util/FormItemInputContext.js +1 -2
  317. package/es/tntd-rc-select/_util/PurePanel.js +59 -48
  318. package/es/tntd-rc-select/_util/SizeContext.js +1 -2
  319. package/es/tntd-rc-select/_util/context.js +5 -7
  320. package/es/tntd-rc-select/_util/defaultRenderEmpty.js +21 -10
  321. package/es/tntd-rc-select/_util/getIcons.js +72 -50
  322. package/es/tntd-rc-select/_util/interface.js +1 -2
  323. package/es/tntd-rc-select/_util/motion.js +36 -27
  324. package/es/tntd-rc-select/_util/type.js +1 -2
  325. package/es/tntd-rc-select/_util/useCompactItemContext.js +22 -20
  326. package/es/tntd-rc-select/_util/warning.js +9 -10
  327. package/es/tntd-rc-select/index.js +131 -76
  328. package/es/tntd-second-page/index.js +47 -24
  329. package/es/tntd-select/DropDownWrap.js +73 -52
  330. package/es/tntd-select/index.js +593 -505
  331. package/es/tooltip/index.js +1 -2
  332. package/es/transfer/index.js +1 -2
  333. package/es/tree/index.js +1 -2
  334. package/es/tree-select/index.js +1 -2
  335. package/es/typography/index.js +1 -2
  336. package/es/upload/index.js +4 -3
  337. package/es/utils/checkAuth.js +24 -21
  338. package/es/utils/findMenuInfoByPath.js +33 -30
  339. package/es/utils/index.js +71 -65
  340. package/es/utils/lang.js +62 -112
  341. package/es/utils/lang.js.map +1 -1
  342. package/es/utils/simple-template.js +2 -3
  343. package/es/version/index.js +1 -2
  344. package/es/water-mark/index.js +98 -87
  345. package/lib/_util/context.d.ts.map +1 -0
  346. package/lib/_util/context.js +22 -0
  347. package/lib/_util/context.js.map +1 -0
  348. package/lib/_util/defaultRenderEmpty.d.ts.map +1 -0
  349. package/lib/_util/defaultRenderEmpty.js +44 -0
  350. package/lib/_util/defaultRenderEmpty.js.map +1 -0
  351. package/lib/_util/hooks/useFlexGapSupport.d.ts +3 -0
  352. package/lib/_util/hooks/useFlexGapSupport.d.ts.map +1 -0
  353. package/lib/_util/hooks/useFlexGapSupport.js +28 -0
  354. package/lib/_util/hooks/useFlexGapSupport.js.map +1 -0
  355. package/lib/_util/hooks/useForceUpdate.d.ts +3 -0
  356. package/lib/_util/hooks/useForceUpdate.d.ts.map +1 -0
  357. package/lib/_util/hooks/useForceUpdate.js +24 -0
  358. package/lib/_util/hooks/useForceUpdate.js.map +1 -0
  359. package/lib/_util/motion.d.ts +3 -0
  360. package/lib/_util/motion.d.ts.map +1 -1
  361. package/lib/_util/motion.js +54 -15
  362. package/lib/_util/motion.js.map +1 -1
  363. package/lib/_util/reactNode.d.ts +9 -0
  364. package/lib/_util/reactNode.d.ts.map +1 -0
  365. package/lib/{mention/index.js → _util/reactNode.js} +19 -17
  366. package/lib/_util/reactNode.js.map +1 -0
  367. package/lib/_util/responsiveObserve.d.ts +22 -0
  368. package/lib/_util/responsiveObserve.d.ts.map +1 -0
  369. package/lib/_util/responsiveObserve.js +73 -0
  370. package/lib/_util/responsiveObserve.js.map +1 -0
  371. package/lib/_util/styleChecker.d.ts +5 -0
  372. package/lib/_util/styleChecker.d.ts.map +1 -0
  373. package/lib/_util/styleChecker.js +42 -0
  374. package/lib/_util/styleChecker.js.map +1 -0
  375. package/lib/_util/type.d.ts.map +1 -1
  376. package/lib/_util/type.js +17 -5
  377. package/lib/_util/type.js.map +1 -1
  378. package/lib/_util/warning.d.ts.map +1 -1
  379. package/lib/_util/warning.js +17 -29
  380. package/lib/_util/warning.js.map +1 -1
  381. package/lib/actions/index.js +31 -14
  382. package/lib/affix/index.d.ts +3 -3
  383. package/lib/affix/index.js +23 -22
  384. package/lib/affix/index.js.map +1 -1
  385. package/lib/alert/index.d.ts +3 -3
  386. package/lib/alert/index.js +23 -22
  387. package/lib/alert/index.js.map +1 -1
  388. package/lib/anchor/index.d.ts +3 -3
  389. package/lib/anchor/index.js +23 -22
  390. package/lib/anchor/index.js.map +1 -1
  391. package/lib/array-input/icon.js +33 -12
  392. package/lib/array-input/index.js +254 -150
  393. package/lib/auth-context/index.js +10 -4
  394. package/lib/auto-complete/index.d.ts +3 -3
  395. package/lib/auto-complete/index.js +23 -22
  396. package/lib/auto-complete/index.js.map +1 -1
  397. package/lib/avatar/index.d.ts +3 -3
  398. package/lib/avatar/index.js +23 -22
  399. package/lib/avatar/index.js.map +1 -1
  400. package/lib/back-top/index.d.ts +3 -3
  401. package/lib/back-top/index.js +23 -22
  402. package/lib/back-top/index.js.map +1 -1
  403. package/lib/badge/index.d.ts +3 -3
  404. package/lib/badge/index.js +23 -22
  405. package/lib/badge/index.js.map +1 -1
  406. package/lib/breadcrumb/index.d.ts +3 -3
  407. package/lib/breadcrumb/index.js +23 -22
  408. package/lib/breadcrumb/index.js.map +1 -1
  409. package/lib/button/button.d.ts +9 -5
  410. package/lib/button/button.d.ts.map +1 -1
  411. package/lib/button/button.js +62 -71
  412. package/lib/button/button.js.map +1 -1
  413. package/lib/button/index.d.ts +1 -1
  414. package/lib/button/index.js +20 -19
  415. package/lib/button/index.js.map +1 -1
  416. package/lib/calendar/index.d.ts +3 -3
  417. package/lib/calendar/index.js +23 -22
  418. package/lib/calendar/index.js.map +1 -1
  419. package/lib/card/card.d.ts +3 -3
  420. package/lib/card/card.js +45 -51
  421. package/lib/card/card.js.map +1 -1
  422. package/lib/card/index.d.ts +1 -1
  423. package/lib/card/index.js +20 -19
  424. package/lib/card/index.js.map +1 -1
  425. package/lib/carousel/index.d.ts +3 -3
  426. package/lib/carousel/index.js +23 -22
  427. package/lib/carousel/index.js.map +1 -1
  428. package/lib/cascader/index.d.ts +3 -3
  429. package/lib/cascader/index.js +29 -26
  430. package/lib/cascader/index.js.map +1 -1
  431. package/lib/check-card/group.js +228 -171
  432. package/lib/check-card/index.js +171 -141
  433. package/lib/checkbox/checkbox-group.d.ts +1 -1
  434. package/lib/checkbox/checkbox-group.js +11 -9
  435. package/lib/checkbox/checkbox-group.js.map +1 -1
  436. package/lib/checkbox/index.d.ts +3 -3
  437. package/lib/checkbox/index.js +37 -25
  438. package/lib/checkbox/index.js.map +1 -1
  439. package/lib/col/index.d.ts +3 -3
  440. package/lib/col/index.js +23 -22
  441. package/lib/col/index.js.map +1 -1
  442. package/lib/collapse/index.d.ts +3 -3
  443. package/lib/collapse/index.js +24 -23
  444. package/lib/collapse/index.js.map +1 -1
  445. package/lib/color-picker/ColorPicker.js +156 -113
  446. package/lib/color-picker/index.js +18 -14
  447. package/lib/color-picker/index.js.map +1 -1
  448. package/lib/columns/index.js +81 -41
  449. package/lib/columns/style/index.js +1 -2
  450. package/lib/comment/index.d.ts +3 -3
  451. package/lib/comment/index.js +23 -22
  452. package/lib/comment/index.js.map +1 -1
  453. package/lib/config-provider/DisabledContext.js +18 -31
  454. package/lib/config-provider/SizeContext.js +19 -28
  455. package/lib/config-provider/config-provider.d.ts +1 -1
  456. package/lib/config-provider/config-provider.js +12 -8
  457. package/lib/config-provider/config-provider.js.map +1 -1
  458. package/lib/config-provider/index.d.ts +4 -4
  459. package/lib/config-provider/index.js +35 -23
  460. package/lib/config-provider/index.js.map +1 -1
  461. package/lib/connect/index.js +44 -26
  462. package/lib/date-picker/index.d.ts +4 -4
  463. package/lib/date-picker/index.js +48 -32
  464. package/lib/date-picker/index.js.map +1 -1
  465. package/lib/descriptions/descriptions.d.ts +3 -3
  466. package/lib/descriptions/descriptions.js +64 -55
  467. package/lib/descriptions/descriptions.js.map +1 -1
  468. package/lib/descriptions/index.d.ts +1 -1
  469. package/lib/descriptions/index.js +23 -22
  470. package/lib/descriptions/index.js.map +1 -1
  471. package/lib/development-login/LoginModal.js +110 -79
  472. package/lib/development-login/index.js +42 -35
  473. package/lib/divider/index.d.ts +3 -3
  474. package/lib/divider/index.js +23 -22
  475. package/lib/divider/index.js.map +1 -1
  476. package/lib/drawer/drawer.d.ts +1 -1
  477. package/lib/drawer/drawer.js +41 -30
  478. package/lib/drawer/drawer.js.map +1 -1
  479. package/lib/drawer/index.d.ts +2 -2
  480. package/lib/drawer/index.js +22 -20
  481. package/lib/drawer/index.js.map +1 -1
  482. package/lib/dropdown/index.d.ts +3 -3
  483. package/lib/dropdown/index.js +23 -22
  484. package/lib/dropdown/index.js.map +1 -1
  485. package/lib/ellipsis/Svg/CopySVG.js +70 -20
  486. package/lib/ellipsis/Svg/TickSVG.js +48 -15
  487. package/lib/ellipsis/index.js +176 -137
  488. package/lib/empty/empty.d.ts +2 -2
  489. package/lib/empty/empty.js +90 -75
  490. package/lib/empty/empty.js.map +1 -1
  491. package/lib/empty/empty.stories.js +19 -18
  492. package/lib/empty/index.d.ts +1 -1
  493. package/lib/empty/index.js +20 -19
  494. package/lib/empty/index.js.map +1 -1
  495. package/lib/exception/exception.js +46 -31
  496. package/lib/exception/exception.js.map +1 -1
  497. package/lib/exception/index.js +19 -18
  498. package/lib/form/form.d.ts +5 -5
  499. package/lib/form/form.js +90 -92
  500. package/lib/form/form.js.map +1 -1
  501. package/lib/form/index.d.ts +1 -1
  502. package/lib/form/index.js +20 -19
  503. package/lib/form/index.js.map +1 -1
  504. package/lib/grid/RowContext.d.ts +9 -0
  505. package/lib/grid/RowContext.d.ts.map +1 -0
  506. package/lib/grid/RowContext.js +10 -0
  507. package/lib/grid/RowContext.js.map +1 -0
  508. package/lib/grid/col.d.ts +29 -0
  509. package/lib/grid/col.d.ts.map +1 -0
  510. package/lib/grid/col.js +105 -0
  511. package/lib/grid/col.js.map +1 -0
  512. package/lib/grid/hooks/useBreakpoint.d.ts +4 -0
  513. package/lib/grid/hooks/useBreakpoint.d.ts.map +1 -0
  514. package/lib/grid/hooks/useBreakpoint.js +29 -0
  515. package/lib/grid/hooks/useBreakpoint.js.map +1 -0
  516. package/lib/grid/index.d.ts +12 -0
  517. package/lib/grid/index.d.ts.map +1 -0
  518. package/lib/grid/index.js +31 -0
  519. package/lib/grid/index.js.map +1 -0
  520. package/lib/grid/row.d.ts +21 -0
  521. package/lib/grid/row.d.ts.map +1 -0
  522. package/lib/grid/row.js +187 -0
  523. package/lib/grid/row.js.map +1 -0
  524. package/lib/grid/style/index.d.ts +2 -0
  525. package/lib/grid/style/index.d.ts.map +1 -0
  526. package/lib/grid/style/index.js +3 -0
  527. package/lib/grid/style/index.js.map +1 -0
  528. package/lib/grid/style/index.less +124 -0
  529. package/lib/grid/style/mixin.less +57 -0
  530. package/lib/grid/style/rtl.less +69 -0
  531. package/lib/handle/index.d.ts.map +1 -1
  532. package/lib/handle/index.js +165 -149
  533. package/lib/handle/index.js.map +1 -1
  534. package/lib/icon/index.d.ts +3 -3
  535. package/lib/icon/index.js +23 -22
  536. package/lib/icon/index.js.map +1 -1
  537. package/lib/icon-list/index.js +7 -121
  538. package/lib/img/Contain.js +69 -44
  539. package/lib/img/Cover.js +117 -78
  540. package/lib/img/index.js +74 -60
  541. package/lib/index.d.ts +2 -0
  542. package/lib/index.d.ts.map +1 -1
  543. package/lib/index.js +662 -197
  544. package/lib/index.js.map +1 -1
  545. package/lib/input/index.d.ts +1 -1
  546. package/lib/input/index.js +21 -20
  547. package/lib/input/index.js.map +1 -1
  548. package/lib/input/input.d.ts +5 -5
  549. package/lib/input/input.js +100 -90
  550. package/lib/input/input.js.map +1 -1
  551. package/lib/input-number/index.d.ts +3 -3
  552. package/lib/input-number/index.js +26 -24
  553. package/lib/input-number/index.js.map +1 -1
  554. package/lib/label/index.d.ts +2 -2
  555. package/lib/label/index.js +134 -137
  556. package/lib/label/index.js.map +1 -1
  557. package/lib/layout/index.d.ts +3 -3
  558. package/lib/layout/index.js +23 -22
  559. package/lib/layout/index.js.map +1 -1
  560. package/lib/list/index.d.ts +3 -3
  561. package/lib/list/index.js +23 -22
  562. package/lib/list/index.js.map +1 -1
  563. package/lib/loading-button/index.js +58 -55
  564. package/lib/locale/default.js +12 -10
  565. package/lib/locale/default.js.map +1 -1
  566. package/lib/locale/en_US.js +50 -47
  567. package/lib/locale/en_US.js.map +1 -1
  568. package/lib/locale/index.js +36 -18
  569. package/lib/locale/zh_CN.js +42 -40
  570. package/lib/locale/zh_CN.js.map +1 -1
  571. package/lib/locale-provider/index.d.ts +3 -3
  572. package/lib/locale-provider/index.js +26 -25
  573. package/lib/locale-provider/index.js.map +1 -1
  574. package/lib/mentions/index.d.ts +3 -3
  575. package/lib/mentions/index.js +23 -22
  576. package/lib/mentions/index.js.map +1 -1
  577. package/lib/menu/index.d.ts +3 -3
  578. package/lib/menu/index.js +23 -22
  579. package/lib/menu/index.js.map +1 -1
  580. package/lib/message/index.d.ts +3 -3
  581. package/lib/message/index.js +23 -22
  582. package/lib/message/index.js.map +1 -1
  583. package/lib/modal/index.d.ts +1 -1
  584. package/lib/modal/index.js +22 -21
  585. package/lib/modal/index.js.map +1 -1
  586. package/lib/modal/modal.d.ts +9 -5
  587. package/lib/modal/modal.d.ts.map +1 -1
  588. package/lib/modal/modal.js +59 -59
  589. package/lib/modal/modal.js.map +1 -1
  590. package/lib/notification/index.d.ts +3 -3
  591. package/lib/notification/index.js +23 -22
  592. package/lib/notification/index.js.map +1 -1
  593. package/lib/page/Box.js +66 -40
  594. package/lib/page/index.js +148 -95
  595. package/lib/page/utils.js +22 -16
  596. package/lib/page-header/index.d.ts +3 -3
  597. package/lib/page-header/index.js +23 -22
  598. package/lib/page-header/index.js.map +1 -1
  599. package/lib/pagination/index.d.ts +3 -3
  600. package/lib/pagination/index.js +23 -22
  601. package/lib/pagination/index.js.map +1 -1
  602. package/lib/popconfirm/index.d.ts +3 -3
  603. package/lib/popconfirm/index.js +23 -22
  604. package/lib/popconfirm/index.js.map +1 -1
  605. package/lib/popover/index.d.ts +3 -3
  606. package/lib/popover/index.js +23 -22
  607. package/lib/popover/index.js.map +1 -1
  608. package/lib/prev-locale.js +68 -54
  609. package/lib/preview-text/index.d.ts +4 -4
  610. package/lib/preview-text/index.js +263 -209
  611. package/lib/preview-text/index.js.map +1 -1
  612. package/lib/progress/index.d.ts +3 -3
  613. package/lib/progress/index.js +23 -22
  614. package/lib/progress/index.js.map +1 -1
  615. package/lib/query-form/Field/Checkbox.js +28 -22
  616. package/lib/query-form/Field/Select.js +79 -68
  617. package/lib/query-form/Field/SelectInput.js +87 -73
  618. package/lib/query-form/Field/fieldsMap.d.ts +2 -2
  619. package/lib/query-form/Field/fieldsMap.js +34 -32
  620. package/lib/query-form/Field/index.js +143 -96
  621. package/lib/query-form/createActions.js +53 -50
  622. package/lib/query-form/index.js +377 -286
  623. package/lib/query-form/useForm.js +11 -11
  624. package/lib/query-list-scene/List.js +360 -289
  625. package/lib/query-list-scene/QueryForm.js +161 -103
  626. package/lib/query-list-scene/QueryListScene.js +66 -31
  627. package/lib/query-list-scene/Title.js +15 -9
  628. package/lib/query-list-scene/Toolbar.js +31 -20
  629. package/lib/query-list-scene/createActions.js +79 -64
  630. package/lib/query-list-scene/index.js +28 -24
  631. package/lib/query-list-scene/useActions.js +11 -11
  632. package/lib/radio/index.d.ts +3 -3
  633. package/lib/radio/index.js +26 -24
  634. package/lib/radio/index.js.map +1 -1
  635. package/lib/radio/radio-group.d.ts +1 -1
  636. package/lib/radio/radio-group.js +11 -9
  637. package/lib/radio/radio-group.js.map +1 -1
  638. package/lib/rate/index.d.ts +3 -3
  639. package/lib/rate/index.js +23 -22
  640. package/lib/rate/index.js.map +1 -1
  641. package/lib/render-empty/index.js +8 -4
  642. package/lib/render-empty/render-empty.js +28 -22
  643. package/lib/render-empty/render-empty.js.map +1 -1
  644. package/lib/result/index.d.ts +3 -3
  645. package/lib/result/index.js +23 -22
  646. package/lib/result/index.js.map +1 -1
  647. package/lib/row/index.d.ts +3 -3
  648. package/lib/row/index.js +23 -22
  649. package/lib/row/index.js.map +1 -1
  650. package/lib/segmented/index.d.ts +1 -1
  651. package/lib/segmented/index.js +71 -69
  652. package/lib/select/index.d.ts +2 -2
  653. package/lib/select/index.js +22 -20
  654. package/lib/select/index.js.map +1 -1
  655. package/lib/select/select.d.ts +2 -2
  656. package/lib/select/select.js +61 -64
  657. package/lib/select/select.js.map +1 -1
  658. package/lib/skeleton/index.d.ts +3 -3
  659. package/lib/skeleton/index.js +23 -22
  660. package/lib/skeleton/index.js.map +1 -1
  661. package/lib/slider/index.d.ts +3 -3
  662. package/lib/slider/index.js +23 -22
  663. package/lib/slider/index.js.map +1 -1
  664. package/lib/spin/index.d.ts +3 -3
  665. package/lib/spin/index.js +23 -22
  666. package/lib/spin/index.js.map +1 -1
  667. package/lib/statistic/index.d.ts +3 -3
  668. package/lib/statistic/index.js +23 -22
  669. package/lib/statistic/index.js.map +1 -1
  670. package/lib/steps/index.d.ts +1 -1
  671. package/lib/steps/index.js +20 -19
  672. package/lib/steps/index.js.map +1 -1
  673. package/lib/steps/steps.d.ts +3 -3
  674. package/lib/steps/steps.js +72 -59
  675. package/lib/steps/steps.js.map +1 -1
  676. package/lib/svg-components/illustration-403.d.ts +1 -1
  677. package/lib/svg-components/illustration-403.js +217 -84
  678. package/lib/svg-components/illustration-404.d.ts +1 -1
  679. package/lib/svg-components/illustration-404.js +301 -101
  680. package/lib/svg-components/illustration-500.d.ts +1 -1
  681. package/lib/svg-components/illustration-500.js +332 -109
  682. package/lib/svg-components/illustration-empty.d.ts +1 -1
  683. package/lib/svg-components/illustration-empty.js +65 -41
  684. package/lib/svg-components/illustration-failure.d.ts +1 -1
  685. package/lib/svg-components/illustration-failure.js +123 -62
  686. package/lib/svg-components/illustration-no-access.d.ts +1 -1
  687. package/lib/svg-components/illustration-no-access.js +125 -61
  688. package/lib/svg-components/illustration-no-chart.d.ts +1 -1
  689. package/lib/svg-components/illustration-no-chart.js +145 -63
  690. package/lib/svg-components/illustration-no-result.d.ts +1 -1
  691. package/lib/svg-components/illustration-no-result.js +103 -58
  692. package/lib/svg-components/illustration-offline.d.ts +1 -1
  693. package/lib/svg-components/illustration-offline.js +142 -69
  694. package/lib/svg-components/illustration-success.d.ts +1 -1
  695. package/lib/svg-components/illustration-success.js +148 -69
  696. package/lib/svg-components/index.js +75 -26
  697. package/lib/switch/index.js +22 -21
  698. package/lib/switch/switch.d.ts +3 -3
  699. package/lib/switch/switch.js +35 -27
  700. package/lib/switch/switch.js.map +1 -1
  701. package/lib/table/assets/image-loading-background.d.ts +1 -1
  702. package/lib/table/assets/image-loading-background.js +56 -43
  703. package/lib/table/assets/image-loading.d.ts +1 -1
  704. package/lib/table/assets/image-loading.js +37 -31
  705. package/lib/table/constants.d.ts +0 -2
  706. package/lib/table/constants.d.ts.map +1 -1
  707. package/lib/table/constants.js +7 -57
  708. package/lib/table/constants.js.map +1 -1
  709. package/lib/table/context.js +7 -4
  710. package/lib/table/hooks/index.js +14 -16
  711. package/lib/table/hooks/use-column-setting.d.ts +1 -1
  712. package/lib/table/hooks/use-column-setting.js +37 -20
  713. package/lib/table/hooks/use-column-setting.js.map +1 -1
  714. package/lib/table/index.d.ts +1 -1
  715. package/lib/table/index.js +20 -19
  716. package/lib/table/index.js.map +1 -1
  717. package/lib/table/table.d.ts +4 -4
  718. package/lib/table/table.d.ts.map +1 -1
  719. package/lib/table/table.js +199 -212
  720. package/lib/table/table.js.map +1 -1
  721. package/lib/table/table.stories.js +182 -154
  722. package/lib/table/total-shower.d.ts +2 -2
  723. package/lib/table/total-shower.js +14 -10
  724. package/lib/table/total-shower.js.map +1 -1
  725. package/lib/table/utils.d.ts +1 -1
  726. package/lib/table/utils.js +24 -25
  727. package/lib/table/utils.js.map +1 -1
  728. package/lib/tabs/index.d.ts +1 -1
  729. package/lib/tabs/index.js +20 -19
  730. package/lib/tabs/index.js.map +1 -1
  731. package/lib/tabs/tabPane.js +1 -2
  732. package/lib/tabs/tabs.d.ts +3 -3
  733. package/lib/tabs/tabs.js +61 -62
  734. package/lib/tabs/tabs.js.map +1 -1
  735. package/lib/tag/index.d.ts +3 -3
  736. package/lib/tag/index.js +23 -22
  737. package/lib/tag/index.js.map +1 -1
  738. package/lib/time-picker/index.d.ts +3 -3
  739. package/lib/time-picker/index.js +25 -24
  740. package/lib/time-picker/index.js.map +1 -1
  741. package/lib/timeline/index.d.ts +3 -3
  742. package/lib/timeline/index.js +23 -22
  743. package/lib/timeline/index.js.map +1 -1
  744. package/lib/title/index.js +44 -27
  745. package/lib/tntd-cascader/AntdCascader/component/DisabledContext.js +18 -31
  746. package/lib/tntd-cascader/AntdCascader/component/FormItemInputContext.js +9 -26
  747. package/lib/tntd-cascader/AntdCascader/component/SizeContext.js +9 -26
  748. package/lib/tntd-cascader/AntdCascader/component/context.js +18 -16
  749. package/lib/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js +36 -39
  750. package/lib/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js.map +1 -1
  751. package/lib/tntd-cascader/AntdCascader/component/getIcons.js +81 -75
  752. package/lib/tntd-cascader/AntdCascader/component/useCompactItemContext.js +31 -50
  753. package/lib/tntd-cascader/AntdCascader/config/utils.js +29 -27
  754. package/lib/tntd-cascader/AntdCascader/config/warning.js +19 -35
  755. package/lib/tntd-cascader/AntdCascader/index.js +216 -162
  756. package/lib/tntd-cascader/AntdCascader/interface.js +13 -6
  757. package/lib/tntd-cascader/img/no-data-s.png +0 -0
  758. package/lib/tntd-cascader/index.js +12 -8
  759. package/lib/tntd-cascader/rc-cascader/Cascader.js +325 -284
  760. package/lib/tntd-cascader/rc-cascader/OptionList/Checkbox.js +30 -41
  761. package/lib/tntd-cascader/rc-cascader/OptionList/Column.js +198 -152
  762. package/lib/tntd-cascader/rc-cascader/OptionList/index.js +223 -163
  763. package/lib/tntd-cascader/rc-cascader/OptionList/useActive.js +40 -48
  764. package/lib/tntd-cascader/rc-cascader/OptionList/useKeyboard.js +179 -166
  765. package/lib/tntd-cascader/rc-cascader/context.js +11 -27
  766. package/lib/tntd-cascader/rc-cascader/hooks/useDisplayValues.js +62 -63
  767. package/lib/tntd-cascader/rc-cascader/hooks/useEntities.js +39 -49
  768. package/lib/tntd-cascader/rc-cascader/hooks/useMissingValues.js +26 -41
  769. package/lib/tntd-cascader/rc-cascader/hooks/useRefFunc.js +16 -33
  770. package/lib/tntd-cascader/rc-cascader/hooks/useSearchConfig.js +30 -51
  771. package/lib/tntd-cascader/rc-cascader/hooks/useSearchOptions.js +75 -65
  772. package/lib/tntd-cascader/rc-cascader/index.js +9 -7
  773. package/lib/tntd-cascader/rc-cascader/utils/commonUtil.js +49 -38
  774. package/lib/tntd-cascader/rc-cascader/utils/treeUtil.js +42 -39
  775. package/lib/tntd-cascader/rc-cascader/utils/warningPropsUtil.js +34 -30
  776. package/lib/tntd-form/ErrorList.js +99 -77
  777. package/lib/tntd-form/ErrorList.js.map +1 -1
  778. package/lib/tntd-form/Form.js +169 -139
  779. package/lib/tntd-form/FormItem/ItemHolder.js +154 -155
  780. package/lib/tntd-form/FormItem/ItemHolder.js.map +1 -1
  781. package/lib/tntd-form/FormItem/index.js +287 -252
  782. package/lib/tntd-form/FormItem/index.js.map +1 -1
  783. package/lib/tntd-form/FormItemInput.d.ts +1 -1
  784. package/lib/tntd-form/FormItemInput.d.ts.map +1 -1
  785. package/lib/tntd-form/FormItemInput.js +88 -62
  786. package/lib/tntd-form/FormItemInput.js.map +1 -1
  787. package/lib/tntd-form/FormItemLabel.d.ts +1 -1
  788. package/lib/tntd-form/FormItemLabel.d.ts.map +1 -1
  789. package/lib/tntd-form/FormItemLabel.js +99 -94
  790. package/lib/tntd-form/FormItemLabel.js.map +1 -1
  791. package/lib/tntd-form/FormList.js +52 -58
  792. package/lib/tntd-form/FormList.js.map +1 -1
  793. package/lib/tntd-form/_util/context.d.ts +42 -0
  794. package/lib/tntd-form/_util/context.d.ts.map +1 -0
  795. package/lib/tntd-form/_util/context.js +22 -0
  796. package/lib/tntd-form/_util/context.js.map +1 -0
  797. package/lib/tntd-form/_util/defaultRenderEmpty.d.ts +5 -0
  798. package/lib/tntd-form/_util/defaultRenderEmpty.d.ts.map +1 -0
  799. package/lib/tntd-form/_util/defaultRenderEmpty.js +44 -0
  800. package/lib/tntd-form/_util/defaultRenderEmpty.js.map +1 -0
  801. package/lib/tntd-form/_util/hooks/useFlexGapSupport.d.ts +3 -0
  802. package/lib/tntd-form/_util/hooks/useFlexGapSupport.d.ts.map +1 -0
  803. package/lib/tntd-form/_util/hooks/useFlexGapSupport.js +28 -0
  804. package/lib/tntd-form/_util/hooks/useFlexGapSupport.js.map +1 -0
  805. package/lib/tntd-form/_util/hooks/useForceUpdate.d.ts +3 -0
  806. package/lib/tntd-form/_util/hooks/useForceUpdate.d.ts.map +1 -0
  807. package/lib/tntd-form/_util/hooks/useForceUpdate.js +24 -0
  808. package/lib/tntd-form/_util/hooks/useForceUpdate.js.map +1 -0
  809. package/lib/tntd-form/_util/motion.js +51 -34
  810. package/lib/tntd-form/_util/reactNode.js +20 -37
  811. package/lib/tntd-form/_util/responsiveObserve.d.ts +22 -0
  812. package/lib/tntd-form/_util/responsiveObserve.d.ts.map +1 -0
  813. package/lib/tntd-form/_util/responsiveObserve.js +73 -0
  814. package/lib/tntd-form/_util/responsiveObserve.js.map +1 -0
  815. package/lib/tntd-form/_util/scrollTo.js +2 -2
  816. package/lib/tntd-form/_util/styleChecker.d.ts +5 -0
  817. package/lib/tntd-form/_util/styleChecker.d.ts.map +1 -0
  818. package/lib/tntd-form/_util/styleChecker.js +42 -0
  819. package/lib/tntd-form/_util/styleChecker.js.map +1 -0
  820. package/lib/tntd-form/_util/type.js +17 -5
  821. package/lib/tntd-form/_util/warning.js +17 -29
  822. package/lib/tntd-form/_util/wave.js +2 -2
  823. package/lib/tntd-form/context.js +47 -59
  824. package/lib/tntd-form/grid/RowContext.d.ts +9 -0
  825. package/lib/tntd-form/grid/RowContext.d.ts.map +1 -0
  826. package/lib/tntd-form/grid/RowContext.js +10 -0
  827. package/lib/tntd-form/grid/RowContext.js.map +1 -0
  828. package/lib/tntd-form/grid/col.d.ts +29 -0
  829. package/lib/tntd-form/grid/col.d.ts.map +1 -0
  830. package/lib/tntd-form/grid/col.js +105 -0
  831. package/lib/tntd-form/grid/col.js.map +1 -0
  832. package/lib/tntd-form/grid/hooks/useBreakpoint.d.ts +4 -0
  833. package/lib/tntd-form/grid/hooks/useBreakpoint.d.ts.map +1 -0
  834. package/lib/tntd-form/grid/hooks/useBreakpoint.js +29 -0
  835. package/lib/tntd-form/grid/hooks/useBreakpoint.js.map +1 -0
  836. package/lib/tntd-form/grid/index.d.ts +12 -0
  837. package/lib/tntd-form/grid/index.d.ts.map +1 -0
  838. package/lib/tntd-form/grid/index.js +31 -0
  839. package/lib/tntd-form/grid/index.js.map +1 -0
  840. package/lib/tntd-form/grid/row.d.ts +21 -0
  841. package/lib/tntd-form/grid/row.d.ts.map +1 -0
  842. package/lib/tntd-form/grid/row.js +186 -0
  843. package/lib/tntd-form/grid/row.js.map +1 -0
  844. package/lib/tntd-form/grid/style/index.d.ts +3 -0
  845. package/lib/tntd-form/grid/style/index.d.ts.map +1 -0
  846. package/lib/tntd-form/grid/style/index.js +4 -0
  847. package/lib/tntd-form/grid/style/index.js.map +1 -0
  848. package/lib/tntd-form/hooks/useDebounce.js +28 -37
  849. package/lib/tntd-form/hooks/useForm.js +56 -57
  850. package/lib/tntd-form/hooks/useFormInstance.js +11 -8
  851. package/lib/tntd-form/hooks/useFormItemStatus.js +18 -13
  852. package/lib/tntd-form/hooks/useFormItemStatus.js.map +1 -1
  853. package/lib/tntd-form/hooks/useFrameState.js +51 -63
  854. package/lib/tntd-form/hooks/useItemRef.js +24 -41
  855. package/lib/tntd-form/index.d.ts.map +1 -1
  856. package/lib/tntd-form/index.js +24 -43
  857. package/lib/tntd-form/index.js.map +1 -1
  858. package/lib/tntd-form/interface.js +6 -4
  859. package/lib/tntd-form/style/index.js +2 -4
  860. package/lib/tntd-form/tntd-form.stories.d.ts +1 -1
  861. package/lib/tntd-form/tntd-form.stories.js +913 -437
  862. package/lib/tntd-form/util.js +18 -19
  863. package/lib/tntd-form/validateMessagesContext.js +8 -4
  864. package/lib/tntd-icon/fonts/iconfont.js +36 -53
  865. package/lib/tntd-icon/index.js +40 -25
  866. package/lib/tntd-layout/ActionsContext.js +8 -4
  867. package/lib/tntd-layout/AppList.js +173 -224
  868. package/lib/tntd-layout/Application.js +75 -111
  869. package/lib/tntd-layout/Avatar.js +100 -135
  870. package/lib/tntd-layout/CompatibleLanguage.js +128 -180
  871. package/lib/tntd-layout/EnterpriseLayout/Avatar.js +117 -146
  872. package/lib/tntd-layout/EnterpriseLayout/Language.js +73 -90
  873. package/lib/tntd-layout/EnterpriseLayout/Theme.js +69 -102
  874. package/lib/tntd-layout/EnterpriseLayout/index.js +28 -17
  875. package/lib/tntd-layout/GlobalNavigation/NavigationPopup.js +283 -276
  876. package/lib/tntd-layout/GlobalNavigation/index.js +108 -115
  877. package/lib/tntd-layout/Header.js +77 -136
  878. package/lib/tntd-layout/HeaderActions.js +106 -106
  879. package/lib/tntd-layout/HeaderNavs.js +78 -107
  880. package/lib/tntd-layout/HeaderTabs.js +224 -316
  881. package/lib/tntd-layout/Iconfont.js +11 -7
  882. package/lib/tntd-layout/Language.js +69 -76
  883. package/lib/tntd-layout/Layout.js +214 -171
  884. package/lib/tntd-layout/Logo.js +69 -144
  885. package/lib/tntd-layout/OrgAppList.js +238 -388
  886. package/lib/tntd-layout/SideMenu.js +269 -408
  887. package/lib/tntd-layout/Theme.js +75 -93
  888. package/lib/tntd-layout/createActions.js +45 -34
  889. package/lib/tntd-layout/images/avatar/empty.png +0 -0
  890. package/lib/tntd-layout/images/avatar/female1.png +0 -0
  891. package/lib/tntd-layout/images/avatar/female2.png +0 -0
  892. package/lib/tntd-layout/images/avatar/female3.png +0 -0
  893. package/lib/tntd-layout/images/avatar/female4.png +0 -0
  894. package/lib/tntd-layout/images/avatar/female5.png +0 -0
  895. package/lib/tntd-layout/images/avatar/female6.png +0 -0
  896. package/lib/tntd-layout/images/avatar/male1.png +0 -0
  897. package/lib/tntd-layout/images/avatar/male2.png +0 -0
  898. package/lib/tntd-layout/images/avatar/male3.png +0 -0
  899. package/lib/tntd-layout/images/avatar/male4.png +0 -0
  900. package/lib/tntd-layout/images/avatar/male5.png +0 -0
  901. package/lib/tntd-layout/images/avatar/male6.png +0 -0
  902. package/lib/tntd-layout/images/index.js +68 -66
  903. package/lib/tntd-layout/index.js +137 -95
  904. package/lib/tntd-layout/paaslayout/CompactSideMenu.js +131 -182
  905. package/lib/tntd-layout/paaslayout/Header.js +51 -79
  906. package/lib/tntd-layout/paaslayout/Logo.js +15 -30
  907. package/lib/tntd-layout/paaslayout/SideMenu.js +131 -147
  908. package/lib/tntd-layout/paaslayout/index.js +205 -141
  909. package/lib/tntd-layout/storage.js +58 -30
  910. package/lib/tntd-modal/index.js +98 -62
  911. package/lib/tntd-rc-select/_util/DisabledContext.js +18 -31
  912. package/lib/tntd-rc-select/_util/FormItemInputContext.js +9 -26
  913. package/lib/tntd-rc-select/_util/PurePanel.js +84 -78
  914. package/lib/tntd-rc-select/_util/SizeContext.js +9 -26
  915. package/lib/tntd-rc-select/_util/context.js +18 -16
  916. package/lib/tntd-rc-select/_util/defaultRenderEmpty.js +35 -39
  917. package/lib/tntd-rc-select/_util/defaultRenderEmpty.js.map +1 -1
  918. package/lib/tntd-rc-select/_util/getIcons.js +81 -75
  919. package/lib/tntd-rc-select/_util/interface.js +13 -6
  920. package/lib/tntd-rc-select/_util/motion.js +51 -34
  921. package/lib/tntd-rc-select/_util/type.js +17 -5
  922. package/lib/tntd-rc-select/_util/useCompactItemContext.js +31 -50
  923. package/lib/tntd-rc-select/_util/warning.js +19 -35
  924. package/lib/tntd-rc-select/img/no-data-s.png +0 -0
  925. package/lib/tntd-rc-select/index.js +152 -123
  926. package/lib/tntd-second-page/index.js +60 -33
  927. package/lib/tntd-second-page/index.js.map +1 -1
  928. package/lib/tntd-select/DropDownWrap.js +102 -78
  929. package/lib/tntd-select/index.d.ts +2 -2
  930. package/lib/tntd-select/index.js +638 -543
  931. package/lib/tooltip/index.d.ts +3 -3
  932. package/lib/tooltip/index.js +23 -22
  933. package/lib/tooltip/index.js.map +1 -1
  934. package/lib/transfer/index.d.ts +3 -3
  935. package/lib/transfer/index.js +23 -22
  936. package/lib/transfer/index.js.map +1 -1
  937. package/lib/tree/index.d.ts +3 -3
  938. package/lib/tree/index.js +23 -22
  939. package/lib/tree/index.js.map +1 -1
  940. package/lib/tree-select/index.d.ts +5 -5
  941. package/lib/tree-select/index.js +30 -27
  942. package/lib/tree-select/index.js.map +1 -1
  943. package/lib/typography/index.d.ts +3 -3
  944. package/lib/typography/index.js +23 -22
  945. package/lib/typography/index.js.map +1 -1
  946. package/lib/upload/index.d.ts +2 -2
  947. package/lib/upload/index.js +32 -26
  948. package/lib/upload/index.js.map +1 -1
  949. package/lib/utils/checkAuth.js +34 -23
  950. package/lib/utils/findMenuInfoByPath.js +41 -34
  951. package/lib/utils/index.js +151 -90
  952. package/lib/utils/lang.d.ts +5 -1
  953. package/lib/utils/lang.d.ts.map +1 -1
  954. package/lib/utils/lang.js +77 -119
  955. package/lib/utils/lang.js.map +1 -1
  956. package/lib/utils/simple-template.js +11 -7
  957. package/lib/version/index.d.ts +3 -3
  958. package/lib/version/index.js +23 -22
  959. package/lib/version/index.js.map +1 -1
  960. package/lib/water-mark/index.js +130 -117
  961. package/package.json +1 -1
  962. package/es/handle/handle.js +0 -102
  963. package/es/handle/handle.js.map +0 -1
  964. package/es/mention/index.js +0 -4
  965. package/es/mention/index.js.map +0 -1
  966. package/es/tntd-form/TntdForm/components/Item.js +0 -55
  967. package/es/tntd-form/TntdForm/components/Item.js.map +0 -1
  968. package/es/tntd-form/TntdForm/components/ItemComp.js +0 -186
  969. package/es/tntd-form/TntdForm/components/ItemComp.js.map +0 -1
  970. package/es/tntd-form/TntdForm/components/List.js +0 -102
  971. package/es/tntd-form/TntdForm/components/List.js.map +0 -1
  972. package/es/tntd-form/TntdForm/index.js +0 -55
  973. package/es/tntd-form/TntdForm/index.js.map +0 -1
  974. package/es/tntd-form/TntdForm/interface.js +0 -1
  975. package/es/tntd-form/TntdForm/interface.js.map +0 -1
  976. package/es/tntd-form/TntdForm/store.js +0 -2
  977. package/es/tntd-form/TntdForm/store.js.map +0 -1
  978. package/es/tntd-form/TntdForm/utils.js +0 -219
  979. package/es/tntd-form/TntdForm/utils.js.map +0 -1
  980. package/es/tntd-select/_util/DisabledContext.js +0 -8
  981. package/es/tntd-select/_util/DisabledContext.js.map +0 -1
  982. package/es/tntd-select/_util/FormItemInputContext.js +0 -3
  983. package/es/tntd-select/_util/FormItemInputContext.js.map +0 -1
  984. package/es/tntd-select/_util/PurePanel.js +0 -55
  985. package/es/tntd-select/_util/PurePanel.js.map +0 -1
  986. package/es/tntd-select/_util/SizeContext.js +0 -3
  987. package/es/tntd-select/_util/SizeContext.js.map +0 -1
  988. package/es/tntd-select/_util/context.js +0 -14
  989. package/es/tntd-select/_util/context.js.map +0 -1
  990. package/es/tntd-select/_util/defaultRenderEmpty.js +0 -20
  991. package/es/tntd-select/_util/defaultRenderEmpty.js.map +0 -1
  992. package/es/tntd-select/_util/getIcons.js +0 -52
  993. package/es/tntd-select/_util/getIcons.js.map +0 -1
  994. package/es/tntd-select/_util/interface.js +0 -5
  995. package/es/tntd-select/_util/interface.js.map +0 -1
  996. package/es/tntd-select/_util/motion.js +0 -38
  997. package/es/tntd-select/_util/motion.js.map +0 -1
  998. package/es/tntd-select/_util/type.js +0 -4
  999. package/es/tntd-select/_util/type.js.map +0 -1
  1000. package/es/tntd-select/_util/useCompactItemContext.js +0 -24
  1001. package/es/tntd-select/_util/useCompactItemContext.js.map +0 -1
  1002. package/es/tntd-select/_util/warning.js +0 -15
  1003. package/es/tntd-select/_util/warning.js.map +0 -1
  1004. package/es/tntd-select/rc-select/BaseSelect.js +0 -429
  1005. package/es/tntd-select/rc-select/BaseSelect.js.map +0 -1
  1006. package/es/tntd-select/rc-select/OptGroup.js +0 -5
  1007. package/es/tntd-select/rc-select/OptGroup.js.map +0 -1
  1008. package/es/tntd-select/rc-select/Option.js +0 -5
  1009. package/es/tntd-select/rc-select/Option.js.map +0 -1
  1010. package/es/tntd-select/rc-select/OptionList.js +0 -257
  1011. package/es/tntd-select/rc-select/OptionList.js.map +0 -1
  1012. package/es/tntd-select/rc-select/Select.js +0 -428
  1013. package/es/tntd-select/rc-select/Select.js.map +0 -1
  1014. package/es/tntd-select/rc-select/SelectContext.js +0 -4
  1015. package/es/tntd-select/rc-select/SelectContext.js.map +0 -1
  1016. package/es/tntd-select/rc-select/SelectTrigger.js +0 -91
  1017. package/es/tntd-select/rc-select/SelectTrigger.js.map +0 -1
  1018. package/es/tntd-select/rc-select/Selector/Input.js +0 -47
  1019. package/es/tntd-select/rc-select/Selector/Input.js.map +0 -1
  1020. package/es/tntd-select/rc-select/Selector/MultipleSelector.js +0 -97
  1021. package/es/tntd-select/rc-select/Selector/MultipleSelector.js.map +0 -1
  1022. package/es/tntd-select/rc-select/Selector/SingleSelector.js +0 -45
  1023. package/es/tntd-select/rc-select/Selector/SingleSelector.js.map +0 -1
  1024. package/es/tntd-select/rc-select/Selector/index.js +0 -136
  1025. package/es/tntd-select/rc-select/Selector/index.js.map +0 -1
  1026. package/es/tntd-select/rc-select/TransBtn.js +0 -22
  1027. package/es/tntd-select/rc-select/TransBtn.js.map +0 -1
  1028. package/es/tntd-select/rc-select/hooks/useAllowClear.js +0 -25
  1029. package/es/tntd-select/rc-select/hooks/useAllowClear.js.map +0 -1
  1030. package/es/tntd-select/rc-select/hooks/useBaseProps.js +0 -10
  1031. package/es/tntd-select/rc-select/hooks/useBaseProps.js.map +0 -1
  1032. package/es/tntd-select/rc-select/hooks/useCache.js +0 -34
  1033. package/es/tntd-select/rc-select/hooks/useCache.js.map +0 -1
  1034. package/es/tntd-select/rc-select/hooks/useDelayReset.js +0 -24
  1035. package/es/tntd-select/rc-select/hooks/useDelayReset.js.map +0 -1
  1036. package/es/tntd-select/rc-select/hooks/useFilterOptions.js +0 -55
  1037. package/es/tntd-select/rc-select/hooks/useFilterOptions.js.map +0 -1
  1038. package/es/tntd-select/rc-select/hooks/useId.js +0 -28
  1039. package/es/tntd-select/rc-select/hooks/useId.js.map +0 -1
  1040. package/es/tntd-select/rc-select/hooks/useLayoutEffect.js +0 -18
  1041. package/es/tntd-select/rc-select/hooks/useLayoutEffect.js.map +0 -1
  1042. package/es/tntd-select/rc-select/hooks/useLock.js +0 -26
  1043. package/es/tntd-select/rc-select/hooks/useLock.js.map +0 -1
  1044. package/es/tntd-select/rc-select/hooks/useOptions.js +0 -45
  1045. package/es/tntd-select/rc-select/hooks/useOptions.js.map +0 -1
  1046. package/es/tntd-select/rc-select/hooks/useRefFunc.js +0 -14
  1047. package/es/tntd-select/rc-select/hooks/useRefFunc.js.map +0 -1
  1048. package/es/tntd-select/rc-select/hooks/useSelectTriggerControl.js +0 -32
  1049. package/es/tntd-select/rc-select/hooks/useSelectTriggerControl.js.map +0 -1
  1050. package/es/tntd-select/rc-select/index.js +0 -8
  1051. package/es/tntd-select/rc-select/index.js.map +0 -1
  1052. package/es/tntd-select/rc-select/interface.js +0 -2
  1053. package/es/tntd-select/rc-select/interface.js.map +0 -1
  1054. package/es/tntd-select/rc-select/utils/commonUtil.js +0 -32
  1055. package/es/tntd-select/rc-select/utils/commonUtil.js.map +0 -1
  1056. package/es/tntd-select/rc-select/utils/keyUtil.js +0 -34
  1057. package/es/tntd-select/rc-select/utils/keyUtil.js.map +0 -1
  1058. package/es/tntd-select/rc-select/utils/legacyUtil.js +0 -32
  1059. package/es/tntd-select/rc-select/utils/legacyUtil.js.map +0 -1
  1060. package/es/tntd-select/rc-select/utils/platformUtil.js +0 -5
  1061. package/es/tntd-select/rc-select/utils/platformUtil.js.map +0 -1
  1062. package/es/tntd-select/rc-select/utils/valueUtil.js +0 -99
  1063. package/es/tntd-select/rc-select/utils/valueUtil.js.map +0 -1
  1064. package/es/tntd-select/rc-select/utils/warningPropsUtil.js +0 -100
  1065. package/es/tntd-select/rc-select/utils/warningPropsUtil.js.map +0 -1
  1066. package/lib/handle/handle.d.ts +0 -3
  1067. package/lib/handle/handle.d.ts.map +0 -1
  1068. package/lib/handle/handle.js +0 -130
  1069. package/lib/handle/handle.js.map +0 -1
  1070. package/lib/tntd-form/TntdForm/components/Item.js +0 -65
  1071. package/lib/tntd-form/TntdForm/components/ItemComp.js +0 -215
  1072. package/lib/tntd-form/TntdForm/components/List.js +0 -123
  1073. package/lib/tntd-form/TntdForm/index.js +0 -72
  1074. package/lib/tntd-form/TntdForm/interface.js +0 -5
  1075. package/lib/tntd-form/TntdForm/store.js +0 -10
  1076. package/lib/tntd-form/TntdForm/utils.js +0 -239
  1077. package/lib/tntd-select/_util/DisabledContext.d.ts +0 -10
  1078. package/lib/tntd-select/_util/DisabledContext.d.ts.map +0 -1
  1079. package/lib/tntd-select/_util/DisabledContext.js +0 -35
  1080. package/lib/tntd-select/_util/DisabledContext.js.map +0 -1
  1081. package/lib/tntd-select/_util/FormItemInputContext.d.ts +0 -4
  1082. package/lib/tntd-select/_util/FormItemInputContext.d.ts.map +0 -1
  1083. package/lib/tntd-select/_util/FormItemInputContext.js +0 -29
  1084. package/lib/tntd-select/_util/FormItemInputContext.js.map +0 -1
  1085. package/lib/tntd-select/_util/PurePanel.d.ts +0 -9
  1086. package/lib/tntd-select/_util/PurePanel.d.ts.map +0 -1
  1087. package/lib/tntd-select/_util/PurePanel.js +0 -84
  1088. package/lib/tntd-select/_util/PurePanel.js.map +0 -1
  1089. package/lib/tntd-select/_util/SizeContext.d.ts +0 -4
  1090. package/lib/tntd-select/_util/SizeContext.d.ts.map +0 -1
  1091. package/lib/tntd-select/_util/SizeContext.js +0 -29
  1092. package/lib/tntd-select/_util/SizeContext.js.map +0 -1
  1093. package/lib/tntd-select/_util/context.d.ts.map +0 -1
  1094. package/lib/tntd-select/_util/context.js +0 -20
  1095. package/lib/tntd-select/_util/context.js.map +0 -1
  1096. package/lib/tntd-select/_util/defaultRenderEmpty.d.ts.map +0 -1
  1097. package/lib/tntd-select/_util/defaultRenderEmpty.js +0 -48
  1098. package/lib/tntd-select/_util/defaultRenderEmpty.js.map +0 -1
  1099. package/lib/tntd-select/_util/getIcons.d.ts +0 -25
  1100. package/lib/tntd-select/_util/getIcons.d.ts.map +0 -1
  1101. package/lib/tntd-select/_util/getIcons.js +0 -78
  1102. package/lib/tntd-select/_util/getIcons.js.map +0 -1
  1103. package/lib/tntd-select/_util/interface.d.ts +0 -25
  1104. package/lib/tntd-select/_util/interface.d.ts.map +0 -1
  1105. package/lib/tntd-select/_util/interface.js +0 -9
  1106. package/lib/tntd-select/_util/interface.js.map +0 -1
  1107. package/lib/tntd-select/_util/motion.d.ts +0 -9
  1108. package/lib/tntd-select/_util/motion.d.ts.map +0 -1
  1109. package/lib/tntd-select/_util/motion.js +0 -42
  1110. package/lib/tntd-select/_util/motion.js.map +0 -1
  1111. package/lib/tntd-select/_util/type.d.ts +0 -10
  1112. package/lib/tntd-select/_util/type.d.ts.map +0 -1
  1113. package/lib/tntd-select/_util/type.js +0 -9
  1114. package/lib/tntd-select/_util/type.js.map +0 -1
  1115. package/lib/tntd-select/_util/useCompactItemContext.d.ts +0 -9
  1116. package/lib/tntd-select/_util/useCompactItemContext.d.ts.map +0 -1
  1117. package/lib/tntd-select/_util/useCompactItemContext.js +0 -54
  1118. package/lib/tntd-select/_util/useCompactItemContext.js.map +0 -1
  1119. package/lib/tntd-select/_util/warning.d.ts +0 -4
  1120. package/lib/tntd-select/_util/warning.d.ts.map +0 -1
  1121. package/lib/tntd-select/_util/warning.js +0 -40
  1122. package/lib/tntd-select/_util/warning.js.map +0 -1
  1123. package/lib/tntd-select/rc-select/BaseSelect.d.ts +0 -114
  1124. package/lib/tntd-select/rc-select/BaseSelect.d.ts.map +0 -1
  1125. package/lib/tntd-select/rc-select/BaseSelect.js +0 -459
  1126. package/lib/tntd-select/rc-select/BaseSelect.js.map +0 -1
  1127. package/lib/tntd-select/rc-select/OptGroup.d.ts +0 -13
  1128. package/lib/tntd-select/rc-select/OptGroup.d.ts.map +0 -1
  1129. package/lib/tntd-select/rc-select/OptGroup.js +0 -7
  1130. package/lib/tntd-select/rc-select/OptGroup.js.map +0 -1
  1131. package/lib/tntd-select/rc-select/Option.d.ts +0 -15
  1132. package/lib/tntd-select/rc-select/Option.d.ts.map +0 -1
  1133. package/lib/tntd-select/rc-select/Option.js +0 -7
  1134. package/lib/tntd-select/rc-select/Option.js.map +0 -1
  1135. package/lib/tntd-select/rc-select/OptionList.d.ts +0 -11
  1136. package/lib/tntd-select/rc-select/OptionList.d.ts.map +0 -1
  1137. package/lib/tntd-select/rc-select/OptionList.js +0 -285
  1138. package/lib/tntd-select/rc-select/OptionList.js.map +0 -1
  1139. package/lib/tntd-select/rc-select/Select.d.ts +0 -115
  1140. package/lib/tntd-select/rc-select/Select.d.ts.map +0 -1
  1141. package/lib/tntd-select/rc-select/Select.js +0 -456
  1142. package/lib/tntd-select/rc-select/Select.js.map +0 -1
  1143. package/lib/tntd-select/rc-select/SelectContext.d.ts +0 -23
  1144. package/lib/tntd-select/rc-select/SelectContext.d.ts.map +0 -1
  1145. package/lib/tntd-select/rc-select/SelectContext.js +0 -29
  1146. package/lib/tntd-select/rc-select/SelectContext.js.map +0 -1
  1147. package/lib/tntd-select/rc-select/SelectTrigger.d.ts +0 -31
  1148. package/lib/tntd-select/rc-select/SelectTrigger.d.ts.map +0 -1
  1149. package/lib/tntd-select/rc-select/SelectTrigger.js +0 -119
  1150. package/lib/tntd-select/rc-select/SelectTrigger.js.map +0 -1
  1151. package/lib/tntd-select/rc-select/Selector/Input.d.ts +0 -27
  1152. package/lib/tntd-select/rc-select/Selector/Input.d.ts.map +0 -1
  1153. package/lib/tntd-select/rc-select/Selector/Input.js +0 -75
  1154. package/lib/tntd-select/rc-select/Selector/Input.js.map +0 -1
  1155. package/lib/tntd-select/rc-select/Selector/MultipleSelector.d.ts +0 -17
  1156. package/lib/tntd-select/rc-select/Selector/MultipleSelector.d.ts.map +0 -1
  1157. package/lib/tntd-select/rc-select/Selector/MultipleSelector.js +0 -125
  1158. package/lib/tntd-select/rc-select/Selector/MultipleSelector.js.map +0 -1
  1159. package/lib/tntd-select/rc-select/Selector/SingleSelector.d.ts +0 -9
  1160. package/lib/tntd-select/rc-select/Selector/SingleSelector.d.ts.map +0 -1
  1161. package/lib/tntd-select/rc-select/Selector/SingleSelector.js +0 -73
  1162. package/lib/tntd-select/rc-select/Selector/SingleSelector.js.map +0 -1
  1163. package/lib/tntd-select/rc-select/Selector/index.d.ts +0 -83
  1164. package/lib/tntd-select/rc-select/Selector/index.d.ts.map +0 -1
  1165. package/lib/tntd-select/rc-select/Selector/index.js +0 -164
  1166. package/lib/tntd-select/rc-select/Selector/index.js.map +0 -1
  1167. package/lib/tntd-select/rc-select/TransBtn.d.ts +0 -13
  1168. package/lib/tntd-select/rc-select/TransBtn.d.ts.map +0 -1
  1169. package/lib/tntd-select/rc-select/TransBtn.js +0 -50
  1170. package/lib/tntd-select/rc-select/TransBtn.js.map +0 -1
  1171. package/lib/tntd-select/rc-select/hooks/useAllowClear.d.ts +0 -9
  1172. package/lib/tntd-select/rc-select/hooks/useAllowClear.d.ts.map +0 -1
  1173. package/lib/tntd-select/rc-select/hooks/useAllowClear.js +0 -32
  1174. package/lib/tntd-select/rc-select/hooks/useAllowClear.js.map +0 -1
  1175. package/lib/tntd-select/rc-select/hooks/useBaseProps.d.ts +0 -14
  1176. package/lib/tntd-select/rc-select/hooks/useBaseProps.d.ts.map +0 -1
  1177. package/lib/tntd-select/rc-select/hooks/useBaseProps.js +0 -37
  1178. package/lib/tntd-select/rc-select/hooks/useBaseProps.js.map +0 -1
  1179. package/lib/tntd-select/rc-select/hooks/useCache.d.ts +0 -8
  1180. package/lib/tntd-select/rc-select/hooks/useCache.d.ts.map +0 -1
  1181. package/lib/tntd-select/rc-select/hooks/useCache.js +0 -59
  1182. package/lib/tntd-select/rc-select/hooks/useCache.js.map +0 -1
  1183. package/lib/tntd-select/rc-select/hooks/useDelayReset.d.ts +0 -6
  1184. package/lib/tntd-select/rc-select/hooks/useDelayReset.d.ts.map +0 -1
  1185. package/lib/tntd-select/rc-select/hooks/useDelayReset.js +0 -50
  1186. package/lib/tntd-select/rc-select/hooks/useDelayReset.js.map +0 -1
  1187. package/lib/tntd-select/rc-select/hooks/useFilterOptions.d.ts +0 -4
  1188. package/lib/tntd-select/rc-select/hooks/useFilterOptions.d.ts.map +0 -1
  1189. package/lib/tntd-select/rc-select/hooks/useFilterOptions.js +0 -80
  1190. package/lib/tntd-select/rc-select/hooks/useFilterOptions.js.map +0 -1
  1191. package/lib/tntd-select/rc-select/hooks/useId.d.ts +0 -6
  1192. package/lib/tntd-select/rc-select/hooks/useId.d.ts.map +0 -1
  1193. package/lib/tntd-select/rc-select/hooks/useId.js +0 -59
  1194. package/lib/tntd-select/rc-select/hooks/useId.js.map +0 -1
  1195. package/lib/tntd-select/rc-select/hooks/useLayoutEffect.d.ts +0 -6
  1196. package/lib/tntd-select/rc-select/hooks/useLayoutEffect.d.ts.map +0 -1
  1197. package/lib/tntd-select/rc-select/hooks/useLayoutEffect.js +0 -44
  1198. package/lib/tntd-select/rc-select/hooks/useLayoutEffect.js.map +0 -1
  1199. package/lib/tntd-select/rc-select/hooks/useLock.d.ts +0 -8
  1200. package/lib/tntd-select/rc-select/hooks/useLock.d.ts.map +0 -1
  1201. package/lib/tntd-select/rc-select/hooks/useLock.js +0 -52
  1202. package/lib/tntd-select/rc-select/hooks/useLock.js.map +0 -1
  1203. package/lib/tntd-select/rc-select/hooks/useOptions.d.ts +0 -12
  1204. package/lib/tntd-select/rc-select/hooks/useOptions.d.ts.map +0 -1
  1205. package/lib/tntd-select/rc-select/hooks/useOptions.js +0 -71
  1206. package/lib/tntd-select/rc-select/hooks/useOptions.js.map +0 -1
  1207. package/lib/tntd-select/rc-select/hooks/useRefFunc.d.ts +0 -6
  1208. package/lib/tntd-select/rc-select/hooks/useRefFunc.d.ts.map +0 -1
  1209. package/lib/tntd-select/rc-select/hooks/useRefFunc.js +0 -40
  1210. package/lib/tntd-select/rc-select/hooks/useRefFunc.js.map +0 -1
  1211. package/lib/tntd-select/rc-select/hooks/useSelectTriggerControl.d.ts +0 -2
  1212. package/lib/tntd-select/rc-select/hooks/useSelectTriggerControl.d.ts.map +0 -1
  1213. package/lib/tntd-select/rc-select/hooks/useSelectTriggerControl.js +0 -58
  1214. package/lib/tntd-select/rc-select/hooks/useSelectTriggerControl.js.map +0 -1
  1215. package/lib/tntd-select/rc-select/index.d.ts +0 -11
  1216. package/lib/tntd-select/rc-select/index.d.ts.map +0 -1
  1217. package/lib/tntd-select/rc-select/index.js +0 -17
  1218. package/lib/tntd-select/rc-select/index.js.map +0 -1
  1219. package/lib/tntd-select/rc-select/interface.d.ts +0 -23
  1220. package/lib/tntd-select/rc-select/interface.d.ts.map +0 -1
  1221. package/lib/tntd-select/rc-select/interface.js +0 -3
  1222. package/lib/tntd-select/rc-select/interface.js.map +0 -1
  1223. package/lib/tntd-select/rc-select/utils/commonUtil.d.ts +0 -10
  1224. package/lib/tntd-select/rc-select/utils/commonUtil.d.ts.map +0 -1
  1225. package/lib/tntd-select/rc-select/utils/commonUtil.js +0 -39
  1226. package/lib/tntd-select/rc-select/utils/commonUtil.js.map +0 -1
  1227. package/lib/tntd-select/rc-select/utils/keyUtil.d.ts +0 -3
  1228. package/lib/tntd-select/rc-select/utils/keyUtil.d.ts.map +0 -1
  1229. package/lib/tntd-select/rc-select/utils/keyUtil.js +0 -41
  1230. package/lib/tntd-select/rc-select/utils/keyUtil.js.map +0 -1
  1231. package/lib/tntd-select/rc-select/utils/legacyUtil.d.ts +0 -4
  1232. package/lib/tntd-select/rc-select/utils/legacyUtil.d.ts.map +0 -1
  1233. package/lib/tntd-select/rc-select/utils/legacyUtil.js +0 -62
  1234. package/lib/tntd-select/rc-select/utils/legacyUtil.js.map +0 -1
  1235. package/lib/tntd-select/rc-select/utils/platformUtil.d.ts +0 -2
  1236. package/lib/tntd-select/rc-select/utils/platformUtil.d.ts.map +0 -1
  1237. package/lib/tntd-select/rc-select/utils/platformUtil.js +0 -9
  1238. package/lib/tntd-select/rc-select/utils/platformUtil.js.map +0 -1
  1239. package/lib/tntd-select/rc-select/utils/valueUtil.d.ts +0 -24
  1240. package/lib/tntd-select/rc-select/utils/valueUtil.d.ts.map +0 -1
  1241. package/lib/tntd-select/rc-select/utils/valueUtil.js +0 -109
  1242. package/lib/tntd-select/rc-select/utils/valueUtil.js.map +0 -1
  1243. package/lib/tntd-select/rc-select/utils/warningPropsUtil.d.ts +0 -5
  1244. package/lib/tntd-select/rc-select/utils/warningPropsUtil.d.ts.map +0 -1
  1245. package/lib/tntd-select/rc-select/utils/warningPropsUtil.js +0 -130
  1246. package/lib/tntd-select/rc-select/utils/warningPropsUtil.js.map +0 -1
  1247. /package/lib/{tntd-select/_util → _util}/context.d.ts +0 -0
  1248. /package/lib/{tntd-select/_util → _util}/defaultRenderEmpty.d.ts +0 -0
@@ -1,564 +1,659 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
17
5
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __rest = (this && this.__rest) || function (s, e) {
26
- var t = {};
27
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
28
- t[p] = s[p];
29
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
30
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
31
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
32
- t[p[i]] = s[p[i]];
33
- }
34
- return t;
6
+ exports["default"] = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _select = _interopRequireDefault(require("../select"));
9
+ var _empty = _interopRequireDefault(require("../empty"));
10
+ var _spin = _interopRequireDefault(require("../spin"));
11
+ var _DropDownWrap = _interopRequireDefault(require("./DropDownWrap"));
12
+ var _utils = require("../utils");
13
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
14
+ 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); }
15
+ 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; }
16
+ 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); }
17
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
18
+ 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); } }
19
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
20
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
21
+ 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); }
22
+ 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); }
23
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
24
+ 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); }; }
25
+ 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); }
26
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
27
+ 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; } }
28
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
29
+ var __rest = void 0 && (void 0).__rest || function (s, e) {
30
+ var t = {};
31
+ for (var p in s) {
32
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
33
+ }
34
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
35
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
36
+ }
37
+ return t;
35
38
  };
36
- var __importDefault = (this && this.__importDefault) || function (mod) {
37
- return (mod && mod.__esModule) ? mod : { "default": mod };
38
- };
39
- Object.defineProperty(exports, "__esModule", { value: true });
40
- const react_1 = __importStar(require("react"));
41
- const select_1 = __importDefault(require("../select"));
42
- const empty_1 = __importDefault(require("../empty"));
43
- const spin_1 = __importDefault(require("../spin"));
44
- const DropDownWrap_1 = __importDefault(require("./DropDownWrap"));
45
- const utils_1 = require("../utils");
46
39
  // 页面实际渲染的下拉菜单数量,实际为 2 * ITEM_ELEMENT_NUMBER
47
- const ITEM_ELEMENT_NUMBER = 30;
40
+ var ITEM_ELEMENT_NUMBER = 30;
48
41
  // Select size 配置
49
- const ITEM_HEIGHT_CFG = {
50
- small: 24,
51
- large: 40,
52
- default: 32,
42
+ var ITEM_HEIGHT_CFG = {
43
+ small: 24,
44
+ large: 40,
45
+ "default": 32
53
46
  };
54
- const ARROW_CODE = {
55
- 40: 'down',
56
- 38: 'up',
47
+ var ARROW_CODE = {
48
+ 40: 'down',
49
+ 38: 'up'
57
50
  };
58
- const DROPDOWN_HEIGHT = 224;
59
- const Option = select_1.default.Option;
60
- class SuperSelect extends react_1.PureComponent {
61
- constructor(props) {
62
- super(props);
63
- Object.defineProperty(this, "turnChildren", {
64
- enumerable: true,
65
- configurable: true,
66
- writable: true,
67
- value: (children) => {
68
- if (!children)
69
- return [];
70
- let arr = [];
71
- if (children && children.props) {
72
- arr.push(children);
73
- }
74
- else {
75
- children.forEach((item) => {
76
- if (item) {
77
- if (item instanceof Array) {
78
- arr = arr.concat(item);
79
- }
80
- else {
81
- arr.push(item);
82
- }
83
- }
84
- });
85
- }
86
- return arr;
87
- }
88
- });
89
- Object.defineProperty(this, "formulaWidth", {
90
- enumerable: true,
91
- configurable: true,
92
- writable: true,
93
- value: () => {
94
- // 获取dom设置宽度
95
- const { children: arr2, dropdownMatchSelectWidth = true, maxWidth } = this.props;
96
- const selectDom = document.getElementById(this.id);
97
- const selectWidth = selectDom.clientWidth || selectDom.offsetWidth;
98
- let arr = [];
99
- let formulaMaxWidth = 10;
100
- if (!dropdownMatchSelectWidth) {
101
- formulaMaxWidth = maxWidth || 10;
102
- }
103
- if (!dropdownMatchSelectWidth && !maxWidth) {
104
- const children = this.turnChildren(arr2);
105
- for (let i = 0; i < children.length; i++) {
106
- const val = children[i].props.children;
107
- const textWidth = this.getTextPixelWith(val);
108
- arr.push(textWidth.toFixed(2));
109
- }
110
- if (arr.length > 0) {
111
- formulaMaxWidth = Math.max(...arr);
112
- }
113
- }
114
- this.setState({
115
- selectWidth,
116
- maxWidth: formulaMaxWidth,
117
- });
118
- }
119
- });
120
- // 获取单行文本的像素宽度
121
- Object.defineProperty(this, "getTextPixelWith", {
122
- enumerable: true,
123
- configurable: true,
124
- writable: true,
125
- value: (text, fontStyle = '14px') => {
126
- let canvas = document.createElement('canvas'); // 创建 canvas 画布
127
- let context = canvas.getContext('2d'); // 获取 canvas 绘图上下文环境
128
- context.font = fontStyle; // 设置字体样式,使用前设置好对应的 font 样式才能准确获取文字的像素长度
129
- let dimension = context.measureText(text); // 测量文字
130
- return dimension.width;
131
- }
132
- });
133
- Object.defineProperty(this, "getItemStyle", {
134
- enumerable: true,
135
- configurable: true,
136
- writable: true,
137
- value: (i) => ({
138
- position: 'absolute',
139
- top: this.ITEM_HEIGHT * i,
140
- width: '100%',
141
- height: this.ITEM_HEIGHT,
142
- })
143
- });
144
- Object.defineProperty(this, "preventEvent", {
145
- enumerable: true,
146
- configurable: true,
147
- writable: true,
148
- value: (e) => {
149
- e.preventDefault();
150
- }
151
- });
152
- Object.defineProperty(this, "addEvent", {
153
- enumerable: true,
154
- configurable: true,
155
- writable: true,
156
- value: () => {
157
- this.scrollEle = document.querySelector(`.${this.dropdownClassName}`);
158
- // 下拉菜单未展开时元素不存在
159
- if (!this.scrollEle)
160
- return;
161
- this.scrollEle.addEventListener('mousedown', this.preventEvent, false);
162
- this.scrollEle.addEventListener('scroll', this.onScroll, false);
163
- this.inputEle = document.querySelector(`#${this.id}`);
164
- if (!this.inputEle)
165
- return;
166
- this.inputEle.addEventListener('keydown', this.onKeyDown, false);
167
- }
168
- });
169
- // 模拟 antd select 按下 上下箭头 键时滚动列表
170
- Object.defineProperty(this, "onKeyDown", {
171
- enumerable: true,
172
- configurable: true,
173
- writable: true,
174
- value: (e) => {
175
- const { keyCode } = e || {};
176
- setTimeout(() => {
177
- const activeItem = document.querySelector(`.${this.dropdownClassName} .ant-select-dropdown-menu-item-active`);
178
- if (!activeItem)
179
- return;
180
- const { offsetTop } = activeItem;
181
- const isUp = ARROW_CODE[keyCode] === 'up';
182
- const isDown = ARROW_CODE[keyCode] === 'down';
183
- // 在所有列表第一行按上键
184
- if (offsetTop - this.prevTop > DROPDOWN_HEIGHT && isUp && this.scrollEle) {
185
- this.scrollEle.scrollTo(0, this.allHeight - DROPDOWN_HEIGHT);
186
- this.prevTop = this.allHeight;
187
- return;
188
- }
189
- // 在所有列表中最后一行按下键
190
- if (this.prevTop > offsetTop + DROPDOWN_HEIGHT && isDown && this.scrollEle) {
191
- this.scrollEle.scrollTo(0, 0);
192
- this.prevTop = 0;
193
- return;
194
- }
195
- this.prevTop = offsetTop;
196
- // 向下滚动到下拉框最后一行时,向下滚动一行的高度
197
- if (offsetTop > this.scrollEle.scrollTop + DROPDOWN_HEIGHT - this.ITEM_HEIGHT + 10 &&
198
- isDown) {
199
- this.scrollEle.scrollTo(0, this.scrollTop + this.ITEM_HEIGHT);
200
- return;
201
- }
202
- // 向上滚动到下拉框第一一行时,向上滚动一行的高度
203
- if (offsetTop < this.scrollEle.scrollTop && isUp) {
204
- this.scrollEle.scrollTo(0, this.scrollTop - this.ITEM_HEIGHT);
205
- }
206
- }, 100);
207
- }
208
- });
209
- Object.defineProperty(this, "onScroll", {
210
- enumerable: true,
211
- configurable: true,
212
- writable: true,
213
- value: () => this.throttleByHeight(this.onScrollReal)
214
- });
215
- Object.defineProperty(this, "onScrollReal", {
216
- enumerable: true,
217
- configurable: true,
218
- writable: true,
219
- value: () => {
220
- this.allList = this.getUseChildrenList();
221
- const { startIndex, endIndex } = this.getStartAndEndIndex();
222
- this.prevScrollTop = this.scrollTop;
223
- // 重新渲染列表组件 Wrap
224
- const allHeight = this.allList.length * this.ITEM_HEIGHT || 100;
225
- this.wrap.reactList(allHeight, startIndex, endIndex);
226
- }
227
- });
228
- Object.defineProperty(this, "throttleByHeight", {
229
- enumerable: true,
230
- configurable: true,
231
- writable: true,
232
- value: () => {
233
- this.scrollTop = this.scrollEle.scrollTop;
234
- // 滚动的高度
235
- let delta = this.prevScrollTop - this.scrollTop;
236
- delta = delta < 0 ? 0 - delta : delta;
237
- delta > this.reactDelta && this.onScrollReal();
238
- }
239
- });
240
- // 列表可展示所有 children
241
- Object.defineProperty(this, "getUseChildrenList", {
242
- enumerable: true,
243
- configurable: true,
244
- writable: true,
245
- value: () => this.state.filterChildren || this.state.children
246
- });
247
- Object.defineProperty(this, "getStartAndEndIndex", {
248
- enumerable: true,
249
- configurable: true,
250
- writable: true,
251
- value: () => {
252
- // 滚动后显示在列表可视区中的第一个 item 的 index
253
- const showIndex = Number((this.scrollTop / this.ITEM_HEIGHT).toFixed(0));
254
- const startIndex = showIndex - ITEM_ELEMENT_NUMBER < 0 ? 0 : showIndex - ITEM_ELEMENT_NUMBER / 2;
255
- const endIndex = showIndex + ITEM_ELEMENT_NUMBER;
256
- return { startIndex, endIndex };
257
- }
258
- });
259
- // 须使用 setTimeout 确保在 dom 加载完成之后添加事件
260
- Object.defineProperty(this, "setSuperDrowDownMenu", {
261
- enumerable: true,
262
- configurable: true,
263
- writable: true,
264
- value: (visible) => {
265
- if (!visible)
266
- return;
267
- this.allList = this.getUseChildrenList();
268
- if (!this.eventTimer || !this.scrollEle) {
269
- this.eventTimer = setTimeout(() => this.addEvent(), 0);
270
- }
271
- else {
272
- const allHeight = this.allList.length * this.ITEM_HEIGHT || 100;
273
- // 下拉列表单独重新渲染
274
- const { startIndex, endIndex } = this.getStartAndEndIndex();
275
- setTimeout(() => {
276
- this.wrap && this.wrap.reactList(allHeight, startIndex, endIndex);
277
- }, 0);
278
- }
279
- }
280
- });
281
- Object.defineProperty(this, "onDropdownVisibleChange", {
282
- enumerable: true,
283
- configurable: true,
284
- writable: true,
285
- value: (visible) => {
286
- const { onDropdownVisibleChange } = this.props;
287
- onDropdownVisibleChange && onDropdownVisibleChange(visible);
288
- const { value, children } = this.state;
289
- // 关闭下拉框前清空筛选条件,防止下次打开任然显示筛选后的 options
290
- if (!visible) {
291
- // 定时器确保关闭后再设置 filterChildren,防止列表刷新闪烁
292
- setTimeout(() => {
293
- this.setState({ filterChildren: null });
294
- this.setDefaultScrollTop(value);
295
- }, 100);
296
- // this.removeEvent();
297
- }
298
- else {
299
- // this.addEvent();
300
- if (value) {
301
- // 如果已有 value, 设置默认滚动位置
302
- this.setDefaultScrollTop();
303
- // 设置下拉列表显示数据
304
- this.setSuperDrowDownMenu(visible);
305
- }
306
- else if (!value && value !== 0 && children && children.length > 0) {
307
- // 无数据时,下拉回归至第一个
308
- const val = children[0].props.value;
309
- this.setDefaultScrollTop(val);
310
- }
311
- }
312
- }
313
- });
314
- Object.defineProperty(this, "onDeselect", {
315
- enumerable: true,
316
- configurable: true,
317
- writable: true,
318
- value: (value) => {
319
- const { onDeselect } = this.props;
320
- onDeselect && onDeselect(value);
321
- }
322
- });
323
- // 在搜索重新计算下拉滚动条高度
324
- Object.defineProperty(this, "onChange", {
325
- enumerable: true,
326
- configurable: true,
327
- writable: true,
328
- value: (value, opt) => {
329
- const { showSearch, onChange, autoClearSearchValue, maxCount, mode } = this.props;
330
- if (showSearch || this.isMultiple) {
331
- // 搜索模式下选择后是否需要重置搜索状态
332
- if (autoClearSearchValue !== false) {
333
- this.setState({ filterChildren: null }, () => {
334
- // 搜索成功后重新设置列表的总高度
335
- this.setSuperDrowDownMenu(true);
336
- });
337
- }
338
- }
339
- if (mode === 'multiple') {
340
- if (value.length <= maxCount) {
341
- this.setState({ value });
342
- }
343
- }
344
- else {
345
- this.setState({ value });
346
- }
347
- onChange && onChange(value, opt);
348
- if (mode !== 'multiple') {
349
- this.select && this.select.blur();
350
- }
351
- }
352
- });
353
- Object.defineProperty(this, "onSearch", {
354
- enumerable: true,
355
- configurable: true,
356
- writable: true,
357
- value: (v) => {
358
- const { showSearch, onSearch, filterOption, children: arr } = this.props;
359
- let children = this.turnChildren(arr);
360
- if (showSearch && filterOption !== false) {
361
- // 须根据 filterOption(如有该自定义函数)手动 filter 搜索匹配的列表
362
- let filterChildren = null;
363
- if (typeof filterOption === 'function') {
364
- filterChildren = children.filter((item) => filterOption(v, item));
365
- }
366
- else if (filterOption === undefined) {
367
- filterChildren = children.filter((item) => this.filterOption(v, item));
368
- }
369
- // 搜索框有值,去除disabled=true的children
370
- let newFilterChild = [];
371
- filterChildren &&
372
- filterChildren.forEach((item, index) => {
373
- if (!item.props.disabled) {
374
- newFilterChild.push(item);
375
- }
376
- });
377
- filterChildren = newFilterChild;
378
- // 设置下拉列表显示数据
379
- this.setState({ filterChildren: v === '' ? null : filterChildren }, () => {
380
- setTimeout(() => {
381
- // 搜索后需要重置滚动位置到0,防止上次 scrollTop 位置无数据
382
- if (filterChildren && this.scrollEle) {
383
- this.scrollTop = 0;
384
- this.scrollEle.scrollTo(0, 0);
385
- }
386
- // 搜索成功后需要重新设置列表的总高度
387
- this.setSuperDrowDownMenu(true);
388
- }, 0);
389
- });
390
- }
391
- onSearch && onSearch(v);
51
+ var DROPDOWN_HEIGHT = 224;
52
+ var Option = _select["default"].Option;
53
+ var SuperSelect = /*#__PURE__*/function (_PureComponent) {
54
+ _inherits(SuperSelect, _PureComponent);
55
+ var _super = _createSuper(SuperSelect);
56
+ function SuperSelect(props) {
57
+ var _this;
58
+ _classCallCheck(this, SuperSelect);
59
+ _this = _super.call(this, props);
60
+ Object.defineProperty(_assertThisInitialized(_this), "turnChildren", {
61
+ enumerable: true,
62
+ configurable: true,
63
+ writable: true,
64
+ value: function value(children) {
65
+ if (!children) return [];
66
+ var arr = [];
67
+ if (children && children.props) {
68
+ arr.push(children);
69
+ } else {
70
+ children.forEach(function (item) {
71
+ if (item) {
72
+ if (item instanceof Array) {
73
+ arr = arr.concat(item);
74
+ } else {
75
+ arr.push(item);
76
+ }
392
77
  }
78
+ });
79
+ }
80
+ return arr;
81
+ }
82
+ });
83
+ Object.defineProperty(_assertThisInitialized(_this), "formulaWidth", {
84
+ enumerable: true,
85
+ configurable: true,
86
+ writable: true,
87
+ value: function value() {
88
+ // 获取dom设置宽度
89
+ var _this$props = _this.props,
90
+ arr2 = _this$props.children,
91
+ _this$props$dropdownM = _this$props.dropdownMatchSelectWidth,
92
+ dropdownMatchSelectWidth = _this$props$dropdownM === void 0 ? true : _this$props$dropdownM,
93
+ maxWidth = _this$props.maxWidth;
94
+ var selectDom = document.getElementById(_this.id);
95
+ var selectWidth = selectDom.clientWidth || selectDom.offsetWidth;
96
+ var arr = [];
97
+ var formulaMaxWidth = 10;
98
+ if (!dropdownMatchSelectWidth) {
99
+ formulaMaxWidth = maxWidth || 10;
100
+ }
101
+ if (!dropdownMatchSelectWidth && !maxWidth) {
102
+ var _children = _this.turnChildren(arr2);
103
+ for (var i = 0; i < _children.length; i++) {
104
+ var val = _children[i].props.children;
105
+ var textWidth = _this.getTextPixelWith(val);
106
+ arr.push(textWidth.toFixed(2));
107
+ }
108
+ if (arr.length > 0) {
109
+ formulaMaxWidth = Math.max.apply(Math, arr);
110
+ }
111
+ }
112
+ _this.setState({
113
+ selectWidth: selectWidth,
114
+ maxWidth: formulaMaxWidth
393
115
  });
394
- Object.defineProperty(this, "filterOption", {
395
- enumerable: true,
396
- configurable: true,
397
- writable: true,
398
- value: (v, option) => {
399
- // 自定义过滤对应的 option 属性配置
400
- const filterProps = this.props.optionFilterProp || 'value';
401
- return `${option.props[filterProps]}`.indexOf(v) >= 0;
116
+ }
117
+ });
118
+ // 获取单行文本的像素宽度
119
+ Object.defineProperty(_assertThisInitialized(_this), "getTextPixelWith", {
120
+ enumerable: true,
121
+ configurable: true,
122
+ writable: true,
123
+ value: function value(text) {
124
+ var fontStyle = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '14px';
125
+ var canvas = document.createElement('canvas'); // 创建 canvas 画布
126
+ var context = canvas.getContext('2d'); // 获取 canvas 绘图上下文环境
127
+ context.font = fontStyle; // 设置字体样式,使用前设置好对应的 font 样式才能准确获取文字的像素长度
128
+ var dimension = context.measureText(text); // 测量文字
129
+ return dimension.width;
130
+ }
131
+ });
132
+ Object.defineProperty(_assertThisInitialized(_this), "getItemStyle", {
133
+ enumerable: true,
134
+ configurable: true,
135
+ writable: true,
136
+ value: function value(i) {
137
+ return {
138
+ position: 'absolute',
139
+ top: _this.ITEM_HEIGHT * i,
140
+ width: '100%',
141
+ height: _this.ITEM_HEIGHT
142
+ };
143
+ }
144
+ });
145
+ Object.defineProperty(_assertThisInitialized(_this), "preventEvent", {
146
+ enumerable: true,
147
+ configurable: true,
148
+ writable: true,
149
+ value: function value(e) {
150
+ e.preventDefault();
151
+ }
152
+ });
153
+ Object.defineProperty(_assertThisInitialized(_this), "addEvent", {
154
+ enumerable: true,
155
+ configurable: true,
156
+ writable: true,
157
+ value: function value() {
158
+ _this.scrollEle = document.querySelector(".".concat(_this.dropdownClassName));
159
+ // 下拉菜单未展开时元素不存在
160
+ if (!_this.scrollEle) return;
161
+ _this.scrollEle.addEventListener('mousedown', _this.preventEvent, false);
162
+ _this.scrollEle.addEventListener('scroll', _this.onScroll, false);
163
+ _this.inputEle = document.querySelector("#".concat(_this.id));
164
+ if (!_this.inputEle) return;
165
+ _this.inputEle.addEventListener('keydown', _this.onKeyDown, false);
166
+ }
167
+ });
168
+ // 模拟 antd select 按下 上下箭头 键时滚动列表
169
+ Object.defineProperty(_assertThisInitialized(_this), "onKeyDown", {
170
+ enumerable: true,
171
+ configurable: true,
172
+ writable: true,
173
+ value: function value(e) {
174
+ var _ref = e || {},
175
+ keyCode = _ref.keyCode;
176
+ setTimeout(function () {
177
+ var activeItem = document.querySelector(".".concat(_this.dropdownClassName, " .ant-select-dropdown-menu-item-active"));
178
+ if (!activeItem) return;
179
+ var offsetTop = activeItem.offsetTop;
180
+ var isUp = ARROW_CODE[keyCode] === 'up';
181
+ var isDown = ARROW_CODE[keyCode] === 'down';
182
+ // 在所有列表第一行按上键
183
+ if (offsetTop - _this.prevTop > DROPDOWN_HEIGHT && isUp && _this.scrollEle) {
184
+ _this.scrollEle.scrollTo(0, _this.allHeight - DROPDOWN_HEIGHT);
185
+ _this.prevTop = _this.allHeight;
186
+ return;
187
+ }
188
+ // 在所有列表中最后一行按下键
189
+ if (_this.prevTop > offsetTop + DROPDOWN_HEIGHT && isDown && _this.scrollEle) {
190
+ _this.scrollEle.scrollTo(0, 0);
191
+ _this.prevTop = 0;
192
+ return;
193
+ }
194
+ _this.prevTop = offsetTop;
195
+ // 向下滚动到下拉框最后一行时,向下滚动一行的高度
196
+ if (offsetTop > _this.scrollEle.scrollTop + DROPDOWN_HEIGHT - _this.ITEM_HEIGHT + 10 && isDown) {
197
+ _this.scrollEle.scrollTo(0, _this.scrollTop + _this.ITEM_HEIGHT);
198
+ return;
199
+ }
200
+ // 向上滚动到下拉框第一一行时,向上滚动一行的高度
201
+ if (offsetTop < _this.scrollEle.scrollTop && isUp) {
202
+ _this.scrollEle.scrollTo(0, _this.scrollTop - _this.ITEM_HEIGHT);
203
+ }
204
+ }, 100);
205
+ }
206
+ });
207
+ Object.defineProperty(_assertThisInitialized(_this), "onScroll", {
208
+ enumerable: true,
209
+ configurable: true,
210
+ writable: true,
211
+ value: function value() {
212
+ return _this.throttleByHeight(_this.onScrollReal);
213
+ }
214
+ });
215
+ Object.defineProperty(_assertThisInitialized(_this), "onScrollReal", {
216
+ enumerable: true,
217
+ configurable: true,
218
+ writable: true,
219
+ value: function value() {
220
+ _this.allList = _this.getUseChildrenList();
221
+ var _this$getStartAndEndI = _this.getStartAndEndIndex(),
222
+ startIndex = _this$getStartAndEndI.startIndex,
223
+ endIndex = _this$getStartAndEndI.endIndex;
224
+ _this.prevScrollTop = _this.scrollTop;
225
+ // 重新渲染列表组件 Wrap
226
+ var allHeight = _this.allList.length * _this.ITEM_HEIGHT || 100;
227
+ _this.wrap.reactList(allHeight, startIndex, endIndex);
228
+ }
229
+ });
230
+ Object.defineProperty(_assertThisInitialized(_this), "throttleByHeight", {
231
+ enumerable: true,
232
+ configurable: true,
233
+ writable: true,
234
+ value: function value() {
235
+ _this.scrollTop = _this.scrollEle.scrollTop;
236
+ // 滚动的高度
237
+ var delta = _this.prevScrollTop - _this.scrollTop;
238
+ delta = delta < 0 ? 0 - delta : delta;
239
+ delta > _this.reactDelta && _this.onScrollReal();
240
+ }
241
+ });
242
+ // 列表可展示所有 children
243
+ Object.defineProperty(_assertThisInitialized(_this), "getUseChildrenList", {
244
+ enumerable: true,
245
+ configurable: true,
246
+ writable: true,
247
+ value: function value() {
248
+ return _this.state.filterChildren || _this.state.children;
249
+ }
250
+ });
251
+ Object.defineProperty(_assertThisInitialized(_this), "getStartAndEndIndex", {
252
+ enumerable: true,
253
+ configurable: true,
254
+ writable: true,
255
+ value: function value() {
256
+ // 滚动后显示在列表可视区中的第一个 item 的 index
257
+ var showIndex = Number((_this.scrollTop / _this.ITEM_HEIGHT).toFixed(0));
258
+ var startIndex = showIndex - ITEM_ELEMENT_NUMBER < 0 ? 0 : showIndex - ITEM_ELEMENT_NUMBER / 2;
259
+ var endIndex = showIndex + ITEM_ELEMENT_NUMBER;
260
+ return {
261
+ startIndex: startIndex,
262
+ endIndex: endIndex
263
+ };
264
+ }
265
+ });
266
+ // 须使用 setTimeout 确保在 dom 加载完成之后添加事件
267
+ Object.defineProperty(_assertThisInitialized(_this), "setSuperDrowDownMenu", {
268
+ enumerable: true,
269
+ configurable: true,
270
+ writable: true,
271
+ value: function value(visible) {
272
+ if (!visible) return;
273
+ _this.allList = _this.getUseChildrenList();
274
+ if (!_this.eventTimer || !_this.scrollEle) {
275
+ _this.eventTimer = setTimeout(function () {
276
+ return _this.addEvent();
277
+ }, 0);
278
+ } else {
279
+ var allHeight = _this.allList.length * _this.ITEM_HEIGHT || 100;
280
+ // 下拉列表单独重新渲染
281
+ var _this$getStartAndEndI2 = _this.getStartAndEndIndex(),
282
+ startIndex = _this$getStartAndEndI2.startIndex,
283
+ endIndex = _this$getStartAndEndI2.endIndex;
284
+ setTimeout(function () {
285
+ _this.wrap && _this.wrap.reactList(allHeight, startIndex, endIndex);
286
+ }, 0);
287
+ }
288
+ }
289
+ });
290
+ Object.defineProperty(_assertThisInitialized(_this), "onDropdownVisibleChange", {
291
+ enumerable: true,
292
+ configurable: true,
293
+ writable: true,
294
+ value: function value(visible) {
295
+ var onDropdownVisibleChange = _this.props.onDropdownVisibleChange;
296
+ onDropdownVisibleChange && onDropdownVisibleChange(visible);
297
+ var _this$state = _this.state,
298
+ value = _this$state.value,
299
+ children = _this$state.children;
300
+ // 关闭下拉框前清空筛选条件,防止下次打开任然显示筛选后的 options
301
+ if (!visible) {
302
+ // 定时器确保关闭后再设置 filterChildren,防止列表刷新闪烁
303
+ setTimeout(function () {
304
+ _this.setState({
305
+ filterChildren: null
306
+ });
307
+ _this.setDefaultScrollTop(value);
308
+ }, 100);
309
+ // this.removeEvent();
310
+ } else {
311
+ // this.addEvent();
312
+ if (value) {
313
+ // 如果已有 value, 设置默认滚动位置
314
+ _this.setDefaultScrollTop();
315
+ // 设置下拉列表显示数据
316
+ _this.setSuperDrowDownMenu(visible);
317
+ } else if (!value && value !== 0 && children && children.length > 0) {
318
+ // 无数据时,下拉回归至第一个
319
+ var val = children[0].props.value;
320
+ _this.setDefaultScrollTop(val);
321
+ }
322
+ }
323
+ }
324
+ });
325
+ Object.defineProperty(_assertThisInitialized(_this), "onDeselect", {
326
+ enumerable: true,
327
+ configurable: true,
328
+ writable: true,
329
+ value: function value(_value) {
330
+ var onDeselect = _this.props.onDeselect;
331
+ onDeselect && onDeselect(_value);
332
+ }
333
+ });
334
+ // 在搜索重新计算下拉滚动条高度
335
+ Object.defineProperty(_assertThisInitialized(_this), "onChange", {
336
+ enumerable: true,
337
+ configurable: true,
338
+ writable: true,
339
+ value: function value(_value2, opt) {
340
+ var _this$props2 = _this.props,
341
+ showSearch = _this$props2.showSearch,
342
+ onChange = _this$props2.onChange,
343
+ autoClearSearchValue = _this$props2.autoClearSearchValue,
344
+ maxCount = _this$props2.maxCount,
345
+ mode = _this$props2.mode;
346
+ if (showSearch || _this.isMultiple) {
347
+ // 搜索模式下选择后是否需要重置搜索状态
348
+ if (autoClearSearchValue !== false) {
349
+ _this.setState({
350
+ filterChildren: null
351
+ }, function () {
352
+ // 搜索成功后重新设置列表的总高度
353
+ _this.setSuperDrowDownMenu(true);
354
+ });
355
+ }
356
+ }
357
+ if (mode === 'multiple') {
358
+ if (_value2.length <= maxCount) {
359
+ _this.setState({
360
+ value: _value2
361
+ });
362
+ }
363
+ } else {
364
+ _this.setState({
365
+ value: _value2
366
+ });
367
+ }
368
+ onChange && onChange(_value2, opt);
369
+ if (mode !== 'multiple') {
370
+ _this.select && _this.select.blur();
371
+ }
372
+ }
373
+ });
374
+ Object.defineProperty(_assertThisInitialized(_this), "onSearch", {
375
+ enumerable: true,
376
+ configurable: true,
377
+ writable: true,
378
+ value: function value(v) {
379
+ var _this$props3 = _this.props,
380
+ showSearch = _this$props3.showSearch,
381
+ onSearch = _this$props3.onSearch,
382
+ filterOption = _this$props3.filterOption,
383
+ arr = _this$props3.children;
384
+ var children = _this.turnChildren(arr);
385
+ if (showSearch && filterOption !== false) {
386
+ // 须根据 filterOption(如有该自定义函数)手动 filter 搜索匹配的列表
387
+ var filterChildren = null;
388
+ if (typeof filterOption === 'function') {
389
+ filterChildren = children.filter(function (item) {
390
+ return filterOption(v, item);
391
+ });
392
+ } else if (filterOption === undefined) {
393
+ filterChildren = children.filter(function (item) {
394
+ return _this.filterOption(v, item);
395
+ });
396
+ }
397
+ // 搜索框有值,去除disabled=true的children
398
+ var newFilterChild = [];
399
+ filterChildren && filterChildren.forEach(function (item, index) {
400
+ if (!item.props.disabled) {
401
+ newFilterChild.push(item);
402
402
  }
403
- });
404
- Object.defineProperty(this, "setDefaultScrollTop", {
405
- enumerable: true,
406
- configurable: true,
407
- writable: true,
408
- value: (data) => {
409
- const { value } = this.state;
410
- const { children: arr } = this.props;
411
- const children = this.turnChildren(arr);
412
- let val = data || data === 0 ? data : value;
413
- for (let i = 0; i < children.length; i++) {
414
- const item = children[i];
415
- const itemValue = item.props.value;
416
- if (itemValue === val || (Array.isArray(val) && val.includes(itemValue))) {
417
- const targetScrollTop = i * this.ITEM_HEIGHT;
418
- setTimeout(() => {
419
- if (!this.scrollEle) {
420
- this.addEvent();
421
- }
422
- this.scrollEle && this.scrollEle.scrollTo(0, targetScrollTop);
423
- }, 100);
424
- return;
425
- }
403
+ });
404
+ filterChildren = newFilterChild;
405
+ // 设置下拉列表显示数据
406
+ _this.setState({
407
+ filterChildren: v === '' ? null : filterChildren
408
+ }, function () {
409
+ setTimeout(function () {
410
+ // 搜索后需要重置滚动位置到0,防止上次 scrollTop 位置无数据
411
+ if (filterChildren && _this.scrollEle) {
412
+ _this.scrollTop = 0;
413
+ _this.scrollEle.scrollTo(0, 0);
414
+ }
415
+ // 搜索成功后需要重新设置列表的总高度
416
+ _this.setSuperDrowDownMenu(true);
417
+ }, 0);
418
+ });
419
+ }
420
+ onSearch && onSearch(v);
421
+ }
422
+ });
423
+ Object.defineProperty(_assertThisInitialized(_this), "filterOption", {
424
+ enumerable: true,
425
+ configurable: true,
426
+ writable: true,
427
+ value: function value(v, option) {
428
+ // 自定义过滤对应的 option 属性配置
429
+ var filterProps = _this.props.optionFilterProp || 'value';
430
+ return "".concat(option.props[filterProps]).indexOf(v) >= 0;
431
+ }
432
+ });
433
+ Object.defineProperty(_assertThisInitialized(_this), "setDefaultScrollTop", {
434
+ enumerable: true,
435
+ configurable: true,
436
+ writable: true,
437
+ value: function value(data) {
438
+ var value = _this.state.value;
439
+ var arr = _this.props.children;
440
+ var children = _this.turnChildren(arr);
441
+ var val = data || data === 0 ? data : value;
442
+ for (var i = 0; i < children.length; i++) {
443
+ var item = children[i];
444
+ var itemValue = item.props.value;
445
+ if (itemValue === val || Array.isArray(val) && val.includes(itemValue)) {
446
+ var _ret = function () {
447
+ var targetScrollTop = i * _this.ITEM_HEIGHT;
448
+ setTimeout(function () {
449
+ if (!_this.scrollEle) {
450
+ _this.addEvent();
426
451
  }
452
+ _this.scrollEle && _this.scrollEle.scrollTo(0, targetScrollTop);
453
+ }, 100);
454
+ return {
455
+ v: void 0
456
+ };
457
+ }();
458
+ if (_typeof(_ret) === "object") return _ret.v;
459
+ }
460
+ }
461
+ }
462
+ });
463
+ Object.defineProperty(_assertThisInitialized(_this), "removeEvent", {
464
+ enumerable: true,
465
+ configurable: true,
466
+ writable: true,
467
+ value: function value() {
468
+ if (!_this.scrollEle) return;
469
+ _this.scrollEle.removeEventListener('mousedown', _this.preventEvent, false);
470
+ _this.scrollEle.removeEventListener('scroll', _this.onScroll, false);
471
+ if (!_this.inputEle) return;
472
+ _this.inputEle.removeEventListener('keydown', _this.onKeyDown, false);
473
+ }
474
+ });
475
+ var mode = props.mode,
476
+ defaultValue = props.defaultValue,
477
+ value = props.value,
478
+ optionHeight = props.optionHeight,
479
+ arr = props.children;
480
+ _this.isMultiple = ['tags', 'multiple'].includes(mode);
481
+ var children = _this.turnChildren(arr);
482
+ // 设置默认 value
483
+ var defaultV = _this.isMultiple ? [] : '';
484
+ defaultV = value || defaultValue || defaultV;
485
+ _this.state = {
486
+ children: children || [],
487
+ filterChildren: null,
488
+ value: defaultV,
489
+ maxWidth: null,
490
+ selectWidth: null
491
+ };
492
+ // 下拉菜单项行高
493
+ _this.ITEM_HEIGHT = optionHeight || ITEM_HEIGHT_CFG[props.size || 'default'];
494
+ // 可视区 dom 高度
495
+ _this.visibleDomHeight = _this.ITEM_HEIGHT * ITEM_ELEMENT_NUMBER;
496
+ // 滚动时重新渲染的 scrollTop 判断值,大于 reactDelta 则刷新下拉列表
497
+ _this.reactDelta = _this.visibleDomHeight / 3;
498
+ // 是否拖动滚动条快速滚动状态
499
+ _this.isStopReact = false;
500
+ // 上一次滚动的 scrollTop 值
501
+ _this.prevScrollTop = 0;
502
+ // 上一次按下方向键时 scrollTop 值
503
+ _this.prevTop = 0;
504
+ _this.scrollTop = 0;
505
+ // className
506
+ _this.dropdownClassName = "dc".concat(+new Date());
507
+ _this.id = "sid".concat(+new Date());
508
+ return _this;
509
+ }
510
+ _createClass(SuperSelect, [{
511
+ key: "componentDidMount",
512
+ value: function componentDidMount() {
513
+ var _this2 = this;
514
+ // defaultOpens=true 时添加滚动事件
515
+ setTimeout(function () {
516
+ _this2.addEvent();
517
+ }, 500);
518
+ var arr = this.props.children;
519
+ var children = this.turnChildren(arr);
520
+ // if (children && children.length > 0) {
521
+ this.formulaWidth();
522
+ // }
523
+ }
524
+ }, {
525
+ key: "componentDidUpdate",
526
+ value: function componentDidUpdate(prevProps) {
527
+ var _this3 = this;
528
+ var _this$props4 = this.props,
529
+ mode = _this$props4.mode,
530
+ defaultValue = _this$props4.defaultValue,
531
+ value = _this$props4.value,
532
+ children = _this$props4.children;
533
+ var arr = this.turnChildren(children);
534
+ if (prevProps.children !== children) {
535
+ this.isMultiple = ['tags', 'multiple'].includes(mode);
536
+ this.setState({
537
+ children: arr || [],
538
+ filterChildren: null
539
+ }, function () {
540
+ if (arr && arr.length > 0) {
541
+ // 设置下拉列表显示数据
542
+ if (!value) {
543
+ _this3.scrollTop = 0;
544
+ _this3.scrollEle && _this3.scrollEle.scrollTo(0, 0);
545
+ _this3.setSuperDrowDownMenu(true);
427
546
  }
428
- });
429
- Object.defineProperty(this, "removeEvent", {
430
- enumerable: true,
431
- configurable: true,
432
- writable: true,
433
- value: () => {
434
- if (!this.scrollEle)
435
- return;
436
- this.scrollEle.removeEventListener('mousedown', this.preventEvent, false);
437
- this.scrollEle.removeEventListener('scroll', this.onScroll, false);
438
- if (!this.inputEle)
439
- return;
440
- this.inputEle.removeEventListener('keydown', this.onKeyDown, false);
547
+ _this3.formulaWidth();
548
+ if (!_this3.inputEle) {
549
+ _this3.removeEvent();
550
+ _this3.addEvent();
441
551
  }
552
+ }
442
553
  });
443
- const { mode, defaultValue, value, optionHeight, children: arr } = props;
444
- this.isMultiple = ['tags', 'multiple'].includes(mode);
445
- const children = this.turnChildren(arr);
446
- // 设置默认 value
447
- let defaultV = this.isMultiple ? [] : '';
554
+ }
555
+ if (prevProps.value !== value) {
556
+ // 更新时设置默认 value
557
+ var defaultV = this.isMultiple ? [] : '';
448
558
  defaultV = value || defaultValue || defaultV;
449
- this.state = {
450
- children: children || [],
451
- filterChildren: null,
452
- value: defaultV,
453
- maxWidth: null,
454
- selectWidth: null,
455
- };
456
- // 下拉菜单项行高
457
- this.ITEM_HEIGHT = optionHeight || ITEM_HEIGHT_CFG[props.size || 'default'];
458
- // 可视区 dom 高度
459
- this.visibleDomHeight = this.ITEM_HEIGHT * ITEM_ELEMENT_NUMBER;
460
- // 滚动时重新渲染的 scrollTop 判断值,大于 reactDelta 则刷新下拉列表
461
- this.reactDelta = this.visibleDomHeight / 3;
462
- // 是否拖动滚动条快速滚动状态
463
- this.isStopReact = false;
464
- // 上一次滚动的 scrollTop 值
465
- this.prevScrollTop = 0;
466
- // 上一次按下方向键时 scrollTop 值
467
- this.prevTop = 0;
468
- this.scrollTop = 0;
469
- // className
470
- this.dropdownClassName = `dc${+new Date()}`;
471
- this.id = `sid${+new Date()}`;
559
+ this.setState({
560
+ value: defaultV
561
+ });
562
+ }
472
563
  }
473
- componentDidMount() {
474
- // defaultOpens=true 时添加滚动事件
475
- setTimeout(() => {
476
- this.addEvent();
477
- }, 500);
478
- const { children: arr } = this.props;
479
- const children = this.turnChildren(arr);
480
- // if (children && children.length > 0) {
481
- this.formulaWidth();
482
- // }
564
+ }, {
565
+ key: "componentWillUnmount",
566
+ value: function componentWillUnmount() {
567
+ this.removeEvent();
483
568
  }
484
- componentDidUpdate(prevProps) {
485
- const { mode, defaultValue, value, children } = this.props;
486
- let arr = this.turnChildren(children);
487
- if (prevProps.children !== children) {
488
- this.isMultiple = ['tags', 'multiple'].includes(mode);
489
- this.setState({
490
- children: arr || [],
491
- filterChildren: null
492
- }, () => {
493
- if (arr && arr.length > 0) {
494
- // 设置下拉列表显示数据
495
- if (!value) {
496
- this.scrollTop = 0;
497
- this.scrollEle && this.scrollEle.scrollTo(0, 0);
498
- this.setSuperDrowDownMenu(true);
499
- }
500
- this.formulaWidth();
501
- if (!this.inputEle) {
502
- this.removeEvent();
503
- this.addEvent();
504
- }
505
- }
569
+ }, {
570
+ key: "render",
571
+ value: function render() {
572
+ var _this4 = this;
573
+ var _this$state2 = this.state,
574
+ maxWidth = _this$state2.maxWidth,
575
+ selectWidth = _this$state2.selectWidth;
576
+ var _a = this.props,
577
+ dropdownStyle = _a.dropdownStyle,
578
+ optionLabelProp = _a.optionLabelProp,
579
+ dropdownClassName = _a.dropdownClassName,
580
+ props = __rest(_a, ["dropdownStyle", "optionLabelProp", "dropdownClassName"]);
581
+ this.allList = this.getUseChildrenList();
582
+ this.allHeight = this.allList.length * this.ITEM_HEIGHT || 100;
583
+ var _this$getStartAndEndI3 = this.getStartAndEndIndex(),
584
+ startIndex = _this$getStartAndEndI3.startIndex,
585
+ endIndex = _this$getStartAndEndI3.endIndex;
586
+ var dynamicWidth = maxWidth;
587
+ if (this.allList.length === 0 || maxWidth < selectWidth) {
588
+ dynamicWidth = selectWidth;
589
+ }
590
+ dropdownStyle = Object.assign(Object.assign({
591
+ maxHeight: "".concat(DROPDOWN_HEIGHT, "px")
592
+ }, dropdownStyle), {
593
+ overflow: 'auto',
594
+ position: 'relative',
595
+ maxWidth: dynamicWidth
596
+ });
597
+ var value = this.state.value;
598
+ // 判断处于 antd Form 中时不自动设置 value
599
+ var _props = Object.assign({}, props);
600
+ // 先删除 value,再手动赋值,防止空 value 影响 placeholder
601
+ delete _props.value;
602
+ // value 为空字符会隐藏 placeholder,改为 undefined
603
+ if (typeof value === 'string' && !value) {
604
+ _props.value = undefined;
605
+ } else {
606
+ _props.value = value;
607
+ }
608
+ optionLabelProp = optionLabelProp || 'children';
609
+ return _react["default"].createElement(_select["default"], Object.assign({}, _props, {
610
+ id: this.id,
611
+ placeholder: (0, _utils.capitalizeFirstLetter)(props === null || props === void 0 ? void 0 : props.placeholder, props === null || props === void 0 ? void 0 : props.capitalize),
612
+ onSearch: this.onSearch,
613
+ onChange: this.onChange,
614
+ dropdownClassName: "".concat(this.dropdownClassName, " ").concat(dropdownClassName || ''),
615
+ optionLabelProp: optionLabelProp,
616
+ dropdownStyle: dropdownStyle,
617
+ onDropdownVisibleChange: this.onDropdownVisibleChange,
618
+ onDeselect: this.onDeselect,
619
+ ref: function ref(ele) {
620
+ return _this4.select = ele;
621
+ },
622
+ dropdownRender: function dropdownRender(menu, props) {
623
+ if (_props.loading) {
624
+ return _react["default"].createElement(_spin["default"], {
625
+ size: "small",
626
+ style: {
627
+ marginLeft: 8
628
+ }
506
629
  });
630
+ }
631
+ if (_this4.allList.length === 0) {
632
+ return _react["default"].createElement("div", {
633
+ style: {
634
+ padding: '5px 12px'
635
+ }
636
+ }, _react["default"].createElement(_empty["default"], {
637
+ image: _empty["default"].PRESENTED_IMAGE_SIMPLE
638
+ }));
639
+ }
640
+ return _react["default"].createElement(_DropDownWrap["default"], Object.assign({}, {
641
+ startIndex: startIndex,
642
+ endIndex: endIndex,
643
+ allHeight: _this4.allHeight,
644
+ menu: menu,
645
+ itemHeight: _this4.ITEM_HEIGHT
646
+ }, {
647
+ ref: function ref(ele) {
648
+ _this4.wrap = ele;
649
+ }
650
+ }));
507
651
  }
508
- if (prevProps.value !== value) {
509
- // 更新时设置默认 value
510
- let defaultV = this.isMultiple ? [] : '';
511
- defaultV = value || defaultValue || defaultV;
512
- this.setState({ value: defaultV });
513
- }
514
- }
515
- componentWillUnmount() {
516
- this.removeEvent();
517
- }
518
- render() {
519
- const { maxWidth, selectWidth } = this.state;
520
- let _a = this.props, { dropdownStyle, optionLabelProp, dropdownClassName } = _a, props = __rest(_a, ["dropdownStyle", "optionLabelProp", "dropdownClassName"]);
521
- this.allList = this.getUseChildrenList();
522
- this.allHeight = this.allList.length * this.ITEM_HEIGHT || 100;
523
- const { startIndex, endIndex } = this.getStartAndEndIndex();
524
- let dynamicWidth = maxWidth;
525
- if (this.allList.length === 0 || maxWidth < selectWidth) {
526
- dynamicWidth = selectWidth;
527
- }
528
- dropdownStyle = Object.assign(Object.assign({ maxHeight: `${DROPDOWN_HEIGHT}px` }, dropdownStyle), { overflow: 'auto', position: 'relative', maxWidth: dynamicWidth });
529
- const { value } = this.state;
530
- // 判断处于 antd Form 中时不自动设置 value
531
- const _props = Object.assign({}, props);
532
- // 先删除 value,再手动赋值,防止空 value 影响 placeholder
533
- delete _props.value;
534
- // value 为空字符会隐藏 placeholder,改为 undefined
535
- if (typeof value === 'string' && !value) {
536
- _props.value = undefined;
537
- }
538
- else {
539
- _props.value = value;
540
- }
541
- optionLabelProp = optionLabelProp || 'children';
542
- return (react_1.default.createElement(select_1.default, Object.assign({}, _props, { id: this.id, placeholder: (0, utils_1.capitalizeFirstLetter)(props === null || props === void 0 ? void 0 : props.placeholder, props === null || props === void 0 ? void 0 : props.capitalize), onSearch: this.onSearch, onChange: this.onChange, dropdownClassName: `${this.dropdownClassName} ${dropdownClassName || ''}`, optionLabelProp: optionLabelProp, dropdownStyle: dropdownStyle, onDropdownVisibleChange: this.onDropdownVisibleChange, onDeselect: this.onDeselect, ref: (ele) => (this.select = ele), dropdownRender: (menu, props) => {
543
- if (_props.loading) {
544
- return (react_1.default.createElement(spin_1.default, { size: "small", style: { marginLeft: 8 } }));
545
- }
546
- if (this.allList.length === 0) {
547
- return (react_1.default.createElement("div", { style: { padding: '5px 12px' } },
548
- react_1.default.createElement(empty_1.default, { image: empty_1.default.PRESENTED_IMAGE_SIMPLE })));
549
- }
550
- return (react_1.default.createElement(DropDownWrap_1.default, Object.assign({}, {
551
- startIndex,
552
- endIndex,
553
- allHeight: this.allHeight,
554
- menu,
555
- itemHeight: this.ITEM_HEIGHT,
556
- }, { ref: (ele) => {
557
- this.wrap = ele;
558
- } })));
559
- } }), this.allList));
652
+ }), this.allList);
560
653
  }
561
- }
654
+ }]);
655
+ return SuperSelect;
656
+ }(_react.PureComponent);
562
657
  SuperSelect.Option = Option;
563
- exports.default = SuperSelect;
564
- //# sourceMappingURL=index.js.map
658
+ var _default = SuperSelect;
659
+ exports["default"] = _default;