tntd 2.5.6 → 2.5.8

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 (622) hide show
  1. package/es/affix/index.js +1 -2
  2. package/es/alert/index.js +1 -2
  3. package/es/anchor/index.js +1 -2
  4. package/es/array-input/icon.js +24 -6
  5. package/es/array-input/index.js +203 -119
  6. package/es/auth-context/index.js +1 -2
  7. package/es/auto-complete/index.js +1 -2
  8. package/es/avatar/index.js +1 -2
  9. package/es/back-top/index.js +1 -2
  10. package/es/badge/index.js +1 -2
  11. package/es/breadcrumb/index.js +1 -2
  12. package/es/button/index.js +1 -2
  13. package/es/calendar/index.js +1 -2
  14. package/es/card/index.js +1 -2
  15. package/es/carousel/index.js +1 -2
  16. package/es/cascader/index.js +1 -2
  17. package/es/checkbox/index.js +1 -2
  18. package/es/col/index.js +1 -2
  19. package/es/collapse/index.js +1 -2
  20. package/es/color-picker/ColorPicker.js +126 -80
  21. package/es/color-picker/index.js +8 -5
  22. package/es/columns/index.js +66 -30
  23. package/es/columns/style/index.js +1 -2
  24. package/es/comment/index.js +1 -2
  25. package/es/config-provider/config-provider.js +1 -2
  26. package/es/config-provider/index.js +1 -2
  27. package/es/date-picker/index.js +1 -2
  28. package/es/descriptions/descriptions.js +38 -30
  29. package/es/descriptions/index.js +1 -2
  30. package/es/development-login/LoginModal.js +81 -46
  31. package/es/development-login/index.js +17 -8
  32. package/es/divider/index.js +1 -2
  33. package/es/drawer/drawer.js +27 -20
  34. package/es/drawer/index.js +1 -2
  35. package/es/dropdown/index.js +1 -2
  36. package/es/ellipsis/Svg/CopySVG.js +63 -16
  37. package/es/ellipsis/Svg/TickSVG.js +41 -11
  38. package/es/ellipsis/index.js +115 -78
  39. package/es/empty/empty.js +58 -48
  40. package/es/empty/empty.stories.js +5 -6
  41. package/es/empty/index.js +1 -2
  42. package/es/exception/exception.js +32 -19
  43. package/es/exception/index.js +1 -2
  44. package/es/form/index.js +1 -2
  45. package/es/handle/index.js +110 -71
  46. package/es/icon/index.js +1 -2
  47. package/es/icon-list/index.js +1 -120
  48. package/es/img/Contain.js +60 -39
  49. package/es/img/Cover.js +98 -72
  50. package/es/img/index.js +48 -32
  51. package/es/index.js +1 -2
  52. package/es/input/index.js +1 -2
  53. package/es/input-number/index.js +1 -2
  54. package/es/layout/index.js +1 -2
  55. package/es/list/index.js +1 -2
  56. package/es/loading-button/index.js +33 -28
  57. package/es/locale/default.js +3 -4
  58. package/es/locale/en_US.js +30 -31
  59. package/es/locale/index.js +1 -2
  60. package/es/locale/zh_CN.js +30 -31
  61. package/es/locale-provider/index.js +2 -3
  62. package/es/mention/index.js +1 -2
  63. package/es/mentions/index.js +1 -2
  64. package/es/menu/index.js +1 -2
  65. package/es/message/index.js +1 -2
  66. package/es/modal/index.js +1 -2
  67. package/es/modal/modal.js +20 -17
  68. package/es/notification/index.js +1 -2
  69. package/es/page/Box.js +49 -33
  70. package/es/page/index.js +119 -84
  71. package/es/page/utils.js +12 -14
  72. package/es/page-header/index.js +1 -2
  73. package/es/pagination/index.js +1 -2
  74. package/es/popconfirm/index.js +1 -2
  75. package/es/popover/index.js +1 -2
  76. package/es/prev-locale.js +49 -47
  77. package/es/progress/index.js +1 -2
  78. package/es/query-form/Field/Checkbox.js +20 -17
  79. package/es/query-form/Field/Select.js +54 -39
  80. package/es/query-form/Field/SelectInput.js +63 -45
  81. package/es/query-form/Field/fieldsMap.js +19 -20
  82. package/es/query-form/Field/index.js +104 -66
  83. package/es/query-form/createActions.js +46 -46
  84. package/es/query-form/index.js +327 -247
  85. package/es/query-form/useForm.js +3 -4
  86. package/es/query-list-scene/List.js +319 -255
  87. package/es/query-list-scene/QueryForm.js +132 -94
  88. package/es/query-list-scene/QueryListScene.js +29 -21
  89. package/es/query-list-scene/Title.js +6 -4
  90. package/es/query-list-scene/Toolbar.js +21 -15
  91. package/es/query-list-scene/createActions.js +60 -60
  92. package/es/query-list-scene/index.js +1 -2
  93. package/es/query-list-scene/useActions.js +3 -4
  94. package/es/radio/index.js +1 -2
  95. package/es/rate/index.js +1 -2
  96. package/es/render-empty/index.js +1 -2
  97. package/es/render-empty/render-empty.js +19 -16
  98. package/es/result/index.js +1 -2
  99. package/es/row/index.js +1 -2
  100. package/es/select/index.js +1 -2
  101. package/es/skeleton/index.js +1 -2
  102. package/es/slider/index.js +1 -2
  103. package/es/spin/index.js +1 -2
  104. package/es/statistic/index.js +1 -2
  105. package/es/steps/index.js +1 -2
  106. package/es/steps/steps.js +51 -35
  107. package/es/svg-components/illustration-403.js +206 -58
  108. package/es/svg-components/illustration-404.js +290 -75
  109. package/es/svg-components/illustration-500.js +321 -83
  110. package/es/svg-components/illustration-empty.js +54 -15
  111. package/es/svg-components/illustration-failure.js +112 -36
  112. package/es/svg-components/illustration-no-access.js +114 -35
  113. package/es/svg-components/illustration-no-chart.js +134 -37
  114. package/es/svg-components/illustration-no-result.js +92 -32
  115. package/es/svg-components/illustration-offline.js +131 -43
  116. package/es/svg-components/illustration-success.js +137 -43
  117. package/es/svg-components/index.js +1 -2
  118. package/es/switch/index.js +1 -2
  119. package/es/table/assets/image-loading-background.js +45 -17
  120. package/es/table/assets/image-loading.js +26 -5
  121. package/es/table/constants.js +1 -2
  122. package/es/table/context.js +1 -2
  123. package/es/table/hooks/index.js +1 -2
  124. package/es/table/hooks/use-column-setting.js +13 -16
  125. package/es/table/index.js +1 -2
  126. package/es/table/table.js +76 -53
  127. package/es/table/table.stories.js +148 -139
  128. package/es/table/utils.js +17 -18
  129. package/es/tabs/index.js +1 -2
  130. package/es/tag/index.js +115 -98
  131. package/es/time-picker/index.js +1 -2
  132. package/es/timeline/index.js +1 -2
  133. package/es/title/index.js +34 -20
  134. package/es/tntd-cascader/AntdCascader/component/DisabledContext.js +9 -5
  135. package/es/tntd-cascader/AntdCascader/component/FormItemInputContext.js +1 -2
  136. package/es/tntd-cascader/AntdCascader/component/SizeContext.js +1 -2
  137. package/es/tntd-cascader/AntdCascader/component/context.js +5 -7
  138. package/es/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js +22 -10
  139. package/es/tntd-cascader/AntdCascader/component/getIcons.js +72 -50
  140. package/es/tntd-cascader/AntdCascader/component/useCompactItemContext.js +22 -20
  141. package/es/tntd-cascader/AntdCascader/config/utils.js +17 -18
  142. package/es/tntd-cascader/AntdCascader/config/warning.js +9 -10
  143. package/es/tntd-cascader/AntdCascader/index.js +189 -118
  144. package/es/tntd-cascader/AntdCascader/interface.js +1 -2
  145. package/es/tntd-cascader/index.js +1 -2
  146. package/es/tntd-cascader/rc-cascader/Cascader.js +256 -239
  147. package/es/tntd-cascader/rc-cascader/OptionList/Checkbox.js +21 -11
  148. package/es/tntd-cascader/rc-cascader/OptionList/Column.js +175 -116
  149. package/es/tntd-cascader/rc-cascader/OptionList/index.js +180 -128
  150. package/es/tntd-cascader/rc-cascader/OptionList/useActive.js +22 -19
  151. package/es/tntd-cascader/rc-cascader/OptionList/useKeyboard.js +144 -137
  152. package/es/tntd-cascader/rc-cascader/context.js +1 -2
  153. package/es/tntd-cascader/rc-cascader/hooks/useDisplayValues.js +44 -37
  154. package/es/tntd-cascader/rc-cascader/hooks/useEntities.js +25 -24
  155. package/es/tntd-cascader/rc-cascader/hooks/useMissingValues.js +15 -17
  156. package/es/tntd-cascader/rc-cascader/hooks/useRefFunc.js +7 -8
  157. package/es/tntd-cascader/rc-cascader/hooks/useSearchConfig.js +20 -21
  158. package/es/tntd-cascader/rc-cascader/hooks/useSearchOptions.js +51 -41
  159. package/es/tntd-cascader/rc-cascader/index.js +1 -2
  160. package/es/tntd-cascader/rc-cascader/utils/commonUtil.js +33 -27
  161. package/es/tntd-cascader/rc-cascader/utils/treeUtil.js +29 -32
  162. package/es/tntd-cascader/rc-cascader/utils/warningPropsUtil.js +26 -23
  163. package/es/tntd-form/TntdForm/components/Item.js +42 -30
  164. package/es/tntd-form/TntdForm/components/ItemComp.js +167 -158
  165. package/es/tntd-form/TntdForm/components/List.js +89 -78
  166. package/es/tntd-form/TntdForm/index.js +38 -33
  167. package/es/tntd-form/TntdForm/interface.js +1 -2
  168. package/es/tntd-form/TntdForm/store.js +1 -2
  169. package/es/tntd-form/TntdForm/utils.js +158 -168
  170. package/es/tntd-form/index.js +1 -2
  171. package/es/tntd-icon/fonts/iconfont.js +36 -53
  172. package/es/tntd-icon/index.js +23 -17
  173. package/es/tntd-layout/ActionsContext.js +1 -2
  174. package/es/tntd-layout/AppList.js +135 -77
  175. package/es/tntd-layout/Application.js +42 -29
  176. package/es/tntd-layout/Avatar.js +80 -42
  177. package/es/tntd-layout/CompatibleLanguage.js +93 -56
  178. package/es/tntd-layout/EnterpriseLayout/Avatar.js +93 -47
  179. package/es/tntd-layout/EnterpriseLayout/Language.js +56 -34
  180. package/es/tntd-layout/EnterpriseLayout/Theme.js +45 -24
  181. package/es/tntd-layout/EnterpriseLayout/index.js +17 -9
  182. package/es/tntd-layout/GlobalNavigation/NavigationPopup.js +212 -153
  183. package/es/tntd-layout/GlobalNavigation/index.js +84 -50
  184. package/es/tntd-layout/Header.js +59 -26
  185. package/es/tntd-layout/HeaderActions.js +83 -34
  186. package/es/tntd-layout/HeaderNavs.js +46 -35
  187. package/es/tntd-layout/HeaderTabs.js +176 -140
  188. package/es/tntd-layout/Iconfont.js +1 -2
  189. package/es/tntd-layout/Language.js +55 -33
  190. package/es/tntd-layout/Layout.js +176 -78
  191. package/es/tntd-layout/Logo.js +52 -40
  192. package/es/tntd-layout/OrgAppList.js +208 -139
  193. package/es/tntd-layout/SideMenu.js +230 -160
  194. package/es/tntd-layout/Theme.js +47 -29
  195. package/es/tntd-layout/createActions.js +28 -29
  196. package/es/tntd-layout/images/index.js +31 -32
  197. package/es/tntd-layout/index.js +92 -60
  198. package/es/tntd-layout/paaslayout/CompactSideMenu.js +109 -65
  199. package/es/tntd-layout/paaslayout/Header.js +37 -14
  200. package/es/tntd-layout/paaslayout/Logo.js +2 -3
  201. package/es/tntd-layout/paaslayout/SideMenu.js +109 -63
  202. package/es/tntd-layout/paaslayout/index.js +159 -79
  203. package/es/tntd-layout/storage.js +18 -11
  204. package/es/tntd-modal/index.js +73 -32
  205. package/es/tntd-second-page/index.js +47 -24
  206. package/es/tntd-select/DropDownWrap.js +73 -52
  207. package/es/tntd-select/index.js +574 -492
  208. package/es/tooltip/index.js +1 -2
  209. package/es/transfer/index.js +1 -2
  210. package/es/tree/index.js +1 -2
  211. package/es/tree-select/index.js +1 -2
  212. package/es/typography/index.js +1 -2
  213. package/es/upload/index.js +1 -2
  214. package/es/utils/checkAuth.js +24 -21
  215. package/es/utils/findMenuInfoByPath.js +33 -30
  216. package/es/utils/index.js +65 -59
  217. package/es/version/index.js +1 -2
  218. package/lib/affix/index.d.ts +3 -3
  219. package/lib/affix/index.js +23 -22
  220. package/lib/affix/index.js.map +1 -1
  221. package/lib/alert/index.d.ts +3 -3
  222. package/lib/alert/index.js +23 -22
  223. package/lib/alert/index.js.map +1 -1
  224. package/lib/anchor/index.d.ts +3 -3
  225. package/lib/anchor/index.js +23 -22
  226. package/lib/anchor/index.js.map +1 -1
  227. package/lib/array-input/icon.js +33 -12
  228. package/lib/array-input/index.js +254 -150
  229. package/lib/auth-context/index.js +10 -4
  230. package/lib/auto-complete/index.d.ts +3 -3
  231. package/lib/auto-complete/index.js +23 -22
  232. package/lib/auto-complete/index.js.map +1 -1
  233. package/lib/avatar/index.d.ts +3 -3
  234. package/lib/avatar/index.js +23 -22
  235. package/lib/avatar/index.js.map +1 -1
  236. package/lib/back-top/index.d.ts +3 -3
  237. package/lib/back-top/index.js +23 -22
  238. package/lib/back-top/index.js.map +1 -1
  239. package/lib/badge/index.d.ts +3 -3
  240. package/lib/badge/index.js +23 -22
  241. package/lib/badge/index.js.map +1 -1
  242. package/lib/breadcrumb/index.d.ts +3 -3
  243. package/lib/breadcrumb/index.js +23 -22
  244. package/lib/breadcrumb/index.js.map +1 -1
  245. package/lib/button/index.d.ts +3 -3
  246. package/lib/button/index.js +23 -22
  247. package/lib/button/index.js.map +1 -1
  248. package/lib/calendar/index.d.ts +3 -3
  249. package/lib/calendar/index.js +23 -22
  250. package/lib/calendar/index.js.map +1 -1
  251. package/lib/card/index.d.ts +3 -3
  252. package/lib/card/index.js +23 -22
  253. package/lib/card/index.js.map +1 -1
  254. package/lib/carousel/index.d.ts +3 -3
  255. package/lib/carousel/index.js +23 -22
  256. package/lib/carousel/index.js.map +1 -1
  257. package/lib/cascader/index.d.ts +3 -3
  258. package/lib/cascader/index.js +23 -22
  259. package/lib/cascader/index.js.map +1 -1
  260. package/lib/checkbox/index.d.ts +3 -3
  261. package/lib/checkbox/index.js +23 -22
  262. package/lib/checkbox/index.js.map +1 -1
  263. package/lib/col/index.d.ts +3 -3
  264. package/lib/col/index.js +23 -22
  265. package/lib/col/index.js.map +1 -1
  266. package/lib/collapse/index.d.ts +3 -3
  267. package/lib/collapse/index.js +24 -23
  268. package/lib/collapse/index.js.map +1 -1
  269. package/lib/color-picker/ColorPicker.js +156 -113
  270. package/lib/color-picker/index.js +18 -14
  271. package/lib/color-picker/index.js.map +1 -1
  272. package/lib/columns/index.js +81 -41
  273. package/lib/columns/style/index.js +1 -2
  274. package/lib/comment/index.d.ts +3 -3
  275. package/lib/comment/index.js +23 -22
  276. package/lib/comment/index.js.map +1 -1
  277. package/lib/config-provider/config-provider.d.ts +1 -1
  278. package/lib/config-provider/config-provider.js +12 -8
  279. package/lib/config-provider/config-provider.js.map +1 -1
  280. package/lib/config-provider/index.d.ts +3 -3
  281. package/lib/config-provider/index.js +23 -22
  282. package/lib/config-provider/index.js.map +1 -1
  283. package/lib/date-picker/index.d.ts +3 -3
  284. package/lib/date-picker/index.js +23 -22
  285. package/lib/date-picker/index.js.map +1 -1
  286. package/lib/descriptions/descriptions.d.ts +4 -4
  287. package/lib/descriptions/descriptions.d.ts.map +1 -1
  288. package/lib/descriptions/descriptions.js +64 -55
  289. package/lib/descriptions/descriptions.js.map +1 -1
  290. package/lib/descriptions/index.d.ts +1 -1
  291. package/lib/descriptions/index.js +23 -22
  292. package/lib/descriptions/index.js.map +1 -1
  293. package/lib/development-login/LoginModal.js +110 -79
  294. package/lib/development-login/index.js +42 -35
  295. package/lib/divider/index.d.ts +3 -3
  296. package/lib/divider/index.js +23 -22
  297. package/lib/divider/index.js.map +1 -1
  298. package/lib/drawer/drawer.d.ts +1 -1
  299. package/lib/drawer/drawer.js +41 -30
  300. package/lib/drawer/drawer.js.map +1 -1
  301. package/lib/drawer/index.d.ts +2 -2
  302. package/lib/drawer/index.js +22 -20
  303. package/lib/drawer/index.js.map +1 -1
  304. package/lib/dropdown/index.d.ts +3 -3
  305. package/lib/dropdown/index.js +23 -22
  306. package/lib/dropdown/index.js.map +1 -1
  307. package/lib/ellipsis/Svg/CopySVG.js +70 -20
  308. package/lib/ellipsis/Svg/TickSVG.js +48 -15
  309. package/lib/ellipsis/index.js +146 -115
  310. package/lib/empty/empty.d.ts +2 -2
  311. package/lib/empty/empty.js +90 -75
  312. package/lib/empty/empty.js.map +1 -1
  313. package/lib/empty/empty.stories.js +19 -18
  314. package/lib/empty/index.d.ts +1 -1
  315. package/lib/empty/index.js +20 -19
  316. package/lib/empty/index.js.map +1 -1
  317. package/lib/exception/exception.js +46 -31
  318. package/lib/exception/exception.js.map +1 -1
  319. package/lib/exception/index.js +19 -18
  320. package/lib/form/index.d.ts +3 -3
  321. package/lib/form/index.js +23 -22
  322. package/lib/form/index.js.map +1 -1
  323. package/lib/handle/index.js +140 -104
  324. package/lib/handle/index.js.map +1 -1
  325. package/lib/icon/index.d.ts +3 -3
  326. package/lib/icon/index.js +23 -22
  327. package/lib/icon/index.js.map +1 -1
  328. package/lib/icon-list/index.js +7 -121
  329. package/lib/img/Contain.js +69 -44
  330. package/lib/img/Cover.js +117 -78
  331. package/lib/img/index.js +74 -60
  332. package/lib/index.js +621 -186
  333. package/lib/input/index.d.ts +3 -3
  334. package/lib/input/index.js +23 -22
  335. package/lib/input/index.js.map +1 -1
  336. package/lib/input-number/index.d.ts +3 -3
  337. package/lib/input-number/index.js +23 -22
  338. package/lib/input-number/index.js.map +1 -1
  339. package/lib/layout/index.d.ts +3 -3
  340. package/lib/layout/index.js +23 -22
  341. package/lib/layout/index.js.map +1 -1
  342. package/lib/list/index.d.ts +3 -3
  343. package/lib/list/index.js +23 -22
  344. package/lib/list/index.js.map +1 -1
  345. package/lib/loading-button/index.js +58 -55
  346. package/lib/locale/default.js +12 -10
  347. package/lib/locale/default.js.map +1 -1
  348. package/lib/locale/en_US.js +38 -36
  349. package/lib/locale/en_US.js.map +1 -1
  350. package/lib/locale/index.js +36 -18
  351. package/lib/locale/zh_CN.js +38 -36
  352. package/lib/locale/zh_CN.js.map +1 -1
  353. package/lib/locale-provider/index.d.ts +3 -3
  354. package/lib/locale-provider/index.js +26 -25
  355. package/lib/locale-provider/index.js.map +1 -1
  356. package/lib/mention/index.d.ts +3 -3
  357. package/lib/mention/index.js +23 -22
  358. package/lib/mention/index.js.map +1 -1
  359. package/lib/mentions/index.d.ts +3 -3
  360. package/lib/mentions/index.js +23 -22
  361. package/lib/mentions/index.js.map +1 -1
  362. package/lib/menu/index.d.ts +3 -3
  363. package/lib/menu/index.js +23 -22
  364. package/lib/menu/index.js.map +1 -1
  365. package/lib/message/index.d.ts +3 -3
  366. package/lib/message/index.js +23 -22
  367. package/lib/message/index.js.map +1 -1
  368. package/lib/modal/index.d.ts +1 -1
  369. package/lib/modal/index.js +22 -21
  370. package/lib/modal/index.js.map +1 -1
  371. package/lib/modal/modal.d.ts +9 -9
  372. package/lib/modal/modal.js +53 -49
  373. package/lib/modal/modal.js.map +1 -1
  374. package/lib/notification/index.d.ts +3 -3
  375. package/lib/notification/index.js +23 -22
  376. package/lib/notification/index.js.map +1 -1
  377. package/lib/page/Box.js +66 -40
  378. package/lib/page/index.js +147 -95
  379. package/lib/page/utils.js +22 -16
  380. package/lib/page-header/index.d.ts +3 -3
  381. package/lib/page-header/index.js +23 -22
  382. package/lib/page-header/index.js.map +1 -1
  383. package/lib/pagination/index.d.ts +3 -3
  384. package/lib/pagination/index.js +23 -22
  385. package/lib/pagination/index.js.map +1 -1
  386. package/lib/popconfirm/index.d.ts +3 -3
  387. package/lib/popconfirm/index.js +23 -22
  388. package/lib/popconfirm/index.js.map +1 -1
  389. package/lib/popover/index.d.ts +3 -3
  390. package/lib/popover/index.js +23 -22
  391. package/lib/popover/index.js.map +1 -1
  392. package/lib/prev-locale.js +67 -53
  393. package/lib/progress/index.d.ts +3 -3
  394. package/lib/progress/index.js +23 -22
  395. package/lib/progress/index.js.map +1 -1
  396. package/lib/query-form/Field/Checkbox.js +28 -22
  397. package/lib/query-form/Field/Select.js +79 -68
  398. package/lib/query-form/Field/SelectInput.js +85 -73
  399. package/lib/query-form/Field/fieldsMap.d.ts +2 -2
  400. package/lib/query-form/Field/fieldsMap.js +34 -32
  401. package/lib/query-form/Field/index.js +139 -95
  402. package/lib/query-form/createActions.js +53 -50
  403. package/lib/query-form/index.js +377 -286
  404. package/lib/query-form/useForm.js +11 -11
  405. package/lib/query-list-scene/List.js +358 -289
  406. package/lib/query-list-scene/QueryForm.js +161 -103
  407. package/lib/query-list-scene/QueryListScene.js +66 -31
  408. package/lib/query-list-scene/Title.js +15 -9
  409. package/lib/query-list-scene/Toolbar.js +31 -20
  410. package/lib/query-list-scene/createActions.js +79 -64
  411. package/lib/query-list-scene/index.js +28 -24
  412. package/lib/query-list-scene/useActions.js +11 -11
  413. package/lib/radio/index.d.ts +3 -3
  414. package/lib/radio/index.js +23 -22
  415. package/lib/radio/index.js.map +1 -1
  416. package/lib/rate/index.d.ts +3 -3
  417. package/lib/rate/index.js +23 -22
  418. package/lib/rate/index.js.map +1 -1
  419. package/lib/render-empty/index.js +8 -4
  420. package/lib/render-empty/render-empty.js +28 -22
  421. package/lib/render-empty/render-empty.js.map +1 -1
  422. package/lib/result/index.d.ts +3 -3
  423. package/lib/result/index.js +23 -22
  424. package/lib/result/index.js.map +1 -1
  425. package/lib/row/index.d.ts +3 -3
  426. package/lib/row/index.js +23 -22
  427. package/lib/row/index.js.map +1 -1
  428. package/lib/select/index.d.ts +3 -3
  429. package/lib/select/index.js +23 -22
  430. package/lib/select/index.js.map +1 -1
  431. package/lib/skeleton/index.d.ts +3 -3
  432. package/lib/skeleton/index.js +23 -22
  433. package/lib/skeleton/index.js.map +1 -1
  434. package/lib/slider/index.d.ts +3 -3
  435. package/lib/slider/index.js +23 -22
  436. package/lib/slider/index.js.map +1 -1
  437. package/lib/spin/index.d.ts +3 -3
  438. package/lib/spin/index.js +23 -22
  439. package/lib/spin/index.js.map +1 -1
  440. package/lib/statistic/index.d.ts +3 -3
  441. package/lib/statistic/index.js +23 -22
  442. package/lib/statistic/index.js.map +1 -1
  443. package/lib/steps/index.d.ts +1 -1
  444. package/lib/steps/index.js +20 -19
  445. package/lib/steps/index.js.map +1 -1
  446. package/lib/steps/steps.d.ts +3 -3
  447. package/lib/steps/steps.js +72 -59
  448. package/lib/steps/steps.js.map +1 -1
  449. package/lib/svg-components/illustration-403.d.ts +1 -1
  450. package/lib/svg-components/illustration-403.js +217 -84
  451. package/lib/svg-components/illustration-404.d.ts +1 -1
  452. package/lib/svg-components/illustration-404.js +301 -101
  453. package/lib/svg-components/illustration-500.d.ts +1 -1
  454. package/lib/svg-components/illustration-500.js +332 -109
  455. package/lib/svg-components/illustration-empty.d.ts +1 -1
  456. package/lib/svg-components/illustration-empty.js +65 -41
  457. package/lib/svg-components/illustration-failure.d.ts +1 -1
  458. package/lib/svg-components/illustration-failure.js +123 -62
  459. package/lib/svg-components/illustration-no-access.d.ts +1 -1
  460. package/lib/svg-components/illustration-no-access.js +125 -61
  461. package/lib/svg-components/illustration-no-chart.d.ts +1 -1
  462. package/lib/svg-components/illustration-no-chart.js +145 -63
  463. package/lib/svg-components/illustration-no-result.d.ts +1 -1
  464. package/lib/svg-components/illustration-no-result.js +103 -58
  465. package/lib/svg-components/illustration-offline.d.ts +1 -1
  466. package/lib/svg-components/illustration-offline.js +142 -69
  467. package/lib/svg-components/illustration-success.d.ts +1 -1
  468. package/lib/svg-components/illustration-success.js +148 -69
  469. package/lib/svg-components/index.js +75 -26
  470. package/lib/switch/index.d.ts +3 -3
  471. package/lib/switch/index.js +23 -22
  472. package/lib/switch/index.js.map +1 -1
  473. package/lib/table/assets/image-loading-background.d.ts +1 -1
  474. package/lib/table/assets/image-loading-background.js +56 -43
  475. package/lib/table/assets/image-loading.d.ts +1 -1
  476. package/lib/table/assets/image-loading.js +37 -31
  477. package/lib/table/constants.js +6 -3
  478. package/lib/table/context.js +7 -4
  479. package/lib/table/hooks/index.js +14 -16
  480. package/lib/table/hooks/use-column-setting.d.ts +1 -1
  481. package/lib/table/hooks/use-column-setting.js +37 -20
  482. package/lib/table/hooks/use-column-setting.js.map +1 -1
  483. package/lib/table/index.d.ts +1 -1
  484. package/lib/table/index.js +20 -19
  485. package/lib/table/index.js.map +1 -1
  486. package/lib/table/table.d.ts +3 -3
  487. package/lib/table/table.js +110 -92
  488. package/lib/table/table.js.map +1 -1
  489. package/lib/table/table.stories.js +182 -154
  490. package/lib/table/utils.d.ts +1 -1
  491. package/lib/table/utils.js +24 -25
  492. package/lib/table/utils.js.map +1 -1
  493. package/lib/tabs/index.d.ts +3 -3
  494. package/lib/tabs/index.js +23 -22
  495. package/lib/tabs/index.js.map +1 -1
  496. package/lib/tag/index.d.ts +4 -4
  497. package/lib/tag/index.js +149 -141
  498. package/lib/tag/index.js.map +1 -1
  499. package/lib/time-picker/index.d.ts +3 -3
  500. package/lib/time-picker/index.js +23 -22
  501. package/lib/time-picker/index.js.map +1 -1
  502. package/lib/timeline/index.d.ts +3 -3
  503. package/lib/timeline/index.js +23 -22
  504. package/lib/timeline/index.js.map +1 -1
  505. package/lib/title/index.js +45 -26
  506. package/lib/tntd-cascader/AntdCascader/component/DisabledContext.js +18 -31
  507. package/lib/tntd-cascader/AntdCascader/component/FormItemInputContext.js +9 -26
  508. package/lib/tntd-cascader/AntdCascader/component/SizeContext.js +9 -26
  509. package/lib/tntd-cascader/AntdCascader/component/context.js +18 -16
  510. package/lib/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js +36 -39
  511. package/lib/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js.map +1 -1
  512. package/lib/tntd-cascader/AntdCascader/component/getIcons.js +81 -75
  513. package/lib/tntd-cascader/AntdCascader/component/useCompactItemContext.js +31 -50
  514. package/lib/tntd-cascader/AntdCascader/config/utils.js +29 -27
  515. package/lib/tntd-cascader/AntdCascader/config/warning.js +19 -35
  516. package/lib/tntd-cascader/AntdCascader/index.js +216 -162
  517. package/lib/tntd-cascader/AntdCascader/interface.js +13 -6
  518. package/lib/tntd-cascader/img/no-data-s.png +0 -0
  519. package/lib/tntd-cascader/index.js +12 -8
  520. package/lib/tntd-cascader/rc-cascader/Cascader.js +325 -284
  521. package/lib/tntd-cascader/rc-cascader/OptionList/Checkbox.js +30 -41
  522. package/lib/tntd-cascader/rc-cascader/OptionList/Column.js +198 -152
  523. package/lib/tntd-cascader/rc-cascader/OptionList/index.js +223 -163
  524. package/lib/tntd-cascader/rc-cascader/OptionList/useActive.js +40 -48
  525. package/lib/tntd-cascader/rc-cascader/OptionList/useKeyboard.js +179 -166
  526. package/lib/tntd-cascader/rc-cascader/context.js +11 -27
  527. package/lib/tntd-cascader/rc-cascader/hooks/useDisplayValues.js +62 -63
  528. package/lib/tntd-cascader/rc-cascader/hooks/useEntities.js +39 -49
  529. package/lib/tntd-cascader/rc-cascader/hooks/useMissingValues.js +26 -41
  530. package/lib/tntd-cascader/rc-cascader/hooks/useRefFunc.js +16 -33
  531. package/lib/tntd-cascader/rc-cascader/hooks/useSearchConfig.js +30 -51
  532. package/lib/tntd-cascader/rc-cascader/hooks/useSearchOptions.js +75 -65
  533. package/lib/tntd-cascader/rc-cascader/index.js +9 -7
  534. package/lib/tntd-cascader/rc-cascader/utils/commonUtil.js +49 -38
  535. package/lib/tntd-cascader/rc-cascader/utils/treeUtil.js +42 -39
  536. package/lib/tntd-cascader/rc-cascader/utils/warningPropsUtil.js +34 -30
  537. package/lib/tntd-form/TntdForm/components/Item.js +55 -61
  538. package/lib/tntd-form/TntdForm/components/ItemComp.js +203 -190
  539. package/lib/tntd-form/TntdForm/components/List.js +118 -111
  540. package/lib/tntd-form/TntdForm/index.js +61 -67
  541. package/lib/tntd-form/TntdForm/interface.js +4 -2
  542. package/lib/tntd-form/TntdForm/store.js +8 -7
  543. package/lib/tntd-form/TntdForm/utils.js +182 -184
  544. package/lib/tntd-form/index.js +12 -8
  545. package/lib/tntd-icon/fonts/iconfont.js +36 -53
  546. package/lib/tntd-icon/index.js +40 -25
  547. package/lib/tntd-layout/ActionsContext.js +8 -4
  548. package/lib/tntd-layout/AppList.js +173 -224
  549. package/lib/tntd-layout/Application.js +75 -111
  550. package/lib/tntd-layout/Avatar.js +100 -135
  551. package/lib/tntd-layout/CompatibleLanguage.js +128 -180
  552. package/lib/tntd-layout/EnterpriseLayout/Avatar.js +117 -146
  553. package/lib/tntd-layout/EnterpriseLayout/Language.js +73 -90
  554. package/lib/tntd-layout/EnterpriseLayout/Theme.js +69 -102
  555. package/lib/tntd-layout/EnterpriseLayout/index.js +28 -17
  556. package/lib/tntd-layout/GlobalNavigation/NavigationPopup.js +283 -276
  557. package/lib/tntd-layout/GlobalNavigation/index.js +108 -115
  558. package/lib/tntd-layout/Header.js +77 -136
  559. package/lib/tntd-layout/HeaderActions.js +105 -106
  560. package/lib/tntd-layout/HeaderNavs.js +78 -107
  561. package/lib/tntd-layout/HeaderTabs.js +224 -316
  562. package/lib/tntd-layout/Iconfont.js +11 -7
  563. package/lib/tntd-layout/Language.js +69 -76
  564. package/lib/tntd-layout/Layout.js +214 -171
  565. package/lib/tntd-layout/Logo.js +69 -144
  566. package/lib/tntd-layout/OrgAppList.js +238 -388
  567. package/lib/tntd-layout/SideMenu.js +269 -408
  568. package/lib/tntd-layout/Theme.js +75 -93
  569. package/lib/tntd-layout/createActions.js +45 -34
  570. package/lib/tntd-layout/images/avatar/empty.png +0 -0
  571. package/lib/tntd-layout/images/avatar/female1.png +0 -0
  572. package/lib/tntd-layout/images/avatar/female2.png +0 -0
  573. package/lib/tntd-layout/images/avatar/female3.png +0 -0
  574. package/lib/tntd-layout/images/avatar/female4.png +0 -0
  575. package/lib/tntd-layout/images/avatar/female5.png +0 -0
  576. package/lib/tntd-layout/images/avatar/female6.png +0 -0
  577. package/lib/tntd-layout/images/avatar/male1.png +0 -0
  578. package/lib/tntd-layout/images/avatar/male2.png +0 -0
  579. package/lib/tntd-layout/images/avatar/male3.png +0 -0
  580. package/lib/tntd-layout/images/avatar/male4.png +0 -0
  581. package/lib/tntd-layout/images/avatar/male5.png +0 -0
  582. package/lib/tntd-layout/images/avatar/male6.png +0 -0
  583. package/lib/tntd-layout/images/index.js +68 -66
  584. package/lib/tntd-layout/index.js +137 -95
  585. package/lib/tntd-layout/paaslayout/CompactSideMenu.js +131 -182
  586. package/lib/tntd-layout/paaslayout/Header.js +51 -79
  587. package/lib/tntd-layout/paaslayout/Logo.js +15 -30
  588. package/lib/tntd-layout/paaslayout/SideMenu.js +131 -147
  589. package/lib/tntd-layout/paaslayout/index.js +205 -141
  590. package/lib/tntd-layout/storage.js +58 -30
  591. package/lib/tntd-modal/index.js +98 -62
  592. package/lib/tntd-second-page/index.js +60 -33
  593. package/lib/tntd-second-page/index.js.map +1 -1
  594. package/lib/tntd-select/DropDownWrap.js +102 -78
  595. package/lib/tntd-select/index.d.ts +3 -2
  596. package/lib/tntd-select/index.d.ts.map +1 -1
  597. package/lib/tntd-select/index.js +617 -529
  598. package/lib/tooltip/index.d.ts +3 -3
  599. package/lib/tooltip/index.js +23 -22
  600. package/lib/tooltip/index.js.map +1 -1
  601. package/lib/transfer/index.d.ts +3 -3
  602. package/lib/transfer/index.js +23 -22
  603. package/lib/transfer/index.js.map +1 -1
  604. package/lib/tree/index.d.ts +3 -3
  605. package/lib/tree/index.js +23 -22
  606. package/lib/tree/index.js.map +1 -1
  607. package/lib/tree-select/index.d.ts +3 -3
  608. package/lib/tree-select/index.js +23 -22
  609. package/lib/tree-select/index.js.map +1 -1
  610. package/lib/typography/index.d.ts +3 -3
  611. package/lib/typography/index.js +23 -22
  612. package/lib/typography/index.js.map +1 -1
  613. package/lib/upload/index.d.ts +3 -3
  614. package/lib/upload/index.js +23 -22
  615. package/lib/upload/index.js.map +1 -1
  616. package/lib/utils/checkAuth.js +34 -23
  617. package/lib/utils/findMenuInfoByPath.js +41 -34
  618. package/lib/utils/index.js +117 -80
  619. package/lib/version/index.d.ts +3 -3
  620. package/lib/version/index.js +23 -22
  621. package/lib/version/index.js.map +1 -1
  622. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
+ import _debounce from "lodash/debounce";
1
2
  import classnames from 'classnames';
2
- import { debounce } from 'lodash';
3
3
  import React, { createRef } from 'react';
4
4
  import createActions from './createActions';
5
5
  import Field from './Field';
@@ -13,263 +13,343 @@ import Icon from '../tntd-icon';
13
13
  import './index.less';
14
14
  const clsPrefix = 'tnt-queryform';
15
15
  class QueryForm extends React.PureComponent {
16
- constructor(props) {
17
- super(props);
18
- Object.defineProperty(this, "onWindowResize", {
19
- enumerable: true,
20
- configurable: true,
21
- writable: true,
22
- value: debounce(() => {
23
- const { current } = this.fieldsRef;
24
- if (current) {
25
- setTimeout(() => {
26
- this.setState({
27
- showMore: this.isFieldsWidthOverflow(),
28
- });
29
- }, 25);
30
- }
31
- }, 50)
32
- });
33
- Object.defineProperty(this, "search", {
34
- enumerable: true,
35
- configurable: true,
36
- writable: true,
37
- value: (params) => {
38
- this.props.onSearch(Object.assign(Object.assign({}, this.form.getValues()), params));
39
- }
40
- });
41
- Object.defineProperty(this, "onSearch", {
42
- enumerable: true,
43
- configurable: true,
44
- writable: true,
45
- value: () => {
46
- var _a, _b;
47
- (_b = (_a = this.props).onSearch) === null || _b === void 0 ? void 0 : _b.call(_a, this.form.getValues());
48
- }
49
- });
50
- Object.defineProperty(this, "onReset", {
51
- enumerable: true,
52
- configurable: true,
53
- writable: true,
54
- value: () => {
55
- const { initialValues, onReset } = this.props;
56
- this.form.setValues(Object.assign({}, initialValues));
57
- this.updateDrawerFieldsValueCount();
58
- onReset === null || onReset === void 0 ? void 0 : onReset(initialValues);
59
- }
60
- });
61
- Object.defineProperty(this, "onToggleExpand", {
62
- enumerable: true,
63
- configurable: true,
64
- writable: true,
65
- value: () => {
66
- var _a, _b;
67
- this.setState({
68
- expanded: !this.state.expanded,
69
- });
70
- (_b = (_a = this.props).onToggleExpand) === null || _b === void 0 ? void 0 : _b.call(_a, !this.state.expanded);
71
- }
72
- });
73
- Object.defineProperty(this, "onShowDrawer", {
74
- enumerable: true,
75
- configurable: true,
76
- writable: true,
77
- value: () => {
78
- this.setState({ drawerVisible: true });
79
- }
80
- });
81
- Object.defineProperty(this, "onFieldChange", {
82
- enumerable: true,
83
- configurable: true,
84
- writable: true,
85
- value: (name, value, ...rest) => {
86
- const values = this.form.getValues();
87
- const newValues = Object.assign(Object.assign({}, values), { [name]: value });
88
- const changedInfo = { name, value, preValue: values === null || values === void 0 ? void 0 : values[name] };
89
- const { onChange } = this.props;
90
- this.form.setData('values', newValues);
91
- onChange && onChange(newValues, changedInfo, ...rest);
92
- this.updateDrawerFieldsValueCount(newValues);
93
- }
16
+ constructor(props) {
17
+ super(props);
18
+ Object.defineProperty(this, "onWindowResize", {
19
+ enumerable: true,
20
+ configurable: true,
21
+ writable: true,
22
+ value: _debounce(() => {
23
+ const {
24
+ current
25
+ } = this.fieldsRef;
26
+ if (current) {
27
+ setTimeout(() => {
28
+ this.setState({
29
+ showMore: this.isFieldsWidthOverflow()
30
+ });
31
+ }, 25);
32
+ }
33
+ }, 50)
34
+ });
35
+ Object.defineProperty(this, "search", {
36
+ enumerable: true,
37
+ configurable: true,
38
+ writable: true,
39
+ value: params => {
40
+ this.props.onSearch(Object.assign(Object.assign({}, this.form.getValues()), params));
41
+ }
42
+ });
43
+ Object.defineProperty(this, "onSearch", {
44
+ enumerable: true,
45
+ configurable: true,
46
+ writable: true,
47
+ value: () => {
48
+ var _a, _b;
49
+ (_b = (_a = this.props).onSearch) === null || _b === void 0 ? void 0 : _b.call(_a, this.form.getValues());
50
+ }
51
+ });
52
+ Object.defineProperty(this, "onReset", {
53
+ enumerable: true,
54
+ configurable: true,
55
+ writable: true,
56
+ value: () => {
57
+ const {
58
+ initialValues,
59
+ onReset
60
+ } = this.props;
61
+ this.form.setValues(Object.assign({}, initialValues));
62
+ this.updateDrawerFieldsValueCount();
63
+ onReset === null || onReset === void 0 ? void 0 : onReset(initialValues);
64
+ }
65
+ });
66
+ Object.defineProperty(this, "onToggleExpand", {
67
+ enumerable: true,
68
+ configurable: true,
69
+ writable: true,
70
+ value: () => {
71
+ var _a, _b;
72
+ this.setState({
73
+ expanded: !this.state.expanded
94
74
  });
95
- Object.defineProperty(this, "updateDrawerFieldsValueCount", {
96
- enumerable: true,
97
- configurable: true,
98
- writable: true,
99
- value: () => {
100
- const values = this.form.getValues();
101
- const { showFieldCount, children } = this.props;
102
- if (showFieldCount) {
103
- const drawerFieldsValueCount = children.reduce((acc, cur, index) => {
104
- var _a;
105
- if (index >= showFieldCount && (values === null || values === void 0 ? void 0 : values[(_a = cur === null || cur === void 0 ? void 0 : cur.props) === null || _a === void 0 ? void 0 : _a.name])) {
106
- acc++;
107
- }
108
- return acc;
109
- }, 0);
110
- if (drawerFieldsValueCount !== this.state.drawerFieldsValueCount) {
111
- this.setState({
112
- drawerFieldsValueCount,
113
- });
114
- }
115
- }
116
- }
75
+ (_b = (_a = this.props).onToggleExpand) === null || _b === void 0 ? void 0 : _b.call(_a, !this.state.expanded);
76
+ }
77
+ });
78
+ Object.defineProperty(this, "onShowDrawer", {
79
+ enumerable: true,
80
+ configurable: true,
81
+ writable: true,
82
+ value: () => {
83
+ this.setState({
84
+ drawerVisible: true
117
85
  });
118
- Object.defineProperty(this, "addResizeListener", {
119
- enumerable: true,
120
- configurable: true,
121
- writable: true,
122
- value: () => {
123
- if ('ResizeObserver' in window) {
124
- const { current } = this.fieldsRef;
125
- if (current) {
126
- const observer = new ResizeObserver(this.onWindowResize);
127
- observer.observe(current);
128
- return () => observer.disconnect();
129
- }
130
- }
131
- else {
132
- window.addEventListener('resize', this.onWindowResize);
133
- return () => window.removeEventListener('resize', this.onWindowResize);
134
- }
135
- }
86
+ }
87
+ });
88
+ Object.defineProperty(this, "onFieldChange", {
89
+ enumerable: true,
90
+ configurable: true,
91
+ writable: true,
92
+ value: (name, value, ...rest) => {
93
+ const values = this.form.getValues();
94
+ const newValues = Object.assign(Object.assign({}, values), {
95
+ [name]: value
136
96
  });
137
- const { form, initialValues, showExpand = true, renderActions, defaultExpanded } = props;
138
- this.state = {
139
- showMore: false,
140
- expanded: defaultExpanded || !showExpand || renderActions ? true : false,
141
- drawerVisible: false,
142
- drawerFieldsValueCount: 0,
97
+ const changedInfo = {
98
+ name,
99
+ value,
100
+ preValue: values === null || values === void 0 ? void 0 : values[name]
143
101
  };
144
- this.fieldsRef = createRef();
145
- this.formBoxRef = createRef();
146
- this.form = form || createActions();
147
- this.form.setData('initialValues', initialValues);
148
- this.form.setData('values', Object.assign({}, initialValues));
149
- }
150
- render() {
151
- const { children, className = '', initialValues = {}, renderActions, showSearch = true, showReset = true, showFieldCount, drawerProps = {}, size, } = this.props;
152
- const extraActions = this.props.extraActions;
153
- const { expanded, showMore, drawerVisible, drawerFieldsValueCount } = this.state;
154
- const renderFormActions = renderActions ||
155
- (() => (React.createElement(React.Fragment, null,
156
- showFieldCount && (React.createElement(Badge, { count: drawerFieldsValueCount },
157
- React.createElement(Button, { onClick: this.onShowDrawer },
158
- React.createElement(Icon, { type: "filter" }),
159
- this.getText('moreFiltering')))),
160
- showSearch && (React.createElement(Button, { type: "primary", onClick: this.onSearch }, this.getText('search'))),
161
- showReset && React.createElement(Button, { onClick: this.onReset }, this.getText('reset')),
162
- showMore && !showFieldCount && (React.createElement(Button, { className: "expand-link", type: "link", onClick: this.onToggleExpand }, this.getText(expanded ? 'collapse' : 'expand'))),
163
- React.Children.map(children, (child) => { var _a; return child && ((_a = child === null || child === void 0 ? void 0 : child.props) === null || _a === void 0 ? void 0 : _a.align) === 'right' && React.cloneElement(child); }))));
164
- return (React.createElement("div", { ref: this.formBoxRef, className: classnames(clsPrefix, { [className]: className }) },
165
- React.createElement(Form, { layout: "inline", className: classnames({ expanded: !showMore || expanded, showMore }) },
166
- React.createElement("div", { ref: this.fieldsRef }, React.Children.map(children, (child, index) => {
167
- var _a, _b;
168
- return child &&
169
- ((_a = child === null || child === void 0 ? void 0 : child.props) === null || _a === void 0 ? void 0 : _a.align) !== 'right' &&
170
- (!showFieldCount || showFieldCount > index) &&
171
- React.cloneElement(child, {
172
- form: this.form,
173
- initialValue: initialValues === null || initialValues === void 0 ? void 0 : initialValues[(_b = child.props) === null || _b === void 0 ? void 0 : _b.name],
174
- onChange: this.onFieldChange,
175
- });
176
- })),
177
- React.createElement("div", { className: `${clsPrefix}-actions` }, renderFormActions()),
178
- showFieldCount && (React.createElement(Drawer, Object.assign({ title: this.getText('moreFiltering'), visible: drawerVisible, onClose: () => this.setState({ drawerVisible: false }), width: 300, size: size, getContainer: false }, drawerProps, { className: classnames(`${clsPrefix}-drawer`, {
179
- 'large-size': size === 'large',
180
- [className]: className,
181
- }) }),
182
- React.Children.map(children, (child, index) => child &&
183
- index >= showFieldCount &&
184
- React.cloneElement(child, {
185
- form: this.form,
186
- isFieldInDrawer: true,
187
- initialValue: initialValues === null || initialValues === void 0 ? void 0 : initialValues[child.props.name],
188
- onChange: this.onFieldChange,
189
- onSearch: this.onSearch,
190
- })),
191
- React.createElement(Button, { type: "primary", onClick: this.onSearch }, this.getText('search')),
192
- React.createElement(Button, { onClick: this.onReset }, this.getText('reset'))))),
193
- extraActions && React.createElement("div", { className: `${clsPrefix}-extra` }, extraActions)));
194
- }
195
- getText(key) {
196
- return getText(key, this.props.language || getLanguage());
197
- }
198
- isFieldsWidthOverflow() {
199
- const { current } = this.fieldsRef;
200
- if (current) {
201
- return (parseFloat(window.getComputedStyle(current).width, 10) <
202
- [].reduce.call(current.children, (acc, cur) => {
203
- const { margin, width } = window.getComputedStyle(cur);
204
- const marginArray = margin.split(' ').map((str) => parseFloat(str, 10));
205
- acc += parseFloat(width, 10) + marginArray[1];
206
- return acc;
207
- }, 0));
208
- }
209
- return false;
210
- }
211
- updateFieldHeight() {
212
- var _a, _b, _c;
213
- const { formBoxRef, fieldsRef } = this;
214
- const getFieldHeight = () => {
102
+ const {
103
+ onChange
104
+ } = this.props;
105
+ this.form.setData('values', newValues);
106
+ onChange && onChange(newValues, changedInfo, ...rest);
107
+ this.updateDrawerFieldsValueCount(newValues);
108
+ }
109
+ });
110
+ Object.defineProperty(this, "updateDrawerFieldsValueCount", {
111
+ enumerable: true,
112
+ configurable: true,
113
+ writable: true,
114
+ value: () => {
115
+ const values = this.form.getValues();
116
+ const {
117
+ showFieldCount,
118
+ children
119
+ } = this.props;
120
+ if (showFieldCount) {
121
+ const drawerFieldsValueCount = children.reduce((acc, cur, index) => {
215
122
  var _a;
216
- const { current } = fieldsRef;
217
- let height = '32px';
218
- if (current && ((_a = current.children) === null || _a === void 0 ? void 0 : _a[0])) {
219
- height = window.getComputedStyle(current.children[0]).height;
123
+ if (index >= showFieldCount && (values === null || values === void 0 ? void 0 : values[(_a = cur === null || cur === void 0 ? void 0 : cur.props) === null || _a === void 0 ? void 0 : _a.name])) {
124
+ acc++;
220
125
  }
221
- return height;
222
- };
223
- const queryFormActionsDom = (_a = formBoxRef === null || formBoxRef === void 0 ? void 0 : formBoxRef.current) === null || _a === void 0 ? void 0 : _a.querySelector(`.${clsPrefix}-actions`);
224
- const queryFormExtraDom = (_b = formBoxRef === null || formBoxRef === void 0 ? void 0 : formBoxRef.current) === null || _b === void 0 ? void 0 : _b.querySelector(`.${clsPrefix}-extra`);
225
- const formItemsDomList = (_c = fieldsRef === null || fieldsRef === void 0 ? void 0 : fieldsRef.current) === null || _c === void 0 ? void 0 : _c.querySelectorAll('.ant-form-item-control');
226
- const fieldHeight = getFieldHeight();
227
- fieldsRef.current.style.height = fieldHeight;
228
- [queryFormActionsDom, queryFormExtraDom].forEach((item) => {
229
- item &&
230
- Object.assign(item.style, {
231
- height: fieldHeight,
232
- lineHeight: fieldHeight,
233
- });
234
- });
235
- [].forEach.call(formItemsDomList, (item) => {
236
- item.style.lineHeight = fieldHeight;
237
- });
238
- }
239
- componentDidMount() {
240
- const { current } = this.fieldsRef;
241
- const { showFieldCount, showExpand = true } = this.props;
242
- this.updateFieldHeight();
243
- this.form.on('search', this.search);
244
- // 未设置第一行显示数量且禁止了展开操作 或 自定义了操作区域,则不需要处理展开计算逻辑
245
- // || renderActions
246
- if (!showFieldCount && !showExpand) {
247
- return;
126
+ return acc;
127
+ }, 0);
128
+ if (drawerFieldsValueCount !== this.state.drawerFieldsValueCount) {
129
+ this.setState({
130
+ drawerFieldsValueCount
131
+ });
132
+ }
248
133
  }
249
- if (!showFieldCount) {
250
- if (current && this.isFieldsWidthOverflow()) {
251
- this.setState({
252
- showMore: true,
253
- });
254
- }
255
- this.removeResizeListener = this.addResizeListener();
256
- }
257
- else {
258
- this.updateDrawerFieldsValueCount();
259
- this.form.on('setValues', this.updateDrawerFieldsValueCount);
260
- this.form.on('setValue', this.updateDrawerFieldsValueCount);
134
+ }
135
+ });
136
+ Object.defineProperty(this, "addResizeListener", {
137
+ enumerable: true,
138
+ configurable: true,
139
+ writable: true,
140
+ value: () => {
141
+ if ('ResizeObserver' in window) {
142
+ const {
143
+ current
144
+ } = this.fieldsRef;
145
+ if (current) {
146
+ const observer = new ResizeObserver(this.onWindowResize);
147
+ observer.observe(current);
148
+ return () => observer.disconnect();
149
+ }
150
+ } else {
151
+ window.addEventListener('resize', this.onWindowResize);
152
+ return () => window.removeEventListener('resize', this.onWindowResize);
261
153
  }
154
+ }
155
+ });
156
+ const {
157
+ form,
158
+ initialValues,
159
+ showExpand = true,
160
+ renderActions,
161
+ defaultExpanded
162
+ } = props;
163
+ this.state = {
164
+ showMore: false,
165
+ expanded: defaultExpanded || !showExpand || renderActions ? true : false,
166
+ drawerVisible: false,
167
+ drawerFieldsValueCount: 0
168
+ };
169
+ this.fieldsRef = createRef();
170
+ this.formBoxRef = createRef();
171
+ this.form = form || createActions();
172
+ this.form.setData('initialValues', initialValues);
173
+ this.form.setData('values', Object.assign({}, initialValues));
174
+ }
175
+ render() {
176
+ const {
177
+ children,
178
+ className = '',
179
+ initialValues = {},
180
+ renderActions,
181
+ showSearch = true,
182
+ showReset = true,
183
+ showFieldCount,
184
+ drawerProps = {},
185
+ size
186
+ } = this.props;
187
+ const extraActions = this.props.extraActions;
188
+ const {
189
+ expanded,
190
+ showMore,
191
+ drawerVisible,
192
+ drawerFieldsValueCount
193
+ } = this.state;
194
+ const renderFormActions = renderActions || (() => React.createElement(React.Fragment, null, showFieldCount && React.createElement(Badge, {
195
+ count: drawerFieldsValueCount
196
+ }, React.createElement(Button, {
197
+ onClick: this.onShowDrawer
198
+ }, React.createElement(Icon, {
199
+ type: "filter"
200
+ }), this.getText('moreFiltering'))), showSearch && React.createElement(Button, {
201
+ type: "primary",
202
+ onClick: this.onSearch
203
+ }, this.getText('search')), showReset && React.createElement(Button, {
204
+ onClick: this.onReset
205
+ }, this.getText('reset')), showMore && !showFieldCount && React.createElement(Button, {
206
+ className: "expand-link",
207
+ type: "link",
208
+ onClick: this.onToggleExpand
209
+ }, this.getText(expanded ? 'collapse' : 'expand')), React.Children.map(children, child => {
210
+ var _a;
211
+ return child && ((_a = child === null || child === void 0 ? void 0 : child.props) === null || _a === void 0 ? void 0 : _a.align) === 'right' && React.cloneElement(child);
212
+ })));
213
+ return React.createElement("div", {
214
+ ref: this.formBoxRef,
215
+ className: classnames(clsPrefix, {
216
+ [className]: className
217
+ })
218
+ }, React.createElement(Form, {
219
+ layout: "inline",
220
+ className: classnames({
221
+ expanded: !showMore || expanded,
222
+ showMore
223
+ })
224
+ }, React.createElement("div", {
225
+ ref: this.fieldsRef
226
+ }, React.Children.map(children, (child, index) => {
227
+ var _a, _b;
228
+ return child && ((_a = child === null || child === void 0 ? void 0 : child.props) === null || _a === void 0 ? void 0 : _a.align) !== 'right' && (!showFieldCount || showFieldCount > index) && React.cloneElement(child, {
229
+ form: this.form,
230
+ initialValue: initialValues === null || initialValues === void 0 ? void 0 : initialValues[(_b = child.props) === null || _b === void 0 ? void 0 : _b.name],
231
+ onChange: this.onFieldChange
232
+ });
233
+ })), React.createElement("div", {
234
+ className: `${clsPrefix}-actions`
235
+ }, renderFormActions()), showFieldCount && React.createElement(Drawer, Object.assign({
236
+ title: this.getText('moreFiltering'),
237
+ visible: drawerVisible,
238
+ onClose: () => this.setState({
239
+ drawerVisible: false
240
+ }),
241
+ width: 300,
242
+ size: size,
243
+ getContainer: false
244
+ }, drawerProps, {
245
+ className: classnames(`${clsPrefix}-drawer`, {
246
+ 'large-size': size === 'large',
247
+ [className]: className
248
+ })
249
+ }), React.Children.map(children, (child, index) => child && index >= showFieldCount && React.cloneElement(child, {
250
+ form: this.form,
251
+ isFieldInDrawer: true,
252
+ initialValue: initialValues === null || initialValues === void 0 ? void 0 : initialValues[child.props.name],
253
+ onChange: this.onFieldChange,
254
+ onSearch: this.onSearch
255
+ })), React.createElement(Button, {
256
+ type: "primary",
257
+ onClick: this.onSearch
258
+ }, this.getText('search')), React.createElement(Button, {
259
+ onClick: this.onReset
260
+ }, this.getText('reset')))), extraActions && React.createElement("div", {
261
+ className: `${clsPrefix}-extra`
262
+ }, extraActions));
263
+ }
264
+ getText(key) {
265
+ return getText(key, this.props.language || getLanguage());
266
+ }
267
+ isFieldsWidthOverflow() {
268
+ const {
269
+ current
270
+ } = this.fieldsRef;
271
+ if (current) {
272
+ return parseFloat(window.getComputedStyle(current).width, 10) < [].reduce.call(current.children, (acc, cur) => {
273
+ const {
274
+ margin,
275
+ width
276
+ } = window.getComputedStyle(cur);
277
+ const marginArray = margin.split(' ').map(str => parseFloat(str, 10));
278
+ acc += parseFloat(width, 10) + marginArray[1];
279
+ return acc;
280
+ }, 0);
281
+ }
282
+ return false;
283
+ }
284
+ updateFieldHeight() {
285
+ var _a, _b, _c;
286
+ const {
287
+ formBoxRef,
288
+ fieldsRef
289
+ } = this;
290
+ const getFieldHeight = () => {
291
+ var _a;
292
+ const {
293
+ current
294
+ } = fieldsRef;
295
+ let height = '32px';
296
+ if (current && ((_a = current.children) === null || _a === void 0 ? void 0 : _a[0])) {
297
+ height = window.getComputedStyle(current.children[0]).height;
298
+ }
299
+ return height;
300
+ };
301
+ const queryFormActionsDom = (_a = formBoxRef === null || formBoxRef === void 0 ? void 0 : formBoxRef.current) === null || _a === void 0 ? void 0 : _a.querySelector(`.${clsPrefix}-actions`);
302
+ const queryFormExtraDom = (_b = formBoxRef === null || formBoxRef === void 0 ? void 0 : formBoxRef.current) === null || _b === void 0 ? void 0 : _b.querySelector(`.${clsPrefix}-extra`);
303
+ const formItemsDomList = (_c = fieldsRef === null || fieldsRef === void 0 ? void 0 : fieldsRef.current) === null || _c === void 0 ? void 0 : _c.querySelectorAll('.ant-form-item-control');
304
+ const fieldHeight = getFieldHeight();
305
+ fieldsRef.current.style.height = fieldHeight;
306
+ [queryFormActionsDom, queryFormExtraDom].forEach(item => {
307
+ item && Object.assign(item.style, {
308
+ height: fieldHeight,
309
+ lineHeight: fieldHeight
310
+ });
311
+ });
312
+ [].forEach.call(formItemsDomList, item => {
313
+ item.style.lineHeight = fieldHeight;
314
+ });
315
+ }
316
+ componentDidMount() {
317
+ const {
318
+ current
319
+ } = this.fieldsRef;
320
+ const {
321
+ showFieldCount,
322
+ showExpand = true
323
+ } = this.props;
324
+ this.updateFieldHeight();
325
+ this.form.on('search', this.search);
326
+ // 未设置第一行显示数量且禁止了展开操作 或 自定义了操作区域,则不需要处理展开计算逻辑
327
+ // || renderActions
328
+ if (!showFieldCount && !showExpand) {
329
+ return;
262
330
  }
263
- componentWillUnmount() {
264
- var _a;
265
- (_a = this.removeResizeListener) === null || _a === void 0 ? void 0 : _a.call(this);
266
- this.form.off('setValues', this.updateDrawerFieldsValueCount);
267
- this.form.off('setValue', this.updateDrawerFieldsValueCount);
268
- this.form.off('search', this.search);
331
+ if (!showFieldCount) {
332
+ if (current && this.isFieldsWidthOverflow()) {
333
+ this.setState({
334
+ showMore: true
335
+ });
336
+ }
337
+ this.removeResizeListener = this.addResizeListener();
338
+ } else {
339
+ this.updateDrawerFieldsValueCount();
340
+ this.form.on('setValues', this.updateDrawerFieldsValueCount);
341
+ this.form.on('setValue', this.updateDrawerFieldsValueCount);
269
342
  }
343
+ }
344
+ componentWillUnmount() {
345
+ var _a;
346
+ (_a = this.removeResizeListener) === null || _a === void 0 ? void 0 : _a.call(this);
347
+ this.form.off('setValues', this.updateDrawerFieldsValueCount);
348
+ this.form.off('setValue', this.updateDrawerFieldsValueCount);
349
+ this.form.off('search', this.search);
350
+ }
270
351
  }
271
352
  QueryForm.Field = Field;
272
353
  QueryForm.useForm = useForm;
273
354
  QueryForm.createForm = createActions;
274
- export default QueryForm;
275
- //# sourceMappingURL=index.js.map
355
+ export default QueryForm;
@@ -1,7 +1,6 @@
1
1
  import { useRef } from 'react';
2
2
  import createActions from './createActions';
3
3
  export default function useForm() {
4
- const form = useRef(createActions());
5
- return [form.current];
6
- }
7
- //# sourceMappingURL=useForm.js.map
4
+ const form = useRef(createActions());
5
+ return [form.current];
6
+ }