amis-ui 3.4.2 → 3.5.0

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