@sheinx/base 3.7.0-beta.4 → 3.7.0-beta.40

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 (365) hide show
  1. package/cjs/alert/alert.d.ts.map +1 -1
  2. package/cjs/alert/alert.js +1 -1
  3. package/cjs/alert/alert.type.d.ts +1 -0
  4. package/cjs/alert/alert.type.d.ts.map +1 -1
  5. package/cjs/animation-list/animation-list.js +1 -1
  6. package/cjs/carousel/carousel.d.ts.map +1 -1
  7. package/cjs/carousel/carousel.js +6 -3
  8. package/cjs/carousel/carousel.type.d.ts +12 -0
  9. package/cjs/carousel/carousel.type.d.ts.map +1 -1
  10. package/cjs/cascader/cascader.d.ts.map +1 -1
  11. package/cjs/cascader/cascader.js +55 -36
  12. package/cjs/cascader/cascader.type.d.ts +14 -2
  13. package/cjs/cascader/cascader.type.d.ts.map +1 -1
  14. package/cjs/cascader/filter-list.type.d.ts +1 -1
  15. package/cjs/cascader/filter-list.type.d.ts.map +1 -1
  16. package/cjs/cascader/filter-node.d.ts.map +1 -1
  17. package/cjs/cascader/filter-node.js +16 -6
  18. package/cjs/cascader/node.d.ts.map +1 -1
  19. package/cjs/cascader/node.js +11 -2
  20. package/cjs/common/common.type.d.ts +2 -0
  21. package/cjs/common/common.type.d.ts.map +1 -0
  22. package/cjs/common/common.type.js +12 -0
  23. package/cjs/common/index.d.ts +2 -0
  24. package/cjs/common/index.d.ts.map +1 -0
  25. package/cjs/common/index.js +6 -0
  26. package/cjs/common/type.d.ts +3 -0
  27. package/cjs/common/type.d.ts.map +1 -1
  28. package/cjs/date-picker/date-picker.js +1 -1
  29. package/cjs/date-picker/date-picker.type.d.ts +0 -1
  30. package/cjs/date-picker/date-picker.type.d.ts.map +1 -1
  31. package/cjs/date-picker/day.d.ts.map +1 -1
  32. package/cjs/date-picker/day.js +3 -4
  33. package/cjs/form/form-flow.js +1 -1
  34. package/cjs/form/form-footer-context.d.ts +2 -1
  35. package/cjs/form/form-footer-context.d.ts.map +1 -1
  36. package/cjs/form/form-item.d.ts.map +1 -1
  37. package/cjs/form/form-item.js +4 -3
  38. package/cjs/form/form.d.ts.map +1 -1
  39. package/cjs/form/form.js +4 -2
  40. package/cjs/form/form.type.d.ts +3 -0
  41. package/cjs/form/form.type.d.ts.map +1 -1
  42. package/cjs/grid/grid.d.ts.map +1 -1
  43. package/cjs/grid/grid.js +5 -2
  44. package/cjs/grid/grid.type.d.ts +8 -0
  45. package/cjs/grid/grid.type.d.ts.map +1 -1
  46. package/cjs/grid/index.d.ts +1 -1
  47. package/cjs/grid/index.d.ts.map +1 -1
  48. package/cjs/grid/util.d.ts.map +1 -1
  49. package/cjs/grid/util.js +4 -12
  50. package/cjs/icons/config.d.ts +3 -2
  51. package/cjs/icons/config.d.ts.map +1 -1
  52. package/cjs/icons/config.js +5 -4
  53. package/cjs/icons/icons.js +6 -2
  54. package/cjs/image/image.d.ts.map +1 -1
  55. package/cjs/image/image.js +3 -2
  56. package/cjs/index.d.ts +2 -0
  57. package/cjs/index.d.ts.map +1 -1
  58. package/cjs/index.js +24 -0
  59. package/cjs/list/list.d.ts.map +1 -1
  60. package/cjs/list/list.js +16 -5
  61. package/cjs/list/list.type.d.ts +8 -0
  62. package/cjs/list/list.type.d.ts.map +1 -1
  63. package/cjs/modal/modal-content.d.ts.map +1 -1
  64. package/cjs/modal/modal-content.js +14 -3
  65. package/cjs/modal/modal-submit.d.ts.map +1 -1
  66. package/cjs/modal/modal-submit.js +10 -3
  67. package/cjs/modal/modal.d.ts.map +1 -1
  68. package/cjs/modal/modal.js +3 -0
  69. package/cjs/popover/confirm.type.d.ts +1 -1
  70. package/cjs/popover/confirm.type.d.ts.map +1 -1
  71. package/cjs/popover/popover.d.ts.map +1 -1
  72. package/cjs/popover/popover.js +29 -1
  73. package/cjs/select/list-option.d.ts.map +1 -1
  74. package/cjs/select/list-option.js +11 -2
  75. package/cjs/select/list.d.ts.map +1 -1
  76. package/cjs/select/list.js +2 -1
  77. package/cjs/select/result-more.d.ts.map +1 -1
  78. package/cjs/select/result-more.js +1 -1
  79. package/cjs/select/result.d.ts.map +1 -1
  80. package/cjs/select/result.js +10 -1
  81. package/cjs/select/select.d.ts.map +1 -1
  82. package/cjs/select/select.js +49 -38
  83. package/cjs/select/select.type.d.ts +10 -2
  84. package/cjs/select/select.type.d.ts.map +1 -1
  85. package/cjs/skeleton/button.d.ts +8 -0
  86. package/cjs/skeleton/button.d.ts.map +1 -0
  87. package/cjs/skeleton/button.js +34 -0
  88. package/cjs/skeleton/image.d.ts +8 -0
  89. package/cjs/skeleton/image.d.ts.map +1 -0
  90. package/cjs/skeleton/image.js +27 -0
  91. package/cjs/skeleton/index.d.ts +3 -0
  92. package/cjs/skeleton/index.d.ts.map +1 -0
  93. package/cjs/skeleton/index.js +20 -0
  94. package/cjs/skeleton/skeleton.d.ts +5 -0
  95. package/cjs/skeleton/skeleton.d.ts.map +1 -0
  96. package/cjs/skeleton/skeleton.js +58 -0
  97. package/cjs/skeleton/skeleton.type.d.ts +125 -0
  98. package/cjs/skeleton/skeleton.type.d.ts.map +1 -0
  99. package/cjs/skeleton/skeleton.type.js +5 -0
  100. package/cjs/skeleton/text.d.ts +8 -0
  101. package/cjs/skeleton/text.d.ts.map +1 -0
  102. package/cjs/skeleton/text.js +53 -0
  103. package/cjs/sticky/sticky.d.ts.map +1 -1
  104. package/cjs/sticky/sticky.js +6 -3
  105. package/cjs/sticky/sticky.type.d.ts +2 -2
  106. package/cjs/sticky/sticky.type.d.ts.map +1 -1
  107. package/cjs/table/table.d.ts.map +1 -1
  108. package/cjs/table/table.js +189 -43
  109. package/cjs/table/table.type.d.ts +19 -3
  110. package/cjs/table/table.type.d.ts.map +1 -1
  111. package/cjs/table/tbody.d.ts +1 -1
  112. package/cjs/table/tbody.d.ts.map +1 -1
  113. package/cjs/table/tbody.js +17 -7
  114. package/cjs/table/tbody.type.d.ts +2 -1
  115. package/cjs/table/tbody.type.d.ts.map +1 -1
  116. package/cjs/table/td.d.ts +3 -3
  117. package/cjs/table/td.d.ts.map +1 -1
  118. package/cjs/table/td.js +24 -18
  119. package/cjs/table/thead-filter.d.ts.map +1 -1
  120. package/cjs/table/thead-filter.js +20 -19
  121. package/cjs/table/thead.d.ts.map +1 -1
  122. package/cjs/table/thead.js +5 -1
  123. package/cjs/table/tr.d.ts +2 -1
  124. package/cjs/table/tr.d.ts.map +1 -1
  125. package/cjs/table/tr.js +17 -12
  126. package/cjs/tabs/tabs-panel.js +4 -3
  127. package/cjs/tabs/tabs.d.ts.map +1 -1
  128. package/cjs/tabs/tabs.js +10 -1
  129. package/cjs/tabs/tabs.type.d.ts +6 -0
  130. package/cjs/tabs/tabs.type.d.ts.map +1 -1
  131. package/cjs/tag/tag.d.ts.map +1 -1
  132. package/cjs/tag/tag.js +3 -1
  133. package/cjs/tag/tag.type.d.ts +6 -0
  134. package/cjs/tag/tag.type.d.ts.map +1 -1
  135. package/cjs/tooltip/tooltip.d.ts.map +1 -1
  136. package/cjs/tooltip/tooltip.js +21 -1
  137. package/cjs/transfer/transfer-list.type.d.ts +1 -1
  138. package/cjs/transfer/transfer-list.type.d.ts.map +1 -1
  139. package/cjs/transfer/transfer.d.ts.map +1 -1
  140. package/cjs/transfer/transfer.js +16 -2
  141. package/cjs/transfer/transfer.type.d.ts +1 -1
  142. package/cjs/transfer/transfer.type.d.ts.map +1 -1
  143. package/cjs/tree/tree-checkbox.d.ts.map +1 -1
  144. package/cjs/tree/tree-checkbox.js +4 -2
  145. package/cjs/tree/tree-checkbox.type.d.ts +1 -0
  146. package/cjs/tree/tree-checkbox.type.d.ts.map +1 -1
  147. package/cjs/tree/tree-content.d.ts.map +1 -1
  148. package/cjs/tree/tree-content.js +37 -5
  149. package/cjs/tree/tree-content.type.d.ts +1 -2
  150. package/cjs/tree/tree-content.type.d.ts.map +1 -1
  151. package/cjs/tree/tree-context.d.ts +3 -3
  152. package/cjs/tree/tree-context.d.ts.map +1 -1
  153. package/cjs/tree/tree-context.type.d.ts +2 -1
  154. package/cjs/tree/tree-context.type.d.ts.map +1 -1
  155. package/cjs/tree/tree-list.type.d.ts +1 -2
  156. package/cjs/tree/tree-list.type.d.ts.map +1 -1
  157. package/cjs/tree/tree-node.type.d.ts +2 -4
  158. package/cjs/tree/tree-node.type.d.ts.map +1 -1
  159. package/cjs/tree/tree-root.type.d.ts +1 -2
  160. package/cjs/tree/tree-root.type.d.ts.map +1 -1
  161. package/cjs/tree/tree-virtual-node.d.ts.map +1 -1
  162. package/cjs/tree/tree-virtual-node.js +20 -5
  163. package/cjs/tree/tree-virtual.d.ts.map +1 -1
  164. package/cjs/tree/tree-virtual.js +11 -4
  165. package/cjs/tree/tree.d.ts.map +1 -1
  166. package/cjs/tree/tree.js +11 -14
  167. package/cjs/tree/tree.type.d.ts +26 -7
  168. package/cjs/tree/tree.type.d.ts.map +1 -1
  169. package/cjs/tree-select/tree-select.d.ts.map +1 -1
  170. package/cjs/tree-select/tree-select.js +63 -40
  171. package/cjs/tree-select/tree-select.type.d.ts +36 -2
  172. package/cjs/tree-select/tree-select.type.d.ts.map +1 -1
  173. package/cjs/upload/drop.d.ts +1 -0
  174. package/cjs/upload/drop.d.ts.map +1 -1
  175. package/cjs/upload/drop.js +43 -12
  176. package/cjs/upload/upload.d.ts.map +1 -1
  177. package/cjs/upload/upload.js +3 -1
  178. package/cjs/upload/upload.type.d.ts +6 -0
  179. package/cjs/upload/upload.type.d.ts.map +1 -1
  180. package/cjs/virtual-scroll/scroll-table.d.ts +7 -4
  181. package/cjs/virtual-scroll/scroll-table.d.ts.map +1 -1
  182. package/cjs/virtual-scroll/scroll-table.js +59 -29
  183. package/esm/alert/alert.d.ts.map +1 -1
  184. package/esm/alert/alert.js +1 -1
  185. package/esm/alert/alert.type.d.ts +1 -0
  186. package/esm/alert/alert.type.d.ts.map +1 -1
  187. package/esm/animation-list/animation-list.js +1 -1
  188. package/esm/carousel/carousel.d.ts.map +1 -1
  189. package/esm/carousel/carousel.js +6 -3
  190. package/esm/carousel/carousel.type.d.ts +12 -0
  191. package/esm/carousel/carousel.type.d.ts.map +1 -1
  192. package/esm/cascader/cascader.d.ts.map +1 -1
  193. package/esm/cascader/cascader.js +55 -36
  194. package/esm/cascader/cascader.type.d.ts +14 -2
  195. package/esm/cascader/cascader.type.d.ts.map +1 -1
  196. package/esm/cascader/filter-list.type.d.ts +1 -1
  197. package/esm/cascader/filter-list.type.d.ts.map +1 -1
  198. package/esm/cascader/filter-node.d.ts.map +1 -1
  199. package/esm/cascader/filter-node.js +17 -7
  200. package/esm/cascader/node.d.ts.map +1 -1
  201. package/esm/cascader/node.js +13 -4
  202. package/esm/common/common.type.d.ts +2 -0
  203. package/esm/common/common.type.d.ts.map +1 -0
  204. package/esm/common/common.type.js +1 -0
  205. package/esm/common/index.d.ts +2 -0
  206. package/esm/common/index.d.ts.map +1 -0
  207. package/esm/common/index.js +2 -0
  208. package/esm/common/type.d.ts +3 -0
  209. package/esm/common/type.d.ts.map +1 -1
  210. package/esm/date-picker/date-picker.js +1 -1
  211. package/esm/date-picker/date-picker.type.d.ts +0 -1
  212. package/esm/date-picker/date-picker.type.d.ts.map +1 -1
  213. package/esm/date-picker/day.d.ts.map +1 -1
  214. package/esm/date-picker/day.js +3 -4
  215. package/esm/form/form-flow.js +1 -1
  216. package/esm/form/form-footer-context.d.ts +2 -1
  217. package/esm/form/form-footer-context.d.ts.map +1 -1
  218. package/esm/form/form-item.d.ts.map +1 -1
  219. package/esm/form/form-item.js +4 -3
  220. package/esm/form/form.d.ts.map +1 -1
  221. package/esm/form/form.js +4 -2
  222. package/esm/form/form.type.d.ts +3 -0
  223. package/esm/form/form.type.d.ts.map +1 -1
  224. package/esm/grid/grid.d.ts.map +1 -1
  225. package/esm/grid/grid.js +5 -2
  226. package/esm/grid/grid.type.d.ts +8 -0
  227. package/esm/grid/grid.type.d.ts.map +1 -1
  228. package/esm/grid/index.d.ts +1 -1
  229. package/esm/grid/index.d.ts.map +1 -1
  230. package/esm/grid/util.d.ts.map +1 -1
  231. package/esm/grid/util.js +4 -12
  232. package/esm/icons/config.d.ts +3 -2
  233. package/esm/icons/config.d.ts.map +1 -1
  234. package/esm/icons/config.js +5 -4
  235. package/esm/icons/icons.js +6 -2
  236. package/esm/image/image.d.ts.map +1 -1
  237. package/esm/image/image.js +3 -2
  238. package/esm/index.d.ts +2 -0
  239. package/esm/index.d.ts.map +1 -1
  240. package/esm/index.js +2 -0
  241. package/esm/list/list.d.ts.map +1 -1
  242. package/esm/list/list.js +16 -5
  243. package/esm/list/list.type.d.ts +8 -0
  244. package/esm/list/list.type.d.ts.map +1 -1
  245. package/esm/modal/modal-content.d.ts.map +1 -1
  246. package/esm/modal/modal-content.js +14 -3
  247. package/esm/modal/modal-submit.d.ts.map +1 -1
  248. package/esm/modal/modal-submit.js +10 -3
  249. package/esm/modal/modal.d.ts.map +1 -1
  250. package/esm/modal/modal.js +3 -0
  251. package/esm/popover/confirm.type.d.ts +1 -1
  252. package/esm/popover/confirm.type.d.ts.map +1 -1
  253. package/esm/popover/popover.d.ts.map +1 -1
  254. package/esm/popover/popover.js +29 -1
  255. package/esm/select/list-option.d.ts.map +1 -1
  256. package/esm/select/list-option.js +13 -4
  257. package/esm/select/list.d.ts.map +1 -1
  258. package/esm/select/list.js +2 -1
  259. package/esm/select/result-more.d.ts.map +1 -1
  260. package/esm/select/result-more.js +1 -1
  261. package/esm/select/result.d.ts.map +1 -1
  262. package/esm/select/result.js +10 -1
  263. package/esm/select/select.d.ts.map +1 -1
  264. package/esm/select/select.js +49 -38
  265. package/esm/select/select.type.d.ts +10 -2
  266. package/esm/select/select.type.d.ts.map +1 -1
  267. package/esm/skeleton/button.d.ts +8 -0
  268. package/esm/skeleton/button.d.ts.map +1 -0
  269. package/esm/skeleton/button.js +27 -0
  270. package/esm/skeleton/image.d.ts +8 -0
  271. package/esm/skeleton/image.d.ts.map +1 -0
  272. package/esm/skeleton/image.js +20 -0
  273. package/esm/skeleton/index.d.ts +3 -0
  274. package/esm/skeleton/index.d.ts.map +1 -0
  275. package/esm/skeleton/index.js +2 -0
  276. package/esm/skeleton/skeleton.d.ts +5 -0
  277. package/esm/skeleton/skeleton.d.ts.map +1 -0
  278. package/esm/skeleton/skeleton.js +52 -0
  279. package/esm/skeleton/skeleton.type.d.ts +125 -0
  280. package/esm/skeleton/skeleton.type.d.ts.map +1 -0
  281. package/esm/skeleton/skeleton.type.js +1 -0
  282. package/esm/skeleton/text.d.ts +8 -0
  283. package/esm/skeleton/text.d.ts.map +1 -0
  284. package/esm/skeleton/text.js +46 -0
  285. package/esm/sticky/sticky.d.ts.map +1 -1
  286. package/esm/sticky/sticky.js +6 -3
  287. package/esm/sticky/sticky.type.d.ts +2 -2
  288. package/esm/sticky/sticky.type.d.ts.map +1 -1
  289. package/esm/table/table.d.ts.map +1 -1
  290. package/esm/table/table.js +190 -44
  291. package/esm/table/table.type.d.ts +19 -3
  292. package/esm/table/table.type.d.ts.map +1 -1
  293. package/esm/table/tbody.d.ts +1 -1
  294. package/esm/table/tbody.d.ts.map +1 -1
  295. package/esm/table/tbody.js +18 -8
  296. package/esm/table/tbody.type.d.ts +2 -1
  297. package/esm/table/tbody.type.d.ts.map +1 -1
  298. package/esm/table/td.d.ts +3 -3
  299. package/esm/table/td.d.ts.map +1 -1
  300. package/esm/table/td.js +22 -18
  301. package/esm/table/thead-filter.d.ts.map +1 -1
  302. package/esm/table/thead-filter.js +20 -19
  303. package/esm/table/thead.d.ts.map +1 -1
  304. package/esm/table/thead.js +5 -1
  305. package/esm/table/tr.d.ts +2 -1
  306. package/esm/table/tr.d.ts.map +1 -1
  307. package/esm/table/tr.js +17 -12
  308. package/esm/tabs/tabs-panel.js +4 -3
  309. package/esm/tabs/tabs.d.ts.map +1 -1
  310. package/esm/tabs/tabs.js +10 -1
  311. package/esm/tabs/tabs.type.d.ts +6 -0
  312. package/esm/tabs/tabs.type.d.ts.map +1 -1
  313. package/esm/tag/tag.d.ts.map +1 -1
  314. package/esm/tag/tag.js +3 -1
  315. package/esm/tag/tag.type.d.ts +6 -0
  316. package/esm/tag/tag.type.d.ts.map +1 -1
  317. package/esm/tooltip/tooltip.d.ts.map +1 -1
  318. package/esm/tooltip/tooltip.js +21 -1
  319. package/esm/transfer/transfer-list.type.d.ts +1 -1
  320. package/esm/transfer/transfer-list.type.d.ts.map +1 -1
  321. package/esm/transfer/transfer.d.ts.map +1 -1
  322. package/esm/transfer/transfer.js +16 -2
  323. package/esm/transfer/transfer.type.d.ts +1 -1
  324. package/esm/transfer/transfer.type.d.ts.map +1 -1
  325. package/esm/tree/tree-checkbox.d.ts.map +1 -1
  326. package/esm/tree/tree-checkbox.js +4 -2
  327. package/esm/tree/tree-checkbox.type.d.ts +1 -0
  328. package/esm/tree/tree-checkbox.type.d.ts.map +1 -1
  329. package/esm/tree/tree-content.d.ts.map +1 -1
  330. package/esm/tree/tree-content.js +38 -5
  331. package/esm/tree/tree-content.type.d.ts +1 -2
  332. package/esm/tree/tree-content.type.d.ts.map +1 -1
  333. package/esm/tree/tree-context.d.ts +3 -3
  334. package/esm/tree/tree-context.d.ts.map +1 -1
  335. package/esm/tree/tree-context.type.d.ts +2 -1
  336. package/esm/tree/tree-context.type.d.ts.map +1 -1
  337. package/esm/tree/tree-list.type.d.ts +1 -2
  338. package/esm/tree/tree-list.type.d.ts.map +1 -1
  339. package/esm/tree/tree-node.type.d.ts +2 -4
  340. package/esm/tree/tree-node.type.d.ts.map +1 -1
  341. package/esm/tree/tree-root.type.d.ts +1 -2
  342. package/esm/tree/tree-root.type.d.ts.map +1 -1
  343. package/esm/tree/tree-virtual-node.d.ts.map +1 -1
  344. package/esm/tree/tree-virtual-node.js +21 -5
  345. package/esm/tree/tree-virtual.d.ts.map +1 -1
  346. package/esm/tree/tree-virtual.js +11 -4
  347. package/esm/tree/tree.d.ts.map +1 -1
  348. package/esm/tree/tree.js +11 -14
  349. package/esm/tree/tree.type.d.ts +26 -7
  350. package/esm/tree/tree.type.d.ts.map +1 -1
  351. package/esm/tree-select/tree-select.d.ts.map +1 -1
  352. package/esm/tree-select/tree-select.js +63 -40
  353. package/esm/tree-select/tree-select.type.d.ts +36 -2
  354. package/esm/tree-select/tree-select.type.d.ts.map +1 -1
  355. package/esm/upload/drop.d.ts +1 -0
  356. package/esm/upload/drop.d.ts.map +1 -1
  357. package/esm/upload/drop.js +43 -12
  358. package/esm/upload/upload.d.ts.map +1 -1
  359. package/esm/upload/upload.js +3 -1
  360. package/esm/upload/upload.type.d.ts +6 -0
  361. package/esm/upload/upload.type.d.ts.map +1 -1
  362. package/esm/virtual-scroll/scroll-table.d.ts +7 -4
  363. package/esm/virtual-scroll/scroll-table.d.ts.map +1 -1
  364. package/esm/virtual-scroll/scroll-table.js +60 -30
  365. package/package.json +2 -2
@@ -0,0 +1,125 @@
1
+ /// <reference types="react" />
2
+ import { CommonType } from '../common/type';
3
+ export interface SkeletonClasses {
4
+ rootClass: string;
5
+ wrapper: string;
6
+ content: string;
7
+ animation: string;
8
+ text: string;
9
+ textItem: string;
10
+ button: string;
11
+ buttonItem: string;
12
+ buttonLeft: string;
13
+ buttonRight: string;
14
+ buttonSmall: string;
15
+ buttonLarge: string;
16
+ image: string;
17
+ imageLeft: string;
18
+ imageRight: string;
19
+ imageCircle: string;
20
+ imageSquare: string;
21
+ imageSmall: string;
22
+ imageLarge: string;
23
+ }
24
+ export interface SkeletonTextProps {
25
+ /**
26
+ * 文本行数
27
+ */
28
+ rows?: number;
29
+ /**
30
+ * 文本宽度
31
+ */
32
+ width?: string | number | Array<string | number>;
33
+ /**
34
+ * 文本高度
35
+ */
36
+ height?: number | Array<number>;
37
+ /**
38
+ * 自定义className
39
+ */
40
+ className?: string;
41
+ /**
42
+ * 自定义style
43
+ */
44
+ style?: React.CSSProperties;
45
+ }
46
+ export interface SkeletonImageProps {
47
+ /**
48
+ * 图片位置
49
+ */
50
+ position?: 'left' | 'right';
51
+ /**
52
+ * 图片形状
53
+ */
54
+ shape?: 'circle' | 'square';
55
+ /**
56
+ * 图片大小,小尺寸-40px,默认-64px, 大尺寸-80px
57
+ */
58
+ size?: 'small' | 'default' | 'large';
59
+ /**
60
+ * 自定义className
61
+ */
62
+ className?: string;
63
+ /**
64
+ * 自定义style
65
+ */
66
+ style?: React.CSSProperties;
67
+ }
68
+ export interface SkeletonButtonProps {
69
+ /**
70
+ * 按钮位置
71
+ */
72
+ position?: 'left' | 'right';
73
+ /**
74
+ * 按钮数量
75
+ */
76
+ count?: number;
77
+ /**
78
+ * 按钮尺寸
79
+ */
80
+ size?: 'small' | 'default' | 'large';
81
+ /**
82
+ * 自定义className
83
+ */
84
+ className?: string;
85
+ /**
86
+ * 自定义style
87
+ */
88
+ style?: React.CSSProperties;
89
+ }
90
+ export interface SkeletonProps extends Pick<CommonType, 'className' | 'style'> {
91
+ jssStyle?: {
92
+ skeleton: () => SkeletonClasses;
93
+ };
94
+ /**
95
+ * @en Whether to enable animation effects
96
+ * @cn 是否开启动画效果
97
+ */
98
+ animation?: boolean;
99
+ /**
100
+ * @en Whether to load, when true, show the skeleton screen
101
+ * @cn 是否加载中,为true时,显示骨架屏
102
+ */
103
+ loading?: boolean;
104
+ /**
105
+ * @en Real content
106
+ * @cn 真实内容
107
+ */
108
+ children?: React.ReactNode;
109
+ /**
110
+ * @en Whether to show text
111
+ * @cn 是否显示文本或段落
112
+ */
113
+ text?: SkeletonTextProps | boolean;
114
+ /**
115
+ * @en Whether to show image
116
+ * @cn 是否显示图片
117
+ */
118
+ image?: SkeletonImageProps | boolean;
119
+ /**
120
+ * @en Whether to show button
121
+ * @cn 是否显示按钮
122
+ */
123
+ button?: SkeletonButtonProps | boolean;
124
+ }
125
+ //# sourceMappingURL=skeleton.type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skeleton.type.d.ts","sourceRoot":"","sources":["skeleton.type.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAElB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IAEjB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IAEpB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IACjD;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;IAChC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B;;OAEG;IACH,KAAK,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC5B;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC;IACrC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC;IACrC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,UAAU,EAAE,WAAW,GAAG,OAAO,CAAC;IAC5E,QAAQ,CAAC,EAAE;QACT,QAAQ,EAAE,MAAM,eAAe,CAAC;KACjC,CAAC;IAEF;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;OAGG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B;;;OAGG;IACH,IAAI,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC;IAEnC;;;OAGG;IACH,KAAK,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC;IAErC;;;OAGG;IACH,MAAM,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC;CACxC"}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import { SkeletonClasses, SkeletonTextProps } from './skeleton.type';
3
+ interface TextProps extends SkeletonTextProps {
4
+ classes: SkeletonClasses;
5
+ }
6
+ export default function Text({ classes, className, rows, width, height, style }: TextProps): JSX.Element;
7
+ export {};
8
+ //# sourceMappingURL=text.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text.d.ts","sourceRoot":"","sources":["text.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAGrE,UAAU,SAAU,SAAQ,iBAAiB;IAC3C,OAAO,EAAE,eAAe,CAAC;CAC1B;AAED,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,IAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,SAAS,GAAG,GAAG,CAAC,OAAO,CA8B3G"}
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = Text;
7
+ var _classnames = _interopRequireDefault(require("classnames"));
8
+ var _hooks = require("@sheinx/hooks");
9
+ var _jsxRuntime = require("react/jsx-runtime");
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+ function Text(_ref) {
12
+ var classes = _ref.classes,
13
+ className = _ref.className,
14
+ _ref$rows = _ref.rows,
15
+ rows = _ref$rows === void 0 ? 3 : _ref$rows,
16
+ width = _ref.width,
17
+ height = _ref.height,
18
+ style = _ref.style;
19
+ var cls = (0, _classnames.default)(classes.text, className);
20
+ var nodes = [];
21
+ function getTextWidth(index) {
22
+ if (_hooks.util.isArray(width)) {
23
+ return width[index];
24
+ }
25
+ if (rows - 1 === index) {
26
+ return width;
27
+ }
28
+ return undefined;
29
+ }
30
+ function getTextHeight(index) {
31
+ if (_hooks.util.isArray(height)) {
32
+ return height[index];
33
+ }
34
+ if (rows - 1 === index) {
35
+ return height;
36
+ }
37
+ return undefined;
38
+ }
39
+ for (var i = 0; i < rows; i++) {
40
+ nodes.push( /*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
41
+ className: classes.textItem,
42
+ style: {
43
+ width: getTextWidth(i),
44
+ height: getTextHeight(i)
45
+ }
46
+ }, i));
47
+ }
48
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("ul", {
49
+ className: cls,
50
+ style: style,
51
+ children: nodes
52
+ });
53
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"sticky.d.ts","sourceRoot":"","sources":["sticky.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAI5C,eAAO,MAAM,aAAa,MAAM,CAAC;AAmBjC,QAAA,MAAM,MAAM,UAAW,WAAW,4CAoYjC,CAAC;AAEF,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"sticky.d.ts","sourceRoot":"","sources":["sticky.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAI5C,eAAO,MAAM,aAAa,MAAM,CAAC;AAmBjC,QAAA,MAAM,MAAM,UAAW,WAAW,4CAqYjC,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -414,12 +414,15 @@ var Sticky = function Sticky(props) {
414
414
  pointerEvents: 'none'
415
415
  };
416
416
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
417
- children: [isFixed ? StickyEl : context.target && context.div && /*#__PURE__*/(0, _reactDom.createPortal)(StickyEl, context.div), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
417
+ children: [isFixed ? StickyEl : context.target && context.div && /*#__PURE__*/(0, _reactDom.createPortal)(StickyEl, context.div), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", _objectSpread(_objectSpread({
418
418
  className: props.className,
419
419
  style: _objectSpread(_objectSpread({}, props.style), show && parentVisible ? hideStyle : {}),
420
- ref: handleElementRef,
420
+ ref: handleElementRef
421
+ }, _hooks.util.getDataAttribute({
422
+ sticky: show && parentVisible ? 'true' : 'false'
423
+ })), {}, {
421
424
  children: children
422
- })]
425
+ }))]
423
426
  });
424
427
  };
425
428
  var _default = exports.default = Sticky;
@@ -21,12 +21,12 @@ export interface StickyProps extends Pick<CommonType, 'className' | 'style'> {
21
21
  /**
22
22
  * @deprecated use scrollContainer
23
23
  */
24
- target?: string | HTMLElement | null;
24
+ target?: string | Element | null;
25
25
  /**
26
26
  * @en Custom attachment target. You can pass in HTMLElement or css selector. The target must be an ancestor node of the Sticky component
27
27
  * @cn 自定义附着的目标。可以传入 HTMLElement 或者 css selector,target 必须为 Sticky 组件的祖先节点
28
28
  */
29
- scrollContainer?: string | HTMLElement | null;
29
+ scrollContainer?: string | HTMLElement | Element | null;
30
30
  /**
31
31
  * @cn sticky 父级元素, 当父元素离开视窗时,sticky 将失效
32
32
  * @en sticky parent, when the parent element leaves the viewport, the sticky will be invalid
@@ -1 +1 @@
1
- {"version":3,"file":"sticky.type.d.ts","sourceRoot":"","sources":["sticky.type.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,UAAU,EAAE,WAAW,GAAG,OAAO,CAAC;IAC1E,QAAQ,CAAC,EAAE;QACT,MAAM,EAAE,MAAM,aAAa,CAAC;KAC7B,CAAC;IAEF;;;OAGG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CAAC;IAErC;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CAAC;IAE9C;;;OAGG;IACH,MAAM,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAC5B;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;;;OAIG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC;IACd;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAEvC;;;OAGG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B"}
1
+ {"version":3,"file":"sticky.type.d.ts","sourceRoot":"","sources":["sticky.type.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,UAAU,EAAE,WAAW,GAAG,OAAO,CAAC;IAC1E,QAAQ,CAAC,EAAE;QACT,MAAM,EAAE,MAAM,aAAa,CAAC;KAC7B,CAAC;IAEF;;;OAGG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;IAEjC;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,OAAO,GAAG,IAAI,CAAC;IAExD;;;OAGG;IACH,MAAM,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAC5B;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;;;OAIG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC;IACd;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAEvC;;;OAGG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B"}
@@ -1 +1 @@
1
- {"version":3,"file":"table.d.ts","sourceRoot":"","sources":["table.tsx"],"names":[],"mappings":"AAyBA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;;AAe1C,wBAqhBE"}
1
+ {"version":3,"file":"table.d.ts","sourceRoot":"","sources":["table.tsx"],"names":[],"mappings":"AAyBA,OAAO,EAAgB,UAAU,EAAE,MAAM,cAAc,CAAC;;AAexD,wBAkqBE"}
@@ -33,13 +33,19 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
33
33
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
34
34
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
35
35
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
36
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
37
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
38
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
39
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
40
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
41
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
36
42
  var devUseWarning = _hooks.util.devUseWarning;
37
43
  var emptyArr = [];
38
44
  var emptyRef = {
39
45
  current: null
40
46
  };
41
47
  var _default = exports.default = function _default(props) {
42
- var _props$jssStyle, _props$jssStyle$table, _props$data, _columns$find;
48
+ var _props$jssStyle, _props$jssStyle$table, _columns$find;
43
49
  var _props$verticalAlign = props.verticalAlign,
44
50
  verticalAlign = _props$verticalAlign === void 0 ? 'top' : _props$verticalAlign,
45
51
  _props$size = props.size,
@@ -51,10 +57,20 @@ var _default = exports.default = function _default(props) {
51
57
  var tableClasses = props === null || props === void 0 || (_props$jssStyle = props.jssStyle) === null || _props$jssStyle === void 0 || (_props$jssStyle$table = _props$jssStyle.table) === null || _props$jssStyle$table === void 0 ? void 0 : _props$jssStyle$table.call(_props$jssStyle);
52
58
  var tbodyRef = (0, _react.useRef)(null);
53
59
  var theadRef = (0, _react.useRef)(null);
60
+ var theadIdRef = (0, _react.useRef)("thead-container-".concat(_hooks.util.generateUUID()));
54
61
  var tfootRef = (0, _react.useRef)(null);
55
62
  var scrollRef = (0, _react.useRef)(null);
56
- var mirrorScrollRef = (0, _react.useRef)(null);
63
+ var headMirrorScrollRef = (0, _react.useRef)(null);
64
+ var bottomMirrorScrollRef = (0, _react.useRef)(null);
57
65
  var tableRef = (0, _react.useRef)(null);
66
+ var _useState = (0, _react.useState)(false),
67
+ _useState2 = _slicedToArray(_useState, 2),
68
+ scrolling = _useState2[0],
69
+ setScrolling = _useState2[1];
70
+ var _useState3 = (0, _react.useState)(false),
71
+ _useState4 = _slicedToArray(_useState3, 2),
72
+ fakeVirtual = _useState4[0],
73
+ setFakeVirtual = _useState4[1];
58
74
  var browserScrollbarWidth = (0, _hooks.useScrollbarWidth)();
59
75
  if (props.fixed) {
60
76
  devUseWarning.deprecated('fixed', 'virtual', 'Table');
@@ -77,10 +93,11 @@ var _default = exports.default = function _default(props) {
77
93
  };
78
94
  var _useRef = (0, _react.useRef)({
79
95
  emptyHeight: 0,
80
- theadAndTfootHeight: 0
96
+ theadAndTfootHeight: 0,
97
+ scrollingTimer: null
81
98
  }),
82
99
  context = _useRef.current;
83
- var virtual = ((_props$data = props.data) === null || _props$data === void 0 ? void 0 : _props$data.length) && props.rowsInView !== 0 && (!!props.virtual || props.fixed === 'both' || props.fixed === 'y' || props.fixed === 'auto');
100
+ var virtual = !fakeVirtual && props.rowsInView !== 0 && (!!props.virtual || props.fixed === 'both' || props.fixed === 'y' || props.fixed === 'auto');
84
101
 
85
102
  // 虚拟列表高度另外计算
86
103
  var _useResize = (0, _hooks.useResize)({
@@ -211,7 +228,13 @@ var _default = exports.default = function _default(props) {
211
228
  });
212
229
  (0, _react.useEffect)(function () {
213
230
  var _theadRef$current, _tfootRef$current;
214
- context.theadAndTfootHeight = ((theadRef === null || theadRef === void 0 || (_theadRef$current = theadRef.current) === null || _theadRef$current === void 0 ? void 0 : _theadRef$current.clientHeight) || 0) + (((_tfootRef$current = tfootRef.current) === null || _tfootRef$current === void 0 ? void 0 : _tfootRef$current.clientHeight) || 0);
231
+ var theadHeight = (theadRef === null || theadRef === void 0 || (_theadRef$current = theadRef.current) === null || _theadRef$current === void 0 ? void 0 : _theadRef$current.clientHeight) || 0;
232
+ var tfootHeight = ((_tfootRef$current = tfootRef.current) === null || _tfootRef$current === void 0 ? void 0 : _tfootRef$current.clientHeight) || 0;
233
+ if (props.sticky) {
234
+ context.theadAndTfootHeight = tfootHeight;
235
+ } else {
236
+ context.theadAndTfootHeight = theadHeight + tfootHeight;
237
+ }
215
238
  }, [theadRef.current, tfootRef.current]);
216
239
  var virtualInfo = (0, _hooks.useTableVirtual)({
217
240
  disabled: !virtual,
@@ -226,14 +249,27 @@ var _default = exports.default = function _default(props) {
226
249
  isRtl: isRtl,
227
250
  theadAndTfootHeight: context.theadAndTfootHeight
228
251
  });
252
+ var syncHeaderScroll = (0, _hooks.usePersistFn)(function (left) {
253
+ var _tableRef$current;
254
+ if (props.hideHeader || !props.sticky) return;
255
+
256
+ // why use querySelectorAll: thead经历了Sticky组件的渲染再回来时,theadRef就丢失了
257
+ var theads = tableRef === null || tableRef === void 0 || (_tableRef$current = tableRef.current) === null || _tableRef$current === void 0 ? void 0 : _tableRef$current.querySelectorAll("[data-soui-role=".concat(theadIdRef.current, "]"));
258
+ theads === null || theads === void 0 || theads.forEach(function (item) {
259
+ item.scrollLeft = left;
260
+ });
261
+ });
229
262
 
230
263
  // 简单表格的滚动事件
231
264
  var handleBodyScroll = (0, _hooks.usePersistFn)(function (e) {
232
265
  var target = e.currentTarget;
233
266
  if (!target) return;
234
267
  layoutFunc.checkFloat();
235
- if (mirrorScrollRef.current) {
236
- mirrorScrollRef.current.scrollLeft = target.scrollLeft;
268
+ if (headMirrorScrollRef.current) {
269
+ headMirrorScrollRef.current.scrollLeft = target.scrollLeft;
270
+ }
271
+ if (bottomMirrorScrollRef.current) {
272
+ bottomMirrorScrollRef.current.scrollLeft = target.scrollLeft;
237
273
  }
238
274
  if (props.onScroll && typeof props.onScroll === 'function') {
239
275
  var maxWidth = target.scrollWidth - target.clientWidth;
@@ -242,22 +278,34 @@ var _default = exports.default = function _default(props) {
242
278
  var y = Math.min(target.scrollTop / maxHeight, 1);
243
279
  props.onScroll(x, y, target.scrollLeft, target.scrollTop);
244
280
  }
281
+ syncHeaderScroll(target.scrollLeft);
245
282
  });
246
283
 
247
284
  // 虚拟表格的滚动事件
248
285
  var handleVirtualScroll = (0, _hooks.usePersistFn)(function (info) {
249
286
  virtualInfo.handleScroll(info);
250
287
  layoutFunc.checkFloat();
251
- if (mirrorScrollRef.current) {
252
- mirrorScrollRef.current.scrollLeft = info.scrollLeft;
288
+ if (headMirrorScrollRef.current) {
289
+ headMirrorScrollRef.current.scrollLeft = info.scrollLeft;
290
+ }
291
+ if (bottomMirrorScrollRef.current) {
292
+ bottomMirrorScrollRef.current.scrollLeft = info.scrollLeft;
253
293
  }
254
294
  if (props.onScroll && typeof props.onScroll === 'function') {
255
295
  props.onScroll(info.x, info.y, info.scrollLeft, info.scrollTop);
256
296
  }
297
+ syncHeaderScroll(info.scrollLeft);
298
+ if (context.scrollingTimer) {
299
+ clearTimeout(context.scrollingTimer);
300
+ }
301
+ setScrolling(true);
302
+ context.scrollingTimer = setTimeout(function () {
303
+ setScrolling(false);
304
+ }, 100);
257
305
  });
258
306
  var renderEmpty = function renderEmpty() {
259
- var _props$data2;
260
- if (!((_props$data2 = props.data) !== null && _props$data2 !== void 0 && _props$data2.length) || filteredData !== undefined && filteredData.length === 0) {
307
+ var _props$data;
308
+ if (!((_props$data = props.data) !== null && _props$data !== void 0 && _props$data.length) || filteredData !== undefined && filteredData.length === 0) {
261
309
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
262
310
  className: (0, _classnames.default)(tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.emptyWrapper, isScrollX && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.emptyNoBorder)),
263
311
  ref: function ref(el) {
@@ -270,14 +318,16 @@ var _default = exports.default = function _default(props) {
270
318
  }
271
319
  return null;
272
320
  };
321
+ var $empty = renderEmpty();
273
322
  var renderTable = function renderTable() {
274
- var _props$summary, _sticky$top, _props$data3;
323
+ var _props$summary, _sticky$top, _props$data2;
275
324
  var Group = /*#__PURE__*/(0, _jsxRuntime.jsx)(_colgroup.default, {
276
325
  colgroup: colgroup,
277
326
  columns: columns,
278
327
  shouldLastColAuto: !!shouldLastColAuto
279
328
  });
280
329
  var bodyCommonProps = {
330
+ virtual: props.virtual,
281
331
  hover: props.hover,
282
332
  disabled: props.disabled,
283
333
  rowClickAttr: props.rowClickAttr,
@@ -346,16 +396,22 @@ var _default = exports.default = function _default(props) {
346
396
  target: sticky === null || sticky === void 0 ? void 0 : sticky.target,
347
397
  top: (_sticky$top = sticky === null || sticky === void 0 ? void 0 : sticky.top) !== null && _sticky$top !== void 0 ? _sticky$top : 0,
348
398
  css: sticky === null || sticky === void 0 ? void 0 : sticky.css,
349
- parent: tableRef === null || tableRef === void 0 ? void 0 : tableRef.current
399
+ parent: tableRef === null || tableRef === void 0 ? void 0 : tableRef.current,
400
+ onChange: function onChange(isSticky) {
401
+ if (isSticky) {
402
+ var _scrollRef$current;
403
+ syncHeaderScroll(((_scrollRef$current = scrollRef.current) === null || _scrollRef$current === void 0 ? void 0 : _scrollRef$current.scrollLeft) || 0);
404
+ }
405
+ }
350
406
  };
351
- var isRenderVirtualTable = virtual || props.sticky || !((_props$data3 = props.data) !== null && _props$data3 !== void 0 && _props$data3.length);
352
- var headWrapperClass = (0, _classnames.default)(tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.headWrapper);
407
+ var isRenderVirtualTable = virtual || props.sticky || !((_props$data2 = props.data) !== null && _props$data2 !== void 0 && _props$data2.length);
408
+ var headWrapperClass = (0, _classnames.default)(tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.headWrapper, !!$empty && tableClasses.emptyHeader, props.sticky && isScrollY && tableClasses.scrollY, props.sticky && !isScrollY && tableClasses.scrollX);
353
409
  var footWrapperClass = (0, _classnames.default)(tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.footWrapper);
354
410
  var renderHeadMirrorScroller = function renderHeadMirrorScroller() {
355
- var _scrollRef$current, _scrollRef$current2, _scrollRef$current3;
411
+ var _scrollRef$current2, _scrollRef$current3, _scrollRef$current4;
356
412
  if (!props.showTopScrollbar) return null;
357
- var scrollRefWidth = (scrollRef === null || scrollRef === void 0 || (_scrollRef$current = scrollRef.current) === null || _scrollRef$current === void 0 ? void 0 : _scrollRef$current.clientWidth) || 0;
358
- var scrollRefScrollWidth = (scrollRef === null || scrollRef === void 0 || (_scrollRef$current2 = scrollRef.current) === null || _scrollRef$current2 === void 0 ? void 0 : _scrollRef$current2.scrollWidth) || 0;
413
+ var scrollRefWidth = (scrollRef === null || scrollRef === void 0 || (_scrollRef$current2 = scrollRef.current) === null || _scrollRef$current2 === void 0 ? void 0 : _scrollRef$current2.clientWidth) || 0;
414
+ var scrollRefScrollWidth = (scrollRef === null || scrollRef === void 0 || (_scrollRef$current3 = scrollRef.current) === null || _scrollRef$current3 === void 0 ? void 0 : _scrollRef$current3.scrollWidth) || 0;
359
415
  var mirrorScrollRefWidth = scrollRefWidth + scrollBarWidth;
360
416
  var showScroll = scrollRefScrollWidth > scrollRefWidth;
361
417
  // 开启了双滚,但是没有滚动条,不显示
@@ -366,7 +422,7 @@ var _default = exports.default = function _default(props) {
366
422
  });
367
423
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(StickyWrapper, _objectSpread(_objectSpread({}, props.sticky ? scrollerStickyProps : {}), {}, {
368
424
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
369
- className: tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.headMirrorScroller,
425
+ className: tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.mirrorScroller,
370
426
  style: {
371
427
  height: browserScrollbarWidth,
372
428
  width: mirrorScrollRefWidth
@@ -377,48 +433,102 @@ var _default = exports.default = function _default(props) {
377
433
  scrollRef.current.scrollLeft = target.scrollLeft;
378
434
  }
379
435
  },
380
- ref: mirrorScrollRef,
436
+ ref: headMirrorScrollRef,
381
437
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
382
438
  style: {
383
- width: scrollRef === null || scrollRef === void 0 || (_scrollRef$current3 = scrollRef.current) === null || _scrollRef$current3 === void 0 ? void 0 : _scrollRef$current3.scrollWidth,
439
+ width: scrollRef === null || scrollRef === void 0 || (_scrollRef$current4 = scrollRef.current) === null || _scrollRef$current4 === void 0 ? void 0 : _scrollRef$current4.scrollWidth,
384
440
  height: 1
385
441
  }
386
442
  })
387
443
  })
388
444
  }));
389
445
  };
446
+ var renderBottomMirrorScroller = function renderBottomMirrorScroller() {
447
+ var _scrollRef$current5, _scrollRef$current6, _scrollRef$current7;
448
+ if (!props.showBottomScrollbar) return null;
449
+ var scrollRefWidth = (scrollRef === null || scrollRef === void 0 || (_scrollRef$current5 = scrollRef.current) === null || _scrollRef$current5 === void 0 ? void 0 : _scrollRef$current5.clientWidth) || 0;
450
+ var scrollRefScrollWidth = (scrollRef === null || scrollRef === void 0 || (_scrollRef$current6 = scrollRef.current) === null || _scrollRef$current6 === void 0 ? void 0 : _scrollRef$current6.scrollWidth) || 0;
451
+ var mirrorScrollRefWidth = scrollRefWidth + scrollBarWidth;
452
+ var showScroll = scrollRefScrollWidth > scrollRefWidth;
453
+ // 开启了双滚,但是没有滚动条,不显示
454
+ if (!scrollRefWidth || !mirrorScrollRefWidth || !showScroll) return null;
455
+ var options = props.showBottomScrollbar === true ? {} : props.showBottomScrollbar;
456
+ var scrollerStickyProps = {
457
+ bottom: options.bottom || 0,
458
+ zIndex: options.zIndex || _sticky.defaultZIndex + 1,
459
+ parent: tableRef === null || tableRef === void 0 ? void 0 : tableRef.current
460
+ };
461
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_sticky.default, _objectSpread(_objectSpread({}, scrollerStickyProps), {}, {
462
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
463
+ className: tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.mirrorScroller,
464
+ style: {
465
+ height: browserScrollbarWidth,
466
+ width: mirrorScrollRefWidth,
467
+ marginTop: -browserScrollbarWidth
468
+ },
469
+ onScroll: function onScroll(e) {
470
+ var target = e.currentTarget;
471
+ if (scrollRef !== null && scrollRef !== void 0 && scrollRef.current && scrollRef.current.scrollLeft !== target.scrollLeft) {
472
+ scrollRef.current.scrollLeft = target.scrollLeft;
473
+ }
474
+ },
475
+ ref: bottomMirrorScrollRef,
476
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
477
+ style: {
478
+ width: scrollRef === null || scrollRef === void 0 || (_scrollRef$current7 = scrollRef.current) === null || _scrollRef$current7 === void 0 ? void 0 : _scrollRef$current7.scrollWidth,
479
+ height: 1
480
+ }
481
+ })
482
+ })
483
+ }));
484
+ };
485
+ var $headTable = /*#__PURE__*/(0, _jsxRuntime.jsx)("div", _objectSpread(_objectSpread({
486
+ className: headWrapperClass
487
+ }, _hooks.util.getDataAttribute({
488
+ role: theadIdRef.current
489
+ })), {}, {
490
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("table", {
491
+ style: {
492
+ width: width
493
+ },
494
+ ref: theadRef,
495
+ children: [Group, /*#__PURE__*/(0, _jsxRuntime.jsx)(_thead.default, _objectSpread({}, headCommonProps))]
496
+ })
497
+ }));
390
498
  if (isRenderVirtualTable) {
391
- var _props$data4, _props$data5;
499
+ var _props$data3;
500
+ var showStickyHeader = !props.hideHeader && props.sticky;
392
501
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
393
- children: [renderHeadMirrorScroller(), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_scrollTable.default, {
502
+ children: [renderHeadMirrorScroller(), showStickyHeader && /*#__PURE__*/(0, _jsxRuntime.jsx)(StickyWrapper, _objectSpread(_objectSpread({}, stickyProps), {}, {
503
+ children: $headTable
504
+ })), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_scrollTable.default, {
505
+ style: {
506
+ display: 'flex',
507
+ minWidth: 0,
508
+ minHeight: 0,
509
+ flex: 1
510
+ },
394
511
  wrapperRef: scrollRef,
395
512
  scrollWidth: width || 1,
396
513
  scrollHeight: virtual ? virtualInfo.scrollHeight : tbodyHeight,
397
514
  onScroll: handleVirtualScroll,
398
515
  defaultHeight: context.emptyHeight,
399
516
  isScrollY: isScrollY,
400
- isEmptyContent: !((_props$data4 = props.data) !== null && _props$data4 !== void 0 && _props$data4.length),
401
- children: [!props.hideHeader && /*#__PURE__*/(0, _jsxRuntime.jsx)(StickyWrapper, _objectSpread(_objectSpread({}, props.sticky ? stickyProps : {}), {}, {
402
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
403
- className: headWrapperClass,
404
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("table", {
405
- style: {
406
- width: width
407
- },
408
- ref: theadRef,
409
- children: [Group, /*#__PURE__*/(0, _jsxRuntime.jsx)(_thead.default, _objectSpread({}, headCommonProps))]
410
- })
411
- })
412
- })), !!((_props$data5 = props.data) !== null && _props$data5 !== void 0 && _props$data5.length) && /*#__PURE__*/(0, _jsxRuntime.jsxs)("table", {
517
+ isScrollX: isScrollX,
518
+ isEmpty: !!$empty,
519
+ tableRef: tableRef,
520
+ setFakeVirtual: setFakeVirtual,
521
+ children: [!props.hideHeader && !props.sticky && $headTable, !!((_props$data3 = props.data) !== null && _props$data3 !== void 0 && _props$data3.length) && /*#__PURE__*/(0, _jsxRuntime.jsxs)("table", {
413
522
  style: {
414
523
  width: width,
415
- transform: virtualInfo.getTranslate()
524
+ transform: virtualInfo.translateStyle
416
525
  },
417
526
  ref: tbodyRef,
418
527
  children: [Group, /*#__PURE__*/(0, _jsxRuntime.jsx)(_tbody.default, _objectSpread(_objectSpread({}, bodyCommonProps), {}, {
419
528
  currentIndex: virtualInfo.startIndex,
420
529
  data: virtualInfo.data,
421
- setRowHeight: virtualInfo.setRowHeight
530
+ setRowHeight: virtualInfo.setRowHeight,
531
+ scrolling: scrolling
422
532
  }))]
423
533
  }), showFoot ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
424
534
  className: footWrapperClass,
@@ -429,8 +539,8 @@ var _default = exports.default = function _default(props) {
429
539
  ref: tfootRef,
430
540
  children: [Group, /*#__PURE__*/(0, _jsxRuntime.jsx)(_tfoot.default, _objectSpread({}, footCommonProps))]
431
541
  })
432
- }) : null, renderEmpty()]
433
- })]
542
+ }) : null, $empty]
543
+ }), renderBottomMirrorScroller()]
434
544
  });
435
545
  }
436
546
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
@@ -445,9 +555,9 @@ var _default = exports.default = function _default(props) {
445
555
  ref: tbodyRef,
446
556
  children: [Group, !props.hideHeader && /*#__PURE__*/(0, _jsxRuntime.jsx)(_thead.default, _objectSpread({}, headCommonProps)), bodyCommonProps.data.length === 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_tbodyEmpty.default, {
447
557
  children: renderEmpty()
448
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_tbody.default, _objectSpread({}, bodyCommonProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_tfoot.default, _objectSpread({}, footCommonProps))]
558
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_tbody.default, _objectSpread({}, bodyCommonProps)), showFoot && /*#__PURE__*/(0, _jsxRuntime.jsx)(_tfoot.default, _objectSpread({}, footCommonProps))]
449
559
  })
450
- })]
560
+ }), renderBottomMirrorScroller()]
451
561
  });
452
562
  };
453
563
  var renderLoading = function renderLoading() {
@@ -467,6 +577,42 @@ var _default = exports.default = function _default(props) {
467
577
  align: "right"
468
578
  }, pagination), paginationInfo));
469
579
  };
580
+
581
+ // handle head and foot scroll
582
+ var handleHeaderWheel = (0, _hooks.usePersistFn)(function (e) {
583
+ var _theadRef$current2;
584
+ var scrollEl = scrollRef.current;
585
+ if (!scrollEl) return;
586
+ if (!(theadRef !== null && theadRef !== void 0 && (_theadRef$current2 = theadRef.current) !== null && _theadRef$current2 !== void 0 && _theadRef$current2.parentElement)) return;
587
+ var max = scrollEl.scrollWidth - scrollEl.clientWidth;
588
+ var scrollLeft = scrollEl.scrollLeft + e.deltaX;
589
+ if (scrollLeft === scrollEl.scrollLeft) {
590
+ return;
591
+ }
592
+ e.preventDefault();
593
+ var left = Math.min(Math.max(scrollLeft, 0), max);
594
+ scrollEl.scrollLeft = left;
595
+ theadRef.current.parentElement.scrollLeft = left;
596
+ });
597
+ (0, _react.useEffect)(function () {
598
+ var _scrollRef$current8;
599
+ if (!props.sticky || !scrollRef.current || !isScrollX) return;
600
+ // sticky场景下,从空数据到有数据切换时,同步一次滚动条的位置
601
+ syncHeaderScroll(((_scrollRef$current8 = scrollRef.current) === null || _scrollRef$current8 === void 0 ? void 0 : _scrollRef$current8.scrollLeft) || 0);
602
+ }, [isScrollX, props.sticky, $empty]);
603
+ (0, _react.useEffect)(function () {
604
+ // 绑定 wheel 事件
605
+ if (props.sticky && theadRef.current && theadRef.current.parentElement) {
606
+ theadRef.current.parentElement.addEventListener('wheel', handleHeaderWheel, {
607
+ passive: false
608
+ });
609
+ }
610
+ return function () {
611
+ if (props.sticky && theadRef.current && theadRef.current.parentElement) {
612
+ theadRef.current.parentElement.removeEventListener('wheel', handleHeaderWheel);
613
+ }
614
+ };
615
+ }, [theadRef.current, props.sticky, isScrollY]);
470
616
  var getRenderIndexByData = function getRenderIndexByData(data) {
471
617
  var originKey = typeof data === 'string' ? data : _hooks.util.getKey(props.keygen, data);
472
618
  var index = treeData.findIndex(function (item) {
@@ -502,7 +648,7 @@ var _default = exports.default = function _default(props) {
502
648
  });
503
649
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
504
650
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", _objectSpread(_objectSpread({
505
- className: (0, _classnames.default)(tableWrapperClass, floatLeft && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.floatLeft), floatRight && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.floatRight), props.sticky && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.sticky)),
651
+ className: (0, _classnames.default)(tableWrapperClass, _defineProperty(_defineProperty(_defineProperty({}, tableClasses.sticky, props.sticky), tableClasses.floatLeft, floatLeft), tableClasses.floatRight, floatRight)),
506
652
  style: _objectSpread({
507
653
  height: defaultHeight
508
654
  }, props.style)