@autobest-ui/components 2.2.1 → 2.4.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 (378) hide show
  1. package/esm/accordion/Item.js +6 -23
  2. package/esm/accordion/index.js +8 -36
  3. package/esm/accordion/style/index.css +1 -0
  4. package/esm/affix/PortalAffix.js +7 -11
  5. package/esm/affix/index.js +30 -70
  6. package/esm/affix/style/index.css +1 -1
  7. package/esm/base.css +1 -1
  8. package/esm/carousel/index.js +45 -141
  9. package/esm/checkbox/index.js +12 -37
  10. package/esm/checkbox/style/index.css +1 -1
  11. package/esm/collapse/index.js +11 -49
  12. package/esm/confirm/index.d.ts +8 -0
  13. package/esm/confirm/index.js +23 -31
  14. package/esm/confirm/style/index.css +1 -1
  15. package/esm/date-picker/DateEnum.js +0 -3
  16. package/esm/date-picker/calendar/Day.js +62 -78
  17. package/esm/date-picker/calendar/MonthYear.js +20 -53
  18. package/esm/date-picker/calendar/grid/index.js +7 -12
  19. package/esm/date-picker/calendar/index.js +4 -31
  20. package/esm/date-picker/index.js +11 -51
  21. package/esm/date-picker/style/index.css +1 -1
  22. package/esm/date-picker/utils.js +6 -11
  23. package/esm/drawer/Child.js +10 -20
  24. package/esm/drawer/index.js +22 -71
  25. package/esm/drawer/style/index.css +1 -1
  26. package/esm/ellipsis/index.js +9 -17
  27. package/esm/ellipsis/style/index.css +1 -1
  28. package/esm/guide/index.js +25 -63
  29. package/esm/guide/style/index.css +1 -1
  30. package/esm/index.d.ts +1 -1
  31. package/esm/input-number/ControlArrow.js +0 -2
  32. package/esm/input-number/constants.js +2 -2
  33. package/esm/input-number/index.js +26 -106
  34. package/esm/input-number/style/index.css +1 -1
  35. package/esm/lazy-image/index.js +10 -55
  36. package/esm/lazy-image/style/index.css +1 -1
  37. package/esm/link-list/index.js +11 -35
  38. package/esm/link-list/style/index.css +1 -1
  39. package/esm/loading/index.js +15 -42
  40. package/esm/loading/style/index.css +1 -1
  41. package/esm/loading-bar/style/index.css +1 -1
  42. package/esm/loading-container/index.js +3 -6
  43. package/esm/loading-container/style/index.css +1 -1
  44. package/esm/loading-icon/index.js +0 -2
  45. package/esm/loading-icon/style/index.css +1 -1
  46. package/esm/mask/index.js +6 -9
  47. package/esm/mask/style/index.css +1 -1
  48. package/esm/message/index.d.ts +17 -6
  49. package/esm/message/index.js +68 -96
  50. package/esm/message/renderMessage.d.ts +17 -0
  51. package/esm/message/renderMessage.js +137 -0
  52. package/esm/message/style/index.css +1 -1
  53. package/esm/modal/Title.js +5 -12
  54. package/esm/modal/getPopupLocation.js +5 -7
  55. package/esm/modal/index.js +44 -125
  56. package/esm/modal/style/index.css +1 -1
  57. package/esm/move/index.js +32 -132
  58. package/esm/move/range.js +6 -12
  59. package/esm/move/utils.js +3 -10
  60. package/esm/popover/index.js +9 -28
  61. package/esm/popover/style/index.css +1 -1
  62. package/esm/portal/index.js +1 -22
  63. package/esm/script/index.js +19 -59
  64. package/esm/select/index.js +28 -106
  65. package/esm/select/style/index.css +1 -1
  66. package/esm/show-more/index.js +40 -103
  67. package/esm/skeleton/Item.js +1 -3
  68. package/esm/skeleton/index.js +5 -11
  69. package/esm/skeleton/style/index.css +1 -1
  70. package/esm/style.css +1 -33
  71. package/esm/table/body/BodyRow.js +11 -28
  72. package/esm/table/body/CheckIcon.js +10 -18
  73. package/esm/table/body/index.js +8 -12
  74. package/esm/table/header/CheckIcon.js +3 -11
  75. package/esm/table/header/HeaderCell.js +12 -33
  76. package/esm/table/header/HeaderRow.js +6 -17
  77. package/esm/table/index.js +30 -100
  78. package/esm/table/style/index.css +1 -1
  79. package/esm/tabs/index.js +35 -118
  80. package/esm/tabs/style/index.css +1 -1
  81. package/esm/tooltip/index.js +0 -4
  82. package/esm/tooltip/style/index.css +1 -1
  83. package/esm/trigger/align.js +6 -6
  84. package/esm/trigger/bottomAlign.js +33 -45
  85. package/esm/trigger/constants.js +0 -1
  86. package/esm/trigger/getPopupLocation.js +48 -68
  87. package/esm/trigger/index.js +52 -187
  88. package/esm/trigger/leftAlign.js +33 -47
  89. package/esm/trigger/ref.js +2 -7
  90. package/esm/trigger/rightAlign.js +33 -45
  91. package/esm/trigger/topAlign.js +33 -45
  92. package/esm/trigger/utils.js +28 -45
  93. package/lib/accordion/Item.js +6 -27
  94. package/lib/accordion/index.js +8 -41
  95. package/lib/accordion/style/index.css +1 -0
  96. package/lib/affix/PortalAffix.js +7 -17
  97. package/lib/affix/index.js +30 -75
  98. package/lib/affix/style/index.css +1 -1
  99. package/lib/base.css +1 -1
  100. package/lib/carousel/index.js +45 -146
  101. package/lib/checkbox/index.js +12 -41
  102. package/lib/checkbox/style/index.css +1 -1
  103. package/lib/collapse/index.js +11 -53
  104. package/lib/confirm/index.d.ts +8 -0
  105. package/lib/confirm/index.js +23 -38
  106. package/lib/confirm/style/index.css +1 -1
  107. package/lib/date-picker/DateEnum.js +0 -3
  108. package/lib/date-picker/calendar/Day.js +62 -87
  109. package/lib/date-picker/calendar/MonthYear.js +20 -62
  110. package/lib/date-picker/calendar/grid/index.js +7 -16
  111. package/lib/date-picker/calendar/index.js +4 -37
  112. package/lib/date-picker/index.js +9 -58
  113. package/lib/date-picker/style/index.css +1 -1
  114. package/lib/date-picker/utils.js +6 -26
  115. package/lib/drawer/Child.js +10 -25
  116. package/lib/drawer/index.js +22 -78
  117. package/lib/drawer/style/index.css +1 -1
  118. package/lib/ellipsis/index.js +9 -23
  119. package/lib/ellipsis/style/index.css +1 -1
  120. package/lib/guide/index.js +25 -71
  121. package/lib/guide/style/index.css +1 -1
  122. package/lib/index.d.ts +1 -1
  123. package/lib/index.js +0 -29
  124. package/lib/input-number/ControlArrow.js +0 -4
  125. package/lib/input-number/constants.js +2 -2
  126. package/lib/input-number/index.js +26 -114
  127. package/lib/input-number/style/index.css +1 -1
  128. package/lib/lazy-image/index.js +10 -58
  129. package/lib/lazy-image/style/index.css +1 -1
  130. package/lib/link-list/index.js +11 -40
  131. package/lib/link-list/style/index.css +1 -1
  132. package/lib/loading/index.js +13 -48
  133. package/lib/loading/style/index.css +1 -1
  134. package/lib/loading-bar/index.js +0 -5
  135. package/lib/loading-bar/style/index.css +1 -1
  136. package/lib/loading-container/index.js +3 -11
  137. package/lib/loading-container/style/index.css +1 -1
  138. package/lib/loading-icon/index.js +0 -7
  139. package/lib/loading-icon/style/index.css +1 -1
  140. package/lib/mask/index.js +6 -17
  141. package/lib/mask/style/index.css +1 -1
  142. package/lib/message/index.d.ts +17 -6
  143. package/lib/message/index.js +67 -104
  144. package/lib/message/renderMessage.d.ts +17 -0
  145. package/lib/message/renderMessage.js +144 -0
  146. package/lib/message/style/index.css +1 -1
  147. package/lib/modal/Affix.js +0 -4
  148. package/lib/modal/Title.js +5 -15
  149. package/lib/modal/getPopupLocation.js +5 -9
  150. package/lib/modal/index.js +44 -135
  151. package/lib/modal/style/index.css +1 -1
  152. package/lib/move/index.js +32 -144
  153. package/lib/move/range.js +6 -14
  154. package/lib/move/utils.js +3 -12
  155. package/lib/popover/index.js +9 -33
  156. package/lib/popover/style/index.css +1 -1
  157. package/lib/portal/index.js +1 -25
  158. package/lib/script/index.js +19 -61
  159. package/lib/select/index.js +28 -113
  160. package/lib/select/style/index.css +1 -1
  161. package/lib/show-more/index.js +40 -110
  162. package/lib/skeleton/Item.js +1 -8
  163. package/lib/skeleton/index.js +5 -16
  164. package/lib/skeleton/style/index.css +1 -1
  165. package/lib/style.css +1 -33
  166. package/lib/table/body/BodyRow.js +11 -33
  167. package/lib/table/body/CheckIcon.js +10 -22
  168. package/lib/table/body/index.js +8 -17
  169. package/lib/table/header/CheckIcon.js +3 -15
  170. package/lib/table/header/HeaderCell.js +12 -37
  171. package/lib/table/header/HeaderRow.js +6 -22
  172. package/lib/table/index.js +30 -107
  173. package/lib/table/style/index.css +1 -1
  174. package/lib/tabs/index.js +35 -122
  175. package/lib/tabs/style/index.css +1 -1
  176. package/lib/tooltip/index.js +0 -9
  177. package/lib/tooltip/style/index.css +1 -1
  178. package/lib/trigger/align.js +0 -4
  179. package/lib/trigger/bottomAlign.js +33 -48
  180. package/lib/trigger/constants.js +0 -2
  181. package/lib/trigger/getPopupLocation.js +48 -74
  182. package/lib/trigger/index.js +52 -198
  183. package/lib/trigger/leftAlign.js +33 -50
  184. package/lib/trigger/ref.js +2 -12
  185. package/lib/trigger/rightAlign.js +33 -48
  186. package/lib/trigger/topAlign.js +33 -48
  187. package/lib/trigger/utils.js +28 -53
  188. package/package.json +9 -3
  189. package/esm/accordion/style/index.d.ts +0 -1
  190. package/esm/accordion/style/index.js +0 -5
  191. package/esm/affix/style/index.d.ts +0 -1
  192. package/esm/affix/style/index.js +0 -5
  193. package/esm/affix/style/index.scss +0 -35
  194. package/esm/base.scss +0 -42
  195. package/esm/carousel/style/index.d.ts +0 -1
  196. package/esm/carousel/style/index.js +0 -5
  197. package/esm/carousel/style/index.scss +0 -37
  198. package/esm/checkbox/style/index.d.ts +0 -1
  199. package/esm/checkbox/style/index.js +0 -5
  200. package/esm/checkbox/style/index.scss +0 -118
  201. package/esm/collapse/style/index.d.ts +0 -1
  202. package/esm/collapse/style/index.js +0 -5
  203. package/esm/collapse/style/index.scss +0 -43
  204. package/esm/confirm/style/index.d.ts +0 -1
  205. package/esm/confirm/style/index.js +0 -7
  206. package/esm/confirm/style/index.scss +0 -44
  207. package/esm/date-picker/calendar/grid/index.scss +0 -90
  208. package/esm/date-picker/calendar/index.scss +0 -58
  209. package/esm/date-picker/style/index.d.ts +0 -1
  210. package/esm/date-picker/style/index.js +0 -11
  211. package/esm/date-picker/style/index.scss +0 -24
  212. package/esm/drawer/style/index.d.ts +0 -1
  213. package/esm/drawer/style/index.js +0 -7
  214. package/esm/drawer/style/index.scss +0 -44
  215. package/esm/ellipsis/style/index.d.ts +0 -1
  216. package/esm/ellipsis/style/index.js +0 -5
  217. package/esm/ellipsis/style/index.scss +0 -35
  218. package/esm/guide/style/index.d.ts +0 -1
  219. package/esm/guide/style/index.js +0 -7
  220. package/esm/guide/style/index.scss +0 -18
  221. package/esm/input-number/style/index.d.ts +0 -1
  222. package/esm/input-number/style/index.js +0 -5
  223. package/esm/input-number/style/index.scss +0 -70
  224. package/esm/lazy-image/style/index.d.ts +0 -1
  225. package/esm/lazy-image/style/index.js +0 -5
  226. package/esm/lazy-image/style/index.scss +0 -25
  227. package/esm/link-list/style/index.d.ts +0 -1
  228. package/esm/link-list/style/index.js +0 -7
  229. package/esm/link-list/style/index.scss +0 -125
  230. package/esm/loading/style/index.d.ts +0 -1
  231. package/esm/loading/style/index.js +0 -7
  232. package/esm/loading/style/index.scss +0 -21
  233. package/esm/loading-bar/style/index.d.ts +0 -1
  234. package/esm/loading-bar/style/index.js +0 -5
  235. package/esm/loading-bar/style/index.scss +0 -62
  236. package/esm/loading-container/style/index.d.ts +0 -1
  237. package/esm/loading-container/style/index.js +0 -7
  238. package/esm/loading-container/style/index.scss +0 -28
  239. package/esm/loading-icon/style/index.d.ts +0 -1
  240. package/esm/loading-icon/style/index.js +0 -5
  241. package/esm/loading-icon/style/index.scss +0 -24
  242. package/esm/mask/style/index.d.ts +0 -1
  243. package/esm/mask/style/index.js +0 -5
  244. package/esm/mask/style/index.scss +0 -35
  245. package/esm/message/style/index.d.ts +0 -1
  246. package/esm/message/style/index.js +0 -5
  247. package/esm/message/style/index.scss +0 -71
  248. package/esm/modal/style/index.d.ts +0 -1
  249. package/esm/modal/style/index.js +0 -7
  250. package/esm/modal/style/index.scss +0 -112
  251. package/esm/move/style/index.d.ts +0 -1
  252. package/esm/move/style/index.js +0 -5
  253. package/esm/move/style/index.scss +0 -7
  254. package/esm/popover/style/index.d.ts +0 -1
  255. package/esm/popover/style/index.js +0 -7
  256. package/esm/popover/style/index.scss +0 -60
  257. package/esm/portal/style/index.d.ts +0 -1
  258. package/esm/portal/style/index.js +0 -5
  259. package/esm/portal/style/index.scss +0 -0
  260. package/esm/script/style/index.d.ts +0 -1
  261. package/esm/script/style/index.js +0 -1
  262. package/esm/script/style/index.scss +0 -0
  263. package/esm/select/style/index.d.ts +0 -1
  264. package/esm/select/style/index.js +0 -7
  265. package/esm/select/style/index.scss +0 -126
  266. package/esm/show-more/style/index.d.ts +0 -1
  267. package/esm/show-more/style/index.js +0 -5
  268. package/esm/show-more/style/index.scss +0 -23
  269. package/esm/skeleton/style/index.d.ts +0 -1
  270. package/esm/skeleton/style/index.js +0 -5
  271. package/esm/skeleton/style/index.scss +0 -27
  272. package/esm/table/style/index.d.ts +0 -1
  273. package/esm/table/style/index.js +0 -9
  274. package/esm/table/style/index.scss +0 -45
  275. package/esm/tabs/style/index.d.ts +0 -1
  276. package/esm/tabs/style/index.js +0 -5
  277. package/esm/tabs/style/index.scss +0 -62
  278. package/esm/tooltip/style/index.d.ts +0 -1
  279. package/esm/tooltip/style/index.js +0 -7
  280. package/esm/tooltip/style/index.scss +0 -62
  281. package/esm/trigger/style/index.d.ts +0 -1
  282. package/esm/trigger/style/index.js +0 -5
  283. package/esm/trigger/style/index.scss +0 -79
  284. package/lib/accordion/style/index.d.ts +0 -1
  285. package/lib/accordion/style/index.js +0 -7
  286. package/lib/affix/style/index.d.ts +0 -1
  287. package/lib/affix/style/index.js +0 -7
  288. package/lib/affix/style/index.scss +0 -35
  289. package/lib/base.scss +0 -42
  290. package/lib/carousel/style/index.d.ts +0 -1
  291. package/lib/carousel/style/index.js +0 -7
  292. package/lib/carousel/style/index.scss +0 -37
  293. package/lib/checkbox/style/index.d.ts +0 -1
  294. package/lib/checkbox/style/index.js +0 -7
  295. package/lib/checkbox/style/index.scss +0 -118
  296. package/lib/collapse/style/index.d.ts +0 -1
  297. package/lib/collapse/style/index.js +0 -7
  298. package/lib/collapse/style/index.scss +0 -43
  299. package/lib/confirm/style/index.d.ts +0 -1
  300. package/lib/confirm/style/index.js +0 -9
  301. package/lib/confirm/style/index.scss +0 -44
  302. package/lib/date-picker/calendar/grid/index.scss +0 -90
  303. package/lib/date-picker/calendar/index.scss +0 -58
  304. package/lib/date-picker/style/index.d.ts +0 -1
  305. package/lib/date-picker/style/index.js +0 -13
  306. package/lib/date-picker/style/index.scss +0 -24
  307. package/lib/drawer/style/index.d.ts +0 -1
  308. package/lib/drawer/style/index.js +0 -9
  309. package/lib/drawer/style/index.scss +0 -44
  310. package/lib/ellipsis/style/index.d.ts +0 -1
  311. package/lib/ellipsis/style/index.js +0 -7
  312. package/lib/ellipsis/style/index.scss +0 -35
  313. package/lib/guide/style/index.d.ts +0 -1
  314. package/lib/guide/style/index.js +0 -9
  315. package/lib/guide/style/index.scss +0 -18
  316. package/lib/input-number/style/index.d.ts +0 -1
  317. package/lib/input-number/style/index.js +0 -7
  318. package/lib/input-number/style/index.scss +0 -70
  319. package/lib/lazy-image/style/index.d.ts +0 -1
  320. package/lib/lazy-image/style/index.js +0 -7
  321. package/lib/lazy-image/style/index.scss +0 -25
  322. package/lib/link-list/style/index.d.ts +0 -1
  323. package/lib/link-list/style/index.js +0 -9
  324. package/lib/link-list/style/index.scss +0 -125
  325. package/lib/loading/style/index.d.ts +0 -1
  326. package/lib/loading/style/index.js +0 -9
  327. package/lib/loading/style/index.scss +0 -21
  328. package/lib/loading-bar/style/index.d.ts +0 -1
  329. package/lib/loading-bar/style/index.js +0 -7
  330. package/lib/loading-bar/style/index.scss +0 -62
  331. package/lib/loading-container/style/index.d.ts +0 -1
  332. package/lib/loading-container/style/index.js +0 -9
  333. package/lib/loading-container/style/index.scss +0 -28
  334. package/lib/loading-icon/style/index.d.ts +0 -1
  335. package/lib/loading-icon/style/index.js +0 -7
  336. package/lib/loading-icon/style/index.scss +0 -24
  337. package/lib/mask/style/index.d.ts +0 -1
  338. package/lib/mask/style/index.js +0 -7
  339. package/lib/mask/style/index.scss +0 -35
  340. package/lib/message/style/index.d.ts +0 -1
  341. package/lib/message/style/index.js +0 -7
  342. package/lib/message/style/index.scss +0 -71
  343. package/lib/modal/style/index.d.ts +0 -1
  344. package/lib/modal/style/index.js +0 -9
  345. package/lib/modal/style/index.scss +0 -112
  346. package/lib/move/style/index.d.ts +0 -1
  347. package/lib/move/style/index.js +0 -7
  348. package/lib/move/style/index.scss +0 -7
  349. package/lib/popover/style/index.d.ts +0 -1
  350. package/lib/popover/style/index.js +0 -9
  351. package/lib/popover/style/index.scss +0 -60
  352. package/lib/portal/style/index.d.ts +0 -1
  353. package/lib/portal/style/index.js +0 -7
  354. package/lib/portal/style/index.scss +0 -0
  355. package/lib/script/style/index.d.ts +0 -1
  356. package/lib/script/style/index.js +0 -1
  357. package/lib/script/style/index.scss +0 -0
  358. package/lib/select/style/index.d.ts +0 -1
  359. package/lib/select/style/index.js +0 -9
  360. package/lib/select/style/index.scss +0 -126
  361. package/lib/show-more/style/index.d.ts +0 -1
  362. package/lib/show-more/style/index.js +0 -7
  363. package/lib/show-more/style/index.scss +0 -23
  364. package/lib/skeleton/style/index.d.ts +0 -1
  365. package/lib/skeleton/style/index.js +0 -7
  366. package/lib/skeleton/style/index.scss +0 -27
  367. package/lib/table/style/index.d.ts +0 -1
  368. package/lib/table/style/index.js +0 -11
  369. package/lib/table/style/index.scss +0 -45
  370. package/lib/tabs/style/index.d.ts +0 -1
  371. package/lib/tabs/style/index.js +0 -7
  372. package/lib/tabs/style/index.scss +0 -62
  373. package/lib/tooltip/style/index.d.ts +0 -1
  374. package/lib/tooltip/style/index.js +0 -9
  375. package/lib/tooltip/style/index.scss +0 -62
  376. package/lib/trigger/style/index.d.ts +0 -1
  377. package/lib/trigger/style/index.js +0 -7
  378. package/lib/trigger/style/index.scss +0 -79
@@ -1,39 +1,29 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = void 0;
9
-
10
8
  var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
11
-
12
9
  var _react = _interopRequireDefault(require("react"));
13
-
14
10
  var _utils = require("@autobest-ui/utils");
15
-
16
11
  var __assign = void 0 && (void 0).__assign || function () {
17
12
  __assign = Object.assign || function (t) {
18
13
  for (var s, i = 1, n = arguments.length; i < n; i++) {
19
14
  s = arguments[i];
20
-
21
15
  for (var p in s) {
22
16
  if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
23
17
  }
24
18
  }
25
-
26
19
  return t;
27
20
  };
28
-
29
21
  return __assign.apply(this, arguments);
30
22
  };
31
-
32
23
  var getIndentCol = function getIndentCol(prefixCls, number) {
33
24
  if (number === 0) {
34
25
  return null;
35
26
  }
36
-
37
27
  return new Array(number).fill(false).map(function (_item, index) {
38
28
  return /*#__PURE__*/_react.default.createElement("td", {
39
29
  key: index,
@@ -41,52 +31,44 @@ var getIndentCol = function getIndentCol(prefixCls, number) {
41
31
  });
42
32
  });
43
33
  };
44
-
45
34
  function BodyRow(_a) {
46
35
  var className = _a.className,
47
- cls = _a.prefixCls,
48
- rowData = _a.rowData,
49
- index = _a.index,
50
- columns = _a.columns,
51
- indent = _a.indent,
52
- CheckCell = _a.CheckCell,
53
- isExpand = _a.isExpand,
54
- onRowClick = _a.onRowClick;
55
-
36
+ cls = _a.prefixCls,
37
+ rowData = _a.rowData,
38
+ index = _a.index,
39
+ columns = _a.columns,
40
+ indent = _a.indent,
41
+ CheckCell = _a.CheckCell,
42
+ isExpand = _a.isExpand,
43
+ onRowClick = _a.onRowClick;
56
44
  var indentCell = _react.default.useMemo(function () {
57
45
  return getIndentCol(cls, indent);
58
46
  }, [cls, indent]);
59
-
60
47
  var contentCells = [];
61
48
  columns.forEach(function (col, colIndex) {
62
49
  var renderer = (columns[colIndex] || {}).onRender;
63
50
  var renderInfo = renderer ? renderer(rowData, index, colIndex) : rowData[col.dataIndex];
64
51
  var cellProps = {};
65
52
  var content;
66
-
67
53
  if (renderInfo && (0, _typeof2.default)(renderInfo) === 'object' && !Array.isArray(renderInfo) && ! /*#__PURE__*/_react.default.isValidElement(renderInfo)) {
68
54
  var children = renderInfo.children,
69
- props = renderInfo.props;
55
+ props = renderInfo.props;
70
56
  content = children;
71
57
  cellProps = props;
72
58
  } else {
73
59
  content = renderInfo;
74
60
  }
75
-
76
61
  var colSpan = cellProps.colSpan,
77
- rowSpan = cellProps.rowSpan,
78
- tdClassName = cellProps.className;
79
-
62
+ rowSpan = cellProps.rowSpan,
63
+ tdClassName = cellProps.className;
80
64
  var cellInfo = __assign(__assign({}, col), {
81
65
  content: content,
82
66
  colSpan: colSpan === undefined ? 1 : colSpan,
83
67
  rowSpan: rowSpan === undefined ? 1 : rowSpan
84
68
  });
85
-
86
69
  if (cellInfo.colSpan === 0 || cellInfo.rowSpan === 0 || isExpand && !cellInfo.content) {
87
70
  return;
88
71
  }
89
-
90
72
  contentCells.push( /*#__PURE__*/_react.default.createElement("td", {
91
73
  className: tdClassName,
92
74
  key: cellInfo.key,
@@ -94,23 +76,19 @@ function BodyRow(_a) {
94
76
  rowSpan: cellInfo.rowSpan
95
77
  }, cellInfo.content));
96
78
  });
97
-
98
79
  var onTrClick = function onTrClick() {
99
80
  if (onRowClick) {
100
81
  onRowClick(rowData, index);
101
82
  }
102
83
  };
103
-
104
84
  if (!(0, _utils.isEmptyArray)(contentCells)) {
105
85
  return /*#__PURE__*/_react.default.createElement("tr", {
106
86
  className: className,
107
87
  onClick: onTrClick
108
88
  }, indentCell, CheckCell, contentCells);
109
89
  }
110
-
111
90
  return null;
112
91
  }
113
-
114
92
  BodyRow.defaultProps = {
115
93
  isExpand: false
116
94
  };
@@ -1,47 +1,37 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = void 0;
9
-
10
8
  var _react = _interopRequireDefault(require("react"));
11
-
12
9
  var _checkbox = _interopRequireDefault(require("../../checkbox"));
13
-
14
10
  function BodyCheckIcon(_a) {
15
11
  var cls = _a.prefixCls,
16
- rowData = _a.rowData,
17
- rowKey = _a.rowKey,
18
- rowIndex = _a.rowIndex,
19
- selectedRowKeys = _a.selectedRowKeys,
20
- _b = _a.rowSelection,
21
- checkIcon = _b.checkIcon,
22
- getDisabled = _b.getDisabled,
23
- onSelect = _b.onSelect;
12
+ rowData = _a.rowData,
13
+ rowKey = _a.rowKey,
14
+ rowIndex = _a.rowIndex,
15
+ selectedRowKeys = _a.selectedRowKeys,
16
+ _b = _a.rowSelection,
17
+ checkIcon = _b.checkIcon,
18
+ getDisabled = _b.getDisabled,
19
+ onSelect = _b.onSelect;
24
20
  var checked = selectedRowKeys.includes(rowKey);
25
-
26
21
  if (checkIcon) {
27
22
  return /*#__PURE__*/_react.default.createElement("td", null, checkIcon(checked, rowData, rowIndex));
28
23
  }
29
-
30
24
  var disabled = getDisabled(rowData);
31
-
32
25
  var onCheckBoxChange = function onCheckBoxChange(currentChecked) {
33
26
  onSelect(currentChecked, rowData, rowIndex);
34
27
  };
35
-
36
28
  var onClickCell = function onClickCell(ev) {
37
29
  if (!ev) {
38
30
  return;
39
- } // 阻止触发onRowClick
40
-
41
-
31
+ }
32
+ // 阻止触发onRowClick
42
33
  ev.stopPropagation();
43
34
  };
44
-
45
35
  return /*#__PURE__*/_react.default.createElement("td", {
46
36
  className: "".concat(cls, "-checkbox"),
47
37
  onClick: onClickCell
@@ -51,7 +41,5 @@ function BodyCheckIcon(_a) {
51
41
  onChange: onCheckBoxChange
52
42
  }));
53
43
  }
54
-
55
44
  var _default = /*#__PURE__*/_react.default.memo(BodyCheckIcon);
56
-
57
45
  exports.default = _default;
@@ -1,34 +1,27 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = void 0;
9
-
10
8
  var _react = _interopRequireDefault(require("react"));
11
-
12
9
  var _utils = require("@autobest-ui/utils");
13
-
14
10
  var _BodyRow = _interopRequireDefault(require("./BodyRow"));
15
-
16
11
  var _CheckIcon = _interopRequireDefault(require("./CheckIcon"));
17
-
18
12
  var noop = function noop() {
19
13
  return null;
20
14
  };
21
-
22
15
  function Body(_a) {
23
16
  var prefixCls = _a.prefixCls,
24
- columns = _a.columns,
25
- dataSource = _a.dataSource,
26
- getRowKey = _a.getRowKey,
27
- rowSelection = _a.rowSelection,
28
- selectedRowKeys = _a.selectedRowKeys,
29
- expandable = _a.expandable,
30
- onRowClick = _a.onRowClick,
31
- getRowClassName = _a.getRowClassName;
17
+ columns = _a.columns,
18
+ dataSource = _a.dataSource,
19
+ getRowKey = _a.getRowKey,
20
+ rowSelection = _a.rowSelection,
21
+ selectedRowKeys = _a.selectedRowKeys,
22
+ expandable = _a.expandable,
23
+ onRowClick = _a.onRowClick,
24
+ getRowClassName = _a.getRowClassName;
32
25
  var rows = [];
33
26
  var expandedRowRenderer = expandable ? expandable.expandedRowRender : noop;
34
27
  dataSource.forEach(function (row, rowIndex) {
@@ -52,7 +45,6 @@ function Body(_a) {
52
45
  onRowClick: onRowClick,
53
46
  className: getRowClassName(row, rowIndex)
54
47
  }));
55
-
56
48
  if (expandable) {
57
49
  var expandedRowKey = "".concat(rowKey, " expanded");
58
50
  var expandedColumns = [{
@@ -76,6 +68,5 @@ function Body(_a) {
76
68
  });
77
69
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, rows);
78
70
  }
79
-
80
71
  var _default = Body;
81
72
  exports.default = _default;
@@ -1,41 +1,31 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = void 0;
9
-
10
8
  var _react = _interopRequireDefault(require("react"));
11
-
12
9
  var _checkbox = _interopRequireDefault(require("../../checkbox"));
13
-
14
10
  function HeaderCheckIcon(_a) {
15
11
  var cls = _a.prefixCls,
16
- rowSelection = _a.rowSelection;
17
-
12
+ rowSelection = _a.rowSelection;
18
13
  if (!rowSelection) {
19
14
  return null;
20
15
  }
21
-
22
16
  if (!rowSelection.selectAllVisible) {
23
17
  // 有勾选功能,但是没有全选功能,需有占位元素
24
18
  return /*#__PURE__*/_react.default.createElement("th", null, " ");
25
19
  }
26
-
27
20
  var checkIcon = rowSelection.checkIcon,
28
- selectAllChecked = rowSelection.selectAllChecked,
29
- onSelectAll = rowSelection.onSelectAll;
30
-
21
+ selectAllChecked = rowSelection.selectAllChecked,
22
+ onSelectAll = rowSelection.onSelectAll;
31
23
  if (checkIcon) {
32
24
  return /*#__PURE__*/_react.default.createElement("th", null, checkIcon(selectAllChecked, null, -1));
33
25
  }
34
-
35
26
  var onCheckBoxChange = function onCheckBoxChange() {
36
27
  onSelectAll(!selectAllChecked);
37
28
  };
38
-
39
29
  return /*#__PURE__*/_react.default.createElement("th", {
40
30
  className: "".concat(cls, "-checkbox")
41
31
  }, /*#__PURE__*/_react.default.createElement(_checkbox.default, {
@@ -43,7 +33,5 @@ function HeaderCheckIcon(_a) {
43
33
  onChange: onCheckBoxChange
44
34
  }));
45
35
  }
46
-
47
36
  var _default = /*#__PURE__*/_react.default.memo(HeaderCheckIcon);
48
-
49
37
  exports.default = _default;
@@ -1,16 +1,12 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = void 0;
9
-
10
8
  var _react = _interopRequireDefault(require("react"));
11
-
12
9
  var _classnames = _interopRequireDefault(require("classnames"));
13
-
14
10
  var __extends = void 0 && (void 0).__extends || function () {
15
11
  var _extendStatics = function extendStatics(d, b) {
16
12
  _extendStatics = Object.setPrototypeOf || {
@@ -22,60 +18,44 @@ var __extends = void 0 && (void 0).__extends || function () {
22
18
  if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
23
19
  }
24
20
  };
25
-
26
21
  return _extendStatics(d, b);
27
22
  };
28
-
29
23
  return function (d, b) {
30
24
  if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
31
-
32
25
  _extendStatics(d, b);
33
-
34
26
  function __() {
35
27
  this.constructor = d;
36
28
  }
37
-
38
29
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
39
30
  };
40
31
  }();
41
-
42
32
  var rotate180Style = {
43
33
  transform: 'rotate(180deg)'
44
34
  };
45
-
46
- var HeaderCell =
47
- /** @class */
48
- function (_super) {
35
+ var HeaderCell = /** @class */function (_super) {
49
36
  __extends(HeaderCell, _super);
50
-
51
37
  function HeaderCell() {
52
38
  var _this = _super !== null && _super.apply(this, arguments) || this;
53
-
54
39
  _this.onClick = function () {
55
40
  var _a = _this.props,
56
- onSort = _a.onSort,
57
- sortName = _a.sortName;
58
-
41
+ onSort = _a.onSort,
42
+ sortName = _a.sortName;
59
43
  if (sortName && onSort) {
60
44
  onSort(sortName);
61
45
  }
62
46
  };
63
-
64
47
  _this.renderArrow = function () {
65
48
  var _a = _this.props,
66
- prefixCls = _a.prefixCls,
67
- isSort = _a.isSort,
68
- isSortedDescending = _a.isSortedDescending,
69
- sortIcon = _a.sortIcon;
70
-
49
+ prefixCls = _a.prefixCls,
50
+ isSort = _a.isSort,
51
+ isSortedDescending = _a.isSortedDescending,
52
+ sortIcon = _a.sortIcon;
71
53
  if (!isSort) {
72
54
  return null;
73
55
  }
74
-
75
56
  if (sortIcon) {
76
57
  return sortIcon(isSortedDescending);
77
58
  }
78
-
79
59
  return /*#__PURE__*/_react.default.createElement("span", {
80
60
  className: "".concat(prefixCls, "-arrow")
81
61
  }, /*#__PURE__*/_react.default.createElement("svg", {
@@ -90,19 +70,16 @@ function (_super) {
90
70
  d: "M525.339326 186.172452L801.789086 462.622212c12.496698 12.496698 32.758136 12.496698 45.254834 0 12.497405-12.497405 12.496698-32.758136 0-45.254834l-331.014362-331.014362c-12.496698-12.496698-32.757429-12.497405-45.254834 0l-341.795619 339.143969c-12.496698 12.496698-12.496698 32.758136 0 45.254834 12.496698 12.496698 32.758136 12.496698 45.254834 0l287.10586-284.454209L461.372325 925.726242c0 17.673427 14.32669 32.000117 32.000118 32.000117 17.67272-0.000707 31.99941-14.327398 32.000117-32.000117l-0.032527-739.553083z"
91
71
  })));
92
72
  };
93
-
94
73
  return _this;
95
74
  }
96
-
97
75
  HeaderCell.prototype.render = function () {
98
76
  var _a;
99
-
100
77
  var _b = this.props,
101
- prefixCls = _b.prefixCls,
102
- className = _b.className,
103
- title = _b.title,
104
- sortName = _b.sortName,
105
- colSpan = _b.colSpan;
78
+ prefixCls = _b.prefixCls,
79
+ className = _b.className,
80
+ title = _b.title,
81
+ sortName = _b.sortName,
82
+ colSpan = _b.colSpan;
106
83
  return /*#__PURE__*/_react.default.createElement("th", {
107
84
  className: (0, _classnames.default)(className, (_a = {}, _a["".concat(prefixCls, "-point")] = sortName, _a)),
108
85
  colSpan: colSpan,
@@ -111,9 +88,7 @@ function (_super) {
111
88
  className: "".concat(prefixCls, "-title")
112
89
  }, title, this.renderArrow()));
113
90
  };
114
-
115
91
  return HeaderCell;
116
92
  }(_react.default.PureComponent);
117
-
118
93
  var _default = HeaderCell;
119
94
  exports.default = _default;
@@ -1,74 +1,59 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = void 0;
9
-
10
8
  var _react = _interopRequireDefault(require("react"));
11
-
12
9
  var _HeaderCell = _interopRequireDefault(require("./HeaderCell"));
13
-
14
10
  var _CheckIcon = _interopRequireDefault(require("./CheckIcon"));
15
-
16
11
  var __assign = void 0 && (void 0).__assign || function () {
17
12
  __assign = Object.assign || function (t) {
18
13
  for (var s, i = 1, n = arguments.length; i < n; i++) {
19
14
  s = arguments[i];
20
-
21
15
  for (var p in s) {
22
16
  if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
23
17
  }
24
18
  }
25
-
26
19
  return t;
27
20
  };
28
-
29
21
  return __assign.apply(this, arguments);
30
22
  };
31
-
32
23
  function parseHeaderRows(columns) {
33
24
  var rows = [];
34
25
  columns.forEach(function (col) {
35
26
  if ('colSpan' in col && col.colSpan === 0) {
36
27
  return;
37
28
  }
38
-
39
29
  rows.push(__assign(__assign({}, col), {
40
30
  colSpan: col.colSpan ? col.colSpan : 1
41
31
  }));
42
32
  });
43
33
  return rows;
44
34
  }
45
-
46
35
  function HeaderRow(_a) {
47
36
  var cls = _a.prefixCls,
48
- columns = _a.columns,
49
- rowSelection = _a.rowSelection,
50
- sortName = _a.sortName,
51
- isSortedDescending = _a.isSortedDescending,
52
- onSortChange = _a.onSortChange,
53
- sortIcon = _a.sortIcon;
37
+ columns = _a.columns,
38
+ rowSelection = _a.rowSelection,
39
+ sortName = _a.sortName,
40
+ isSortedDescending = _a.isSortedDescending,
41
+ onSortChange = _a.onSortChange,
42
+ sortIcon = _a.sortIcon;
54
43
  /**
55
44
  * 点击某一列的表头,触发排序
56
45
  * @param name
57
46
  */
58
-
59
47
  var onSort = function onSort(name) {
60
48
  if (!onSortChange) {
61
49
  return;
62
50
  }
63
-
64
51
  var isSortedDesc = sortName === name ? !isSortedDescending : true;
65
52
  onSortChange(isSortedDesc, name);
66
53
  };
67
-
68
54
  var rows = _react.default.useMemo(function () {
69
55
  return parseHeaderRows(columns);
70
56
  }, [columns]);
71
-
72
57
  return /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement(_CheckIcon.default, {
73
58
  prefixCls: cls,
74
59
  rowSelection: rowSelection
@@ -84,6 +69,5 @@ function HeaderRow(_a) {
84
69
  }));
85
70
  }));
86
71
  }
87
-
88
72
  var _default = HeaderRow;
89
73
  exports.default = _default;