amis-ui 3.4.2 → 3.4.3

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 (626) hide show
  1. package/esm/components/404.js +1 -1
  2. package/esm/components/Alert.d.ts +1 -0
  3. package/esm/components/Alert.js +4 -2
  4. package/esm/components/Alert2.js +1 -1
  5. package/esm/components/AnchorNav.js +1 -1
  6. package/esm/components/ArrayInput.js +1 -1
  7. package/esm/components/AsideNav.js +1 -1
  8. package/esm/components/AssociatedSelection.js +1 -1
  9. package/esm/components/Avatar.js +1 -1
  10. package/esm/components/Badge.js +1 -1
  11. package/esm/components/BaiduMapPicker.js +1 -1
  12. package/esm/components/BarCode.js +1 -1
  13. package/esm/components/Breadcrumb.js +1 -1
  14. package/esm/components/Button.js +1 -1
  15. package/esm/components/CalendarMobile.js +1 -1
  16. package/esm/components/Card.js +1 -1
  17. package/esm/components/Cascader.js +1 -1
  18. package/esm/components/ChainedDropdownSelection.js +1 -1
  19. package/esm/components/ChainedSelection.js +5 -3
  20. package/esm/components/Checkbox.js +1 -1
  21. package/esm/components/CityArea.js +1 -1
  22. package/esm/components/CityDB.js +1 -1
  23. package/esm/components/CodeMirror.js +1 -1
  24. package/esm/components/Collapse.js +2 -2
  25. package/esm/components/CollapseGroup.js +1 -1
  26. package/esm/components/ColorPicker.js +1 -1
  27. package/esm/components/Combo.js +1 -1
  28. package/esm/components/ConfirmBox.js +1 -1
  29. package/esm/components/ContextMenu.d.ts +1 -0
  30. package/esm/components/ContextMenu.js +4 -2
  31. package/esm/components/DatePicker.js +1 -1
  32. package/esm/components/DateRangePicker.js +1 -1
  33. package/esm/components/DndContainer.js +1 -1
  34. package/esm/components/Drawer.js +1 -1
  35. package/esm/components/DropDownSelection.js +3 -2
  36. package/esm/components/Editor.js +1 -1
  37. package/esm/components/Form.js +1 -1
  38. package/esm/components/FormField.js +1 -1
  39. package/esm/components/GaodeMapPicker.js +1 -1
  40. package/esm/components/GridNav.js +1 -1
  41. package/esm/components/GroupedSelection.js +7 -4
  42. package/esm/components/Html.js +1 -1
  43. package/esm/components/ImageGallery.js +1 -1
  44. package/esm/components/Input.js +1 -1
  45. package/esm/components/InputBox.js +1 -1
  46. package/esm/components/InputBoxWithSuggestion.js +3 -2
  47. package/esm/components/InputTable.js +1 -1
  48. package/esm/components/Layout.js +1 -1
  49. package/esm/components/Link.js +1 -1
  50. package/esm/components/ListGroup.d.ts +10 -10
  51. package/esm/components/ListGroup.js +1 -1
  52. package/esm/components/ListMenu.js +1 -1
  53. package/esm/components/LocationPicker.js +1 -1
  54. package/esm/components/Markdown.js +1 -1
  55. package/esm/components/Modal.js +6 -11
  56. package/esm/components/ModalManager.js +1 -1
  57. package/esm/components/MultilineText.js +1 -1
  58. package/esm/components/NumberInput.js +1 -1
  59. package/esm/components/Pagination.js +1 -1
  60. package/esm/components/Picker.js +1 -1
  61. package/esm/components/PickerColumn.js +1 -1
  62. package/esm/components/PickerContainer.js +1 -1
  63. package/esm/components/PopOverContainer.js +1 -1
  64. package/esm/components/PopUp.js +1 -1
  65. package/esm/components/Progress.js +1 -1
  66. package/esm/components/PullRefresh.js +1 -1
  67. package/esm/components/Radios.js +1 -1
  68. package/esm/components/Range.js +1 -1
  69. package/esm/components/Rating.js +1 -1
  70. package/esm/components/ResultBox.js +1 -1
  71. package/esm/components/ResultList.d.ts +2 -1
  72. package/esm/components/ResultList.js +12 -3
  73. package/esm/components/ResultTableList.js +1 -1
  74. package/esm/components/ResultTreeList.js +1 -1
  75. package/esm/components/RichText.js +1 -1
  76. package/esm/components/SearchBox.js +1 -1
  77. package/esm/components/Select.js +1 -1
  78. package/esm/components/SelectMobile.js +7 -4
  79. package/esm/components/Selection.d.ts +2 -1
  80. package/esm/components/Selection.js +11 -4
  81. package/esm/components/SparkLine.js +1 -1
  82. package/esm/components/Spinner.js +1 -1
  83. package/esm/components/Steps.js +8 -4
  84. package/esm/components/Switch.js +1 -1
  85. package/esm/components/TableSelection.js +1 -1
  86. package/esm/components/Tabs.js +1 -1
  87. package/esm/components/TabsTransfer.js +1 -1
  88. package/esm/components/TabsTransferPicker.js +1 -1
  89. package/esm/components/Tag.js +1 -1
  90. package/esm/components/Textarea.js +1 -1
  91. package/esm/components/Timeline.js +1 -1
  92. package/esm/components/TimelineItem.js +1 -1
  93. package/esm/components/Tinymce.js +1 -1
  94. package/esm/components/TitleBar.js +1 -1
  95. package/esm/components/Toast.js +1 -1
  96. package/esm/components/Tooltip.js +1 -1
  97. package/esm/components/TooltipWrapper.js +1 -1
  98. package/esm/components/Transfer.js +5 -5
  99. package/esm/components/TransferDropDown.js +1 -1
  100. package/esm/components/TransferPicker.js +1 -1
  101. package/esm/components/TransferSearch.js +1 -1
  102. package/esm/components/Tree.js +3 -2
  103. package/esm/components/TreeSelection.js +3 -2
  104. package/esm/components/UserSelect.js +1 -1
  105. package/esm/components/UserTabSelect.js +1 -1
  106. package/esm/components/WithRemoteConfig.js +1 -1
  107. package/esm/components/WithStore.js +1 -1
  108. package/esm/components/calendar/Calendar.js +1 -1
  109. package/esm/components/calendar/CalendarContainer.js +1 -1
  110. package/esm/components/calendar/DaysView.js +1 -1
  111. package/esm/components/calendar/MonthsView.js +1 -1
  112. package/esm/components/calendar/QuartersView.js +1 -1
  113. package/esm/components/calendar/TimeView.js +1 -1
  114. package/esm/components/calendar/YearsView.js +1 -1
  115. package/esm/components/condition-builder/Expression.js +1 -1
  116. package/esm/components/condition-builder/Field.js +1 -1
  117. package/esm/components/condition-builder/Func.js +1 -1
  118. package/esm/components/condition-builder/Group.js +1 -1
  119. package/esm/components/condition-builder/GroupOrItem.js +1 -1
  120. package/esm/components/condition-builder/InputSwitch.js +1 -1
  121. package/esm/components/condition-builder/Item.js +1 -1
  122. package/esm/components/condition-builder/Value.js +1 -1
  123. package/esm/components/condition-builder/config.js +1 -1
  124. package/esm/components/condition-builder/index.js +1 -1
  125. package/esm/components/formula/Editor.js +1 -1
  126. package/esm/components/formula/FuncList.js +1 -1
  127. package/esm/components/formula/Input.js +1 -1
  128. package/esm/components/formula/Picker.js +1 -1
  129. package/esm/components/formula/VariableList.js +7 -6
  130. package/esm/components/formula/plugin.js +1 -1
  131. package/esm/components/icons.js +17 -17
  132. package/esm/components/json-schema/Array.js +1 -1
  133. package/esm/components/json-schema/Item.js +1 -1
  134. package/esm/components/json-schema/Object.js +1 -1
  135. package/esm/components/json-schema/index.js +1 -1
  136. package/esm/components/menu/MenuContext.js +1 -1
  137. package/esm/components/menu/MenuItem.js +1 -1
  138. package/esm/components/menu/SubMenu.js +1 -1
  139. package/esm/components/menu/index.js +1 -1
  140. package/esm/components/schema-editor/Array.js +1 -1
  141. package/esm/components/schema-editor/Common.js +1 -1
  142. package/esm/components/schema-editor/Item.js +1 -1
  143. package/esm/components/schema-editor/Object.js +1 -1
  144. package/esm/components/schema-editor/SchemaVariableList.js +1 -1
  145. package/esm/components/schema-editor/SchemaVariableListPicker.js +1 -1
  146. package/esm/components/schema-editor/index.js +1 -1
  147. package/esm/components/table/Cell.js +3 -3
  148. package/esm/components/table/ColGroup.d.ts +19 -0
  149. package/esm/components/table/ColGroup.js +52 -0
  150. package/esm/components/table/HeadCellDropDown.js +1 -1
  151. package/esm/components/table/HeadCellFilter.js +1 -1
  152. package/esm/components/table/HeadCellSelect.js +1 -1
  153. package/esm/components/table/HeadCellSort.js +1 -1
  154. package/esm/components/table/ItemActionsWrapper.js +1 -1
  155. package/esm/components/table/index.d.ts +56 -3
  156. package/esm/components/table/index.js +149 -89
  157. package/esm/components/virtual-list/AutoSizer.js +1 -1
  158. package/esm/components/virtual-list/SizeAndPositionManager.js +1 -1
  159. package/esm/components/virtual-list/constants.js +1 -1
  160. package/esm/components/virtual-list/index.js +1 -1
  161. package/esm/hooks/use-set-state.js +1 -1
  162. package/esm/hooks/use-sub-form.js +1 -1
  163. package/esm/hooks/use-touch.js +1 -1
  164. package/esm/hooks/use-update-effect.js +1 -1
  165. package/esm/hooks/use-validation-resolver.js +1 -1
  166. package/esm/icons/alert-danger.svg.js +1 -1
  167. package/esm/icons/alert-info.svg.js +1 -1
  168. package/esm/icons/alert-success.svg.js +1 -1
  169. package/esm/icons/alert-warning.svg.js +1 -1
  170. package/esm/icons/back.svg.js +1 -1
  171. package/esm/icons/calendar.svg.js +1 -1
  172. package/esm/icons/caret.svg.js +1 -1
  173. package/esm/icons/check.svg.js +1 -1
  174. package/esm/icons/clock.svg.js +1 -1
  175. package/esm/icons/close-small.svg.js +1 -1
  176. package/esm/icons/close.svg.js +1 -1
  177. package/esm/icons/cloud-upload.svg.js +1 -1
  178. package/esm/icons/column-filter.svg.js +1 -1
  179. package/esm/icons/columns.svg.js +1 -1
  180. package/esm/icons/compress-alt.svg.js +1 -1
  181. package/esm/icons/copy.svg.js +1 -1
  182. package/esm/icons/date.svg.js +1 -1
  183. package/esm/icons/department.svg.js +1 -1
  184. package/esm/icons/desk-empty.svg.js +1 -1
  185. package/esm/icons/dot.svg.js +1 -1
  186. package/esm/icons/down-arrow-bold.svg.js +1 -1
  187. package/esm/icons/down.svg.js +1 -1
  188. package/esm/icons/download.svg.js +1 -1
  189. package/esm/icons/drag-bar.svg.js +1 -1
  190. package/esm/icons/drag.svg.js +1 -1
  191. package/esm/icons/edit.svg.js +1 -1
  192. package/esm/icons/ellipsis-v.svg.js +1 -1
  193. package/esm/icons/enter.svg.js +1 -1
  194. package/esm/icons/exchange.svg.js +1 -1
  195. package/esm/icons/expand-alt.svg.js +1 -1
  196. package/esm/icons/fail.svg.js +1 -1
  197. package/esm/icons/file.svg.js +1 -1
  198. package/esm/icons/filter.svg.js +1 -1
  199. package/esm/icons/folder.svg.js +1 -1
  200. package/esm/icons/function.svg.js +1 -1
  201. package/esm/icons/home.svg.js +1 -1
  202. package/esm/icons/if.svg.js +1 -1
  203. package/esm/icons/image.svg.js +1 -1
  204. package/esm/icons/info-circle.svg.js +1 -1
  205. package/esm/icons/info.svg.js +1 -1
  206. package/esm/icons/input-clear.svg.js +1 -1
  207. package/esm/icons/invisible.svg.js +1 -1
  208. package/esm/icons/left-arrow.svg.js +1 -1
  209. package/esm/icons/loading-outline.svg.js +1 -1
  210. package/esm/icons/location.svg.js +1 -1
  211. package/esm/icons/menu.svg.js +1 -1
  212. package/esm/icons/minus.svg.js +1 -1
  213. package/esm/icons/move.svg.js +1 -1
  214. package/esm/icons/mute.svg.js +1 -1
  215. package/esm/icons/new-edit.svg.js +1 -1
  216. package/esm/icons/pause.svg.js +1 -1
  217. package/esm/icons/pencil.svg.js +1 -1
  218. package/esm/icons/play.svg.js +1 -1
  219. package/esm/icons/plus-cicle.svg.js +1 -1
  220. package/esm/icons/plus-fine.svg.js +1 -1
  221. package/esm/icons/plus.svg.js +1 -1
  222. package/esm/icons/post.svg.js +1 -1
  223. package/esm/icons/question-mark.svg.js +1 -1
  224. package/esm/icons/question.svg.js +1 -1
  225. package/esm/icons/redo.svg.js +1 -1
  226. package/esm/icons/refresh.svg.js +1 -1
  227. package/esm/icons/reload.svg.js +1 -1
  228. package/esm/icons/remove.svg.js +1 -1
  229. package/esm/icons/retry.svg.js +1 -1
  230. package/esm/icons/right-arrow-bold.svg.js +1 -1
  231. package/esm/icons/right-arrow.svg.js +1 -1
  232. package/esm/icons/right-double-arrow.svg.js +1 -1
  233. package/esm/icons/role.svg.js +1 -1
  234. package/esm/icons/rotate-left.svg.js +1 -1
  235. package/esm/icons/rotate-right.svg.js +1 -1
  236. package/esm/icons/scale-origin.svg.js +1 -1
  237. package/esm/icons/schedule.svg.js +1 -1
  238. package/esm/icons/search.svg.js +1 -1
  239. package/esm/icons/setting.svg.js +1 -1
  240. package/esm/icons/slider-handle-icon.svg.js +1 -1
  241. package/esm/icons/sort-asc.svg.js +1 -1
  242. package/esm/icons/sort-default.svg.js +1 -1
  243. package/esm/icons/sort-desc.svg.js +1 -1
  244. package/esm/icons/star.svg.js +1 -1
  245. package/esm/icons/status-close.svg.js +1 -1
  246. package/esm/icons/steps-finsh.svg.js +1 -1
  247. package/esm/icons/success.svg.js +1 -1
  248. package/esm/icons/transparent.svg.js +1 -1
  249. package/esm/icons/trash.svg.js +1 -1
  250. package/esm/icons/tree-down.svg.js +1 -1
  251. package/esm/icons/undo.svg.js +1 -1
  252. package/esm/icons/upload.svg.js +1 -1
  253. package/esm/icons/user-remove.svg.js +1 -1
  254. package/esm/icons/view.svg.js +1 -1
  255. package/esm/icons/volume.svg.js +1 -1
  256. package/esm/icons/warning-mark.svg.js +1 -1
  257. package/esm/icons/warning.svg.js +1 -1
  258. package/esm/icons/window-restore.svg.js +1 -1
  259. package/esm/icons/zoom-in.svg.js +1 -1
  260. package/esm/icons/zoom-out.svg.js +1 -1
  261. package/esm/index.js +1 -1
  262. package/esm/locale/de-DE.js +1 -1
  263. package/esm/locale/en-US.js +1 -1
  264. package/esm/locale/zh-CN.js +1 -1
  265. package/esm/themes/ang.js +1 -1
  266. package/esm/themes/antd.js +1 -1
  267. package/esm/themes/cxd.js +1 -1
  268. package/esm/themes/dark.js +1 -1
  269. package/lib/components/404.js +1 -1
  270. package/lib/components/Alert.d.ts +41 -40
  271. package/lib/components/Alert.js +4 -2
  272. package/lib/components/Alert2.d.ts +10 -10
  273. package/lib/components/Alert2.js +1 -1
  274. package/lib/components/AnchorNav.d.ts +20 -20
  275. package/lib/components/AnchorNav.js +1 -1
  276. package/lib/components/ArrayInput.d.ts +40 -40
  277. package/lib/components/ArrayInput.js +1 -1
  278. package/lib/components/AsideNav.js +1 -1
  279. package/lib/components/AssociatedSelection.d.ts +80 -80
  280. package/lib/components/AssociatedSelection.js +1 -1
  281. package/lib/components/Avatar.d.ts +70 -70
  282. package/lib/components/Avatar.js +1 -1
  283. package/lib/components/Badge.d.ts +1 -1
  284. package/lib/components/Badge.js +1 -1
  285. package/lib/components/BaiduMapPicker.js +1 -1
  286. package/lib/components/BarCode.js +1 -1
  287. package/lib/components/Breadcrumb.js +1 -1
  288. package/lib/components/Button.d.ts +30 -30
  289. package/lib/components/Button.js +1 -1
  290. package/lib/components/CalendarMobile.d.ts +40 -40
  291. package/lib/components/CalendarMobile.js +1 -1
  292. package/lib/components/Card.d.ts +100 -100
  293. package/lib/components/Card.js +1 -1
  294. package/lib/components/Cascader.js +1 -1
  295. package/lib/components/ChainedDropdownSelection.d.ts +80 -80
  296. package/lib/components/ChainedDropdownSelection.js +1 -1
  297. package/lib/components/ChainedSelection.d.ts +80 -80
  298. package/lib/components/ChainedSelection.js +5 -3
  299. package/lib/components/Checkbox.d.ts +10 -10
  300. package/lib/components/Checkbox.js +1 -1
  301. package/lib/components/CityArea.js +1 -1
  302. package/lib/components/CityDB.js +1 -1
  303. package/lib/components/CodeMirror.js +1 -1
  304. package/lib/components/Collapse.d.ts +120 -120
  305. package/lib/components/Collapse.js +2 -2
  306. package/lib/components/CollapseGroup.d.ts +20 -20
  307. package/lib/components/CollapseGroup.js +1 -1
  308. package/lib/components/ColorPicker.d.ts +80 -80
  309. package/lib/components/ColorPicker.js +1 -1
  310. package/lib/components/Combo.js +1 -1
  311. package/lib/components/ConfirmBox.d.ts +80 -80
  312. package/lib/components/ConfirmBox.js +1 -1
  313. package/lib/components/ContextMenu.d.ts +1 -0
  314. package/lib/components/ContextMenu.js +4 -2
  315. package/lib/components/DatePicker.d.ts +81 -81
  316. package/lib/components/DatePicker.js +1 -1
  317. package/lib/components/DateRangePicker.d.ts +120 -120
  318. package/lib/components/DateRangePicker.js +1 -1
  319. package/lib/components/DndContainer.js +1 -1
  320. package/lib/components/Drawer.d.ts +30 -30
  321. package/lib/components/Drawer.js +1 -1
  322. package/lib/components/DropDownSelection.d.ts +80 -80
  323. package/lib/components/DropDownSelection.js +3 -2
  324. package/lib/components/Editor.d.ts +40 -40
  325. package/lib/components/Editor.js +1 -1
  326. package/lib/components/Form.js +1 -1
  327. package/lib/components/FormField.js +1 -1
  328. package/lib/components/GaodeMapPicker.js +1 -1
  329. package/lib/components/GridNav.js +1 -1
  330. package/lib/components/GroupedSelection.d.ts +80 -80
  331. package/lib/components/GroupedSelection.js +7 -4
  332. package/lib/components/Html.js +1 -1
  333. package/lib/components/ImageGallery.d.ts +40 -40
  334. package/lib/components/ImageGallery.js +1 -1
  335. package/lib/components/Input.js +1 -1
  336. package/lib/components/InputBox.d.ts +10 -10
  337. package/lib/components/InputBox.js +1 -1
  338. package/lib/components/InputBoxWithSuggestion.js +3 -2
  339. package/lib/components/InputTable.js +1 -1
  340. package/lib/components/Layout.d.ts +10 -10
  341. package/lib/components/Layout.js +1 -1
  342. package/lib/components/Link.js +1 -1
  343. package/lib/components/ListGroup.d.ts +10 -10
  344. package/lib/components/ListGroup.js +1 -1
  345. package/lib/components/ListMenu.d.ts +80 -80
  346. package/lib/components/ListMenu.js +1 -1
  347. package/lib/components/LocationPicker.d.ts +40 -40
  348. package/lib/components/LocationPicker.js +1 -1
  349. package/lib/components/Markdown.js +1 -1
  350. package/lib/components/Modal.d.ts +80 -80
  351. package/lib/components/Modal.js +6 -11
  352. package/lib/components/ModalManager.js +1 -1
  353. package/lib/components/MonthRangePicker.d.ts +120 -120
  354. package/lib/components/MultilineText.d.ts +40 -40
  355. package/lib/components/MultilineText.js +1 -1
  356. package/lib/components/NumberInput.d.ts +20 -20
  357. package/lib/components/NumberInput.js +1 -1
  358. package/lib/components/Pagination.d.ts +80 -80
  359. package/lib/components/Pagination.js +1 -1
  360. package/lib/components/Picker.js +1 -1
  361. package/lib/components/PickerColumn.js +1 -1
  362. package/lib/components/PickerContainer.js +1 -1
  363. package/lib/components/PopOverContainer.js +1 -1
  364. package/lib/components/PopUp.d.ts +120 -120
  365. package/lib/components/PopUp.js +1 -1
  366. package/lib/components/Progress.d.ts +50 -50
  367. package/lib/components/Progress.js +1 -1
  368. package/lib/components/PullRefresh.js +1 -1
  369. package/lib/components/Radios.d.ts +10 -10
  370. package/lib/components/Radios.js +1 -1
  371. package/lib/components/Range.js +1 -1
  372. package/lib/components/Rating.d.ts +10 -10
  373. package/lib/components/Rating.js +1 -1
  374. package/lib/components/ResultBox.d.ts +80 -80
  375. package/lib/components/ResultBox.js +1 -1
  376. package/lib/components/ResultList.d.ts +42 -41
  377. package/lib/components/ResultList.js +12 -3
  378. package/lib/components/ResultTableList.d.ts +80 -80
  379. package/lib/components/ResultTableList.js +1 -1
  380. package/lib/components/ResultTreeList.d.ts +40 -40
  381. package/lib/components/ResultTreeList.js +1 -1
  382. package/lib/components/RichText.js +1 -1
  383. package/lib/components/SearchBox.d.ts +80 -80
  384. package/lib/components/SearchBox.js +1 -1
  385. package/lib/components/Select.d.ts +1160 -1160
  386. package/lib/components/Select.js +1 -1
  387. package/lib/components/SelectMobile.js +7 -4
  388. package/lib/components/Selection.d.ts +82 -81
  389. package/lib/components/Selection.js +11 -4
  390. package/lib/components/SparkLine.d.ts +40 -40
  391. package/lib/components/SparkLine.js +1 -1
  392. package/lib/components/Spinner.d.ts +50 -50
  393. package/lib/components/Spinner.js +1 -1
  394. package/lib/components/Steps.js +8 -4
  395. package/lib/components/Switch.d.ts +10 -10
  396. package/lib/components/Switch.js +1 -1
  397. package/lib/components/TableSelection.d.ts +80 -80
  398. package/lib/components/TableSelection.js +1 -1
  399. package/lib/components/Tabs.d.ts +40 -40
  400. package/lib/components/Tabs.js +1 -1
  401. package/lib/components/TabsTransfer.d.ts +40 -40
  402. package/lib/components/TabsTransfer.js +1 -1
  403. package/lib/components/TabsTransferPicker.js +1 -1
  404. package/lib/components/Tag.d.ts +60 -60
  405. package/lib/components/Tag.js +1 -1
  406. package/lib/components/Textarea.d.ts +40 -40
  407. package/lib/components/Textarea.js +1 -1
  408. package/lib/components/Timeline.js +1 -1
  409. package/lib/components/TimelineItem.js +1 -1
  410. package/lib/components/Tinymce.js +1 -1
  411. package/lib/components/TitleBar.d.ts +10 -10
  412. package/lib/components/TitleBar.js +1 -1
  413. package/lib/components/Toast.d.ts +80 -80
  414. package/lib/components/Toast.js +1 -1
  415. package/lib/components/Tooltip.js +1 -1
  416. package/lib/components/TooltipWrapper.d.ts +30 -30
  417. package/lib/components/TooltipWrapper.js +1 -1
  418. package/lib/components/Transfer.d.ts +169 -169
  419. package/lib/components/Transfer.js +5 -5
  420. package/lib/components/TransferDropDown.d.ts +160 -160
  421. package/lib/components/TransferDropDown.js +1 -1
  422. package/lib/components/TransferPicker.js +1 -1
  423. package/lib/components/TransferSearch.js +1 -1
  424. package/lib/components/Tree.d.ts +160 -160
  425. package/lib/components/Tree.js +3 -2
  426. package/lib/components/TreeSelection.d.ts +80 -80
  427. package/lib/components/TreeSelection.js +3 -2
  428. package/lib/components/UserSelect.d.ts +40 -40
  429. package/lib/components/UserSelect.js +1 -1
  430. package/lib/components/UserTabSelect.d.ts +40 -40
  431. package/lib/components/UserTabSelect.js +1 -1
  432. package/lib/components/WithRemoteConfig.js +1 -1
  433. package/lib/components/WithStore.js +1 -1
  434. package/lib/components/calendar/Calendar.js +1 -1
  435. package/lib/components/calendar/CalendarContainer.js +1 -1
  436. package/lib/components/calendar/DaysView.js +1 -1
  437. package/lib/components/calendar/MonthsView.js +1 -1
  438. package/lib/components/calendar/QuartersView.js +1 -1
  439. package/lib/components/calendar/TimeView.js +1 -1
  440. package/lib/components/calendar/YearsView.js +1 -1
  441. package/lib/components/condition-builder/Expression.js +1 -1
  442. package/lib/components/condition-builder/Field.js +1 -1
  443. package/lib/components/condition-builder/Func.js +1 -1
  444. package/lib/components/condition-builder/Group.js +1 -1
  445. package/lib/components/condition-builder/GroupOrItem.js +1 -1
  446. package/lib/components/condition-builder/InputSwitch.js +1 -1
  447. package/lib/components/condition-builder/Item.js +1 -1
  448. package/lib/components/condition-builder/Value.js +1 -1
  449. package/lib/components/condition-builder/config.js +1 -1
  450. package/lib/components/condition-builder/index.js +1 -1
  451. package/lib/components/formula/Editor.d.ts +40 -40
  452. package/lib/components/formula/Editor.js +1 -1
  453. package/lib/components/formula/FuncList.js +1 -1
  454. package/lib/components/formula/Input.js +1 -1
  455. package/lib/components/formula/Picker.d.ts +40 -40
  456. package/lib/components/formula/Picker.js +1 -1
  457. package/lib/components/formula/VariableList.js +7 -6
  458. package/lib/components/formula/plugin.js +1 -1
  459. package/lib/components/icons.js +17 -17
  460. package/lib/components/json-schema/Array.js +1 -1
  461. package/lib/components/json-schema/Item.js +1 -1
  462. package/lib/components/json-schema/Object.js +1 -1
  463. package/lib/components/json-schema/index.js +1 -1
  464. package/lib/components/menu/MenuContext.js +1 -1
  465. package/lib/components/menu/MenuItem.js +1 -1
  466. package/lib/components/menu/SubMenu.js +1 -1
  467. package/lib/components/menu/index.d.ts +60 -60
  468. package/lib/components/menu/index.js +1 -1
  469. package/lib/components/schema-editor/Array.js +1 -1
  470. package/lib/components/schema-editor/Common.js +1 -1
  471. package/lib/components/schema-editor/Item.js +1 -1
  472. package/lib/components/schema-editor/Object.js +1 -1
  473. package/lib/components/schema-editor/SchemaVariableList.js +1 -1
  474. package/lib/components/schema-editor/SchemaVariableListPicker.js +1 -1
  475. package/lib/components/schema-editor/index.d.ts +40 -40
  476. package/lib/components/schema-editor/index.js +1 -1
  477. package/lib/components/table/Cell.d.ts +40 -40
  478. package/lib/components/table/Cell.js +3 -3
  479. package/lib/components/table/ColGroup.d.ts +19 -0
  480. package/lib/components/table/ColGroup.js +64 -0
  481. package/lib/components/table/HeadCellDropDown.js +1 -1
  482. package/lib/components/table/HeadCellFilter.d.ts +40 -40
  483. package/lib/components/table/HeadCellFilter.js +1 -1
  484. package/lib/components/table/HeadCellSelect.d.ts +40 -40
  485. package/lib/components/table/HeadCellSelect.js +1 -1
  486. package/lib/components/table/HeadCellSort.js +1 -1
  487. package/lib/components/table/ItemActionsWrapper.js +1 -1
  488. package/lib/components/table/index.d.ts +136 -83
  489. package/lib/components/table/index.js +149 -88
  490. package/lib/components/virtual-list/AutoSizer.js +1 -1
  491. package/lib/components/virtual-list/SizeAndPositionManager.js +1 -1
  492. package/lib/components/virtual-list/constants.js +1 -1
  493. package/lib/components/virtual-list/index.js +1 -1
  494. package/lib/hooks/use-set-state.js +1 -1
  495. package/lib/hooks/use-sub-form.js +1 -1
  496. package/lib/hooks/use-touch.js +1 -1
  497. package/lib/hooks/use-update-effect.js +1 -1
  498. package/lib/hooks/use-validation-resolver.js +1 -1
  499. package/lib/icons/alert-danger.svg.js +1 -1
  500. package/lib/icons/alert-info.svg.js +1 -1
  501. package/lib/icons/alert-success.svg.js +1 -1
  502. package/lib/icons/alert-warning.svg.js +1 -1
  503. package/lib/icons/back.svg.js +1 -1
  504. package/lib/icons/calendar.svg.js +1 -1
  505. package/lib/icons/caret.svg.js +1 -1
  506. package/lib/icons/check.svg.js +1 -1
  507. package/lib/icons/clock.svg.js +1 -1
  508. package/lib/icons/close-small.svg.js +1 -1
  509. package/lib/icons/close.svg.js +1 -1
  510. package/lib/icons/cloud-upload.svg.js +1 -1
  511. package/lib/icons/column-filter.svg.js +1 -1
  512. package/lib/icons/columns.svg.js +1 -1
  513. package/lib/icons/compress-alt.svg.js +1 -1
  514. package/lib/icons/copy.svg.js +1 -1
  515. package/lib/icons/date.svg.js +1 -1
  516. package/lib/icons/department.svg.js +1 -1
  517. package/lib/icons/desk-empty.svg.js +1 -1
  518. package/lib/icons/dot.svg.js +1 -1
  519. package/lib/icons/down-arrow-bold.svg.js +1 -1
  520. package/lib/icons/down.svg.js +1 -1
  521. package/lib/icons/download.svg.js +1 -1
  522. package/lib/icons/drag-bar.svg.js +1 -1
  523. package/lib/icons/drag.svg.js +1 -1
  524. package/lib/icons/edit.svg.js +1 -1
  525. package/lib/icons/ellipsis-v.svg.js +1 -1
  526. package/lib/icons/enter.svg.js +1 -1
  527. package/lib/icons/exchange.svg.js +1 -1
  528. package/lib/icons/expand-alt.svg.js +1 -1
  529. package/lib/icons/fail.svg.js +1 -1
  530. package/lib/icons/file.svg.js +1 -1
  531. package/lib/icons/filter.svg.js +1 -1
  532. package/lib/icons/folder.svg.js +1 -1
  533. package/lib/icons/function.svg.js +1 -1
  534. package/lib/icons/home.svg.js +1 -1
  535. package/lib/icons/if.svg.js +1 -1
  536. package/lib/icons/image.svg.js +1 -1
  537. package/lib/icons/info-circle.svg.js +1 -1
  538. package/lib/icons/info.svg.js +1 -1
  539. package/lib/icons/input-clear.svg.js +1 -1
  540. package/lib/icons/invisible.svg.js +1 -1
  541. package/lib/icons/left-arrow.svg.js +1 -1
  542. package/lib/icons/loading-outline.svg.js +1 -1
  543. package/lib/icons/location.svg.js +1 -1
  544. package/lib/icons/menu.svg.js +1 -1
  545. package/lib/icons/minus.svg.js +1 -1
  546. package/lib/icons/move.svg.js +1 -1
  547. package/lib/icons/mute.svg.js +1 -1
  548. package/lib/icons/new-edit.svg.js +1 -1
  549. package/lib/icons/pause.svg.js +1 -1
  550. package/lib/icons/pencil.svg.js +1 -1
  551. package/lib/icons/play.svg.js +1 -1
  552. package/lib/icons/plus-cicle.svg.js +1 -1
  553. package/lib/icons/plus-fine.svg.js +1 -1
  554. package/lib/icons/plus.svg.js +1 -1
  555. package/lib/icons/post.svg.js +1 -1
  556. package/lib/icons/question-mark.svg.js +1 -1
  557. package/lib/icons/question.svg.js +1 -1
  558. package/lib/icons/redo.svg.js +1 -1
  559. package/lib/icons/refresh.svg.js +1 -1
  560. package/lib/icons/reload.svg.js +1 -1
  561. package/lib/icons/remove.svg.js +1 -1
  562. package/lib/icons/retry.svg.js +1 -1
  563. package/lib/icons/right-arrow-bold.svg.js +1 -1
  564. package/lib/icons/right-arrow.svg.js +1 -1
  565. package/lib/icons/right-double-arrow.svg.js +1 -1
  566. package/lib/icons/role.svg.js +1 -1
  567. package/lib/icons/rotate-left.svg.js +1 -1
  568. package/lib/icons/rotate-right.svg.js +1 -1
  569. package/lib/icons/scale-origin.svg.js +1 -1
  570. package/lib/icons/schedule.svg.js +1 -1
  571. package/lib/icons/search.svg.js +1 -1
  572. package/lib/icons/setting.svg.js +1 -1
  573. package/lib/icons/slider-handle-icon.svg.js +1 -1
  574. package/lib/icons/sort-asc.svg.js +1 -1
  575. package/lib/icons/sort-default.svg.js +1 -1
  576. package/lib/icons/sort-desc.svg.js +1 -1
  577. package/lib/icons/star.svg.js +1 -1
  578. package/lib/icons/status-close.svg.js +1 -1
  579. package/lib/icons/steps-finsh.svg.js +1 -1
  580. package/lib/icons/success.svg.js +1 -1
  581. package/lib/icons/transparent.svg.js +1 -1
  582. package/lib/icons/trash.svg.js +1 -1
  583. package/lib/icons/tree-down.svg.js +1 -1
  584. package/lib/icons/undo.svg.js +1 -1
  585. package/lib/icons/upload.svg.js +1 -1
  586. package/lib/icons/user-remove.svg.js +1 -1
  587. package/lib/icons/view.svg.js +1 -1
  588. package/lib/icons/volume.svg.js +1 -1
  589. package/lib/icons/warning-mark.svg.js +1 -1
  590. package/lib/icons/warning.svg.js +1 -1
  591. package/lib/icons/window-restore.svg.js +1 -1
  592. package/lib/icons/zoom-in.svg.js +1 -1
  593. package/lib/icons/zoom-out.svg.js +1 -1
  594. package/lib/index.js +1 -1
  595. package/lib/locale/de-DE.js +1 -1
  596. package/lib/locale/en-US.js +1 -1
  597. package/lib/locale/zh-CN.js +1 -1
  598. package/lib/scss/helper.scss.js +1 -1
  599. package/lib/scss/themes/ang.scss.js +1 -1
  600. package/lib/scss/themes/antd.scss.js +1 -1
  601. package/lib/scss/themes/cxd.scss.js +1 -1
  602. package/lib/scss/themes/dark.scss.js +1 -1
  603. package/lib/scss/themes/default.scss.js +1 -1
  604. package/lib/themes/ang.css +187 -127
  605. package/lib/themes/ang.js +1 -1
  606. package/lib/themes/antd.css +187 -127
  607. package/lib/themes/antd.js +1 -1
  608. package/lib/themes/cxd.css +187 -127
  609. package/lib/themes/cxd.js +1 -1
  610. package/lib/themes/dark.css +187 -127
  611. package/lib/themes/dark.js +1 -1
  612. package/lib/themes/default.css +187 -127
  613. package/package.json +4 -4
  614. package/scss/_components.scss +9 -2
  615. package/scss/components/_collapse.scss +31 -1
  616. package/scss/components/_divider.scss +37 -2
  617. package/scss/components/_formula.scss +2 -1
  618. package/scss/components/_menu.scss +6 -3
  619. package/scss/components/_modal.scss +5 -5
  620. package/scss/components/_table.scss +7 -1
  621. package/scss/components/_table2.scss +4 -15
  622. package/scss/components/form/_combo.scss +9 -2
  623. package/scss/components/form/_icon-select.scss +0 -1
  624. package/scss/components/form/_result-list.scss +1 -0
  625. package/scss/components/form/_selection.scss +7 -0
  626. package/scss/components/form/_textarea.scss +5 -5
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-ui v3.4.2
2
+ * amis-ui v3.4.3
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -14,6 +14,7 @@ var findLastIndex = require('lodash/findLastIndex');
14
14
  var find = require('lodash/find');
15
15
  var isEqual = require('lodash/isEqual');
16
16
  var filter = require('lodash/filter');
17
+ var debounce = require('lodash/debounce');
17
18
  var intersection = require('lodash/intersection');
18
19
  var Sortable = require('sortablejs');
19
20
  var amisCore = require('amis-core');
@@ -25,6 +26,7 @@ var HeadCellFilter = require('./HeadCellFilter.js');
25
26
  var HeadCellSelect = require('./HeadCellSelect.js');
26
27
  var ItemActionsWrapper = require('./ItemActionsWrapper.js');
27
28
  var Cell = require('./Cell.js');
29
+ var ColGroup = require('./ColGroup.js');
28
30
 
29
31
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
30
32
 
@@ -33,6 +35,7 @@ var findLastIndex__default = /*#__PURE__*/_interopDefaultLegacy(findLastIndex);
33
35
  var find__default = /*#__PURE__*/_interopDefaultLegacy(find);
34
36
  var isEqual__default = /*#__PURE__*/_interopDefaultLegacy(isEqual);
35
37
  var filter__default = /*#__PURE__*/_interopDefaultLegacy(filter);
38
+ var debounce__default = /*#__PURE__*/_interopDefaultLegacy(debounce);
36
39
  var intersection__default = /*#__PURE__*/_interopDefaultLegacy(intersection);
37
40
  var Sortable__default = /*#__PURE__*/_interopDefaultLegacy(Sortable);
38
41
 
@@ -154,6 +157,11 @@ var Table = /** @class */ (function (_super) {
154
157
  _this.headerDom = React__default["default"].createRef();
155
158
  _this.tfootDom = React__default["default"].createRef();
156
159
  _this.footDom = React__default["default"].createRef();
160
+ _this.toDispose = [];
161
+ _this.updateTableInfoLazy = debounce__default["default"](_this.updateTableInfo.bind(_this), 250, {
162
+ trailing: true,
163
+ leading: false
164
+ });
157
165
  if (props.rowSelection) {
158
166
  var selectedResult = _this.getSelectedRows(props.dataSource, (_a = props.rowSelection) === null || _a === void 0 ? void 0 : _a.selectedRowKeys);
159
167
  _this.selectedRows = selectedResult.selectedRows;
@@ -167,7 +175,7 @@ var Table = /** @class */ (function (_super) {
167
175
  expandedRowKeys: tslib.__spreadArray(tslib.__spreadArray([], tslib.__read((props.expandable ? props.expandable.expandedRowKeys || [] : [])), false), tslib.__read((props.expandable
168
176
  ? props.expandable.defaultExpandedRowKeys || []
169
177
  : [])), false),
170
- colWidths: [],
178
+ colWidths: {},
171
179
  hoverRow: null
172
180
  };
173
181
  return _this;
@@ -238,6 +246,8 @@ var Table = /** @class */ (function (_super) {
238
246
  this.initDragging();
239
247
  }
240
248
  this.updateStickyHeader();
249
+ var currentNode = ReactDOM.findDOMNode(this);
250
+ this.toDispose.push(amisCore.resizeSensor(currentNode, this.updateTableInfoLazy, false, 'width'));
241
251
  };
242
252
  Table.prototype.componentDidUpdate = function (prevProps, prevState) {
243
253
  var _this = this;
@@ -250,7 +260,6 @@ var Table = /** @class */ (function (_super) {
250
260
  dataSource: tslib.__spreadArray([], tslib.__read(this.props.dataSource), false)
251
261
  }, function () {
252
262
  _this.updateTableFixedRows();
253
- _this.syncTableWidth();
254
263
  });
255
264
  }
256
265
  // 选择项发生了变化触发
@@ -303,6 +312,9 @@ var Table = /** @class */ (function (_super) {
303
312
  if (prevProps.sticky !== this.props.sticky) {
304
313
  this.updateStickyHeader();
305
314
  }
315
+ if (prevProps.columns !== this.props.columns) {
316
+ this.updateTableFixedRows();
317
+ }
306
318
  };
307
319
  Table.prototype.componentWillUnmount = function () {
308
320
  var _this = this;
@@ -313,6 +325,9 @@ var Table = /** @class */ (function (_super) {
313
325
  ref.current.removeEventListener('wheel', _this.onWheel.bind(_this));
314
326
  });
315
327
  this.destroyDragging();
328
+ this.toDispose.forEach(function (fn) { return fn(); });
329
+ this.toDispose = [];
330
+ this.updateTableInfoLazy.cancel();
316
331
  };
317
332
  Table.prototype.initDragging = function () {
318
333
  var _this = this;
@@ -390,6 +405,7 @@ var Table = /** @class */ (function (_super) {
390
405
  var children = row.children;
391
406
  for (var i = 0; i < children.length; i++) {
392
407
  var dom = children[i];
408
+ dom.style.removeProperty('left');
393
409
  var fixed = columns[i] ? columns[i].fixed || '' : '';
394
410
  if (isFixedLeftColumn(fixed)) {
395
411
  dom.style.left =
@@ -401,6 +417,9 @@ var Table = /** @class */ (function (_super) {
401
417
  ? getAfterRightWidth(children, i, columns) + 'px'
402
418
  : '0';
403
419
  }
420
+ dom.classList.remove(cx('Table-cell-fix-left-last'));
421
+ dom.classList.remove(cx('Table-cell-fix-right-first'));
422
+ dom.classList.remove(cx('Table-cell-fix-right-first-prev'));
404
423
  }
405
424
  // 最后一个左fixed的添加样式
406
425
  var leftIndex = findLastIndex__default["default"](columns, function (column) {
@@ -478,18 +497,18 @@ var Table = /** @class */ (function (_super) {
478
497
  this.updateSummaryFixedRow(children, columns);
479
498
  }
480
499
  };
481
- Table.prototype.renderColGroup = function () {
482
- return (_J$X_("colgroup", null, this.state.colWidths.map(function (width, index) {
483
- return (_J$X_("col", { key: index, style: { width: typeof width === 'number' ? width + 'px' : width } }));
484
- })));
500
+ Table.prototype.renderColGroup = function (showReal) {
501
+ var _a = this.props, scroll = _a.scroll, tableLayout = _a.tableLayout;
502
+ var isFixed = !!((scroll && scroll.x) || tableLayout === 'fixed');
503
+ return (_J$X_(ColGroup["default"], { columns: this.tdColumns, colWidths: this.state.colWidths, isFixed: isFixed, syncTableWidth: this.syncTableWidth, initTableWidth: this.initTableWidth, showReal: showReal }));
485
504
  };
486
505
  Table.prototype.onResizeMouseDown = function (event, index) {
487
506
  // 点击记录起始坐标
488
507
  this.resizeStart = event.clientX;
489
508
  this.resizeTarget = event.currentTarget;
490
- var extraCount = this.getExtraColumnCount();
509
+ var column = this.tdColumns[index];
491
510
  this.resizeIndex = index;
492
- this.resizeWidth = this.state.colWidths[extraCount + this.resizeIndex];
511
+ this.resizeWidth = this.state.colWidths[column.name].width;
493
512
  this.resizeTarget.classList.add('is-resizing');
494
513
  document.addEventListener('mousemove', this.onResizeMouseMove);
495
514
  document.addEventListener('mouseup', this.onResizeMouseUp);
@@ -500,18 +519,18 @@ var Table = /** @class */ (function (_super) {
500
519
  if (this.resizeTarget) {
501
520
  // 计算横向移动距离
502
521
  var distance = event.clientX - this.resizeStart;
522
+ var column = this.tdColumns[this.resizeIndex];
503
523
  var newWidth = 0;
504
524
  if (distance > 0) {
505
525
  newWidth = this.resizeWidth + distance;
506
526
  }
507
527
  else {
508
528
  // 缩短列
509
- newWidth = Math.max(this.resizeWidth + distance, DefaultCellWidth, this.tdColumns[this.resizeIndex].minWidth || 0);
529
+ newWidth = Math.max(this.resizeWidth + distance, DefaultCellWidth, column.minWidth || 0);
510
530
  }
511
- var extraCount = this.getExtraColumnCount();
512
531
  var colWidths = this.state.colWidths;
513
- colWidths[extraCount + this.resizeIndex] = newWidth;
514
- this.setState({ colWidths: tslib.__spreadArray([], tslib.__read(colWidths), false) });
532
+ colWidths[column.name].width = newWidth;
533
+ this.setState({ colWidths: tslib.__assign({}, colWidths) });
515
534
  }
516
535
  event && event.stopPropagation();
517
536
  };
@@ -658,7 +677,7 @@ var Table = /** @class */ (function (_super) {
658
677
  resizable ? (_J$X_("i", { className: cx('Table-thead-resizable'), onMouseDown: function (e) { return _this.onResizeMouseDown(e, cIndex); } })) : null)) : null;
659
678
  return (_J$X_(Cell["default"], { wrapperComponent: "th", rowSpan: item.rowSpan, colSpan: item.colSpan, key: "cell-".concat(i), fixed: item.fixed === true ? 'left' : item.fixed, className: cx({
660
679
  'Table-cell-last': i === maxCount - 1 && i === data.length - 1
661
- }), groupId: item.groupId, depth: item.depth, col: cIndex > -1 ? cIndex.toString() : undefined, index: cIndex }, typeof item.title === 'function'
680
+ }), groupId: item.groupId, depth: item.depth, col: cIndex > -1 ? cIndex.toString() : undefined }, typeof item.title === 'function'
662
681
  ? item.title(children)
663
682
  : item.title));
664
683
  }),
@@ -693,11 +712,11 @@ var Table = /** @class */ (function (_super) {
693
712
  };
694
713
  Table.prototype.onRowMouseEnter = function (event, record, rowIndex) {
695
714
  return tslib.__awaiter(this, void 0, void 0, function () {
696
- var _a, cx, onRow, prevented, parent, i, td, target;
715
+ var _a, onRow, itemActions, prevented, target;
697
716
  return tslib.__generator(this, function (_b) {
698
717
  switch (_b.label) {
699
718
  case 0:
700
- _a = this.props, cx = _a.classnames, onRow = _a.onRow;
719
+ _a = this.props, onRow = _a.onRow, itemActions = _a.itemActions;
701
720
  if (!(onRow && onRow.onRowMouseEnter)) return [3 /*break*/, 2];
702
721
  return [4 /*yield*/, onRow.onRowMouseEnter(event, record, rowIndex)];
703
722
  case 1:
@@ -707,17 +726,7 @@ var Table = /** @class */ (function (_super) {
707
726
  }
708
727
  _b.label = 2;
709
728
  case 2:
710
- parent = event.target;
711
- while (parent && parent.tagName !== 'TR') {
712
- parent = parent.parentElement;
713
- }
714
- if (parent && !parent.classList.contains(cx('Table-row-disabled'))) {
715
- for (i = 0; i < parent.children.length; i++) {
716
- td = parent.children[i];
717
- td.classList.add(cx('Table-cell-row-hover')); // 保证有列fixed的时候样式一致
718
- }
719
- }
720
- if (record) {
729
+ if (record && itemActions) {
721
730
  target = event.target;
722
731
  if ((target === null || target === void 0 ? void 0 : target.tagName) !== 'TR') {
723
732
  target = target === null || target === void 0 ? void 0 : target.closest('tr');
@@ -731,37 +740,19 @@ var Table = /** @class */ (function (_super) {
731
740
  };
732
741
  Table.prototype.onRowMouseLeave = function (event, record, rowIndex) {
733
742
  return tslib.__awaiter(this, void 0, void 0, function () {
734
- var _a, cx, onRow, prevented, parent, i, td;
735
- return tslib.__generator(this, function (_b) {
736
- switch (_b.label) {
737
- case 0:
738
- _a = this.props, cx = _a.classnames, onRow = _a.onRow;
739
- if (!(onRow && onRow.onRowMouseLeave)) return [3 /*break*/, 2];
740
- return [4 /*yield*/, onRow.onRowMouseLeave(event, record, rowIndex)];
741
- case 1:
742
- prevented = _b.sent();
743
- if (prevented) {
744
- return [2 /*return*/];
745
- }
746
- _b.label = 2;
747
- case 2:
748
- parent = event.target;
749
- while (parent && parent.tagName !== 'TR') {
750
- parent = parent.parentElement;
751
- }
752
- if (parent) {
753
- for (i = 0; i < parent.children.length; i++) {
754
- td = parent.children[i];
755
- td.classList.remove(cx('Table-cell-row-hover'));
756
- }
757
- }
758
- return [2 /*return*/];
759
- }
743
+ var onRow;
744
+ return tslib.__generator(this, function (_a) {
745
+ onRow = this.props.onRow;
746
+ onRow &&
747
+ onRow.onRowMouseLeave &&
748
+ onRow.onRowMouseLeave(event, record, rowIndex);
749
+ return [2 /*return*/];
760
750
  });
761
751
  });
762
752
  };
763
753
  Table.prototype.onMouseLeave = function () {
764
- this.setState({ hoverRow: null });
754
+ var itemActions = this.props.itemActions;
755
+ itemActions && this.setState({ hoverRow: null });
765
756
  };
766
757
  Table.prototype.onExpandRows = function (data) {
767
758
  var _this = this;
@@ -908,7 +899,7 @@ var Table = /** @class */ (function (_super) {
908
899
  // 为了支持灵活合并单元格,renderers层的Table2传递的render方法,返回{children: <ReactElement>, props: {rowSpan, colSpan}}
909
900
  // 但直接使用amis-ui的table,render方法一般直接返回ReactElement
910
901
  var render = item.render && typeof item.render === 'function'
911
- ? item.render(data[item.name], data, rowIndex, i)
902
+ ? item.render(data[item.name], data, rowIndex, i, levels)
912
903
  : null;
913
904
  var props = { rowSpan: 1, colSpan: 1 };
914
905
  var children = render;
@@ -927,7 +918,7 @@ var Table = /** @class */ (function (_super) {
927
918
  : '';
928
919
  return props.rowSpan === 0 || props.colSpan === 0 ? null : (_J$X_(Cell["default"], tslib.__assign({ key: i }, props, { fixed: item.fixed === true ? 'left' : item.fixed, column: item, groupId: item.groupId, className: cx((_a = {},
929
920
  _a["".concat(className)] = !!className,
930
- _a)) }),
921
+ _a)), col: i > -1 ? i.toString() : undefined }),
931
922
  _J$X_("div", { className: cx('Table-cell-wrapper', (_b = {},
932
923
  _b[cx('Table-cell-wrapper-prefix')] = i === 0 &&
933
924
  (!!indentDom || (levels.length === 0 && hasChildrenRow)),
@@ -1134,19 +1125,21 @@ var Table = /** @class */ (function (_super) {
1134
1125
  this.updateTableDom(target);
1135
1126
  };
1136
1127
  Table.prototype.renderTable = function () {
1137
- var _a = this.props, scroll = _a.scroll, footSummary = _a.footSummary, loading = _a.loading, showHeader = _a.showHeader, itemActions = _a.itemActions, cx = _a.classnames;
1128
+ var _a = this.props, scroll = _a.scroll, footSummary = _a.footSummary, showHeader = _a.showHeader, itemActions = _a.itemActions, tableLayout = _a.tableLayout, cx = _a.classnames;
1138
1129
  var hasScrollX = scroll && scroll.x;
1139
1130
  var hoverRow = this.state.hoverRow;
1140
- var tableStyle = hasScrollX ? { width: scroll.x + 'px' } : {};
1131
+ var tableStyle = hasScrollX
1132
+ ? { width: scroll.x + 'px', tableLayout: 'fixed' }
1133
+ : {};
1141
1134
  return (_J$X_("div", { ref: this.contentDom, className: cx('Table-content'), style: hasScrollX ? { overflow: 'auto hidden' } : {}, onMouseLeave: this.onMouseLeave.bind(this), onScroll: this.onTableContentScroll.bind(this) },
1142
1135
  itemActions && hoverRow ? (_J$X_(ItemActionsWrapper["default"], { dom: hoverRow.target, classnames: cx }, typeof itemActions === 'function'
1143
1136
  ? itemActions(hoverRow.record, hoverRow.rowIndex)
1144
1137
  : null)) : null,
1145
- _J$X_("table", { style: tslib.__assign(tslib.__assign({}, tableStyle), { tableLayout: 'fixed' }), className: cx('Table-table') },
1138
+ _J$X_("table", { style: tslib.__assign(tslib.__assign({}, tableStyle), { tableLayout: tableLayout === 'fixed' ? 'fixed' : 'auto' }), className: cx('Table-table') },
1146
1139
  this.renderColGroup(),
1147
1140
  showHeader ? this.renderTHead() : null,
1148
1141
  this.renderTBody(),
1149
- !loading && footSummary ? this.renderTFoot() : null)));
1142
+ footSummary ? this.renderTFoot() : null)));
1150
1143
  };
1151
1144
  Table.prototype.renderScrollTableHeader = function () {
1152
1145
  var _a;
@@ -1165,7 +1158,7 @@ var Table = /** @class */ (function (_super) {
1165
1158
  _a[cx('Table-sticky-holder')] = !!sticky,
1166
1159
  _a)), style: style },
1167
1160
  _J$X_("table", { className: cx('Table-table'), style: tslib.__assign(tslib.__assign({}, tableStyle), { tableLayout: 'fixed' }) },
1168
- this.renderColGroup(),
1161
+ this.renderColGroup(true),
1169
1162
  showHeader ? this.renderTHead() : null,
1170
1163
  headSummary ? (_J$X_("tbody", null, this.renderSummaryRow(headSummary))) : null)));
1171
1164
  };
@@ -1197,31 +1190,76 @@ var Table = /** @class */ (function (_super) {
1197
1190
  _J$X_("table", { className: cx('Table-table'), style: { width: (scroll === null || scroll === void 0 ? void 0 : scroll.x) + 'px' || '100%', tableLayout: 'fixed' } }, this.renderTFoot())));
1198
1191
  };
1199
1192
  Table.prototype.renderScrollTable = function () {
1200
- var _a = this.props, footSummary = _a.footSummary, loading = _a.loading, cx = _a.classnames;
1193
+ var _a = this.props, footSummary = _a.footSummary, cx = _a.classnames;
1201
1194
  return (_J$X_("div", { className: cx('Table-container') },
1202
1195
  this.renderScrollTableHeader(),
1203
1196
  this.renderScrollTableBody(),
1204
- !loading && footSummary ? this.renderScrollTableFoot() : null));
1197
+ footSummary ? this.renderScrollTableFoot() : null));
1205
1198
  };
1206
1199
  Table.prototype.syncTableWidth = function () {
1207
1200
  var _this = this;
1208
- var _a, _b, _c;
1201
+ var tbodyDom = this.tbodyDom.current;
1202
+ if (!tbodyDom) {
1203
+ return;
1204
+ }
1205
+ var cols = [].slice.call(tbodyDom === null || tbodyDom === void 0 ? void 0 : tbodyDom.querySelectorAll(':scope>tr>td[data-col]'));
1206
+ var colWidths = {};
1207
+ cols.forEach(function (col) {
1208
+ var index = parseInt(col.getAttribute('data-col'), 10);
1209
+ var column = _this.tdColumns[index];
1210
+ var item = _this.state.colWidths[column.name];
1211
+ if (column) {
1212
+ colWidths[column.name] = {
1213
+ width: (item === null || item === void 0 ? void 0 : item.originWidth) !== (column === null || column === void 0 ? void 0 : column.width) ? column === null || column === void 0 ? void 0 : column.width : item === null || item === void 0 ? void 0 : item.width,
1214
+ minWidth: column === null || column === void 0 ? void 0 : column.minWidth,
1215
+ realWidth: col.offsetWidth,
1216
+ originWidth: column === null || column === void 0 ? void 0 : column.width
1217
+ };
1218
+ }
1219
+ });
1220
+ if (!isEqual__default["default"](colWidths, this.state.colWidths)) {
1221
+ this.setState({ colWidths: colWidths });
1222
+ }
1223
+ };
1224
+ Table.prototype.initTableWidth = function () {
1225
+ var _this = this;
1226
+ var _a;
1209
1227
  var tableWrapperDom = this.contentDom.current;
1210
1228
  if (!tableWrapperDom) {
1211
1229
  return;
1212
1230
  }
1231
+ var _b = this.props, scroll = _b.scroll, tableLayout = _b.tableLayout;
1213
1232
  var table = tableWrapperDom.querySelector('table');
1214
- var tableWidth = tableWrapperDom.offsetWidth;
1233
+ var tableWidth = scroll && scroll.x ? scroll.x : tableWrapperDom.offsetWidth;
1215
1234
  var thead = (_a = this.theadDom) === null || _a === void 0 ? void 0 : _a.current;
1216
- var tbodyTr = (_c = (_b = this.tbodyDom) === null || _b === void 0 ? void 0 : _b.current) === null || _c === void 0 ? void 0 : _c.querySelector('tr:first-child');
1235
+ var tbody = null;
1236
+ var htmls = [];
1237
+ var isFixed = tableLayout === 'fixed' || (scroll && scroll.x);
1238
+ var someSettedWidth = this.tdColumns.some(function (column) { return column.width; });
1239
+ var minWidths = {};
1240
+ // fixed 模式需要参考 auto 获得列最小宽度
1241
+ if (isFixed) {
1242
+ tbody = (table === null || table === void 0 ? void 0 : table.querySelector(':scope>tbody')) || null;
1243
+ htmls.push("<table style=\"table-layout:auto!important;width:0!important;min-width:0!important;\" class=\"".concat(table === null || table === void 0 ? void 0 : table.className, "\">").concat(thead === null || thead === void 0 ? void 0 : thead.outerHTML, "</table>"));
1244
+ }
1245
+ if (someSettedWidth || isFixed) {
1246
+ htmls.push("<table style=\"table-layout:auto!important;min-width:".concat(tableWidth, "px!important;width:").concat(tableWidth, "px!important;\" class=\"").concat(table === null || table === void 0 ? void 0 : table.className, "\">").concat(thead ? thead.outerHTML : '').concat(tbody ? "<tbody>".concat(tbody.innerHTML, "</tbody>") : '', "</table>"));
1247
+ }
1248
+ if (!htmls.length) {
1249
+ return;
1250
+ }
1217
1251
  var div = document.createElement('div');
1218
1252
  div.className = 'amis-scope'; // jssdk 里面 css 会在这一层
1219
1253
  div.style.cssText += "visibility: hidden!important;";
1220
- div.innerHTML =
1221
- "<table style=\"table-layout:auto!important;width:0!important;min-width:0!important;\" class=\"".concat(table === null || table === void 0 ? void 0 : table.className, "\">").concat(thead === null || thead === void 0 ? void 0 : thead.outerHTML, "</table>") +
1222
- "<table style=\"table-layout:auto!important;min-width:".concat(tableWidth, "px!important;width:").concat(tableWidth, "px!important;\" class=\"").concat(table === null || table === void 0 ? void 0 : table.className, "\">").concat(thead === null || thead === void 0 ? void 0 : thead.outerHTML).concat(tbodyTr ? "<tbody>".concat(tbodyTr.outerHTML, "</tbody>") : '', "</table>");
1223
- var ths1 = [].slice.call(div.querySelectorAll(':scope>table:first-child>thead>tr>th[data-col]'));
1224
- var ths2 = [].slice.call(div.querySelectorAll(':scope>table:last-child>thead>tr>th[data-col]'));
1254
+ div.innerHTML = htmls.join('');
1255
+ var ths1 = [];
1256
+ var ths2 = [];
1257
+ if (isFixed) {
1258
+ ths1 = [].slice.call(div.querySelectorAll(':scope>table:first-child>thead>tr>th[data-col]'));
1259
+ }
1260
+ if (someSettedWidth || isFixed) {
1261
+ ths2 = [].slice.call(div.querySelectorAll(':scope>table:last-child>thead>tr>th[data-col]'));
1262
+ }
1225
1263
  ths1.forEach(function (th) {
1226
1264
  th.style.cssText += 'width: 0';
1227
1265
  });
@@ -1234,26 +1272,44 @@ var Table = /** @class */ (function (_super) {
1234
1272
  : '');
1235
1273
  });
1236
1274
  document.body.appendChild(div);
1237
- var minWidths = {};
1275
+ var colWidths = {};
1238
1276
  ths1.forEach(function (th) {
1239
- minWidths[th.getAttribute('data-index')] = th.clientWidth;
1277
+ var index = parseInt(th.getAttribute('data-col'), 10);
1278
+ var column = _this.tdColumns[index];
1279
+ minWidths[index] = th.clientWidth;
1280
+ if (colWidths[index]) {
1281
+ colWidths[column === null || column === void 0 ? void 0 : column.name].minWidth = th.clientWidth;
1282
+ }
1283
+ else {
1284
+ colWidths[column === null || column === void 0 ? void 0 : column.name] = { minWidth: th.clientWidth };
1285
+ }
1240
1286
  });
1241
- var colWidths = [];
1242
- ths2.forEach(function (col, index) {
1287
+ ths2.forEach(function (col) {
1288
+ var index = parseInt(col.getAttribute('data-col'), 10);
1243
1289
  var column = _this.tdColumns[index];
1244
- colWidths.push(Math.max(typeof (column === null || column === void 0 ? void 0 : column.width) === 'number' ? column === null || column === void 0 ? void 0 : column.width : col.clientWidth, minWidths[col.getAttribute('data-index')]));
1290
+ if (column && (column.width || isFixed)) {
1291
+ var width = Math.max(typeof column.width === 'number' ? column.width : col.clientWidth, minWidths[index] || 0);
1292
+ if (colWidths[column === null || column === void 0 ? void 0 : column.name]) {
1293
+ colWidths[column === null || column === void 0 ? void 0 : column.name].width = width;
1294
+ }
1295
+ else {
1296
+ colWidths[column === null || column === void 0 ? void 0 : column.name] = { width: width };
1297
+ }
1298
+ if (column.width) {
1299
+ colWidths[column === null || column === void 0 ? void 0 : column.name].originWidth = column.width;
1300
+ }
1301
+ }
1245
1302
  });
1246
- this.setState({ colWidths: colWidths });
1303
+ if (!isEqual__default["default"](colWidths, this.state.colWidths)) {
1304
+ this.setState({ colWidths: colWidths });
1305
+ }
1247
1306
  document.body.removeChild(div);
1248
1307
  };
1249
- Table.prototype.updateTableInfoRef = function (ref) {
1250
- if (!ref) {
1251
- return;
1252
- }
1308
+ Table.prototype.updateTableInfo = function () {
1253
1309
  if (this.resizeTarget) {
1254
1310
  return;
1255
1311
  }
1256
- this.syncTableWidth();
1312
+ this.initTableWidth();
1257
1313
  };
1258
1314
  Table.prototype.render = function () {
1259
1315
  var _a;
@@ -1267,7 +1323,6 @@ var Table = /** @class */ (function (_super) {
1267
1323
  var hasScrollY = scroll && scroll.y;
1268
1324
  // 是否设置了横向滚动
1269
1325
  var hasScrollX = scroll && scroll.x;
1270
- var columnWidthReady = this.state.colWidths.length > 0;
1271
1326
  return (_J$X_("div", { ref: this.tableDom, className: cx('Table2', className, (_a = {},
1272
1327
  _a[cx('Table-scroll-horizontal')] = hasScrollX,
1273
1328
  _a[cx("Table-".concat(size))] = size,
@@ -1276,8 +1331,7 @@ var Table = /** @class */ (function (_super) {
1276
1331
  _a)) },
1277
1332
  title ? (_J$X_("div", { className: cx('Table-title') }, typeof title === 'function' ? title() : title)) : null,
1278
1333
  hasScrollY || sticky ? (this.renderScrollTable()) : (_J$X_("div", { className: cx('Table-container') }, this.renderTable())),
1279
- footer ? (_J$X_("div", { className: cx('Table-footer') }, typeof footer === 'function' ? footer() : footer)) : null,
1280
- columnWidthReady ? null : _J$X_("span", { ref: this.updateTableInfoRef })));
1334
+ footer ? (_J$X_("div", { className: cx('Table-footer') }, typeof footer === 'function' ? footer() : footer)) : null));
1281
1335
  };
1282
1336
  Table.defaultProps = {
1283
1337
  title: '',
@@ -1286,7 +1340,8 @@ var Table = /** @class */ (function (_super) {
1286
1340
  columns: [],
1287
1341
  indentSize: 15,
1288
1342
  placeholder: '暂无数据',
1289
- showHeader: true
1343
+ showHeader: true,
1344
+ tableLayout: 'auto'
1290
1345
  };
1291
1346
  tslib.__decorate([
1292
1347
  amisCore.autobind,
@@ -1315,9 +1370,15 @@ var Table = /** @class */ (function (_super) {
1315
1370
  tslib.__decorate([
1316
1371
  amisCore.autobind,
1317
1372
  tslib.__metadata("design:type", Function),
1318
- tslib.__metadata("design:paramtypes", [Object]),
1373
+ tslib.__metadata("design:paramtypes", []),
1374
+ tslib.__metadata("design:returntype", void 0)
1375
+ ], Table.prototype, "initTableWidth", null);
1376
+ tslib.__decorate([
1377
+ amisCore.autobind,
1378
+ tslib.__metadata("design:type", Function),
1379
+ tslib.__metadata("design:paramtypes", []),
1319
1380
  tslib.__metadata("design:returntype", void 0)
1320
- ], Table.prototype, "updateTableInfoRef", null);
1381
+ ], Table.prototype, "updateTableInfo", null);
1321
1382
  return Table;
1322
1383
  }(React__default["default"].PureComponent));
1323
1384
  var index = amisCore.themeable(amisCore.localeable(Table));
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-ui v3.4.2
2
+ * amis-ui v3.4.3
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-ui v3.4.2
2
+ * amis-ui v3.4.3
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-ui v3.4.2
2
+ * amis-ui v3.4.3
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-ui v3.4.2
2
+ * amis-ui v3.4.3
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-ui v3.4.2
2
+ * amis-ui v3.4.3
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-ui v3.4.2
2
+ * amis-ui v3.4.3
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-ui v3.4.2
2
+ * amis-ui v3.4.3
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-ui v3.4.2
2
+ * amis-ui v3.4.3
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-ui v3.4.2
2
+ * amis-ui v3.4.3
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-ui v3.4.2
2
+ * amis-ui v3.4.3
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-ui v3.4.2
2
+ * amis-ui v3.4.3
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-ui v3.4.2
2
+ * amis-ui v3.4.3
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-ui v3.4.2
2
+ * amis-ui v3.4.3
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-ui v3.4.2
2
+ * amis-ui v3.4.3
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-ui v3.4.2
2
+ * amis-ui v3.4.3
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-ui v3.4.2
2
+ * amis-ui v3.4.3
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-ui v3.4.2
2
+ * amis-ui v3.4.3
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-ui v3.4.2
2
+ * amis-ui v3.4.3
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-ui v3.4.2
2
+ * amis-ui v3.4.3
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-ui v3.4.2
2
+ * amis-ui v3.4.3
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-ui v3.4.2
2
+ * amis-ui v3.4.3
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5