@sheinx/base 3.7.0-beta.9 → 3.7.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 (345) 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 +13 -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 +53 -35
  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-footer-context.d.ts +2 -1
  34. package/cjs/form/form-footer-context.d.ts.map +1 -1
  35. package/cjs/form/form-item.d.ts.map +1 -1
  36. package/cjs/form/form-item.js +4 -3
  37. package/cjs/form/form.d.ts.map +1 -1
  38. package/cjs/form/form.js +4 -2
  39. package/cjs/form/form.type.d.ts +3 -0
  40. package/cjs/form/form.type.d.ts.map +1 -1
  41. package/cjs/grid/grid.d.ts +2 -2
  42. package/cjs/grid/grid.d.ts.map +1 -1
  43. package/cjs/grid/grid.js +8 -5
  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 +1 -0
  51. package/cjs/icons/config.d.ts.map +1 -1
  52. package/cjs/icons/config.js +2 -1
  53. package/cjs/icons/icons.js +1 -1
  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/input/use-input-common.d.ts +1 -1
  60. package/cjs/list/list.d.ts.map +1 -1
  61. package/cjs/list/list.js +16 -5
  62. package/cjs/list/list.type.d.ts +8 -0
  63. package/cjs/list/list.type.d.ts.map +1 -1
  64. package/cjs/modal/modal-content.d.ts.map +1 -1
  65. package/cjs/modal/modal-content.js +12 -3
  66. package/cjs/modal/modal-submit.d.ts.map +1 -1
  67. package/cjs/modal/modal-submit.js +10 -3
  68. package/cjs/modal/modal.d.ts.map +1 -1
  69. package/cjs/modal/modal.js +3 -0
  70. package/cjs/popover/confirm.type.d.ts +1 -1
  71. package/cjs/popover/confirm.type.d.ts.map +1 -1
  72. package/cjs/popover/popover.d.ts.map +1 -1
  73. package/cjs/popover/popover.js +8 -8
  74. package/cjs/select/list-option.d.ts.map +1 -1
  75. package/cjs/select/list-option.js +11 -2
  76. package/cjs/select/result-more.d.ts.map +1 -1
  77. package/cjs/select/result-more.js +1 -1
  78. package/cjs/select/result.d.ts.map +1 -1
  79. package/cjs/select/result.js +9 -0
  80. package/cjs/select/select.d.ts.map +1 -1
  81. package/cjs/select/select.js +48 -38
  82. package/cjs/select/select.type.d.ts +9 -2
  83. package/cjs/select/select.type.d.ts.map +1 -1
  84. package/cjs/skeleton/button.d.ts +8 -0
  85. package/cjs/skeleton/button.d.ts.map +1 -0
  86. package/cjs/skeleton/button.js +34 -0
  87. package/cjs/skeleton/image.d.ts +8 -0
  88. package/cjs/skeleton/image.d.ts.map +1 -0
  89. package/cjs/skeleton/image.js +27 -0
  90. package/cjs/skeleton/index.d.ts +3 -0
  91. package/cjs/skeleton/index.d.ts.map +1 -0
  92. package/cjs/skeleton/index.js +20 -0
  93. package/cjs/skeleton/skeleton.d.ts +5 -0
  94. package/cjs/skeleton/skeleton.d.ts.map +1 -0
  95. package/cjs/skeleton/skeleton.js +58 -0
  96. package/cjs/skeleton/skeleton.type.d.ts +125 -0
  97. package/cjs/skeleton/skeleton.type.d.ts.map +1 -0
  98. package/cjs/skeleton/skeleton.type.js +5 -0
  99. package/cjs/skeleton/text.d.ts +8 -0
  100. package/cjs/skeleton/text.d.ts.map +1 -0
  101. package/cjs/skeleton/text.js +53 -0
  102. package/cjs/table/table.d.ts.map +1 -1
  103. package/cjs/table/table.js +82 -50
  104. package/cjs/table/table.type.d.ts +6 -3
  105. package/cjs/table/table.type.d.ts.map +1 -1
  106. package/cjs/table/tbody.d.ts.map +1 -1
  107. package/cjs/table/tbody.js +4 -17
  108. package/cjs/table/tbody.type.d.ts +1 -1
  109. package/cjs/table/tbody.type.d.ts.map +1 -1
  110. package/cjs/table/td.d.ts +4 -4
  111. package/cjs/table/td.d.ts.map +1 -1
  112. package/cjs/table/td.js +4 -13
  113. package/cjs/table/thead-filter.d.ts.map +1 -1
  114. package/cjs/table/thead-filter.js +20 -19
  115. package/cjs/table/thead.d.ts.map +1 -1
  116. package/cjs/table/thead.js +5 -1
  117. package/cjs/table/tr.d.ts +2 -1
  118. package/cjs/table/tr.d.ts.map +1 -1
  119. package/cjs/table/tr.js +6 -2
  120. package/cjs/tabs/tabs-panel.js +4 -3
  121. package/cjs/tag/tag.d.ts.map +1 -1
  122. package/cjs/tag/tag.js +3 -1
  123. package/cjs/tag/tag.type.d.ts +6 -0
  124. package/cjs/tag/tag.type.d.ts.map +1 -1
  125. package/cjs/tooltip/tooltip.d.ts.map +1 -1
  126. package/cjs/tooltip/tooltip.js +2 -10
  127. package/cjs/transfer/transfer-list.type.d.ts +1 -1
  128. package/cjs/transfer/transfer-list.type.d.ts.map +1 -1
  129. package/cjs/transfer/transfer.d.ts.map +1 -1
  130. package/cjs/transfer/transfer.js +16 -2
  131. package/cjs/transfer/transfer.type.d.ts +1 -1
  132. package/cjs/transfer/transfer.type.d.ts.map +1 -1
  133. package/cjs/tree/tree-checkbox.d.ts.map +1 -1
  134. package/cjs/tree/tree-checkbox.js +4 -2
  135. package/cjs/tree/tree-checkbox.type.d.ts +1 -0
  136. package/cjs/tree/tree-checkbox.type.d.ts.map +1 -1
  137. package/cjs/tree/tree-content.d.ts.map +1 -1
  138. package/cjs/tree/tree-content.js +36 -3
  139. package/cjs/tree/tree-content.type.d.ts +1 -2
  140. package/cjs/tree/tree-content.type.d.ts.map +1 -1
  141. package/cjs/tree/tree-context.d.ts +3 -3
  142. package/cjs/tree/tree-context.d.ts.map +1 -1
  143. package/cjs/tree/tree-context.type.d.ts +2 -1
  144. package/cjs/tree/tree-context.type.d.ts.map +1 -1
  145. package/cjs/tree/tree-list.type.d.ts +1 -2
  146. package/cjs/tree/tree-list.type.d.ts.map +1 -1
  147. package/cjs/tree/tree-node.type.d.ts +2 -4
  148. package/cjs/tree/tree-node.type.d.ts.map +1 -1
  149. package/cjs/tree/tree-root.type.d.ts +1 -2
  150. package/cjs/tree/tree-root.type.d.ts.map +1 -1
  151. package/cjs/tree/tree-virtual-node.d.ts.map +1 -1
  152. package/cjs/tree/tree-virtual-node.js +20 -5
  153. package/cjs/tree/tree-virtual.d.ts.map +1 -1
  154. package/cjs/tree/tree-virtual.js +9 -3
  155. package/cjs/tree/tree.d.ts.map +1 -1
  156. package/cjs/tree/tree.js +8 -14
  157. package/cjs/tree/tree.type.d.ts +24 -5
  158. package/cjs/tree/tree.type.d.ts.map +1 -1
  159. package/cjs/tree-select/tree-select.d.ts.map +1 -1
  160. package/cjs/tree-select/tree-select.js +47 -35
  161. package/cjs/tree-select/tree-select.type.d.ts +30 -1
  162. package/cjs/tree-select/tree-select.type.d.ts.map +1 -1
  163. package/cjs/upload/drop.d.ts +1 -0
  164. package/cjs/upload/drop.d.ts.map +1 -1
  165. package/cjs/upload/drop.js +43 -12
  166. package/cjs/upload/upload.d.ts.map +1 -1
  167. package/cjs/upload/upload.js +3 -1
  168. package/cjs/upload/upload.type.d.ts +6 -0
  169. package/cjs/upload/upload.type.d.ts.map +1 -1
  170. package/cjs/virtual-scroll/scroll-table.d.ts +6 -3
  171. package/cjs/virtual-scroll/scroll-table.d.ts.map +1 -1
  172. package/cjs/virtual-scroll/scroll-table.js +51 -24
  173. package/esm/alert/alert.d.ts.map +1 -1
  174. package/esm/alert/alert.js +1 -1
  175. package/esm/alert/alert.type.d.ts +1 -0
  176. package/esm/alert/alert.type.d.ts.map +1 -1
  177. package/esm/animation-list/animation-list.js +1 -1
  178. package/esm/carousel/carousel.d.ts.map +1 -1
  179. package/esm/carousel/carousel.js +6 -3
  180. package/esm/carousel/carousel.type.d.ts +13 -0
  181. package/esm/carousel/carousel.type.d.ts.map +1 -1
  182. package/esm/cascader/cascader.d.ts.map +1 -1
  183. package/esm/cascader/cascader.js +53 -35
  184. package/esm/cascader/cascader.type.d.ts +14 -2
  185. package/esm/cascader/cascader.type.d.ts.map +1 -1
  186. package/esm/cascader/filter-list.type.d.ts +1 -1
  187. package/esm/cascader/filter-list.type.d.ts.map +1 -1
  188. package/esm/cascader/filter-node.d.ts.map +1 -1
  189. package/esm/cascader/filter-node.js +17 -7
  190. package/esm/cascader/node.d.ts.map +1 -1
  191. package/esm/cascader/node.js +13 -4
  192. package/esm/common/common.type.d.ts +2 -0
  193. package/esm/common/common.type.d.ts.map +1 -0
  194. package/esm/common/common.type.js +1 -0
  195. package/esm/common/index.d.ts +2 -0
  196. package/esm/common/index.d.ts.map +1 -0
  197. package/esm/common/index.js +2 -0
  198. package/esm/common/type.d.ts +3 -0
  199. package/esm/common/type.d.ts.map +1 -1
  200. package/esm/date-picker/date-picker.js +1 -1
  201. package/esm/date-picker/date-picker.type.d.ts +0 -1
  202. package/esm/date-picker/date-picker.type.d.ts.map +1 -1
  203. package/esm/date-picker/day.d.ts.map +1 -1
  204. package/esm/date-picker/day.js +3 -4
  205. package/esm/form/form-footer-context.d.ts +2 -1
  206. package/esm/form/form-footer-context.d.ts.map +1 -1
  207. package/esm/form/form-item.d.ts.map +1 -1
  208. package/esm/form/form-item.js +4 -3
  209. package/esm/form/form.d.ts.map +1 -1
  210. package/esm/form/form.js +4 -2
  211. package/esm/form/form.type.d.ts +3 -0
  212. package/esm/form/form.type.d.ts.map +1 -1
  213. package/esm/grid/grid.d.ts +2 -2
  214. package/esm/grid/grid.d.ts.map +1 -1
  215. package/esm/grid/grid.js +8 -5
  216. package/esm/grid/grid.type.d.ts +8 -0
  217. package/esm/grid/grid.type.d.ts.map +1 -1
  218. package/esm/grid/index.d.ts +1 -1
  219. package/esm/grid/index.d.ts.map +1 -1
  220. package/esm/grid/util.d.ts.map +1 -1
  221. package/esm/grid/util.js +4 -12
  222. package/esm/icons/config.d.ts +1 -0
  223. package/esm/icons/config.d.ts.map +1 -1
  224. package/esm/icons/config.js +2 -1
  225. package/esm/icons/icons.js +1 -1
  226. package/esm/image/image.d.ts.map +1 -1
  227. package/esm/image/image.js +3 -2
  228. package/esm/index.d.ts +2 -0
  229. package/esm/index.d.ts.map +1 -1
  230. package/esm/index.js +2 -0
  231. package/esm/input/use-input-common.d.ts +1 -1
  232. package/esm/list/list.d.ts.map +1 -1
  233. package/esm/list/list.js +16 -5
  234. package/esm/list/list.type.d.ts +8 -0
  235. package/esm/list/list.type.d.ts.map +1 -1
  236. package/esm/modal/modal-content.d.ts.map +1 -1
  237. package/esm/modal/modal-content.js +12 -3
  238. package/esm/modal/modal-submit.d.ts.map +1 -1
  239. package/esm/modal/modal-submit.js +10 -3
  240. package/esm/modal/modal.d.ts.map +1 -1
  241. package/esm/modal/modal.js +3 -0
  242. package/esm/popover/confirm.type.d.ts +1 -1
  243. package/esm/popover/confirm.type.d.ts.map +1 -1
  244. package/esm/popover/popover.d.ts.map +1 -1
  245. package/esm/popover/popover.js +8 -8
  246. package/esm/select/list-option.d.ts.map +1 -1
  247. package/esm/select/list-option.js +13 -4
  248. package/esm/select/result-more.d.ts.map +1 -1
  249. package/esm/select/result-more.js +1 -1
  250. package/esm/select/result.d.ts.map +1 -1
  251. package/esm/select/result.js +9 -0
  252. package/esm/select/select.d.ts.map +1 -1
  253. package/esm/select/select.js +48 -38
  254. package/esm/select/select.type.d.ts +9 -2
  255. package/esm/select/select.type.d.ts.map +1 -1
  256. package/esm/skeleton/button.d.ts +8 -0
  257. package/esm/skeleton/button.d.ts.map +1 -0
  258. package/esm/skeleton/button.js +27 -0
  259. package/esm/skeleton/image.d.ts +8 -0
  260. package/esm/skeleton/image.d.ts.map +1 -0
  261. package/esm/skeleton/image.js +20 -0
  262. package/esm/skeleton/index.d.ts +3 -0
  263. package/esm/skeleton/index.d.ts.map +1 -0
  264. package/esm/skeleton/index.js +2 -0
  265. package/esm/skeleton/skeleton.d.ts +5 -0
  266. package/esm/skeleton/skeleton.d.ts.map +1 -0
  267. package/esm/skeleton/skeleton.js +52 -0
  268. package/esm/skeleton/skeleton.type.d.ts +125 -0
  269. package/esm/skeleton/skeleton.type.d.ts.map +1 -0
  270. package/esm/skeleton/skeleton.type.js +1 -0
  271. package/esm/skeleton/text.d.ts +8 -0
  272. package/esm/skeleton/text.d.ts.map +1 -0
  273. package/esm/skeleton/text.js +46 -0
  274. package/esm/table/table.d.ts.map +1 -1
  275. package/esm/table/table.js +82 -50
  276. package/esm/table/table.type.d.ts +6 -3
  277. package/esm/table/table.type.d.ts.map +1 -1
  278. package/esm/table/tbody.d.ts.map +1 -1
  279. package/esm/table/tbody.js +4 -17
  280. package/esm/table/tbody.type.d.ts +1 -1
  281. package/esm/table/tbody.type.d.ts.map +1 -1
  282. package/esm/table/td.d.ts +4 -4
  283. package/esm/table/td.d.ts.map +1 -1
  284. package/esm/table/td.js +3 -13
  285. package/esm/table/thead-filter.d.ts.map +1 -1
  286. package/esm/table/thead-filter.js +20 -19
  287. package/esm/table/thead.d.ts.map +1 -1
  288. package/esm/table/thead.js +5 -1
  289. package/esm/table/tr.d.ts +2 -1
  290. package/esm/table/tr.d.ts.map +1 -1
  291. package/esm/table/tr.js +6 -2
  292. package/esm/tabs/tabs-panel.js +4 -3
  293. package/esm/tag/tag.d.ts.map +1 -1
  294. package/esm/tag/tag.js +3 -1
  295. package/esm/tag/tag.type.d.ts +6 -0
  296. package/esm/tag/tag.type.d.ts.map +1 -1
  297. package/esm/tooltip/tooltip.d.ts.map +1 -1
  298. package/esm/tooltip/tooltip.js +3 -11
  299. package/esm/transfer/transfer-list.type.d.ts +1 -1
  300. package/esm/transfer/transfer-list.type.d.ts.map +1 -1
  301. package/esm/transfer/transfer.d.ts.map +1 -1
  302. package/esm/transfer/transfer.js +16 -2
  303. package/esm/transfer/transfer.type.d.ts +1 -1
  304. package/esm/transfer/transfer.type.d.ts.map +1 -1
  305. package/esm/tree/tree-checkbox.d.ts.map +1 -1
  306. package/esm/tree/tree-checkbox.js +4 -2
  307. package/esm/tree/tree-checkbox.type.d.ts +1 -0
  308. package/esm/tree/tree-checkbox.type.d.ts.map +1 -1
  309. package/esm/tree/tree-content.d.ts.map +1 -1
  310. package/esm/tree/tree-content.js +37 -3
  311. package/esm/tree/tree-content.type.d.ts +1 -2
  312. package/esm/tree/tree-content.type.d.ts.map +1 -1
  313. package/esm/tree/tree-context.d.ts +3 -3
  314. package/esm/tree/tree-context.d.ts.map +1 -1
  315. package/esm/tree/tree-context.type.d.ts +2 -1
  316. package/esm/tree/tree-context.type.d.ts.map +1 -1
  317. package/esm/tree/tree-list.type.d.ts +1 -2
  318. package/esm/tree/tree-list.type.d.ts.map +1 -1
  319. package/esm/tree/tree-node.type.d.ts +2 -4
  320. package/esm/tree/tree-node.type.d.ts.map +1 -1
  321. package/esm/tree/tree-root.type.d.ts +1 -2
  322. package/esm/tree/tree-root.type.d.ts.map +1 -1
  323. package/esm/tree/tree-virtual-node.d.ts.map +1 -1
  324. package/esm/tree/tree-virtual-node.js +21 -5
  325. package/esm/tree/tree-virtual.d.ts.map +1 -1
  326. package/esm/tree/tree-virtual.js +9 -3
  327. package/esm/tree/tree.d.ts.map +1 -1
  328. package/esm/tree/tree.js +8 -14
  329. package/esm/tree/tree.type.d.ts +24 -5
  330. package/esm/tree/tree.type.d.ts.map +1 -1
  331. package/esm/tree-select/tree-select.d.ts.map +1 -1
  332. package/esm/tree-select/tree-select.js +47 -35
  333. package/esm/tree-select/tree-select.type.d.ts +30 -1
  334. package/esm/tree-select/tree-select.type.d.ts.map +1 -1
  335. package/esm/upload/drop.d.ts +1 -0
  336. package/esm/upload/drop.d.ts.map +1 -1
  337. package/esm/upload/drop.js +43 -12
  338. package/esm/upload/upload.d.ts.map +1 -1
  339. package/esm/upload/upload.js +3 -1
  340. package/esm/upload/upload.type.d.ts +6 -0
  341. package/esm/upload/upload.type.d.ts.map +1 -1
  342. package/esm/virtual-scroll/scroll-table.d.ts +6 -3
  343. package/esm/virtual-scroll/scroll-table.d.ts.map +1 -1
  344. package/esm/virtual-scroll/scroll-table.js +52 -25
  345. package/package.json +2 -2
@@ -0,0 +1,27 @@
1
+ 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); }
2
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
3
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
4
+ 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); }
5
+ import classNames from 'classnames';
6
+ import { jsx as _jsx } from "react/jsx-runtime";
7
+ export default function Button(_ref) {
8
+ var classes = _ref.classes,
9
+ className = _ref.className,
10
+ size = _ref.size,
11
+ position = _ref.position,
12
+ _ref$count = _ref.count,
13
+ count = _ref$count === void 0 ? 1 : _ref$count,
14
+ style = _ref.style;
15
+ var cls = classNames(classes.button, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, classes.buttonLeft, position !== 'right'), classes.buttonRight, position === 'right'), classes.buttonSmall, size === 'small'), classes.buttonLarge, size === 'large'), className);
16
+ var buttons = [];
17
+ for (var i = 0; i < count; i++) {
18
+ buttons.push( /*#__PURE__*/_jsx("div", {
19
+ className: classes.buttonItem
20
+ }, i));
21
+ }
22
+ return /*#__PURE__*/_jsx("div", {
23
+ className: cls,
24
+ style: style,
25
+ children: buttons
26
+ });
27
+ }
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import { SkeletonClasses, SkeletonImageProps } from './skeleton.type';
3
+ interface ImageProps extends SkeletonImageProps {
4
+ classes: SkeletonClasses;
5
+ }
6
+ export default function Image({ classes, className, size, position, shape, style }: ImageProps): JSX.Element;
7
+ export {};
8
+ //# sourceMappingURL=image.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image.d.ts","sourceRoot":"","sources":["image.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAEtE,UAAU,UAAW,SAAQ,kBAAkB;IAC7C,OAAO,EAAE,eAAe,CAAC;CAC1B;AAED,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAgB,EAAE,KAAK,EAAE,EAAE,UAAU,GAAG,GAAG,CAAC,OAAO,CAWtH"}
@@ -0,0 +1,20 @@
1
+ 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); }
2
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
3
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
4
+ 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); }
5
+ import classNames from 'classnames';
6
+ import { jsx as _jsx } from "react/jsx-runtime";
7
+ export default function Image(_ref) {
8
+ var classes = _ref.classes,
9
+ className = _ref.className,
10
+ size = _ref.size,
11
+ position = _ref.position,
12
+ _ref$shape = _ref.shape,
13
+ shape = _ref$shape === void 0 ? 'circle' : _ref$shape,
14
+ style = _ref.style;
15
+ var cls = classNames(classes.image, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, classes.imageLeft, position !== 'right'), classes.imageRight, position === 'right'), classes.imageCircle, shape === 'circle'), classes.imageSquare, shape === 'square'), classes.imageSmall, size === 'small'), classes.imageLarge, size === 'large'), className);
16
+ return /*#__PURE__*/_jsx("div", {
17
+ className: cls,
18
+ style: style
19
+ });
20
+ }
@@ -0,0 +1,3 @@
1
+ export { default, default as Skeleton } from './skeleton';
2
+ export type { SkeletonProps, SkeletonClasses } from './skeleton.type';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC1D,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ export { default, default as Skeleton } from "./skeleton";
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import { SkeletonProps } from './skeleton.type';
3
+ declare const Skeleton: (props: SkeletonProps) => string | number | boolean | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
4
+ export default Skeleton;
5
+ //# sourceMappingURL=skeleton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skeleton.d.ts","sourceRoot":"","sources":["skeleton.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAmB,aAAa,EAAE,MAAM,iBAAiB,CAAC;AASjE,QAAA,MAAM,QAAQ,UAAW,aAAa,iIA6BrC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,52 @@
1
+ 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); }
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
+ 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); }
7
+ import { util } from '@sheinx/hooks';
8
+ import classNames from 'classnames';
9
+ import Text from "./text";
10
+ import Image from "./image";
11
+ import Button from "./button";
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ import { jsxs as _jsxs } from "react/jsx-runtime";
14
+ function getComponentProps(prop) {
15
+ return util.isObject(prop) ? prop : {};
16
+ }
17
+ var Skeleton = function Skeleton(props) {
18
+ var _jssStyle$skeleton;
19
+ var animation = props.animation,
20
+ image = props.image,
21
+ button = props.button,
22
+ _props$text = props.text,
23
+ text = _props$text === void 0 ? true : _props$text,
24
+ children = props.children,
25
+ loading = props.loading,
26
+ jssStyle = props.jssStyle;
27
+ var classes = jssStyle === null || jssStyle === void 0 || (_jssStyle$skeleton = jssStyle.skeleton) === null || _jssStyle$skeleton === void 0 ? void 0 : _jssStyle$skeleton.call(jssStyle);
28
+ var rootClass = classNames(classes.rootClass, classes.wrapper, props.className, _defineProperty({}, classes.animation, animation));
29
+ var imageProps = getComponentProps(image);
30
+ var textProps = getComponentProps(text);
31
+ var buttonProps = getComponentProps(button);
32
+ if (loading) {
33
+ return /*#__PURE__*/_jsxs("div", {
34
+ className: rootClass,
35
+ style: props.style,
36
+ children: [image && imageProps.position !== 'right' && /*#__PURE__*/_jsx(Image, _objectSpread({
37
+ classes: classes
38
+ }, imageProps)), /*#__PURE__*/_jsxs("div", {
39
+ className: classes.content,
40
+ children: [text && /*#__PURE__*/_jsx(Text, _objectSpread({
41
+ classes: classes
42
+ }, textProps)), button && /*#__PURE__*/_jsx(Button, _objectSpread({
43
+ classes: classes
44
+ }, buttonProps))]
45
+ }), image && imageProps.position === 'right' && /*#__PURE__*/_jsx(Image, _objectSpread({
46
+ classes: classes
47
+ }, imageProps))]
48
+ });
49
+ }
50
+ return children;
51
+ };
52
+ export default Skeleton;
@@ -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 @@
1
+ export {};
@@ -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,46 @@
1
+ import classNames from 'classnames';
2
+ import { util } from '@sheinx/hooks';
3
+ import { jsx as _jsx } from "react/jsx-runtime";
4
+ export default function Text(_ref) {
5
+ var classes = _ref.classes,
6
+ className = _ref.className,
7
+ _ref$rows = _ref.rows,
8
+ rows = _ref$rows === void 0 ? 3 : _ref$rows,
9
+ width = _ref.width,
10
+ height = _ref.height,
11
+ style = _ref.style;
12
+ var cls = classNames(classes.text, className);
13
+ var nodes = [];
14
+ function getTextWidth(index) {
15
+ if (util.isArray(width)) {
16
+ return width[index];
17
+ }
18
+ if (rows - 1 === index) {
19
+ return width;
20
+ }
21
+ return undefined;
22
+ }
23
+ function getTextHeight(index) {
24
+ if (util.isArray(height)) {
25
+ return height[index];
26
+ }
27
+ if (rows - 1 === index) {
28
+ return height;
29
+ }
30
+ return undefined;
31
+ }
32
+ for (var i = 0; i < rows; i++) {
33
+ nodes.push( /*#__PURE__*/_jsx("li", {
34
+ className: classes.textItem,
35
+ style: {
36
+ width: getTextWidth(i),
37
+ height: getTextHeight(i)
38
+ }
39
+ }, i));
40
+ }
41
+ return /*#__PURE__*/_jsx("ul", {
42
+ className: cls,
43
+ style: style,
44
+ children: nodes
45
+ });
46
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"table.d.ts","sourceRoot":"","sources":["table.tsx"],"names":[],"mappings":"AAyBA,OAAO,EAAgB,UAAU,EAAE,MAAM,cAAc,CAAC;;AAexD,wBAmoBE"}
1
+ {"version":3,"file":"table.d.ts","sourceRoot":"","sources":["table.tsx"],"names":[],"mappings":"AAyBA,OAAO,EAAgB,UAAU,EAAE,MAAM,cAAc,CAAC;;AAexD,wBAmqBE"}
@@ -38,7 +38,7 @@ var emptyRef = {
38
38
  current: null
39
39
  };
40
40
  export default (function (props) {
41
- var _props$jssStyle, _props$jssStyle$table, _props$data, _columns$find;
41
+ var _props$jssStyle, _props$jssStyle$table, _columns$find;
42
42
  var _props$verticalAlign = props.verticalAlign,
43
43
  verticalAlign = _props$verticalAlign === void 0 ? 'top' : _props$verticalAlign,
44
44
  _props$size = props.size,
@@ -50,6 +50,7 @@ export default (function (props) {
50
50
  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);
51
51
  var tbodyRef = useRef(null);
52
52
  var theadRef = useRef(null);
53
+ var theadIdRef = useRef("thead-container-".concat(util.generateUUID()));
53
54
  var tfootRef = useRef(null);
54
55
  var scrollRef = useRef(null);
55
56
  var headMirrorScrollRef = useRef(null);
@@ -59,6 +60,10 @@ export default (function (props) {
59
60
  _useState2 = _slicedToArray(_useState, 2),
60
61
  scrolling = _useState2[0],
61
62
  setScrolling = _useState2[1];
63
+ var _useState3 = useState(false),
64
+ _useState4 = _slicedToArray(_useState3, 2),
65
+ fakeVirtual = _useState4[0],
66
+ setFakeVirtual = _useState4[1];
62
67
  var browserScrollbarWidth = useScrollbarWidth();
63
68
  if (props.fixed) {
64
69
  devUseWarning.deprecated('fixed', 'virtual', 'Table');
@@ -85,7 +90,7 @@ export default (function (props) {
85
90
  scrollingTimer: null
86
91
  }),
87
92
  context = _useRef.current;
88
- 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');
93
+ var virtual = !fakeVirtual && props.rowsInView !== 0 && (!!props.virtual || props.fixed === 'both' || props.fixed === 'y' || props.fixed === 'auto');
89
94
 
90
95
  // 虚拟列表高度另外计算
91
96
  var _useResize = useResize({
@@ -216,7 +221,13 @@ export default (function (props) {
216
221
  });
217
222
  useEffect(function () {
218
223
  var _theadRef$current, _tfootRef$current;
219
- 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);
224
+ var theadHeight = (theadRef === null || theadRef === void 0 || (_theadRef$current = theadRef.current) === null || _theadRef$current === void 0 ? void 0 : _theadRef$current.clientHeight) || 0;
225
+ var tfootHeight = ((_tfootRef$current = tfootRef.current) === null || _tfootRef$current === void 0 ? void 0 : _tfootRef$current.clientHeight) || 0;
226
+ if (props.sticky) {
227
+ context.theadAndTfootHeight = tfootHeight;
228
+ } else {
229
+ context.theadAndTfootHeight = theadHeight + tfootHeight;
230
+ }
220
231
  }, [theadRef.current, tfootRef.current]);
221
232
  var virtualInfo = useTableVirtual({
222
233
  disabled: !virtual,
@@ -232,10 +243,14 @@ export default (function (props) {
232
243
  theadAndTfootHeight: context.theadAndTfootHeight
233
244
  });
234
245
  var syncHeaderScroll = usePersistFn(function (left) {
235
- var _theadRef$current2;
246
+ var _tableRef$current;
236
247
  if (props.hideHeader || !props.sticky) return;
237
- if (!(theadRef !== null && theadRef !== void 0 && (_theadRef$current2 = theadRef.current) !== null && _theadRef$current2 !== void 0 && _theadRef$current2.parentElement)) return;
238
- theadRef.current.parentElement.scrollLeft = left;
248
+
249
+ // why use querySelectorAll: thead经历了Sticky组件的渲染再回来时,theadRef就丢失了
250
+ 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, "]"));
251
+ theads === null || theads === void 0 || theads.forEach(function (item) {
252
+ item.scrollLeft = left;
253
+ });
239
254
  });
240
255
 
241
256
  // 简单表格的滚动事件
@@ -282,28 +297,33 @@ export default (function (props) {
282
297
  }, 100);
283
298
  });
284
299
  var renderEmpty = function renderEmpty() {
285
- var _props$data2;
286
- if (!((_props$data2 = props.data) !== null && _props$data2 !== void 0 && _props$data2.length) || filteredData !== undefined && filteredData.length === 0) {
300
+ var _props$data;
301
+ if (!((_props$data = props.data) !== null && _props$data !== void 0 && _props$data.length) || filteredData !== undefined && filteredData.length === 0) {
302
+ var empty = props.empty !== undefined ? /*#__PURE__*/_jsx("span", {
303
+ children: props.empty
304
+ }) : /*#__PURE__*/_jsx(Empty, {
305
+ jssStyle: props.jssStyle
306
+ });
287
307
  return /*#__PURE__*/_jsx("div", {
288
308
  className: classNames(tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.emptyWrapper, isScrollX && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.emptyNoBorder)),
289
309
  ref: function ref(el) {
290
310
  context.emptyHeight = (el === null || el === void 0 ? void 0 : el.clientHeight) || 0;
291
311
  },
292
- children: props.empty || /*#__PURE__*/_jsx(Empty, {
293
- jssStyle: props.jssStyle
294
- })
312
+ children: empty
295
313
  });
296
314
  }
297
315
  return null;
298
316
  };
317
+ var $empty = renderEmpty();
299
318
  var renderTable = function renderTable() {
300
- var _props$summary, _sticky$top, _props$data3;
319
+ var _props$summary, _sticky$top, _props$data2;
301
320
  var Group = /*#__PURE__*/_jsx(Colgroup, {
302
321
  colgroup: colgroup,
303
322
  columns: columns,
304
323
  shouldLastColAuto: !!shouldLastColAuto
305
324
  });
306
325
  var bodyCommonProps = {
326
+ virtual: props.virtual,
307
327
  hover: props.hover,
308
328
  disabled: props.disabled,
309
329
  rowClickAttr: props.rowClickAttr,
@@ -332,8 +352,7 @@ export default (function (props) {
332
352
  bodyScrollWidth: scrollWidth,
333
353
  resizeFlag: resizeFlag,
334
354
  treeCheckAll: props.treeCheckAll,
335
- onCellClick: props.onCellClick,
336
- shouldCellUpdate: props.shouldCellUpdate
355
+ onCellClick: props.onCellClick
337
356
  };
338
357
  var headCommonProps = {
339
358
  disabled: props.disabled,
@@ -373,16 +392,22 @@ export default (function (props) {
373
392
  target: sticky === null || sticky === void 0 ? void 0 : sticky.target,
374
393
  top: (_sticky$top = sticky === null || sticky === void 0 ? void 0 : sticky.top) !== null && _sticky$top !== void 0 ? _sticky$top : 0,
375
394
  css: sticky === null || sticky === void 0 ? void 0 : sticky.css,
376
- parent: tableRef === null || tableRef === void 0 ? void 0 : tableRef.current
395
+ parent: tableRef === null || tableRef === void 0 ? void 0 : tableRef.current,
396
+ onChange: function onChange(isSticky) {
397
+ if (isSticky) {
398
+ var _scrollRef$current;
399
+ syncHeaderScroll(((_scrollRef$current = scrollRef.current) === null || _scrollRef$current === void 0 ? void 0 : _scrollRef$current.scrollLeft) || 0);
400
+ }
401
+ }
377
402
  };
378
- var isRenderVirtualTable = virtual || props.sticky || !((_props$data3 = props.data) !== null && _props$data3 !== void 0 && _props$data3.length);
379
- var headWrapperClass = classNames(tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.headWrapper);
403
+ var isRenderVirtualTable = virtual || props.sticky || !((_props$data2 = props.data) !== null && _props$data2 !== void 0 && _props$data2.length);
404
+ var headWrapperClass = classNames(tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.headWrapper, !!$empty && tableClasses.emptyHeader, props.sticky && isScrollY && tableClasses.scrollY, props.sticky && !isScrollY && tableClasses.scrollX);
380
405
  var footWrapperClass = classNames(tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.footWrapper);
381
406
  var renderHeadMirrorScroller = function renderHeadMirrorScroller() {
382
- var _scrollRef$current, _scrollRef$current2, _scrollRef$current3;
407
+ var _scrollRef$current2, _scrollRef$current3, _scrollRef$current4;
383
408
  if (!props.showTopScrollbar) return null;
384
- var scrollRefWidth = (scrollRef === null || scrollRef === void 0 || (_scrollRef$current = scrollRef.current) === null || _scrollRef$current === void 0 ? void 0 : _scrollRef$current.clientWidth) || 0;
385
- var scrollRefScrollWidth = (scrollRef === null || scrollRef === void 0 || (_scrollRef$current2 = scrollRef.current) === null || _scrollRef$current2 === void 0 ? void 0 : _scrollRef$current2.scrollWidth) || 0;
409
+ var scrollRefWidth = (scrollRef === null || scrollRef === void 0 || (_scrollRef$current2 = scrollRef.current) === null || _scrollRef$current2 === void 0 ? void 0 : _scrollRef$current2.clientWidth) || 0;
410
+ var scrollRefScrollWidth = (scrollRef === null || scrollRef === void 0 || (_scrollRef$current3 = scrollRef.current) === null || _scrollRef$current3 === void 0 ? void 0 : _scrollRef$current3.scrollWidth) || 0;
386
411
  var mirrorScrollRefWidth = scrollRefWidth + scrollBarWidth;
387
412
  var showScroll = scrollRefScrollWidth > scrollRefWidth;
388
413
  // 开启了双滚,但是没有滚动条,不显示
@@ -407,7 +432,7 @@ export default (function (props) {
407
432
  ref: headMirrorScrollRef,
408
433
  children: /*#__PURE__*/_jsx("div", {
409
434
  style: {
410
- width: scrollRef === null || scrollRef === void 0 || (_scrollRef$current3 = scrollRef.current) === null || _scrollRef$current3 === void 0 ? void 0 : _scrollRef$current3.scrollWidth,
435
+ width: scrollRef === null || scrollRef === void 0 || (_scrollRef$current4 = scrollRef.current) === null || _scrollRef$current4 === void 0 ? void 0 : _scrollRef$current4.scrollWidth,
411
436
  height: 1
412
437
  }
413
438
  })
@@ -415,17 +440,16 @@ export default (function (props) {
415
440
  }));
416
441
  };
417
442
  var renderBottomMirrorScroller = function renderBottomMirrorScroller() {
418
- var _scrollRef$current4, _scrollRef$current5, _scrollRef$current6;
443
+ var _scrollRef$current5, _scrollRef$current6, _scrollRef$current7;
419
444
  if (!props.showBottomScrollbar) return null;
420
- var scrollRefWidth = (scrollRef === null || scrollRef === void 0 || (_scrollRef$current4 = scrollRef.current) === null || _scrollRef$current4 === void 0 ? void 0 : _scrollRef$current4.clientWidth) || 0;
421
- var scrollRefScrollWidth = (scrollRef === null || scrollRef === void 0 || (_scrollRef$current5 = scrollRef.current) === null || _scrollRef$current5 === void 0 ? void 0 : _scrollRef$current5.scrollWidth) || 0;
445
+ var scrollRefWidth = (scrollRef === null || scrollRef === void 0 || (_scrollRef$current5 = scrollRef.current) === null || _scrollRef$current5 === void 0 ? void 0 : _scrollRef$current5.clientWidth) || 0;
446
+ var scrollRefScrollWidth = (scrollRef === null || scrollRef === void 0 || (_scrollRef$current6 = scrollRef.current) === null || _scrollRef$current6 === void 0 ? void 0 : _scrollRef$current6.scrollWidth) || 0;
422
447
  var mirrorScrollRefWidth = scrollRefWidth + scrollBarWidth;
423
448
  var showScroll = scrollRefScrollWidth > scrollRefWidth;
424
449
  // 开启了双滚,但是没有滚动条,不显示
425
450
  if (!scrollRefWidth || !mirrorScrollRefWidth || !showScroll) return null;
426
451
  var options = props.showBottomScrollbar === true ? {} : props.showBottomScrollbar;
427
452
  var scrollerStickyProps = {
428
- scrollContainer: options.scrollContainer || document.body,
429
453
  bottom: options.bottom || 0,
430
454
  zIndex: options.zIndex || defaultZIndex + 1,
431
455
  parent: tableRef === null || tableRef === void 0 ? void 0 : tableRef.current
@@ -447,31 +471,32 @@ export default (function (props) {
447
471
  ref: bottomMirrorScrollRef,
448
472
  children: /*#__PURE__*/_jsx("div", {
449
473
  style: {
450
- width: scrollRef === null || scrollRef === void 0 || (_scrollRef$current6 = scrollRef.current) === null || _scrollRef$current6 === void 0 ? void 0 : _scrollRef$current6.scrollWidth,
474
+ width: scrollRef === null || scrollRef === void 0 || (_scrollRef$current7 = scrollRef.current) === null || _scrollRef$current7 === void 0 ? void 0 : _scrollRef$current7.scrollWidth,
451
475
  height: 1
452
476
  }
453
477
  })
454
478
  })
455
479
  }));
456
480
  };
457
- var $headTable = /*#__PURE__*/_jsxs("table", {
458
- style: {
459
- width: width
460
- },
461
- ref: theadRef,
462
- children: [Group, /*#__PURE__*/_jsx(Thead, _objectSpread({}, headCommonProps))]
463
- });
481
+ var $headTable = /*#__PURE__*/_jsx("div", _objectSpread(_objectSpread({
482
+ className: headWrapperClass
483
+ }, util.getDataAttribute({
484
+ role: theadIdRef.current
485
+ })), {}, {
486
+ children: /*#__PURE__*/_jsxs("table", {
487
+ style: {
488
+ width: width
489
+ },
490
+ ref: theadRef,
491
+ children: [Group, /*#__PURE__*/_jsx(Thead, _objectSpread({}, headCommonProps))]
492
+ })
493
+ }));
464
494
  if (isRenderVirtualTable) {
465
- var _props$data4;
495
+ var _props$data3;
496
+ var showStickyHeader = !props.hideHeader && props.sticky;
466
497
  return /*#__PURE__*/_jsxs(_Fragment, {
467
- children: [renderHeadMirrorScroller(), !props.hideHeader && props.sticky && /*#__PURE__*/_jsx(StickyWrapper, _objectSpread(_objectSpread({}, stickyProps), {}, {
468
- children: /*#__PURE__*/_jsx("div", {
469
- className: headWrapperClass,
470
- style: {
471
- overflow: 'hidden'
472
- },
473
- children: $headTable
474
- })
498
+ children: [renderHeadMirrorScroller(), showStickyHeader && /*#__PURE__*/_jsx(StickyWrapper, _objectSpread(_objectSpread({}, stickyProps), {}, {
499
+ children: $headTable
475
500
  })), /*#__PURE__*/_jsxs(Scroll, {
476
501
  style: {
477
502
  display: 'flex',
@@ -485,10 +510,11 @@ export default (function (props) {
485
510
  onScroll: handleVirtualScroll,
486
511
  defaultHeight: context.emptyHeight,
487
512
  isScrollY: isScrollY,
488
- children: [!props.hideHeader && !props.sticky && /*#__PURE__*/_jsx("div", {
489
- className: headWrapperClass,
490
- children: $headTable
491
- }), !!((_props$data4 = props.data) !== null && _props$data4 !== void 0 && _props$data4.length) && /*#__PURE__*/_jsxs("table", {
513
+ isScrollX: isScrollX,
514
+ isEmpty: !!$empty,
515
+ tableRef: tableRef,
516
+ setFakeVirtual: setFakeVirtual,
517
+ children: [!props.hideHeader && !props.sticky && $headTable, !!((_props$data3 = props.data) !== null && _props$data3 !== void 0 && _props$data3.length) && /*#__PURE__*/_jsxs("table", {
492
518
  style: {
493
519
  width: width,
494
520
  transform: virtualInfo.translateStyle
@@ -509,7 +535,7 @@ export default (function (props) {
509
535
  ref: tfootRef,
510
536
  children: [Group, /*#__PURE__*/_jsx(Tfoot, _objectSpread({}, footCommonProps))]
511
537
  })
512
- }) : null, renderEmpty()]
538
+ }) : null, $empty]
513
539
  }), renderBottomMirrorScroller()]
514
540
  });
515
541
  }
@@ -525,7 +551,7 @@ export default (function (props) {
525
551
  ref: tbodyRef,
526
552
  children: [Group, !props.hideHeader && /*#__PURE__*/_jsx(Thead, _objectSpread({}, headCommonProps)), bodyCommonProps.data.length === 0 ? /*#__PURE__*/_jsx(TbodyEmpty, {
527
553
  children: renderEmpty()
528
- }) : /*#__PURE__*/_jsx(Tbody, _objectSpread({}, bodyCommonProps)), /*#__PURE__*/_jsx(Tfoot, _objectSpread({}, footCommonProps))]
554
+ }) : /*#__PURE__*/_jsx(Tbody, _objectSpread({}, bodyCommonProps)), showFoot && /*#__PURE__*/_jsx(Tfoot, _objectSpread({}, footCommonProps))]
529
555
  })
530
556
  }), renderBottomMirrorScroller()]
531
557
  });
@@ -550,10 +576,10 @@ export default (function (props) {
550
576
 
551
577
  // handle head and foot scroll
552
578
  var handleHeaderWheel = usePersistFn(function (e) {
553
- var _theadRef$current3;
579
+ var _theadRef$current2;
554
580
  var scrollEl = scrollRef.current;
555
581
  if (!scrollEl) return;
556
- if (!(theadRef !== null && theadRef !== void 0 && (_theadRef$current3 = theadRef.current) !== null && _theadRef$current3 !== void 0 && _theadRef$current3.parentElement)) return;
582
+ if (!(theadRef !== null && theadRef !== void 0 && (_theadRef$current2 = theadRef.current) !== null && _theadRef$current2 !== void 0 && _theadRef$current2.parentElement)) return;
557
583
  var max = scrollEl.scrollWidth - scrollEl.clientWidth;
558
584
  var scrollLeft = scrollEl.scrollLeft + e.deltaX;
559
585
  if (scrollLeft === scrollEl.scrollLeft) {
@@ -564,6 +590,12 @@ export default (function (props) {
564
590
  scrollEl.scrollLeft = left;
565
591
  theadRef.current.parentElement.scrollLeft = left;
566
592
  });
593
+ useEffect(function () {
594
+ var _scrollRef$current8;
595
+ if (!props.sticky || !scrollRef.current || !isScrollX) return;
596
+ // sticky场景下,从空数据到有数据切换时,同步一次滚动条的位置
597
+ syncHeaderScroll(((_scrollRef$current8 = scrollRef.current) === null || _scrollRef$current8 === void 0 ? void 0 : _scrollRef$current8.scrollLeft) || 0);
598
+ }, [isScrollX, props.sticky, $empty]);
567
599
  useEffect(function () {
568
600
  // 绑定 wheel 事件
569
601
  if (props.sticky && theadRef.current && theadRef.current.parentElement) {