@unicom-cloud/ui 0.8.66 → 0.8.68

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 (708) hide show
  1. package/Affix.js +15 -124
  2. package/Alert.js +13 -110
  3. package/Anchor.js +2 -2
  4. package/AutoComplete.js +15 -146
  5. package/Avatar.js +4 -154
  6. package/BackTop.js +14 -83
  7. package/Badge.js +12 -176
  8. package/Breadcrumb.js +12 -138
  9. package/Button.js +12 -149
  10. package/Calendar.js +12 -569
  11. package/Card.js +10 -136
  12. package/Carousel.js +13 -380
  13. package/Cascader.js +2 -2
  14. package/Checkbox.js +2 -2
  15. package/Collapse.js +2 -2
  16. package/ColorPicker.js +14 -582
  17. package/Comment.js +10 -71
  18. package/ConfigProvider.js +5 -6
  19. package/Copy.js +12 -60
  20. package/DatePicker.js +11 -2042
  21. package/Descriptions.js +11 -176
  22. package/Divider.js +7 -38
  23. package/Draggable.js +7 -89
  24. package/Drawer.js +2 -2
  25. package/Dropdown.js +15 -199
  26. package/Empty.js +3 -3
  27. package/Form.js +16 -1416
  28. package/Grid.js +9 -252
  29. package/Icon.js +7 -55
  30. package/IconHover.js +2 -2
  31. package/Image.js +6 -5
  32. package/Input.js +11 -10
  33. package/InputNumber.js +9 -7
  34. package/InputTag.js +2 -2
  35. package/Layout.js +16 -56
  36. package/Link.js +9 -60
  37. package/List.js +18 -312
  38. package/Loading.js +4 -59
  39. package/Mentions.js +12 -163
  40. package/Menu.js +8 -7
  41. package/Message.js +9 -7
  42. package/Modal.js +2 -2
  43. package/Notice.js +13 -3
  44. package/Notification.js +10 -7
  45. package/OverflowEllipsis.js +8 -96
  46. package/PageHeader.js +13 -113
  47. package/Pagination.js +2 -2
  48. package/Picker.js +4 -3
  49. package/Popconfirm.js +13 -128
  50. package/Popover.js +10 -76
  51. package/Portal.js +5 -33
  52. package/Progress.js +11 -363
  53. package/Radio.js +5 -6
  54. package/Rate.js +14 -125
  55. package/ResizeBox.js +16 -555
  56. package/Result.js +14 -1434
  57. package/Select.js +4 -3
  58. package/SelectView.js +9 -406
  59. package/Skeleton.js +11 -94
  60. package/Slider.js +21 -773
  61. package/Space.js +11 -94
  62. package/SpeechSynthesis.js +48 -57
  63. package/Spin.js +11 -94
  64. package/Statistic.js +15 -192
  65. package/Steps.js +11 -148
  66. package/SuspenseFallbackTest.js +3 -10
  67. package/Switch.js +13 -114
  68. package/Table.js +16 -2032
  69. package/Tabs.js +4 -4
  70. package/Tag.js +13 -134
  71. package/TimePicker.js +7 -274
  72. package/Timeline.js +4 -4
  73. package/Tooltip.js +12 -136
  74. package/Transfer.js +14 -449
  75. package/Tree.js +4 -2
  76. package/TreeSelect.js +3 -4
  77. package/Trigger.js +21 -882
  78. package/Typography.js +10 -6
  79. package/Upload.js +4 -4
  80. package/VerificationCode.js +2 -2
  81. package/VirtualList.js +2 -2
  82. package/Watermark.js +2 -2
  83. package/affix/index.js +126 -0
  84. package/alert/index.js +112 -0
  85. package/alert/interface.js +1 -0
  86. package/anchor/Anchor.js +198 -0
  87. package/anchor/Link.js +52 -0
  88. package/anchor/context.js +14 -0
  89. package/anchor/index.js +4 -0
  90. package/anchor/interface.js +1 -0
  91. package/anchor/util.js +50 -0
  92. package/auto-complete/index.js +149 -0
  93. package/auto-complete/interface.js +1 -0
  94. package/avatar/Avatar.js +83 -0
  95. package/avatar/Group.js +82 -0
  96. package/avatar/context.js +5 -0
  97. package/avatar/index.js +7 -0
  98. package/avatar/interface.js +1 -0
  99. package/back-top/index.js +85 -0
  100. package/back-top/interface.js +1 -0
  101. package/badge/Count.js +35 -0
  102. package/badge/index.js +151 -0
  103. package/badge/interface.js +1 -0
  104. package/breadcrumb/Item.js +67 -0
  105. package/breadcrumb/index.js +81 -0
  106. package/breadcrumb/interface.js +1 -0
  107. package/button/Group.js +13 -0
  108. package/button/index.js +146 -0
  109. package/button/interface.js +1 -0
  110. package/calendar/Month.js +12 -0
  111. package/calendar/WeekList.js +24 -0
  112. package/calendar/Year.js +74 -0
  113. package/calendar/index.js +320 -0
  114. package/calendar/interface.js +1 -0
  115. package/card/Grid.js +25 -0
  116. package/card/Meta.js +30 -0
  117. package/card/index.js +99 -0
  118. package/card/interface.js +1 -0
  119. package/carousel/Arrow.js +55 -0
  120. package/carousel/Indicator.js +66 -0
  121. package/carousel/index.js +278 -0
  122. package/carousel/interface.js +1 -0
  123. package/cascader/Cascader.js +26 -0
  124. package/cascader/index.js +4 -0
  125. package/cascader/interface.js +1 -0
  126. package/cascader/util.js +14 -0
  127. package/checkbox/Checkbox.js +16 -0
  128. package/checkbox/Group.js +14 -0
  129. package/checkbox/IconCheck.js +19 -0
  130. package/checkbox/index.js +4 -0
  131. package/checkbox/interface.js +1 -0
  132. package/checkbox/useCheckbox.js +45 -0
  133. package/chunk/5_U1CBIu.js +8 -0
  134. package/chunk/{B8QV6E2b.js → AwZqeapI.js} +5 -5
  135. package/chunk/B2yFlXke.js +6 -0
  136. package/chunk/B4JiMp8I.js +764 -0
  137. package/chunk/B4YRLi8r.js +11 -0
  138. package/chunk/B5RFT17G.js +15 -0
  139. package/chunk/{BnSVm1YC.js → B6X4lnd0.js} +1 -1
  140. package/chunk/B7M-FGia.js +41 -0
  141. package/chunk/BBkdXHrJ.js +24 -0
  142. package/chunk/BDB0LByj.js +98 -0
  143. package/chunk/BFTV6myl.js +19 -0
  144. package/chunk/BJ1soa2K.js +178 -0
  145. package/chunk/BKKEev13.js +11 -0
  146. package/chunk/BKT9BFf4.js +11 -0
  147. package/chunk/BSCrLtfQ.js +10 -0
  148. package/chunk/{CPvvjMwZ.js → BSaQv6mx.js} +46 -43
  149. package/chunk/BXAeh0_V.js +16 -0
  150. package/chunk/Bfq4YEcr.js +23 -0
  151. package/chunk/Bg3uJGPu.js +10 -0
  152. package/chunk/{jhQQCFMn.js → Bi4UkwOR.js} +138 -126
  153. package/chunk/BibHFOCF.js +34 -0
  154. package/chunk/Biupwn8l.js +24 -0
  155. package/chunk/BjpUSKM3.js +629 -0
  156. package/chunk/{D_-UD4vO.js → Bl7BnD1R.js} +9 -9
  157. package/chunk/BrOW642m.js +130 -0
  158. package/chunk/BsY85n3_.js +14 -0
  159. package/chunk/C48SmsN-.js +38 -0
  160. package/chunk/C4OrxKE6.js +18 -0
  161. package/chunk/C98ks5S8.js +473 -0
  162. package/chunk/CC---6jO.js +110 -0
  163. package/chunk/{DUeHQKtx.js → CCv-5KFt.js} +78 -78
  164. package/chunk/{CZOP_ZHJ.js → CD3AUpzo.js} +24 -24
  165. package/chunk/CIRG541s.js +22 -0
  166. package/chunk/CKyu68pu.js +312 -0
  167. package/chunk/CQ_WOOmf.js +8 -0
  168. package/chunk/{CANaGbGR.js → CVYWxu00.js} +54 -53
  169. package/chunk/CYhxqVkn.js +9 -0
  170. package/chunk/CbLaCJmG.js +26 -0
  171. package/chunk/CdaT1b_F.js +20 -0
  172. package/chunk/Ce1j9KTi.js +6 -0
  173. package/chunk/CftuXmo_.js +6 -0
  174. package/chunk/CgurXnoy.js +569 -0
  175. package/chunk/Clo26EcR.js +34 -0
  176. package/chunk/ClqoGc3r.js +17 -0
  177. package/chunk/CmZzBtA4.js +16 -0
  178. package/chunk/CpGBWmuz.js +1461 -0
  179. package/chunk/CzQObzKd.js +1817 -0
  180. package/chunk/D-TPB2Do.js +56 -0
  181. package/chunk/D090jlwP.js +38 -0
  182. package/chunk/D0ZWT7db.js +5 -0
  183. package/chunk/DH7HTOV_.js +11 -0
  184. package/chunk/DKHXj8Kf.js +9 -0
  185. package/chunk/Dh7Osrvr.js +27 -0
  186. package/chunk/DonYzv30.js +14 -0
  187. package/chunk/DpoumMDw.js +50 -0
  188. package/chunk/Duezix3m.js +25 -0
  189. package/chunk/DxVvggX2.js +11 -0
  190. package/chunk/DzVH9IBy.js +1413 -0
  191. package/chunk/{CwhPMMWy.js → Ey4YJCkX.js} +7 -7
  192. package/chunk/JPPo5nY_.js +9 -0
  193. package/chunk/SSK90wgo.js +209 -0
  194. package/chunk/{CSC_V_25.js → URXCKjXr.js} +8 -8
  195. package/chunk/VSe_Wq1g.js +10 -0
  196. package/chunk/XTEsYGuF.js +17 -0
  197. package/chunk/b1e8awfs.js +31 -0
  198. package/chunk/hEWZQ8Zi.js +16 -0
  199. package/chunk/k-OUstoD.js +58 -0
  200. package/chunk/ll867Bf3.js +730 -0
  201. package/chunk/oopARUrq.js +10 -0
  202. package/chunk/tamGhTJp.js +186 -0
  203. package/chunk/{4-gvEY5y.js → uKZyjtff.js} +28 -28
  204. package/chunk/vmgkWLYf.js +843 -0
  205. package/chunk/yl4BU7Sd.js +1068 -0
  206. package/chunk/zmmqLCF4.js +20 -0
  207. package/collapse/Collapse.js +15 -0
  208. package/collapse/Item.js +11 -0
  209. package/collapse/index.js +4 -0
  210. package/collapse/interface.js +1 -0
  211. package/color-picker/ControlBar.js +63 -0
  212. package/color-picker/InputAlpha.js +22 -0
  213. package/color-picker/InputHex.js +55 -0
  214. package/color-picker/InputRgb.js +61 -0
  215. package/color-picker/Mode.js +10 -0
  216. package/color-picker/Palette.js +34 -0
  217. package/color-picker/Panel.js +268 -0
  218. package/color-picker/colors.js +37 -0
  219. package/color-picker/index.js +270 -0
  220. package/color-picker/interface.js +4 -0
  221. package/color-picker/utils.js +89 -0
  222. package/comment/index.js +73 -0
  223. package/comment/interface.js +1 -0
  224. package/config-provider/ConfigProvider.js +15 -0
  225. package/config-provider/context.js +8 -0
  226. package/config-provider/index.js +8 -0
  227. package/config-provider/interface.js +1 -0
  228. package/copy/index.js +63 -0
  229. package/copy/interface.js +1 -0
  230. package/date-picker/Picker.js +410 -0
  231. package/date-picker/PickerRange.js +24 -0
  232. package/date-picker/context.js +5 -0
  233. package/date-picker/index.js +50 -0
  234. package/date-picker/interface.js +1 -0
  235. package/date-picker/util.js +76 -0
  236. package/descriptions/index.js +178 -0
  237. package/descriptions/interface.js +1 -0
  238. package/divider/index.js +40 -0
  239. package/divider/interface.js +1 -0
  240. package/draggable/Item.js +67 -0
  241. package/draggable/index.js +32 -0
  242. package/draggable/interface.js +1 -0
  243. package/{chunk/BFipyA67.js → drawer/Drawer.js} +39 -39
  244. package/drawer/index.js +4 -0
  245. package/drawer/interface.js +1 -0
  246. package/dropdown/Button.js +11 -0
  247. package/dropdown/index.js +201 -0
  248. package/dropdown/interface.js +1 -0
  249. package/empty/index.js +9 -0
  250. package/empty/interface.js +1 -0
  251. package/form/Control.js +262 -0
  252. package/form/Form.js +160 -0
  253. package/form/FormItem.js +239 -0
  254. package/form/FormLabel.js +54 -0
  255. package/form/FormList.js +100 -0
  256. package/form/FormProvider.js +48 -0
  257. package/form/IconSymbol.js +20 -0
  258. package/form/context.js +43 -0
  259. package/form/index.js +107 -0
  260. package/form/interface.js +11 -0
  261. package/form/promisify.js +32 -0
  262. package/form/store.js +360 -0
  263. package/form/useForm.js +53 -0
  264. package/form/util.js +75 -0
  265. package/grid/Col.js +85 -0
  266. package/grid/Row.js +86 -0
  267. package/grid/context.js +9 -0
  268. package/grid/grid-item.js +75 -0
  269. package/grid/grid.js +103 -0
  270. package/grid/index.js +15 -0
  271. package/grid/interface.js +1 -0
  272. package/grid/util.js +51 -0
  273. package/hooks/index.js +51 -47
  274. package/hooks/useComputedState.js +2 -10
  275. package/hooks/useCreate.js +2 -7
  276. package/hooks/useForceUpdate.js +2 -7
  277. package/hooks/useId.js +2 -10
  278. package/hooks/useInView.js +2 -30
  279. package/hooks/useIntersectionObserver.js +2 -23
  280. package/hooks/useInterval.js +2 -17
  281. package/hooks/useIsFirstRender.js +2 -9
  282. package/hooks/useIsomorphicLayoutEffect.js +2 -5
  283. package/hooks/useKeyboardEvent.js +2 -16
  284. package/hooks/useMedia.js +2 -15
  285. package/hooks/useMergeProps.js +2 -18
  286. package/hooks/useMergeValue.js +2 -19
  287. package/hooks/useOnlineStatus.js +4 -0
  288. package/hooks/useOverflowHidden.js +2 -25
  289. package/hooks/useOverrideRef.js +2 -13
  290. package/hooks/usePersistCallback.js +2 -13
  291. package/hooks/usePrefersColorSchemeDark.js +4 -0
  292. package/hooks/usePrevious.js +2 -9
  293. package/hooks/useRefs.js +2 -9
  294. package/hooks/useResizeObserver.js +2 -15
  295. package/hooks/useStateCallback.js +2 -15
  296. package/hooks/useStateWithPromise.js +2 -24
  297. package/hooks/useUpdateEffect.js +2 -9
  298. package/hooks/useVerificationCode.js +73 -0
  299. package/hooks/useWatch.js +2 -10
  300. package/hooks/{use-watermark.js → useWatermark.js} +2 -1
  301. package/hooks/useWindowSize.js +2 -20
  302. package/icon/addFromIconFontCn.js +7 -0
  303. package/icon/index.js +57 -0
  304. package/icon-hover/index.js +7 -0
  305. package/image/Image.js +191 -0
  306. package/image/ImageFooter.js +8 -0
  307. package/image/ImagePreview.js +41 -0
  308. package/image/ImagePreviewArrow.js +46 -0
  309. package/image/ImagePreviewGroup.js +125 -0
  310. package/image/ImagePreviewToolbar.js +99 -0
  311. package/image/TriggerForToolbar.js +10 -0
  312. package/image/index.js +8 -0
  313. package/image/interface.js +1 -0
  314. package/image/previewGroupContext.js +17 -0
  315. package/index.js +604 -585
  316. package/input/Group.js +18 -0
  317. package/input/Input.js +688 -0
  318. package/input/InputElement.js +235 -0
  319. package/input/Number.js +4 -0
  320. package/input/Password.js +13 -0
  321. package/input/Search.js +14 -0
  322. package/input/Tag.js +4 -0
  323. package/input/Textarea.js +16 -0
  324. package/input/autoSizeTextAreaHeight.js +65 -0
  325. package/input/index.js +15 -0
  326. package/input/interface.js +1 -0
  327. package/input/useComposition.js +39 -0
  328. package/input-number/decimal.js +154 -0
  329. package/input-number/index.js +18 -0
  330. package/input-number/interface.js +1 -0
  331. package/input-number/useSelectionRange.js +26 -0
  332. package/input-number/util.js +57 -0
  333. package/{chunk/C6QWSzsM.js → input-tag/InputTag.js} +97 -89
  334. package/input-tag/index.js +4 -0
  335. package/input-tag/interface.js +1 -0
  336. package/layout/Content.js +13 -0
  337. package/layout/Footer.js +13 -0
  338. package/layout/Header.js +13 -0
  339. package/{chunk/CssIjN1g.js → layout/Sider.js} +12 -12
  340. package/layout/index.js +43 -0
  341. package/layout/interface.js +1 -0
  342. package/link/index.js +62 -0
  343. package/link/interface.js +1 -0
  344. package/list/Item.js +44 -0
  345. package/list/Meta.js +19 -0
  346. package/list/index.js +269 -0
  347. package/list/interface.js +1 -0
  348. package/loading/index.js +61 -0
  349. package/locale/en-US.js +4 -2
  350. package/locale/interface.js +1 -4
  351. package/locale/ja-JP.js +3 -1
  352. package/locale/tr-TR.js +1 -1
  353. package/locale/zh-CN.js +3 -1
  354. package/locale/zh-HK.js +3 -1
  355. package/locale/zh-TW.js +3 -1
  356. package/mentions/index.js +146 -0
  357. package/mentions/interface.js +1 -0
  358. package/mentions/util.js +26 -0
  359. package/menu/Indent.js +17 -0
  360. package/menu/Item.js +125 -0
  361. package/menu/ItemGroup.js +39 -0
  362. package/menu/Menu.js +26 -0
  363. package/menu/OverflowWrap.js +10 -0
  364. package/menu/context.js +5 -0
  365. package/menu/index.js +11 -0
  366. package/menu/interface.js +1 -0
  367. package/menu/util.js +80 -0
  368. package/message/index.js +14 -0
  369. package/message/interface.js +1 -0
  370. package/message/useMessage.js +7 -0
  371. package/modal/Confirm.js +13 -0
  372. package/modal/Modal.js +21 -0
  373. package/modal/config.js +25 -0
  374. package/modal/index.js +4 -0
  375. package/modal/interface.js +1 -0
  376. package/notice/index.js +24 -0
  377. package/notification/index.js +16 -0
  378. package/notification/interface.js +1 -0
  379. package/notification/useNotification.js +6 -0
  380. package/notification/withNotification.js +49 -0
  381. package/overflow-ellipsis/OverflowItem.js +35 -0
  382. package/overflow-ellipsis/index.js +74 -0
  383. package/package.json +1 -1
  384. package/page-header/index.js +115 -0
  385. package/page-header/interface.js +1 -0
  386. package/pagination/PageItem.js +119 -0
  387. package/pagination/PageJumper.js +60 -0
  388. package/pagination/PageOption.js +47 -0
  389. package/pagination/Pagination.js +245 -0
  390. package/pagination/index.js +4 -0
  391. package/pagination/interface.js +1 -0
  392. package/picker/Input.js +130 -0
  393. package/picker/InputRange.js +158 -0
  394. package/picker/index.js +6 -0
  395. package/popconfirm/index.js +130 -0
  396. package/popconfirm/interface.js +1 -0
  397. package/popover/index.js +78 -0
  398. package/popover/interface.js +1 -0
  399. package/portal/Portal.js +15 -0
  400. package/portal/index.js +17 -0
  401. package/progress/CircleProgress.js +117 -0
  402. package/progress/LineProgess.js +103 -0
  403. package/progress/StepProgress.js +74 -0
  404. package/progress/index.js +99 -0
  405. package/progress/interface.js +1 -0
  406. package/radio/Group.js +16 -0
  407. package/radio/Radio.js +15 -0
  408. package/radio/index.js +8 -0
  409. package/radio/interface.js +1 -0
  410. package/rate/index.js +127 -0
  411. package/rate/interface.js +1 -0
  412. package/resize-box/ResizeTrigger.js +78 -0
  413. package/resize-box/Split.js +130 -0
  414. package/resize-box/SplitGroup.js +202 -0
  415. package/resize-box/index.js +182 -0
  416. package/resize-box/interface.js +1 -0
  417. package/result/403.js +695 -0
  418. package/result/404.js +513 -0
  419. package/result/500.js +166 -0
  420. package/result/index.js +77 -0
  421. package/result/interface.js +1 -0
  422. package/select/OptGroup.js +20 -0
  423. package/select/Option.js +95 -0
  424. package/select/Select.js +549 -0
  425. package/select/index.js +8 -0
  426. package/select/interface.js +1 -0
  427. package/select/util.js +141 -0
  428. package/select-view/Core.js +370 -0
  429. package/select-view/index.js +67 -0
  430. package/select-view/interface.js +1 -0
  431. package/skeleton/Image.js +24 -0
  432. package/skeleton/Text.js +27 -0
  433. package/skeleton/index.js +57 -0
  434. package/skeleton/interface.js +1 -0
  435. package/slider/Button.js +159 -0
  436. package/slider/Dot.js +43 -0
  437. package/slider/Input.js +75 -0
  438. package/slider/Mark.js +28 -0
  439. package/slider/Tick.js +44 -0
  440. package/slider/index.js +429 -0
  441. package/slider/interface.js +1 -0
  442. package/slider/util.js +63 -0
  443. package/space/index.js +90 -0
  444. package/space/interface.js +1 -0
  445. package/space/toArray.js +11 -0
  446. package/speech-synthesis/index.js +109 -0
  447. package/spin/DotLoading.js +24 -0
  448. package/spin/index.js +79 -0
  449. package/spin/interface.js +1 -0
  450. package/statistic/Countdown.js +55 -0
  451. package/statistic/index.js +120 -0
  452. package/statistic/interface.js +1 -0
  453. package/statistic/util.js +33 -0
  454. package/steps/Step.js +68 -0
  455. package/steps/index.js +89 -0
  456. package/steps/interface.js +1 -0
  457. package/style.css +1 -1
  458. package/suspense-fallback-test/index.js +12 -0
  459. package/switch/index.js +116 -0
  460. package/switch/interface.js +1 -0
  461. package/table/ColGroup.js +59 -0
  462. package/table/Table.js +24 -0
  463. package/table/constant.js +42 -0
  464. package/table/index.js +103 -0
  465. package/table/interface.js +1 -0
  466. package/table/util.js +121 -0
  467. package/tabs/Tab.js +18 -0
  468. package/tabs/TabContent.js +8 -0
  469. package/tabs/TabPane.js +24 -0
  470. package/tabs/index.js +9 -0
  471. package/tabs/interface.js +1 -0
  472. package/tabs/util.js +22 -0
  473. package/tag/index.js +136 -0
  474. package/tag/interface.js +1 -0
  475. package/time-picker/Picker.js +219 -0
  476. package/time-picker/RangePicker.js +56 -0
  477. package/time-picker/TimeColumn.js +65 -0
  478. package/time-picker/TimePicker.js +240 -0
  479. package/time-picker/context.js +5 -0
  480. package/time-picker/index.js +20 -0
  481. package/time-picker/interface.js +1 -0
  482. package/time-picker/util.js +43 -0
  483. package/timeline/Item.js +92 -0
  484. package/timeline/Timeline.js +79 -0
  485. package/timeline/index.js +6 -0
  486. package/timeline/interface.js +1 -0
  487. package/tooltip/index.js +140 -0
  488. package/tooltip/interface.js +1 -0
  489. package/transfer/Item.js +106 -0
  490. package/transfer/List.js +186 -0
  491. package/transfer/index.js +182 -0
  492. package/transfer/interface.js +1 -0
  493. package/tree/Animation.js +11 -0
  494. package/tree/Context.js +5 -0
  495. package/tree/Node.js +16 -0
  496. package/tree/NodeList.js +82 -0
  497. package/tree/Tree.js +580 -0
  498. package/tree/index.js +6 -0
  499. package/tree/interface.js +1 -0
  500. package/tree/util.js +76 -0
  501. package/tree-select/List.js +124 -0
  502. package/tree-select/Select.js +395 -0
  503. package/tree-select/index.js +6 -0
  504. package/tree-select/interface.js +13 -0
  505. package/tree-select/util.js +9 -0
  506. package/trigger/getPopupStyle.js +192 -0
  507. package/trigger/index.js +626 -0
  508. package/trigger/interface.js +1 -0
  509. package/types/anchor/util.d.ts +1 -1
  510. package/types/button/index.d.ts +2 -2
  511. package/types/color-picker/ControlBar.d.ts +12 -5
  512. package/types/color-picker/Mode.d.ts +7 -0
  513. package/types/color-picker/Panel.d.ts +10 -2
  514. package/types/color-picker/hooks/useColorPicker.d.ts +15 -13
  515. package/types/color-picker/hooks/useControlBlock.d.ts +10 -3
  516. package/types/color-picker/index.d.ts +1 -1
  517. package/types/color-picker/interface.d.ts +19 -7
  518. package/types/color-picker/utils.d.ts +23 -0
  519. package/types/form/Control.d.ts +2 -1
  520. package/types/form/FormItem.d.ts +1 -1
  521. package/types/form/store.d.ts +0 -1
  522. package/types/hooks/index.d.ts +2 -0
  523. package/types/hooks/useComputedState.d.ts +1 -4
  524. package/types/hooks/useCreate.d.ts +1 -2
  525. package/types/hooks/useForceUpdate.d.ts +1 -2
  526. package/types/hooks/useId.d.ts +1 -2
  527. package/types/hooks/useInView.d.ts +1 -11
  528. package/types/hooks/useIntersectionObserver.d.ts +1 -7
  529. package/types/hooks/useInterval.d.ts +1 -2
  530. package/types/hooks/useIsFirstRender.d.ts +1 -2
  531. package/types/hooks/useIsomorphicLayoutEffect.d.ts +1 -3
  532. package/types/hooks/useKeyboardEvent.d.ts +1 -8
  533. package/types/hooks/useMedia.d.ts +1 -2
  534. package/types/hooks/useMergeProps.d.ts +1 -5
  535. package/types/hooks/useMergeValue.d.ts +1 -6
  536. package/types/hooks/useOnlineStatus.d.ts +1 -0
  537. package/types/hooks/useOverflowHidden.d.ts +1 -5
  538. package/types/hooks/useOverrideRef.d.ts +1 -6
  539. package/types/hooks/usePersistCallback.d.ts +1 -2
  540. package/types/hooks/usePrefersColorSchemeDark.d.ts +1 -0
  541. package/types/hooks/usePrevious.d.ts +1 -3
  542. package/types/hooks/useRefs.d.ts +1 -2
  543. package/types/hooks/useResizeObserver.d.ts +1 -6
  544. package/types/hooks/useStateCallback.d.ts +1 -5
  545. package/types/hooks/useStateWithPromise.d.ts +1 -2
  546. package/types/hooks/useUpdateEffect.d.ts +1 -3
  547. package/types/hooks/useWatch.d.ts +1 -3
  548. package/types/hooks/useWindowSize.d.ts +1 -5
  549. package/types/image/interface.d.ts +1 -0
  550. package/types/index.d.ts +156 -86
  551. package/types/input/Input.d.ts +1 -1
  552. package/types/input/Textarea.d.ts +2 -2
  553. package/types/locale/en-US.d.ts +2 -0
  554. package/types/locale/interface.d.ts +1 -2
  555. package/types/locale/ja-JP.d.ts +2 -0
  556. package/types/locale/zh-CN.d.ts +2 -0
  557. package/types/locale/zh-HK.d.ts +2 -0
  558. package/types/locale/zh-TW.d.ts +2 -0
  559. package/types/menu/context.d.ts +1 -1
  560. package/types/message/index.d.ts +14 -14
  561. package/types/message/interface.d.ts +2 -0
  562. package/types/modal/config.d.ts +0 -1
  563. package/types/modal/interface.d.ts +0 -1
  564. package/types/notice/index.d.ts +2 -27
  565. package/types/notification/index.d.ts +15 -16
  566. package/types/notification/interface.d.ts +2 -0
  567. package/types/notification/withNotification.d.ts +2 -0
  568. package/types/select/util.d.ts +1 -2
  569. package/types/select-view/interface.d.ts +2 -1
  570. package/types/speech-synthesis/index.d.ts +1 -1
  571. package/types/table/constant.d.ts +2 -0
  572. package/types/table/hook/useThResizable.d.ts +7 -0
  573. package/types/table/index.d.ts +10 -1
  574. package/types/table/style/index.d.ts +1 -0
  575. package/types/table/th-resizable/index.d.ts +2 -0
  576. package/types/table/thead/Column.d.ts +1 -2
  577. package/types/tree/Tree.d.ts +12 -67
  578. package/types/tree-select/Select.d.ts +2 -2
  579. package/types/trigger/index.d.ts +2 -120
  580. package/types/trigger/interface.d.ts +2 -1
  581. package/types/utils/CSSTransition.d.ts +2 -3
  582. package/types/utils/caseName.d.ts +1 -1
  583. package/types/utils/className.d.ts +1 -1
  584. package/types/utils/constant.d.ts +2 -2
  585. package/types/utils/copy.d.ts +1 -1
  586. package/types/utils/dayjs.d.ts +1 -21
  587. package/types/utils/dom.d.ts +1 -6
  588. package/types/utils/fileToURL.d.ts +1 -1
  589. package/types/utils/fillNBSP.d.ts +1 -1
  590. package/types/utils/getHighlightText.d.ts +1 -5
  591. package/types/utils/getHotkeyHandler.d.ts +1 -8
  592. package/types/utils/getStringLength.d.ts +1 -1
  593. package/types/utils/include.d.ts +1 -1
  594. package/types/utils/index.d.ts +3 -4
  595. package/types/utils/is.d.ts +1 -16
  596. package/types/utils/keyboardCode.d.ts +3 -0
  597. package/types/utils/lodash.d.ts +1 -17
  598. package/types/utils/mergeProps.d.ts +1 -1
  599. package/types/utils/mergedToString.d.ts +1 -1
  600. package/types/utils/omit.d.ts +1 -1
  601. package/types/utils/pad.d.ts +1 -2
  602. package/types/utils/pick.d.ts +2 -4
  603. package/types/utils/reactDOM.d.ts +1 -7
  604. package/types/utils/resizeObserverEffect.d.ts +2 -0
  605. package/types/utils/saveAs.d.ts +1 -1
  606. package/types/utils/screenfull.d.ts +2 -0
  607. package/types/utils/scrollIntoView.d.ts +1 -2
  608. package/types/utils/style.d.ts +1 -3
  609. package/types/utils/throttleByRaf.d.ts +1 -5
  610. package/types/utils/throttleByRaf2.d.ts +1 -0
  611. package/types/utils/warning.d.ts +1 -2
  612. package/types/version/index.d.ts +1 -1
  613. package/typography/Base.js +189 -0
  614. package/typography/EditContent.js +46 -0
  615. package/typography/Ellipsis.js +124 -0
  616. package/typography/Operations.js +78 -0
  617. package/typography/Paragraph.js +24 -0
  618. package/typography/Text.js +11 -0
  619. package/typography/Title.js +12 -0
  620. package/typography/Typography.js +13 -0
  621. package/typography/index.js +278 -0
  622. package/typography/interface.js +1 -0
  623. package/typography/useCssEllipsis.js +37 -0
  624. package/typography/useEllipsis.js +150 -0
  625. package/upload/TriggerNode.js +116 -0
  626. package/upload/Upload.js +627 -0
  627. package/upload/Uploader.js +206 -0
  628. package/upload/index.js +8 -0
  629. package/upload/interface.js +9 -0
  630. package/upload/request.js +51 -0
  631. package/upload/request_.js +64 -0
  632. package/upload/util.js +61 -0
  633. package/utils/CSSTransition.js +2 -6
  634. package/utils/className.js +2 -2
  635. package/utils/constant.js +8 -9
  636. package/utils/contextHolder.js +1 -1
  637. package/utils/copy.js +1 -1
  638. package/utils/dayjs.js +14 -173
  639. package/utils/dom.js +35 -31
  640. package/utils/fillNBSP.js +2 -4
  641. package/utils/getHighlightText.js +2 -38
  642. package/utils/getHotkeyHandler.js +2 -25
  643. package/utils/getStringLength.js +2 -7
  644. package/utils/include.js +2 -7
  645. package/utils/index.js +239 -242
  646. package/utils/is.js +116 -156
  647. package/utils/keyboardCode.js +27 -0
  648. package/utils/mergeProps.js +2 -9
  649. package/utils/mergedToString.js +2 -13
  650. package/utils/omit.js +2 -9
  651. package/utils/pick.js +4 -15
  652. package/utils/reactDOM.js +3 -54
  653. package/utils/resizeObserverEffect.js +4 -0
  654. package/utils/saveAs.js +1 -1
  655. package/utils/screenfull.js +4 -0
  656. package/utils/scrollIntoView.js +2 -21
  657. package/utils/style.js +2 -1
  658. package/utils/throttleByRaf.js +13 -12
  659. package/utils/throttleByRaf2.js +5 -0
  660. package/utils/warning.js +2 -1
  661. package/{chunk/BHgJ5Y3T.js → verification-code/VerificationCode.js} +24 -23
  662. package/verification-code/index.js +4 -0
  663. package/verification-code/interface.js +1 -0
  664. package/{Version.js → version/index.js} +1 -1
  665. package/virtual-list/Filler.js +31 -0
  666. package/virtual-list/VirtualList.js +493 -0
  667. package/virtual-list/index.js +4 -0
  668. package/{chunk/Bc7t9jkb.js → watermark/Watermark.js} +17 -16
  669. package/watermark/index.js +4 -0
  670. package/watermark/interface.js +1 -0
  671. package/NotificationBase.js +0 -53
  672. package/chunk/-zpSUpGE.js +0 -1501
  673. package/chunk/BAWsPQBM.js +0 -11
  674. package/chunk/BIT0j3HT.js +0 -269
  675. package/chunk/BbLKnaNO.js +0 -871
  676. package/chunk/Bfhv56O2.js +0 -638
  677. package/chunk/Bh23P4l7.js +0 -162
  678. package/chunk/C2lIz2F9.js +0 -60
  679. package/chunk/CHnFKgbk.js +0 -445
  680. package/chunk/CLBavO5c.js +0 -912
  681. package/chunk/CVkHTbic.js +0 -995
  682. package/chunk/CcV4wQB1.js +0 -968
  683. package/chunk/CeGEvXby.js +0 -278
  684. package/chunk/D3NFxdmG.js +0 -518
  685. package/chunk/DApXtulb.js +0 -1102
  686. package/chunk/DNAigumg.js +0 -166
  687. package/chunk/DPByB1ab.js +0 -698
  688. package/chunk/DQAot004.js +0 -824
  689. package/chunk/DTBtQQ2H.js +0 -334
  690. package/chunk/DV1Ab_cG.js +0 -284
  691. package/chunk/DnvO8A0Z.js +0 -518
  692. package/chunk/Du-bw6qA.js +0 -224
  693. package/chunk/dBnNCOIU.js +0 -778
  694. package/chunk/it8qlDZ3.js +0 -1032
  695. package/chunk/te_43YrB.js +0 -776
  696. package/chunk/znkyQ-HR.js +0 -243
  697. package/hooks/use-verification-code.js +0 -73
  698. package/types/notification-base/index.d.ts +0 -15
  699. package/types/notification-base/style/index.d.ts +0 -2
  700. package/types/style/index.d.ts +0 -1
  701. package/types/trigger/Portal.d.ts +0 -7
  702. package/types/utils/keyCode.d.ts +0 -45
  703. package/types/utils/raf.d.ts +0 -3
  704. package/types/utils/throttleByRafV2.d.ts +0 -5
  705. package/utils/keyCode.js +0 -12
  706. package/utils/raf.js +0 -19
  707. package/utils/throttleByRafV2.js +0 -16
  708. /package/{chunk/l0sNRNKZ.js → affix/interface.js} +0 -0
package/Table.js CHANGED
@@ -1,2034 +1,18 @@
1
- import { jsx as u, jsxs as pe, Fragment as xt } from "react/jsx-runtime";
2
- import { C as Kn, D as Dn } from "./chunk/4-gvEY5y.js";
3
- import Hn from "lodash/debounce";
4
- import ie from "lodash/isArray";
5
- import Fe from "lodash/isNumber";
6
- import q from "lodash/isPlainObject";
7
- import en from "lodash/throttle";
8
- import Ee, { useRef as ue, useEffect as tt, useMemo as fe, useCallback as et, useState as xe, useContext as Le, forwardRef as Ot, createElement as nt, createContext as Mn, useImperativeHandle as Wn } from "react";
9
- import { d as Ge } from "./chunk/-zpSUpGE.js";
10
- import { useIsomorphicLayoutEffect as zn } from "./hooks/useIsomorphicLayoutEffect.js";
11
- import { useMergeProps as tn } from "./hooks/useMergeProps.js";
12
- import { useUpdateEffect as _t } from "./hooks/useUpdateEffect.js";
13
- import { P as nn } from "./chunk/CHnFKgbk.js";
14
- import Un from "./Spin.js";
15
- import { y as Z } from "./chunk/BAWsPQBM.js";
16
- import { on as ht, off as yt } from "./utils/dom.js";
17
- import Vn, { pickDataAttributes as jn } from "./utils/pick.js";
18
- import Yn from "lodash/merge";
19
- import qn from "lodash/isNull";
20
- import je from "lodash/isString";
21
- import Gn from "lodash/isUndefined";
22
- import { V as Xn } from "./chunk/D3NFxdmG.js";
23
- import Qn from "@unicom-cloud/icons/IconUiMinus";
24
- import Jn from "@unicom-cloud/icons/IconUiPlus";
25
- import { C as Ft } from "./chunk/znkyQ-HR.js";
26
- import { R as cn } from "./chunk/CZOP_ZHJ.js";
27
- import Ct from "lodash/get";
28
- import gt from "lodash/isFunction";
29
- import { useForceUpdate as Zn } from "./hooks/useForceUpdate.js";
30
- import dn from "./Tooltip.js";
31
- import eo from "./utils/mergedToString.js";
32
- import to from "@unicom-cloud/icons/IconUiCaretDown";
33
- import no from "@unicom-cloud/icons/IconUiCaretUp";
34
- import oo from "@unicom-cloud/icons/IconUiFilter";
35
- import on from "./Button.js";
36
- import { useMergeValue as ro } from "./hooks/useMergeValue.js";
37
- import so from "./Space.js";
38
- import io from "./Trigger.js";
39
- import lo from "./utils/omit.js";
40
- const Ye = "table_internal_selection_key", qe = "table_internal_expand_key";
41
- function kt(t) {
42
- return typeof t == "number" || typeof t == "string" ? {
43
- width: t
44
- } : {};
45
- }
46
- function mt(t) {
47
- var x;
48
- const o = ue(), {
49
- prefixCls: r,
50
- columns: p,
51
- columnWidths: e,
52
- producer: d,
53
- expandedRowKeys: l,
54
- data: a,
55
- onSetColumnWidths: s
56
- } = t;
57
- tt(() => {
58
- if (d && o.current) {
59
- const N = Array.from(
60
- o.current.querySelectorAll("col") || []
61
- ).filter(
62
- (g) => !g.classList.contains(`${r}-expand-icon-col`) && !g.classList.contains(`${r}-selection-col`)
63
- ).map((g) => {
64
- const { width: v } = g.getBoundingClientRect();
65
- return v;
66
- });
67
- s == null || s(N);
68
- }
69
- }, [d, s, r, l, a, p]);
70
- let w = 0;
71
- return /* @__PURE__ */ u("colgroup", { ref: o, children: (x = p == null ? void 0 : p.map) == null ? void 0 : x.call(p, (h, N) => {
72
- if (h.title === qe)
73
- return /* @__PURE__ */ u(
74
- "col",
75
- {
76
- className: `${r}-expand-icon-col`,
77
- style: kt(h.width)
78
- },
79
- qe
80
- );
81
- if (h.title === Ye)
82
- return /* @__PURE__ */ u(
83
- "col",
84
- {
85
- className: `${r}-selection-col`,
86
- style: kt(h.width)
87
- },
88
- Ye
89
- );
90
- let g;
91
- return h.width ? g = h.width : !d && e && (g = e[w]), w++, /* @__PURE__ */ u("col", { style: kt(g) }, h.key ?? N);
92
- }) });
93
- }
94
- const rn = {
95
- table: "table",
96
- header: {
97
- operations: ({ selectionNode: t, expandNode: o }) => [
98
- {
99
- name: "expandNode",
100
- node: o
101
- },
102
- {
103
- name: "selectionNode",
104
- node: t
105
- }
106
- ],
107
- wrapper: "div",
108
- thead: "thead",
109
- row: "tr",
110
- th: "th",
111
- cell: "div"
112
- },
113
- body: {
114
- operations: ({ selectionNode: t, expandNode: o }) => [
115
- {
116
- name: "expandNode",
117
- node: o
118
- },
119
- {
120
- name: "selectionNode",
121
- node: t
122
- }
123
- ],
124
- wrapper: "div",
125
- tbody: "tbody",
126
- row: "tr",
127
- td: "td",
128
- cell: "span"
129
- }
130
- };
131
- function Be(t) {
132
- const o = fe(
133
- () => q(t) ? Yn({}, rn, t) : rn,
134
- [t]
135
- );
136
- return {
137
- getHeaderComponentOperations: o.header.operations,
138
- getBodyComponentOperations: o.body.operations,
139
- ComponentTable: o.table,
140
- ComponentHeaderWrapper: o.header.wrapper,
141
- ComponentThead: o.header.thead,
142
- ComponentHeaderRow: o.header.row,
143
- ComponentTh: o.header.th,
144
- ComponentHeaderCell: o.header.cell,
145
- ComponentBodyWrapper: o.body.wrapper,
146
- ComponentTbody: o.body.tbody,
147
- ComponentBodyRow: o.body.row,
148
- ComponentTd: o.body.td,
149
- ComponentBodyCell: o.body.cell
150
- };
151
- }
152
- function sn(t, o) {
153
- const r = [];
154
- function p(e) {
155
- e && e.length > 0 && e.forEach((d) => {
156
- d[o] ? p(d[o]) : r.push({ ...d, key: d.dataIndex || d.key });
157
- });
158
- }
159
- return p(t), r;
160
- }
161
- function fn(t, o) {
162
- let r = 0;
163
- return t && t.length > 0 && t.forEach((p) => {
164
- const e = fn(p[o], o) + 1;
165
- r = Math.max(e, r);
166
- }), r;
167
- }
168
- function ao(t) {
169
- const {
170
- component: o,
171
- rowSelection: r,
172
- expandedRowRender: p,
173
- expandProps: e = {},
174
- columns: d = [],
175
- childrenColumnName: l
176
- } = t, a = fe(() => d || [], [d]), s = fe(
177
- () => sn(a, l),
178
- [a, l]
179
- ), w = r && r.type === "checkbox" || r && !("type" in r), x = r && r.type === "radio", { width: h } = e, N = !!p, g = w || x, { getHeaderComponentOperations: v, getBodyComponentOperations: E } = Be(o), T = fe(
180
- () => v({
181
- selectionNode: g ? "holder_node" : "",
182
- expandNode: N ? "holder_node" : ""
183
- }),
184
- [
185
- g,
186
- N,
187
- v
188
- ]
189
- ), C = fe(
190
- () => E({
191
- selectionNode: g ? "holder_node" : "",
192
- expandNode: N ? "holder_node" : ""
193
- }),
194
- [
195
- g,
196
- N,
197
- E
198
- ]
199
- ), y = r && r.fixed, $ = r && r.columnWidth, O = et(
200
- (B, I, k) => {
201
- const L = {}, A = [];
202
- B.forEach((f, _) => {
203
- const b = { ...f };
204
- (!("key" in f) || typeof f.key > "u") && (b.key = b.dataIndex || _), _ === 0 ? (b.$$isFirstColumn = !0, b.fixed === "left" && (L.fixed = b.fixed)) : b.$$isFirstColumn = !1, A.push(b);
205
- });
206
- const D = N && {
207
- key: qe,
208
- title: qe,
209
- width: h,
210
- $$isOperation: !0
211
- }, j = g && {
212
- key: Ye,
213
- title: Ye,
214
- width: $,
215
- $$isOperation: !0
216
- };
217
- return y && (L.fixed = "left"), (typeof k != "number" || k === 0) && [...I].reverse().forEach((f, _) => {
218
- if (f.node) {
219
- const b = T.filter((P) => P.node).length - _ - 1;
220
- f.name === "expandNode" ? A.unshift({
221
- ...D,
222
- ...L,
223
- $$columnIndex: b
224
- }) : f.name === "selectionNode" ? A.unshift({
225
- ...j,
226
- ...L,
227
- $$columnIndex: b
228
- }) : A.unshift({
229
- ...f,
230
- ...L,
231
- title: f.name,
232
- key: f.name,
233
- $$isOperation: !0,
234
- width: f.width || 40,
235
- $$columnIndex: b
236
- });
237
- }
238
- }), A;
239
- },
240
- [
241
- h,
242
- N,
243
- g,
244
- $,
245
- y,
246
- T
247
- ]
248
- ), U = fe(
249
- () => O(s, C),
250
- [s, O, C]
251
- ), Q = fe(
252
- () => fn(a, l),
253
- [a, l]
254
- );
255
- return [fe(() => {
256
- const B = Array.isArray(T) ? T.filter((A) => A.node).length : 0;
257
- if (Q === 1) {
258
- const A = a.map((D, j) => ({
259
- ...D,
260
- $$columnIndex: j + B
261
- }));
262
- return [O(A, T, 0)];
263
- }
264
- let I = B;
265
- const k = [], L = (A, D = 0) => {
266
- k[D] = k[D] || [], A.forEach((j) => {
267
- const f = { ...j };
268
- f[l] ? (f.colSpan = sn(
269
- j[l],
270
- l
271
- ).length, f.$$columnIndex = [I], k[D].push(f), L(f[l], D + 1), f.$$columnIndex.push(I - 1)) : (f.rowSpan = Q - D, f.$$columnIndex = I++, k[D].push(f));
272
- }), k[D] = O(
273
- k[D],
274
- T,
275
- D
276
- );
277
- };
278
- return L(a), k;
279
- }, [
280
- a,
281
- l,
282
- Q,
283
- O,
284
- T
285
- ]), U];
286
- }
287
- function Et(t) {
288
- return Fe(t) ? t : je(t) && t.includes("px") ? +t.replace("px", "") : t;
289
- }
290
- function co(t) {
291
- return t ? t.offsetHeight - t.clientHeight : 0;
292
- }
293
- function fo(t) {
294
- return t ? t.offsetWidth - t.clientWidth : 0;
295
- }
296
- function It(t, o) {
297
- return ie(t[o]) && t[o].length;
298
- }
299
- function uo(t, o) {
300
- function r(p) {
301
- if (!p)
302
- return [];
303
- const e = [];
304
- return p.forEach((d) => {
305
- if (!q(d))
306
- e.push(d);
307
- else {
308
- const l = { ...d };
309
- l.__ORIGIN_DATA = d;
310
- const a = l[o];
311
- q(l) && a && ie(a) && (l[o] = r(a)), e.push(l);
312
- }
313
- }), e;
314
- }
315
- return r(t);
316
- }
317
- function ne(t) {
318
- return q(t) ? t.__ORIGIN_DATA : !t || !ie(t) ? t : t.map((o) => !q(o) || !("__ORIGIN_DATA" in o) ? o : o.__ORIGIN_DATA);
319
- }
320
- function po(t, o, r = [], p = [], e, d, l) {
321
- const a = new Set(r), s = new Set(p);
322
- function w(x) {
323
- o ? (a.add(e(x)), s.delete(e(x))) : a.delete(e(x)), ie(x[d]) && x[d].forEach((h) => {
324
- w(h);
325
- });
326
- }
327
- return l ? (w(t), Lt(
328
- t,
329
- a,
330
- s,
331
- e,
332
- d
333
- )) : o ? a.add(e(t)) : a.delete(e(t)), {
334
- selectedRowKeys: [...a],
335
- indeterminateKeys: [...s]
336
- };
337
- }
338
- function ho(t, o = [], r, p, e) {
339
- if (!e)
340
- return {
341
- selectedRowKeys: o,
342
- indeterminateKeys: []
343
- };
344
- const d = new Set(o), l = /* @__PURE__ */ new Set([]);
345
- function a(s) {
346
- d.add(r(s)), l.delete(r(s)), ie(s[p]) && s[p].forEach((w) => {
347
- a(w);
348
- });
349
- }
350
- return o.forEach((s) => {
351
- const w = t.find((x) => r(x) === s);
352
- !Gn(w) && !qn(w) && (a(w), Lt(
353
- w,
354
- d,
355
- l,
356
- r,
357
- p
358
- ));
359
- }), {
360
- selectedRowKeys: [...d],
361
- indeterminateKeys: [...l]
362
- };
363
- }
364
- function Lt(t, o, r, p, e) {
365
- if (t.__INTERNAL_PARENT) {
366
- const d = p(t.__INTERNAL_PARENT);
367
- if (ie(t.__INTERNAL_PARENT[e])) {
368
- const l = t.__INTERNAL_PARENT[e].length;
369
- let a = 0, s = !1;
370
- t.__INTERNAL_PARENT[e].forEach((w) => {
371
- o.has(p(w)) && (a += 1), r.has(p(w)) && (r.add(d), s = !0);
372
- }), l === a ? (o.add(d), r.delete(d)) : a > 0 && l > a ? (o.delete(d), r.add(d)) : a === 0 && (o.delete(d), s || r.delete(d));
373
- }
374
- Lt(
375
- t.__INTERNAL_PARENT,
376
- o,
377
- r,
378
- p,
379
- e
380
- );
381
- }
382
- }
383
- function Pt(t) {
384
- return typeof t == "function" ? t : typeof t == "object" && typeof t.compare == "function" ? t.compare : null;
385
- }
386
- function At(t) {
387
- if (typeof t == "object" && typeof t.multiple == "number")
388
- return t.multiple;
389
- }
390
- function yo(t, o, r) {
391
- const {
392
- defaultExpandedRowKeys: p,
393
- defaultExpandAllRows: e,
394
- expandedRowRender: d,
395
- onExpand: l,
396
- onExpandedRowsChange: a,
397
- childrenColumnName: s = "children",
398
- expandProps: w
399
- } = t, [x, h] = xe(
400
- g()
401
- ), N = t.expandedRowKeys || x;
402
- function g() {
403
- let T = [];
404
- return t.expandedRowKeys ? T = t.expandedRowKeys : p ? T = p : e && (T = o.map((C, y) => {
405
- const $ = ne(C);
406
- return w && "rowExpandable" in w && typeof w.rowExpandable == "function" ? w.rowExpandable($) && r(C) : typeof d == "function" ? d($, y) && r(C) : It(C, s) && r(C);
407
- }).filter((C) => C)), T;
408
- }
409
- function v(T) {
410
- const C = N.indexOf(T) === -1, y = C ? N.concat(T) : N.filter((O) => T !== O), $ = o.filter((O) => y.indexOf(r(O)) !== -1).map((O) => r(O));
411
- h($), E(T, C), a == null || a($);
412
- }
413
- function E(T, C) {
414
- l == null || l(
415
- ne(o.find((y) => r(y) === T)),
416
- C
417
- );
418
- }
419
- return [N, v];
420
- }
421
- function ln(t) {
422
- return [...new Set(t)];
423
- }
424
- function mo(t, o, r, p) {
425
- const { rowSelection: e, childrenColumnName: d } = t, l = e == null ? void 0 : e.selectedRowKeys, a = e == null ? void 0 : e.onSelectAll, s = e == null ? void 0 : e.onSelect, w = e == null ? void 0 : e.onChange, x = e == null ? void 0 : e.pureKeys, h = typeof (e == null ? void 0 : e.checkStrictly) == "boolean" ? !e.checkStrictly : !1, N = e == null ? void 0 : e.preserveSelectedRowKeys;
426
- function g() {
427
- const f = [], _ = [], b = (S) => {
428
- ie(S) && S.length && S.forEach((K) => {
429
- const i = p(K);
430
- (e && typeof e.checkboxProps == "function" ? e.checkboxProps(ne(K)) : {}).disabled || f.push(i), It(K, t.childrenColumnName) && b(K[t.childrenColumnName]);
431
- });
432
- };
433
- b(o);
434
- const P = (S, K) => {
435
- ie(S) && S.length && S.forEach((i) => {
436
- if (K && h && (i.__INTERNAL_PARENT = K), _.push(i), It(i, t.childrenColumnName)) {
437
- const oe = { ...i };
438
- P(i[t.childrenColumnName], oe);
439
- }
440
- });
441
- };
442
- return P(r, void 0), {
443
- allSelectedRowKeys: f,
444
- flattenData: _
445
- };
446
- }
447
- const { allSelectedRowKeys: v, flattenData: E } = g(), [T, C] = xe([]), [y, $] = xe([]), O = ho(
448
- E,
449
- ln(l || T),
450
- p,
451
- d,
452
- h
453
- ), U = h && !l ? T : O.selectedRowKeys, Q = h && !l ? y : O.indeterminateKeys, [W, B] = xe(
454
- x ? [] : I(U)
455
- );
456
- function I(f, _) {
457
- const b = _ ? W.concat(E) : E, P = new Map(b.map((S) => [p(S), S]));
458
- return f.map((S) => P.get(S)).filter((S) => S);
459
- }
460
- const k = new Set(E.map((f) => p(f)));
461
- function L(f) {
462
- return N ? f : f.filter((_) => k.has(_));
463
- }
464
- function A(f) {
465
- let _ = [], b = [];
466
- if (f)
467
- _ = L(
468
- ln(U.concat(v))
469
- );
470
- else {
471
- const S = new Set(v);
472
- _ = L(
473
- U.filter((K) => !S.has(K))
474
- );
475
- }
476
- x || (b = I(_, !0));
477
- const P = ne(b);
478
- C(_), B(b), $([]), w == null || w(_, P), a == null || a(f, P);
479
- }
480
- function D(f, _) {
481
- const { selectedRowKeys: b, indeterminateKeys: P } = po(
482
- _,
483
- f,
484
- U,
485
- y,
486
- p,
487
- d,
488
- h
489
- ), S = L(b), K = I(S, !0), i = ne(K);
490
- C(S), B(K), $(P), s == null || s(f, ne(_), i), w == null || w(S, i);
491
- }
492
- function j(f, _) {
493
- const b = [E.find((S) => p(S) === f)], P = ne(b);
494
- C([f]), s == null || s(!0, ne(_), P), w == null || w([f], P);
495
- }
496
- return {
497
- selectedRowKeys: U,
498
- indeterminateKeys: Q,
499
- onCheckAll: A,
500
- onCheck: D,
501
- onCheckRadio: j,
502
- setSelectedRowKeys: C,
503
- allSelectedRowKeys: v,
504
- flattenData: E
505
- };
506
- }
507
- function xo(t, o) {
508
- const [r, p] = xe(o), [e, d] = xe({}), l = ue(t), a = et(
509
- (x) => {
510
- const { field: h, direction: N } = x;
511
- return r.find((g) => g.field === h) ? N ? r.map(
512
- (g) => g.field === h ? x : g
513
- ) : r.filter((g) => g.field !== h) : N ? !Fe(x.priority) || r.find((g) => !Fe(g.priority)) ? [x] : [...r, x] : [...r];
514
- },
515
- [r]
516
- ), s = et((x) => {
517
- const h = x.filter((g) => "sortOrder" in g);
518
- let N = [];
519
- return h.forEach((g) => {
520
- const v = At(g.sorter), E = g.sortOrder, T = {
521
- field: g.dataIndex || g.key,
522
- direction: E,
523
- sorterFn: Pt(g.sorter),
524
- priority: v
525
- };
526
- E ? Fe(v) ? N.every((C) => Fe(C.priority) || !C.direction) && N.push(T) : N.every((C) => !C.direction) ? N.push(T) : N = [T] : N.push(T);
527
- }), N;
528
- }, []), w = et(
529
- (x, h) => {
530
- s(t).length || (p(h), d(x));
531
- },
532
- [t, s, p, d]
533
- );
534
- return _t(() => {
535
- const x = l.current, h = s(x), N = s(t), g = h.map(
536
- (E) => E.field
537
- ), v = N.filter((E) => h.find(
538
- ({ field: C, direction: y }) => E.field === C && E.direction !== y
539
- ) ? !0 : !g.includes(E.field));
540
- v && v.length && (p(N), d({})), l.current = t;
541
- }, [
542
- t,
543
- s,
544
- a,
545
- d,
546
- p
547
- ]), {
548
- currentSorter: e,
549
- activeSorters: r,
550
- getNextActiveSorters: a,
551
- updateStateSorters: w
552
- };
553
- }
554
- function go(t, o, r) {
555
- const p = o.map((a) => a.fixed);
556
- function e(a, s) {
557
- return Z({
558
- [`${r}-col-fixed-left`]: a.fixed === "left",
559
- [`${r}-col-fixed-right`]: a.fixed === "right",
560
- [`${r}-col-fixed-left-last`]: a.fixed === "left" && (q(o[s + 1]) ? o[s + 1].fixed !== "left" : !0),
561
- [`${r}-col-fixed-right-first`]: a.fixed === "right" && (q(o[s - 1]) ? o[s - 1].fixed !== "right" : !0)
562
- });
563
- }
564
- const d = fe(() => o.map(
565
- (a, s) => e(a, s)
566
- ), [p.join("-")]);
567
- return [fe(
568
- () => t.map((a) => a.map((s, w) => {
569
- let x = w;
570
- const h = s.$$columnIndex;
571
- return Array.isArray(h) && h.length === 2 ? x = s.fixed === "right" ? h[0] : h[1] : typeof h == "number" && (x = h), e(s, x);
572
- })),
573
- [
574
- t.map((a) => `|${a.map((s) => s.fixed || "undefined").join("-")}|`).join("_")
575
- ]
576
- ), d];
577
- }
578
- function Co(t) {
579
- const o = t.map((e) => Et(e.width)), r = t.map((e) => e.fixed);
580
- return fe(() => t.map((e) => {
581
- let d = 0;
582
- return e.fixed === "left" && t.some((l) => {
583
- if (l.fixed === "left") {
584
- if (l.key === e.key)
585
- return !0;
586
- let a = Et(l.width);
587
- const s = l.$$isOperation ? a || 40 : a;
588
- return d += s, !1;
589
- }
590
- return !1;
591
- }), e.fixed === "right" && [...t].reverse().some((l) => {
592
- if (l.fixed === "right") {
593
- if (l.key === e.key)
594
- return !0;
595
- let a = Et(l.width);
596
- const s = l.$$isOperation ? a || 40 : a;
597
- return d += s, !1;
598
- }
599
- return !1;
600
- }), d;
601
- }), [o.join("-"), r.join("-")]);
602
- }
603
- function wo(t) {
604
- return t && !Ee.isValidElement(t) && q(t);
605
- }
606
- function No(t) {
607
- var ye;
608
- const o = Zn(), {
609
- component: r,
610
- InnerComponentTd: p,
611
- column: e,
612
- columnIndex: d,
613
- prefixCls: l,
614
- stickyClassName: a,
615
- stickyOffset: s,
616
- currentSorter: w,
617
- virtualized: x,
618
- record: h,
619
- trIndex: N,
620
- level: g,
621
- placeholder: v = "-",
622
- indentSize: E,
623
- renderExpandIcon: T,
624
- rowKey: C,
625
- recordHaveChildren: y,
626
- haveTreeData: $
627
- } = t, { rtl: O } = Le(Ge), { ComponentBodyCell: U } = Be(r), Q = ue(null), W = ue(null), B = ue(null), I = ue(null), k = (e == null ? void 0 : e.showTooltip) !== !1 && (e == null ? void 0 : e.ellipsis), L = Z(
628
- `${l}-td`,
629
- a,
630
- {
631
- [`${l}-col-sorted`]: w && w.direction && w.field === (e == null ? void 0 : e.dataIndex)
632
- },
633
- e == null ? void 0 : e.className
634
- );
635
- let A = {}, D, j, f = {};
636
- (e == null ? void 0 : e.fixed) === "left" && (f[O ? "right" : "left"] = s), (e == null ? void 0 : e.fixed) === "right" && (f[O ? "left" : "right"] = s), q(e == null ? void 0 : e.cellStyle) && (f = {
637
- ...f,
638
- ...e == null ? void 0 : e.cellStyle
639
- }), q(e == null ? void 0 : e.bodyCellStyle) && (f = {
640
- ...f,
641
- ...e == null ? void 0 : e.bodyCellStyle
642
- }), gt(e == null ? void 0 : e.bodyCellStyle) && (f = {
643
- ...f,
644
- ...((ye = e == null ? void 0 : e.bodyCellStyle) == null ? void 0 : ye.call(e, h, N)) ?? {}
645
- }), e != null && e.align && (f.textAlign = e == null ? void 0 : e.align), x && e.width && (f.width = e.width, f.minWidth = e.width, f.maxWidth = e.width);
646
- const { onHandleSave: _, ...b } = e != null && e.onCell ? (e == null ? void 0 : e.onCell(
647
- h,
648
- N,
649
- e,
650
- { rowKey: C }
651
- )) ?? {} : { onHandleSave: () => {
652
- } }, P = e == null ? void 0 : e.render;
653
- let S = fe(() => P == null ? void 0 : P(
654
- Ct(h, e == null ? void 0 : e.dataIndex),
655
- ne(h),
656
- N,
657
- e,
658
- // 潘启宝添加
659
- { rowKey: C }
660
- ), [h, e, N]);
661
- if (gt(P) || (S = Ct(h, (e == null ? void 0 : e.dataIndex) ?? "")), wo(S) && (A = S == null ? void 0 : S.props, D = A == null ? void 0 : A.rowSpan, j = A == null ? void 0 : A.colSpan, S = S == null ? void 0 : S.children), D === 0 || j === 0)
662
- return null;
663
- je(S) && (S = S.trim()), !S && S !== 0 && (S = (e == null ? void 0 : e.placeholder) ?? v ?? "-");
664
- const K = e != null && e.ellipsis && je(S) ? {
665
- // title: cellChildren // 暂时不需要title属性了,因为单独加了tooltip组件,潘启宝2023年4月1日于广东省惠州市
666
- } : {}, i = $ && (e == null ? void 0 : e.$$isFirstColumn), oe = i && y;
667
- let ee = i && g > 0 ? E * g : 0;
668
- i && !y && (ee += 20);
669
- function V(ce) {
670
- o();
671
- }
672
- const le = `${d}-${N}-${ee}-${oe}`, te = /* @__PURE__ */ u(
673
- "div",
674
- {
675
- ref: Q,
676
- className: Z(`${l}-cell`, {
677
- [`${l}-cell-text-ellipsis`]: e == null ? void 0 : e.ellipsis
678
- }),
679
- ...K,
680
- onMouseEnter: k ? V : void 0,
681
- children: /* @__PURE__ */ pe(
682
- U,
683
- {
684
- ref: W,
685
- className: `${l}-cell-wrap-value`,
686
- ...je(U) ? {} : {
687
- rowData: ne(h),
688
- column: e,
689
- onHandleSave: _,
690
- ...b
691
- },
692
- children: [
693
- !!ee && /* @__PURE__ */ u(
694
- "span",
695
- {
696
- ref: B,
697
- className: `${l}-cell-indent`,
698
- style: { paddingLeft: ee }
699
- }
700
- ),
701
- !!oe && /* @__PURE__ */ u(
702
- "span",
703
- {
704
- ref: I,
705
- className: `${l}-cell-expand-icon`,
706
- children: T(h, C)
707
- }
708
- ),
709
- t.___dangerouslySetInnerHTML___ ? /* @__PURE__ */ u(
710
- "span",
711
- {
712
- dangerouslySetInnerHTML: {
713
- __html: S
714
- }
715
- }
716
- ) : S
717
- ]
718
- },
719
- le
720
- )
721
- },
722
- le
723
- );
724
- let ae = /* @__PURE__ */ u(
725
- p,
726
- {
727
- className: L,
728
- style: f,
729
- ...Vn(b, [
730
- "onClick",
731
- "onDoubleClick",
732
- "onContextMenu",
733
- "onMouseOver",
734
- "onMouseEnter",
735
- "onMouseLeave",
736
- "onMouseMove",
737
- "onMouseDown",
738
- "onMouseUp"
739
- ]),
740
- ...A,
741
- children: te
742
- },
743
- (e == null ? void 0 : e.key) || (e == null ? void 0 : e.dataIndex) || d
744
- );
745
- if (k) {
746
- let ce = 0, de = 0, he = 0, ge = 0;
747
- if (Q.current instanceof Element && (ce = Q.current.getBoundingClientRect().width), W.current instanceof Element && (de = W.current.getBoundingClientRect().width), B.current instanceof Element && (he = B.current.getBoundingClientRect().width), I.current instanceof Element && (ge = I.current.getBoundingClientRect().width), ce < de + he + ge) {
748
- const J = gt(e == null ? void 0 : e.tooltipContentRender) ? e.tooltipContentRender(h, N, e) : eo(ae);
749
- ae = /* @__PURE__ */ u(
750
- dn,
751
- {
752
- className: Z(`${l}-cell-tooltip`, e.tooltipClassName),
753
- style: e.tooltipStyle,
754
- content: J,
755
- children: ae
756
- }
757
- );
758
- }
759
- }
760
- return tt(() => (o(), () => {
761
- }), [Q.current, W.current]), ae;
762
- }
763
- const $o = Ee.memo(No);
764
- function bo(t, o) {
765
- const {
766
- expandedRowRender: r,
767
- onClickExpandBtn: p,
768
- columns: e,
769
- component: d,
770
- onCheck: l,
771
- onCheckRadio: a,
772
- prefixCls: s,
773
- selectedRowKeys: w,
774
- indeterminateKeys: x,
775
- rowClassName: h,
776
- onRow: N,
777
- rowSelection: g,
778
- indentSize: v = 16,
779
- activeSorters: E,
780
- virtualized: T,
781
- stickyOffsets: C,
782
- stickyClassNames: y,
783
- getRowKey: $,
784
- placeholder: O,
785
- expandProps: U = { strictTreeData: !0 },
786
- data: Q,
787
- expandedRowKeys: W,
788
- childrenColumnName: B,
789
- record: I,
790
- index: k,
791
- type: L,
792
- shouldRowExpand: A,
793
- level: D
794
- } = t, { rtl: j } = Le(Ge), f = ne(I), { ..._ } = (N == null ? void 0 : N(f, k)) || {}, b = $(I), P = L === "radio" ? w.slice(0, 1) : w, S = b || k, K = P.indexOf(b) > -1, i = W.indexOf(b) > -1, oe = x.indexOf(b) > -1, ee = Z(
795
- `${s}-tr`,
796
- {
797
- [`${s}-row-checked`]: K,
798
- [`${s}-row-expanded`]: i
799
- },
800
- h == null ? void 0 : h(f, k)
801
- ), V = g && typeof g.checkboxProps == "function" ? g.checkboxProps(f) : {}, le = Z(`${s}-td`, `${s}-operation`), te = (H) => Z(le, `${s}-${H}`, {
802
- [`${s}-selection-col`]: T && L === "checkbox" || L === "radio",
803
- [`${s}-expand-icon-col`]: T && r
804
- });
805
- function ae(H) {
806
- return U.strictTreeData ? ie(H[B]) && H[B].length : H[B] !== void 0;
807
- }
808
- function ye() {
809
- return Q.find((H) => ae(H));
810
- }
811
- const ce = A(I, k), de = ae(I), he = ye() && !r, ge = he && de, Ce = U.expandRowByClick && (ce || ge) ? {
812
- onClick: (H) => {
813
- var Y;
814
- p(b), (Y = _ == null ? void 0 : _.onClick) == null || Y.call(_, H);
815
- }
816
- } : {}, { ComponentBodyRow: be, ComponentTd: G, getBodyComponentOperations: me } = Be(d), Xe = T ? "div" : be, Se = T ? "div" : G, _e = {
817
- className: ee,
818
- key: S,
819
- ..._,
820
- ...Ce
821
- }, Ie = je(be) ? _e : { ..._e, record: I, index: k };
822
- function Ke(H, Y) {
823
- const { icon: Ae } = U, Oe = !!~W.indexOf(Y), Re = {
824
- onClick: (He) => {
825
- He.stopPropagation(), p(Y);
826
- }
827
- };
828
- return typeof Ae == "function" ? Ae({ expanded: Oe, record: H, ...Re }) : /* @__PURE__ */ u("button", { ...Re, type: "button", children: Oe ? /* @__PURE__ */ u(Qn, {}) : /* @__PURE__ */ u(Jn, {}) });
829
- }
830
- const De = r && /* @__PURE__ */ u(Se, { className: te("expand-icon-cell"), children: ce && Ke(I, b) }), ve = g && g.renderCell;
831
- let M;
832
- const se = /* @__PURE__ */ u(
833
- Ft,
834
- {
835
- value: b,
836
- onChange: (H) => l(H, I),
837
- checked: K,
838
- indeterminate: oe,
839
- ...V
840
- }
841
- ), re = /* @__PURE__ */ u(
842
- cn,
843
- {
844
- onChange: () => a(b, I),
845
- value: b,
846
- checked: K,
847
- ...V
848
- }
849
- );
850
- L === "checkbox" && (M = /* @__PURE__ */ u(Se, { className: te("checkbox"), children: ve ? ve(se, K, f) : se })), L === "radio" && (M = /* @__PURE__ */ u(Se, { className: te("radio"), children: ve ? ve(re, K, f) : re }));
851
- const Pe = me({
852
- selectionNode: M,
853
- expandNode: De
854
- });
855
- return /* @__PURE__ */ nt(Xe, { ...Ie, key: Ie.key, ref: o }, e.map((H, Y) => {
856
- var He, ot, Me, rt;
857
- const Ae = `${H.key}-${H.dataIndex}-${H.title}-${Y}`, Oe = C[Y], Re = y[Y];
858
- if (H.$$isOperation) {
859
- let we = H.node, $e = !0;
860
- H.title === Ye && (we = (He = Pe.find((Qe) => Qe.name === "selectionNode")) == null ? void 0 : He.node, $e = !1), H.title === qe && (we = (ot = Pe.find((Qe) => Qe.name === "expandNode")) == null ? void 0 : ot.node, $e = !1);
861
- const Te = typeof we == "function" ? we(I) : we;
862
- return Ee.cloneElement(Te, {
863
- key: Ae || Y,
864
- ...Te.props,
865
- className: Z(
866
- $e ? le : "",
867
- (Me = Te == null ? void 0 : Te.props) == null ? void 0 : Me.className,
868
- Re
869
- ),
870
- style: {
871
- ...(rt = Te == null ? void 0 : Te.props) == null ? void 0 : rt.style,
872
- ...H.fixed === "left" ? {
873
- [j ? "right" : "left"]: Oe
874
- } : {},
875
- width: H.width,
876
- minWidth: H.width
877
- }
878
- });
879
- }
880
- return /* @__PURE__ */ u(
881
- $o,
882
- {
883
- prefixCls: s,
884
- virtualized: T,
885
- component: d,
886
- currentSorter: E.find(
887
- (we) => we.field === (H.dataIndex || H.key)
888
- ),
889
- placeholder: O,
890
- indentSize: v,
891
- stickyClassName: Re,
892
- stickyOffset: Oe,
893
- InnerComponentTd: Se,
894
- column: H,
895
- columnIndex: Y,
896
- record: I,
897
- trIndex: k,
898
- level: D,
899
- haveTreeData: he,
900
- recordHaveChildren: de,
901
- rowKey: b,
902
- renderExpandIcon: Ke,
903
- ___dangerouslySetInnerHTML___: t.___dangerouslySetInnerHTML___
904
- },
905
- Ae
906
- );
907
- }));
908
- }
909
- const an = Ot(bo), So = Ot(function({
910
- record: o,
911
- index: r,
912
- virtualized: p,
913
- tbodyProps: e
914
- }, d) {
915
- const {
916
- prefixCls: l,
917
- columns: a,
918
- indentSize: s = 16,
919
- childrenColumnName: w = "children",
920
- expandProps: x = {},
921
- rowSelection: h,
922
- hasFixedColumn: N,
923
- tableViewWidth: g,
924
- getRowKey: v,
925
- expandedRowKeys: E,
926
- expandedRowRender: T
927
- } = e;
928
- let C;
929
- h && "type" in h ? C = h.type : h && !("type" in h) && (C = "checkbox");
930
- const y = T && ((k, L) => T(ne(k), L)), $ = (k) => ie(k[w]) && k[w].length, O = (k, L) => "rowExpandable" in x && typeof x.rowExpandable == "function" ? x.rowExpandable(k) : (y == null ? void 0 : y(k, L)) !== null, U = (k, L) => {
931
- const A = [], D = {
932
- ...e,
933
- type: C,
934
- shouldRowExpand: O
935
- };
936
- A.push(
937
- /* @__PURE__ */ u(
938
- an,
939
- {
940
- ref: d,
941
- ...D,
942
- record: k,
943
- level: 0,
944
- index: L
945
- },
946
- v(k)
947
- )
948
- );
949
- const j = (f, _, b = 0) => {
950
- ie(f) && f.length && f.forEach((P, S) => {
951
- E.indexOf(_) !== -1 && (A.push(
952
- /* @__PURE__ */ nt(
953
- an,
954
- {
955
- ...D,
956
- key: v(P),
957
- record: P,
958
- level: b + 1,
959
- index: S
960
- }
961
- )
962
- ), $(P) && j(P[w], v(P), b + 1));
963
- });
964
- };
965
- return y || j(k[w], v(k)), A;
966
- }, Q = v(o), W = O(o, r) && E.indexOf(Q) !== -1, B = p ? "div" : "tr", I = p ? "div" : "td";
967
- return /* @__PURE__ */ pe(Ee.Fragment, { children: [
968
- U(o, r),
969
- W && /* @__PURE__ */ u(
970
- B,
971
- {
972
- className: Z(`${l}-tr`, `${l}-expand-content`),
973
- children: /* @__PURE__ */ u(
974
- I,
975
- {
976
- className: Z(`${l}-td`),
977
- style: { paddingLeft: s },
978
- colSpan: a.length,
979
- children: N ? /* @__PURE__ */ u(
980
- "div",
981
- {
982
- className: `${l}-expand-fixed-row`,
983
- style: { width: g },
984
- children: y == null ? void 0 : y(o, r)
985
- }
986
- ) : y == null ? void 0 : y(o, r)
987
- }
988
- )
989
- },
990
- `${Q}-expanded`
991
- )
992
- ] }, Q);
993
- });
994
- function Ro(t) {
995
- const {
996
- data: o,
997
- columns: r,
998
- prefixCls: p,
999
- component: e,
1000
- noDataElement: d,
1001
- scroll: l,
1002
- tableViewWidth: a,
1003
- virtualized: s,
1004
- virtualListProps: w,
1005
- getRowKey: x,
1006
- saveVirtualListRef: h
1007
- } = t, N = ($) => {
1008
- var O;
1009
- (O = t.saveRef) == null || O.call(t, $);
1010
- }, { ComponentTbody: g } = Be(e);
1011
- let v = {}, E = {};
1012
- l && (l.x && (typeof l.x == "number" || typeof l.x == "string") && (v = {
1013
- width: l.x
1014
- }), l.y && (typeof l.y == "number" || typeof l.y == "string") && (E = {
1015
- maxHeight: l.y
1016
- }));
1017
- const T = {
1018
- className: `${p}-no-data`
1019
- };
1020
- a && (T.className = `${p}-no-data ${p}-expand-fixed-row`, T.style = { width: a });
1021
- const C = /* @__PURE__ */ u("tr", { className: Z(`${p}-tr`, `${p}-empty-row`), children: /* @__PURE__ */ u("td", { className: `${p}-td`, colSpan: r.length, children: /* @__PURE__ */ u("div", { ...T, children: d }) }) }), y = ($, O) => {
1022
- const U = x($) || O;
1023
- return /* @__PURE__ */ u(
1024
- So,
1025
- {
1026
- record: $,
1027
- index: O,
1028
- virtualized: s,
1029
- tbodyProps: t
1030
- },
1031
- U
1032
- );
1033
- };
1034
- return s ? o.length > 0 ? /* @__PURE__ */ u(
1035
- Xn,
1036
- {
1037
- data: o,
1038
- height: E.maxHeight,
1039
- isStaticItemHeight: !1,
1040
- outerStyle: { ...v, minWidth: "100%", overflow: "visible" },
1041
- innerStyle: { right: "auto", minWidth: "100%" },
1042
- className: `${p}-body`,
1043
- ref: ($) => {
1044
- h($), N($ == null ? void 0 : $.dom);
1045
- },
1046
- itemKey: x,
1047
- ...w,
1048
- children: y
1049
- }
1050
- ) : /* @__PURE__ */ u("div", { className: `${p}-body`, ref: N, children: /* @__PURE__ */ u("table", { children: /* @__PURE__ */ u("tbody", { children: C }) }) }) : /* @__PURE__ */ u(g, { ref: N, children: o.length > 0 ? o.map(y) : C });
1051
- }
1052
- const un = Mn({});
1053
- function To(t) {
1054
- const { summary: o, data: r, prefixCls: p, columns: e, stickyOffsets: d, stickyClassNames: l } = t;
1055
- return /* @__PURE__ */ u("tfoot", { className: `${p}-tfoot`, children: /* @__PURE__ */ u(
1056
- un.Provider,
1057
- {
1058
- value: { columns: e, stickyOffsets: d, stickyClassNames: l, prefixCls: p },
1059
- children: o(ne(r))
1060
- }
1061
- ) });
1062
- }
1063
- function vo(t, o) {
1064
- return t === "ascend" ? o.Table.sortAscend : t === "descend" ? o.Table.sortDescend : o.Table.cancelSort;
1065
- }
1066
- const ko = { bottom: 0 };
1067
- function Eo({
1068
- onSort: t,
1069
- onFilter: o,
1070
- onHandleFilter: r,
1071
- onHandleFilterReset: p,
1072
- currentFilters: e = {},
1073
- currentSorter: d,
1074
- _key: l,
1075
- dataIndex: a,
1076
- title: s,
1077
- sorter: w,
1078
- sortDirections: x = ["ascend", "descend"],
1079
- filters: h = [],
1080
- columnFixedStyle: N,
1081
- className: g,
1082
- cellStyle: v,
1083
- headerCellStyle: E,
1084
- rowSpan: T,
1085
- colSpan: C,
1086
- headerCellProps: y,
1087
- prefixCls: $,
1088
- align: O = "left",
1089
- component: U,
1090
- filterIcon: Q,
1091
- filterDropdown: W,
1092
- filterMultiple: B = !0,
1093
- ellipsis: I,
1094
- filterDropdownProps: k,
1095
- onFilterDropdownVisibleChange: L,
1096
- column: A,
1097
- showSorterTooltip: D,
1098
- index: j
1099
- }) {
1100
- const { locale: f, rtl: _ } = Le(Ge), b = l || a || j, [P, S, K] = ro([], {
1101
- value: e[b] || []
1102
- }), [i, oe] = xe(!1), [ee, V] = xe(!1), le = w && ie(x) && x.length, te = le ? ae() : void 0;
1103
- tt(() => {
1104
- S(e[b] || []);
1105
- }, [e, b]), tt(() => {
1106
- P && P !== K && S(P);
1107
- }, [i]);
1108
- function ae() {
1109
- const M = d && d.direction;
1110
- if (!M || d && d.field !== b)
1111
- return x[0];
1112
- const se = x.indexOf(M);
1113
- if (se < x.length)
1114
- return x[se + 1];
1115
- }
1116
- function ye() {
1117
- P && (r == null || r(
1118
- { onFilter: o, filters: h, dataIndex: b },
1119
- K
1120
- ), de(!1));
1121
- }
1122
- function ce() {
1123
- p({ dataIndex: b }), de(!1);
1124
- }
1125
- function de(M) {
1126
- oe(M), L == null || L(M);
1127
- }
1128
- function he(M, se) {
1129
- let re = [...K];
1130
- if (B)
1131
- se ? re = re.concat(M) : re.splice(
1132
- re.findIndex((Pe) => Pe === M),
1133
- 1
1134
- );
1135
- else if (re.length > 0)
1136
- if (re[0] !== M)
1137
- re = [M];
1138
- else
1139
- return;
1140
- else
1141
- re = [M];
1142
- S(re);
1143
- }
1144
- function ge(M) {
1145
- S(M || K), oe(!1), r == null || r(
1146
- { filters: h, onFilter: o, dataIndex: b },
1147
- M || K
1148
- );
1149
- }
1150
- function J() {
1151
- return typeof W == "function" ? W({
1152
- filterKeys: K,
1153
- setFilterKeys: (M, se) => {
1154
- S(M), se == null || se();
1155
- },
1156
- confirm: ge
1157
- }) : /* @__PURE__ */ pe("div", { className: `${$}-filters-popup`, children: [
1158
- /* @__PURE__ */ u("div", { className: `${$}-filters-list`, children: h.map((M) => {
1159
- const se = K.findIndex((re) => re === M.value) !== -1;
1160
- return /* @__PURE__ */ u("div", { className: `${$}-filters-item`, children: B ? /* @__PURE__ */ u(
1161
- Ft,
1162
- {
1163
- checked: se,
1164
- onChange: (re) => he(M.value, re),
1165
- children: M.text
1166
- }
1167
- ) : /* @__PURE__ */ u(
1168
- cn,
1169
- {
1170
- checked: se,
1171
- onChange: (re) => he(M.value, re),
1172
- children: M.text
1173
- }
1174
- ) }, M.value);
1175
- }) }),
1176
- /* @__PURE__ */ pe(so, { className: `${$}-filters-btn`, children: [
1177
- /* @__PURE__ */ u(on, { onClick: ce, size: "mini", children: f.Table.resetText }),
1178
- /* @__PURE__ */ u(on, { onClick: ye, type: "primary", size: "mini", children: f.Table.okText })
1179
- ] })
1180
- ] });
1181
- }
1182
- const Ce = (M) => Z(`${$}-sorter-icon`, {
1183
- [`${$}-sorter-icon-active`]: d && d.direction === M && d.field === b
1184
- }), be = Z(`${$}-filters`, {
1185
- [`${$}-filters-open`]: i,
1186
- [`${$}-filters-active`]: P && P.length
1187
- });
1188
- let G = {
1189
- ...N
1190
- };
1191
- q(v) && (G = {
1192
- ...G,
1193
- ...v
1194
- }), q(E) && (G = {
1195
- ...G,
1196
- ...E
1197
- }), gt(E) && (G = {
1198
- ...G,
1199
- ...E()
1200
- }), O && O !== "left" && (G.textAlign = O);
1201
- const me = {
1202
- style: G,
1203
- key: l || b
1204
- };
1205
- C && C > 1 && (me.colSpan = C), T && T > 1 && (me.rowSpan = T);
1206
- const { ComponentTh: Xe, ComponentHeaderCell: Se } = Be(U), _e = ie(h) && h.length > 0 || typeof W == "function", Ie = I && typeof s == "string" ? { title: s } : {}, Ke = k && k.triggerProps, De = /* @__PURE__ */ pe(xt, { children: [
1207
- le ? /* @__PURE__ */ u(
1208
- dn,
1209
- {
1210
- content: vo(te, f),
1211
- disabled: !D,
1212
- ...q(D) ? D : {},
1213
- children: /* @__PURE__ */ pe(
1214
- "div",
1215
- {
1216
- className: `${$}-cell-with-sorter`,
1217
- onMouseEnter: () => {
1218
- V(!0);
1219
- },
1220
- onMouseLeave: () => {
1221
- V(!1);
1222
- },
1223
- onClick: () => t(te, b),
1224
- children: [
1225
- /* @__PURE__ */ u("span", { className: `${$}-th-item-title`, ...Ie, children: s }),
1226
- le && /* @__PURE__ */ pe(
1227
- "div",
1228
- {
1229
- className: Z(`${$}-sorter`, {
1230
- [`${$}-sorter-direction-one`]: x.length === 1
1231
- }),
1232
- children: [
1233
- x.indexOf("ascend") !== -1 && /* @__PURE__ */ u("div", { className: Ce("ascend"), children: /* @__PURE__ */ u(no, {}) }),
1234
- x.indexOf("descend") !== -1 && /* @__PURE__ */ u("div", { className: Ce("descend"), children: /* @__PURE__ */ u(to, {}) })
1235
- ]
1236
- }
1237
- )
1238
- ]
1239
- }
1240
- )
1241
- }
1242
- ) : /* @__PURE__ */ u("span", { className: `${$}-th-item-title`, ...Ie, children: s }),
1243
- _e && /* @__PURE__ */ u(
1244
- io,
1245
- {
1246
- popup: J,
1247
- trigger: "click",
1248
- classNames: "slideDynamicOrigin",
1249
- position: _ ? "bl" : "br",
1250
- popupAlign: ko,
1251
- popupVisible: i,
1252
- onVisibleChange: de,
1253
- ...Ke,
1254
- children: /* @__PURE__ */ u("div", { className: be, children: Q || /* @__PURE__ */ u(oo, {}) })
1255
- }
1256
- )
1257
- ] }), ve = Z(`${$}-th-item`, {
1258
- [`${$}-cell-text-ellipsis`]: I,
1259
- [`${$}-cell-mouseenter`]: ee,
1260
- [`${$}-cell-next-${te}`]: ee && te,
1261
- [`${$}-col-has-sorter`]: le,
1262
- [`${$}-col-has-filter`]: _e
1263
- });
1264
- return C !== 0 && /* @__PURE__ */ nt(
1265
- Xe,
1266
- {
1267
- className: Z(
1268
- `${$}-th`,
1269
- {
1270
- [`${$}-col-sorted`]: d && d.direction && d.field === b
1271
- },
1272
- g
1273
- ),
1274
- ...me,
1275
- key: me.key,
1276
- ...y
1277
- },
1278
- je(Se) ? /* @__PURE__ */ u(Se, { className: ve, children: De }) : /* @__PURE__ */ u(
1279
- Se,
1280
- {
1281
- className: ve,
1282
- column: A,
1283
- children: De
1284
- }
1285
- )
1286
- );
1287
- }
1288
- function _o(t) {
1289
- const {
1290
- activeSorters: o,
1291
- expandedRowRender: r,
1292
- expandProps: p = {},
1293
- onSort: e,
1294
- onHandleFilter: d,
1295
- onHandleFilterReset: l,
1296
- onHeaderRow: a,
1297
- prefixCls: s,
1298
- currentFilters: w,
1299
- component: x,
1300
- data: h,
1301
- selectedRowKeys: N,
1302
- rowSelection: g,
1303
- allSelectedRowKeys: v = [],
1304
- groupColumns: E,
1305
- stickyOffsets: T,
1306
- groupStickyClassNames: C,
1307
- showSorterTooltip: y
1308
- } = t, { rtl: $ } = Le(Ge), { ComponentThead: O, ComponentHeaderRow: U, getHeaderComponentOperations: Q } = Be(x), W = g && (g.type === "checkbox" || !("type" in g)), B = g && "checkAll" in g ? g.checkAll : !0, I = g && g.type === "radio", { columnTitle: k } = p, L = fe(() => {
1309
- const j = new Set(v);
1310
- return N.filter((f) => j.has(f));
1311
- }, [N, v]), A = E.length > 1 ? { rowSpan: E.length } : {}, D = Z(`${s}-th`, `${s}-operation`);
1312
- return /* @__PURE__ */ u(O, { children: E.map((j, f) => {
1313
- const _ = a == null ? void 0 : a(j, f), b = (W || I) && f === 0 && /* @__PURE__ */ u(
1314
- "th",
1315
- {
1316
- className: Z(
1317
- D,
1318
- `${s}-${I ? "radio" : "checkbox"}`
1319
- ),
1320
- children: /* @__PURE__ */ pe("div", { className: `${s}-th-item`, children: [
1321
- B && !I ? /* @__PURE__ */ u(
1322
- Ft,
1323
- {
1324
- indeterminate: h && L.length > 0 && L.length !== v.length,
1325
- checked: h && L.length !== 0 && L.length === v.length,
1326
- disabled: !v.length,
1327
- onChange: t.onCheckAll
1328
- }
1329
- ) : null,
1330
- g && g.columnTitle
1331
- ] })
1332
- }
1333
- ), P = r && /* @__PURE__ */ u("th", { className: Z(D, `${s}-expand`), children: k && /* @__PURE__ */ u("div", { className: `${s}-th-item`, children: k }) }), S = C[f], K = Q({
1334
- selectionNode: b,
1335
- expandNode: P
1336
- });
1337
- return /* @__PURE__ */ nt(
1338
- U,
1339
- {
1340
- ..._,
1341
- key: f,
1342
- className: `${s}-tr`
1343
- },
1344
- j.map((i, oe) => {
1345
- var ce, de, he, ge, J;
1346
- const ee = i.$$columnIndex;
1347
- let V = 0;
1348
- Array.isArray(ee) && ee.length === 2 ? V = i.fixed === "right" ? T[ee[1]] : T[ee[0]] : typeof ee == "number" && (V = T[ee] || 0);
1349
- const le = S[oe];
1350
- if (i.$$isOperation) {
1351
- let Ce = i.node, be = !0;
1352
- i.title === Ye && (Ce = (ce = K.find(
1353
- (me) => me.name === "selectionNode"
1354
- )) == null ? void 0 : ce.node, be = !1), i.title === qe && (Ce = (de = K.find(
1355
- (me) => me.name === "expandNode"
1356
- )) == null ? void 0 : de.node, be = !1);
1357
- const G = Ce;
1358
- return Ee.cloneElement(G, {
1359
- key: i.key || oe,
1360
- ...G.props,
1361
- ...A,
1362
- className: Z(
1363
- be ? D : "",
1364
- (he = G == null ? void 0 : G.props) == null ? void 0 : he.className,
1365
- le
1366
- ),
1367
- style: {
1368
- ...(ge = G == null ? void 0 : G.props) == null ? void 0 : ge.style,
1369
- ...i.fixed === "left" ? {
1370
- [$ ? "right" : "left"]: V
1371
- } : {},
1372
- width: i.width,
1373
- minWidth: i.width
1374
- }
1375
- });
1376
- }
1377
- const te = (J = i == null ? void 0 : i.onHeaderCell) == null ? void 0 : J.call(i, i, oe), ae = Z(le, i.className), ye = {};
1378
- return i.fixed === "left" && (ye[$ ? "right" : "left"] = V), i.fixed === "right" && (ye[$ ? "left" : "right"] = V), /* @__PURE__ */ nt(
1379
- Eo,
1380
- {
1381
- index: oe,
1382
- onSort: e,
1383
- onHandleFilter: d,
1384
- onHandleFilterReset: l,
1385
- currentSorter: o.find(
1386
- (Ce) => Ce.field === (i.dataIndex || i.key)
1387
- ),
1388
- currentFilters: w,
1389
- _key: i.key || i.dataIndex || oe,
1390
- ...i,
1391
- key: i.key,
1392
- column: i,
1393
- headerCellProps: te,
1394
- prefixCls: s,
1395
- component: x,
1396
- className: ae,
1397
- columnFixedStyle: ye,
1398
- showSorterTooltip: y
1399
- }
1400
- );
1401
- })
1402
- );
1403
- }) });
1404
- }
1405
- const Io = [], Po = [], Ao = {
1406
- showHeader: !0,
1407
- border: !0,
1408
- hover: !0,
1409
- rowKey: "key",
1410
- pagePosition: "br",
1411
- childrenColumnName: "children",
1412
- indentSize: 15,
1413
- showSorterTooltip: !0
1414
- };
1415
- function Oo(t, o) {
1416
- var Jt, Zt;
1417
- const {
1418
- getPrefixCls: r,
1419
- loadingElement: p,
1420
- size: e,
1421
- tablePagination: d,
1422
- renderEmpty: l,
1423
- componentConfig: a,
1424
- rtl: s
1425
- } = Le(Ge), w = tn(
1426
- t,
1427
- Ao,
1428
- a == null ? void 0 : a.Table
1429
- ), x = tn(
1430
- q(t == null ? void 0 : t.pagination) ? t == null ? void 0 : t.pagination : {},
1431
- q((Jt = a == null ? void 0 : a.Table) == null ? void 0 : Jt.pagination) ? (Zt = a == null ? void 0 : a.Table) == null ? void 0 : Zt.pagination : {},
1432
- d || {}
1433
- ), {
1434
- style: h,
1435
- className: N,
1436
- component: g,
1437
- border: v,
1438
- borderCell: E,
1439
- columns: T = Po,
1440
- data: C = Io,
1441
- scroll: y,
1442
- noDataElement: $,
1443
- showHeader: O,
1444
- stripe: U,
1445
- hover: Q,
1446
- pagination: W,
1447
- onChange: B,
1448
- pagePosition: I,
1449
- childrenColumnName: k,
1450
- indentSize: L,
1451
- rowSelection: A,
1452
- tableLayoutFixed: D,
1453
- header: j,
1454
- // 潘启宝添加
1455
- footer: f,
1456
- virtualized: _,
1457
- renderPagination: b,
1458
- summary: P,
1459
- rowKey: S
1460
- } = w, K = fe(
1461
- () => uo(C, k),
1462
- [C, k]
1463
- ), i = r("table"), oe = w.size || (["default", "middle", "small"].indexOf(e) > -1 ? e : "default"), ee = ue(null), V = ue(null), le = ue(null), te = ue(null), ae = ue(null), ye = ue(null), ce = ue(null), de = ue(0), he = ue(!1), [ge, J] = ao(w), { currentFilters: Ce, defaultSorters: be } = rt(), [G, me] = xe(1), [Xe, Se] = xe(
1464
- x.pageSize || x.defaultPageSize || 10
1465
- ), [_e, Ie] = xe(Ce), [Ke, De] = xe(0), [ve, M] = xe([]), se = Co(J), [re, Pe] = go(
1466
- ge,
1467
- J,
1468
- i
1469
- ), {
1470
- currentSorter: H,
1471
- activeSorters: Y,
1472
- getNextActiveSorters: Ae,
1473
- updateStateSorters: Oe
1474
- } = xo(J, be), { ComponentTable: Re, ComponentBodyWrapper: He, ComponentHeaderWrapper: ot } = Be(g), Me = fe(() => typeof S == "function" ? (n) => S(ne(n)) : (n) => n[S], [S]);
1475
- function rt() {
1476
- const n = {};
1477
- let c = [];
1478
- return J.forEach((m) => {
1479
- const R = m.dataIndex || m.key;
1480
- if (m.defaultFilters && (n[R] = m.defaultFilters), m.filteredValue && (n[R] = m.filteredValue), "defaultSortOrder" in m || "sortOrder" in m) {
1481
- const F = At(m.sorter), X = "sortOrder" in m ? m.sortOrder : m.defaultSortOrder, z = {
1482
- field: R,
1483
- direction: X,
1484
- sorterFn: Pt(m.sorter),
1485
- priority: F
1486
- };
1487
- X ? Fe(F) ? c.every(
1488
- (Ne) => Fe(Ne.priority) || !Ne.direction
1489
- ) && c.push(z) : c.every((Ne) => !Ne.direction) ? c.push(z) : c = [z] : c.push(z);
1490
- }
1491
- }), { currentFilters: n, defaultSorters: c };
1492
- }
1493
- const we = fe(() => {
1494
- const n = J.filter(
1495
- (m) => "filteredValue" in m
1496
- ), c = {};
1497
- return n.length && n.forEach((m, R) => {
1498
- const F = m.key || m.dataIndex || R;
1499
- F !== void 0 && (c[F] = m.filteredValue);
1500
- }), c;
1501
- }, [J]), $e = fe(() => Object.keys(we).length ? we : _e, [_e, we]);
1502
- function Te(n, c) {
1503
- const m = zt(c);
1504
- if (!m)
1505
- return;
1506
- const R = {
1507
- direction: n,
1508
- field: c,
1509
- sorterFn: Pt(m.sorter),
1510
- priority: At(m.sorter)
1511
- }, F = Ae(R);
1512
- Oe(R, F);
1513
- const X = at(
1514
- R,
1515
- F,
1516
- $e
1517
- ), z = Je(X);
1518
- B == null || B(ze(X), R, $e, {
1519
- currentData: ne(z),
1520
- currentAllData: ne(X),
1521
- action: "sort"
1522
- });
1523
- }
1524
- function Qe(n) {
1525
- const c = function(R, F) {
1526
- return (X, z) => {
1527
- const Ne = R(X, z);
1528
- return F === "descend" ? -Ne : Ne;
1529
- };
1530
- }, m = [...n];
1531
- return m.sort((R, F) => F.priority - R.priority), (R, F) => {
1532
- for (let X = 0, z = m.length; X < z; X++) {
1533
- const { sorterFn: Ne, direction: vt } = m[X];
1534
- if (typeof Ne != "function")
1535
- continue;
1536
- const pt = c(Ne, vt)(R, F);
1537
- if (pt !== 0)
1538
- return pt;
1539
- }
1540
- return 0;
1541
- };
1542
- }
1543
- function yn(n, c) {
1544
- const m = {
1545
- ...$e,
1546
- [n.dataIndex]: c
1547
- }, R = {
1548
- ...m,
1549
- ...we
1550
- };
1551
- if (ie(c) && c.length) {
1552
- Ie(R);
1553
- const F = at(
1554
- H,
1555
- Y,
1556
- m
1557
- ), X = Je(F);
1558
- B == null || B(
1559
- ze(F),
1560
- Y.length === 1 ? Y[0] : Y,
1561
- m,
1562
- {
1563
- currentData: ne(X),
1564
- currentAllData: ne(F),
1565
- action: "filter"
1566
- }
1567
- );
1568
- } else ie(c) && !c.length && Kt(n);
1569
- }
1570
- function Kt({ dataIndex: n }) {
1571
- const c = {
1572
- ...$e
1573
- };
1574
- delete c[n], Ie(c);
1575
- const m = at(
1576
- H,
1577
- Y,
1578
- c
1579
- ), R = Je(m);
1580
- B == null || B(
1581
- ze(m),
1582
- Y.length === 1 ? Y[0] : Y,
1583
- c,
1584
- {
1585
- currentData: ne(R),
1586
- currentAllData: ne(m),
1587
- action: "filter"
1588
- }
1589
- );
1590
- }
1591
- const st = !!J.find((n) => n.fixed === "left"), it = !!J.find((n) => n.fixed === "right"), lt = st || it;
1592
- function at(n, c, m) {
1593
- let R = (K || []).slice();
1594
- Object.keys(m).forEach((X) => {
1595
- if (m[X] && m[X].length) {
1596
- const z = zt(X);
1597
- z && typeof z.onFilter == "function" && (R = R.filter((Ne) => m[X].reduce(
1598
- (vt, pt) => vt || z.onFilter(pt, Ne),
1599
- !1
1600
- )));
1601
- }
1602
- });
1603
- const F = (X) => X.slice().sort(Qe(c)).map((z) => ie(z[k]) ? {
1604
- ...z,
1605
- [k]: F(z[k])
1606
- } : z);
1607
- return n.direction && typeof n.sorterFn == "function" || c.length ? F(R) : R;
1608
- }
1609
- const We = at(
1610
- H,
1611
- Y,
1612
- $e
1613
- );
1614
- function ze(n = We) {
1615
- const c = x.pageSize || Xe || 10, m = oe === "middle" ? "default" : oe;
1616
- let R = "top";
1617
- I === "tl" || I === "bl" ? R = "bottom" : R = "top";
1618
- const F = ie(n) ? n.length : 0, X = Math.ceil(F / c) < G ? 1 : G;
1619
- X !== G && me(X);
1620
- let z = {
1621
- size: m,
1622
- total: F,
1623
- pageSize: c,
1624
- current: X,
1625
- selectProps: {
1626
- triggerProps: {
1627
- position: R
1628
- }
1629
- }
1630
- };
1631
- return typeof W == "object" && W.selectProps && (z.selectProps = {
1632
- ...z.selectProps,
1633
- ...W.selectProps
1634
- }), q(W) && (z = {
1635
- ...z,
1636
- ...W
1637
- }), q(x) && (z = {
1638
- ...z,
1639
- ...x
1640
- }), z.onChange = Rn, z;
1641
- }
1642
- const ct = ze(), Ue = Je();
1643
- function Je(n = We, c = ct) {
1644
- const { current: m = 0, pageSize: R = 10 } = c;
1645
- return W === !1 || q(W) && C.length <= R ? n : n.slice((m - 1) * R, m * R);
1646
- }
1647
- const Dt = Hn(Ht, 100), ke = !!(y && y.y), Ze = P == null ? void 0 : P(ne(We)), wt = P && Ee.isValidElement(Ze) && Ze.props.fixed, mn = ke && wt;
1648
- zn(() => {
1649
- Ht(), ht(window, "resize", Dt);
1650
- const n = ee.current, c = V.current, m = te.current;
1651
- c && ht(c, "scroll", Ve);
1652
- const R = n && n.parentNode;
1653
- return n && R && ht(R, "scroll", Ve), m && ht(m, "scroll", Ve), () => {
1654
- yt(window, "resize", Dt), c && yt(c, "scroll", Ve), R && yt(R, "scroll", Ve), m && yt(m, "scroll", Ve);
1655
- };
1656
- }, [
1657
- st,
1658
- it,
1659
- y == null ? void 0 : y.x,
1660
- y == null ? void 0 : y.y,
1661
- J.length,
1662
- C
1663
- ]), _t(() => {
1664
- const { total: n, pageSize: c } = ze(C);
1665
- Math.ceil(n / c) < G && me(1);
1666
- }, [C == null ? void 0 : C.length]), _t(() => {
1667
- dt();
1668
- }, [C, st, it, s]), Wn(o, () => ({
1669
- getRootDomElement: Nt,
1670
- scrollIntoView: (n) => {
1671
- ye.current && ye.current.scrollTo({ key: n });
1672
- },
1673
- getRootDOMNode: Nt
1674
- }));
1675
- function Nt() {
1676
- return ae.current;
1677
- }
1678
- function Ht() {
1679
- var c, m;
1680
- dt();
1681
- const n = Nt();
1682
- if (n && (lt || y && y.x)) {
1683
- const R = n.querySelector(`.${i}-body`) || n.querySelector(`.${i}-content-inner`), F = (m = (c = R == null ? void 0 : R.getBoundingClientRect) == null ? void 0 : c.call(R)) == null ? void 0 : m.width;
1684
- De(F);
1685
- }
1686
- }
1687
- const xn = et(
1688
- en(() => {
1689
- const n = ae.current, c = ke ? V.current : ce.current && ce.current.parentNode;
1690
- if (c) {
1691
- const m = s ? -c.scrollLeft : c.scrollLeft, R = m === 0, F = m + 1 >= c.children[0].getBoundingClientRect().width - c.getBoundingClientRect().width;
1692
- R && F ? ft(
1693
- n.classList,
1694
- `${i}-scroll-position-both`
1695
- ) : R ? ft(
1696
- n.classList,
1697
- `${i}-scroll-position-${s ? "right" : "left"}`
1698
- ) : F ? ft(
1699
- n.classList,
1700
- `${i}-scroll-position-${s ? "left" : "right"}`
1701
- ) : ft(
1702
- n.classList,
1703
- `${i}-scroll-position-middle`
1704
- );
1705
- } else
1706
- n && Wt(n.classList);
1707
- }, 100),
1708
- [ae.current, V.current, ke, s]
1709
- );
1710
- function dt() {
1711
- if (lt || y && q(y) && y.x) {
1712
- const n = ae.current;
1713
- n && (st && Mt(
1714
- n.classList,
1715
- `${i}-has-fixed-col-left`
1716
- ), it && Mt(
1717
- n.classList,
1718
- `${i}-has-fixed-col-right`
1719
- )), xn();
1720
- }
1721
- }
1722
- function Mt(n, c) {
1723
- n.contains(c) || n.add(c);
1724
- }
1725
- function Wt(n) {
1726
- n.remove(`${i}-scroll-position-both`), n.remove(`${i}-scroll-position-left`), n.remove(`${i}-scroll-position-right`), n.remove(`${i}-scroll-position-middle`);
1727
- }
1728
- function ft(n, c) {
1729
- n.contains(c) || (Wt(n), n.add(c));
1730
- }
1731
- const {
1732
- selectedRowKeys: $t,
1733
- indeterminateKeys: gn,
1734
- onCheckAll: Cn,
1735
- onCheck: wn,
1736
- onCheckRadio: Nn,
1737
- setSelectedRowKeys: $n,
1738
- allSelectedRowKeys: bn,
1739
- flattenData: Sn
1740
- } = mo(w, Ue, K, Me);
1741
- function zt(n) {
1742
- return J.find((c, m) => typeof c.key < "u" ? typeof c.key == "number" && typeof n == "string" ? c.key.toString() === n : c.key === n : typeof c.dataIndex < "u" ? c.dataIndex === n : typeof n == "number" ? m === n : !1);
1743
- }
1744
- function Rn(n, c) {
1745
- var R, F;
1746
- me(n), Se(c), n !== G && Tn(), A && !A.checkCrossPage && $t.length && ($n([]), (R = A.onChange) == null || R.call(A, [], []));
1747
- const m = { ...ze(), current: n, pageSize: c };
1748
- B == null || B(
1749
- m,
1750
- Y.length === 1 ? Y[0] : Y,
1751
- $e,
1752
- {
1753
- currentData: ne(
1754
- Je(We, m)
1755
- ),
1756
- currentAllData: ne(We),
1757
- action: "paginate"
1758
- }
1759
- ), (F = x.onChange) == null || F.call(x, n, c);
1760
- }
1761
- function Tn() {
1762
- if (!V.current)
1763
- return;
1764
- const c = V.current.scrollTop;
1765
- new Kn({
1766
- from: { scrollTop: c },
1767
- to: { scrollTop: 0 },
1768
- easing: Dn,
1769
- duration: 300,
1770
- onUpdate: (R) => {
1771
- V.current && (V.current.scrollTop = R.scrollTop);
1772
- }
1773
- }).start();
1774
- }
1775
- function Ve(n) {
1776
- const { target: c } = n, m = V.current, R = ee.current && ee.current.parentNode, F = te.current;
1777
- c.scrollLeft !== de.current && (R && (R.scrollLeft = c.scrollLeft), m && (m.scrollLeft = c.scrollLeft), F && (F.scrollLeft = c.scrollLeft), dt()), de.current = n.target.scrollLeft;
1778
- }
1779
- function vn(n) {
1780
- const { target: c } = n, m = ce.current;
1781
- c.scrollLeft !== de.current && (m.scrollLeft = c.scrollLeft, dt()), de.current = n.target.scrollLeft;
1782
- }
1783
- const [Ut, kn] = yo(
1784
- w,
1785
- Sn,
1786
- Me
1787
- );
1788
- let Vt = {}, bt = {};
1789
- y && (y.x && (typeof y.x == "number" || typeof y.x == "string") && (bt = {
1790
- width: y.x
1791
- }), y.y && (typeof y.y == "number" || typeof y.y == "string") && (Vt = {
1792
- maxHeight: y.y
1793
- }));
1794
- function En() {
1795
- requestAnimationFrame(() => {
1796
- const n = ee.current && ee.current.parentNode, c = co(n);
1797
- c && c > 0 && (n.style.marginBottom = `-${c}px`, n.style.paddingBottom = "0px", te.current && (te.current.style.marginBottom = `-${c}px`, te.current.style.paddingBottom = "0px")), setTimeout(() => {
1798
- const m = V.current;
1799
- fo(m) ? (he.current = !0, n && (n.style.overflowY = "scroll"), te.current && (te.current.style.overflowY = "scroll")) : n && he.current && (he.current = !1, n.style.overflowY = "auto", te.current && (te.current.style.overflowY = "auto"));
1800
- }, 0);
1801
- });
1802
- }
1803
- const jt = /* @__PURE__ */ u(
1804
- _o,
1805
- {
1806
- ...w,
1807
- activeSorters: Y,
1808
- currentSorter: H,
1809
- selectedRowKeys: $t,
1810
- currentFilters: $e,
1811
- onCheckAll: Cn,
1812
- onSort: Te,
1813
- data: Ue,
1814
- onHandleFilter: yn,
1815
- onHandleFilterReset: Kt,
1816
- prefixCls: i,
1817
- allSelectedRowKeys: bn,
1818
- groupColumns: ge,
1819
- stickyOffsets: se,
1820
- groupStickyClassNames: re
1821
- }
1822
- );
1823
- function _n() {
1824
- const n = q(y) && y.x === "max-content";
1825
- return ke || _ ? /* @__PURE__ */ u(ot, { className: `${i}-header`, children: /* @__PURE__ */ pe(
1826
- Re,
1827
- {
1828
- ref: ee,
1829
- style: n ? {} : bt,
1830
- children: [
1831
- /* @__PURE__ */ u(
1832
- mt,
1833
- {
1834
- columns: J,
1835
- prefixCls: i,
1836
- producer: !1,
1837
- columnWidths: n && y.y ? ve : null
1838
- }
1839
- ),
1840
- jt
1841
- ]
1842
- }
1843
- ) }) : jt;
1844
- }
1845
- const Yt = Ze && /* @__PURE__ */ u(
1846
- To,
1847
- {
1848
- prefixCls: i,
1849
- summary: P,
1850
- data: Ue,
1851
- columns: J,
1852
- stickyOffsets: se,
1853
- stickyClassNames: Pe
1854
- }
1855
- ), qt = /* @__PURE__ */ u(
1856
- Ro,
1857
- {
1858
- ...w,
1859
- saveRef: (n) => le.current = n,
1860
- selectedRowKeys: $t,
1861
- indeterminateKeys: gn,
1862
- expandedRowKeys: Ut,
1863
- onCheck: wn,
1864
- onCheckRadio: Nn,
1865
- onClickExpandBtn: kn,
1866
- columns: J,
1867
- data: Ue,
1868
- prefixCls: i,
1869
- hasFixedColumn: lt,
1870
- tableViewWidth: Ke,
1871
- indentSize: L,
1872
- noDataElement: $ || l("Table"),
1873
- activeSorters: Y,
1874
- currentSorter: H,
1875
- stickyOffsets: se,
1876
- stickyClassNames: Pe,
1877
- getRowKey: Me,
1878
- saveVirtualListRef: (n) => {
1879
- _ && (ye.current = n, V.current = n == null ? void 0 : n.dom);
1880
- },
1881
- ___dangerouslySetInnerHTML___: w.___dangerouslySetInnerHTML___
1882
- }
1883
- ), Gt = !_ && !mn ? /* @__PURE__ */ pe(xt, { children: [
1884
- qt,
1885
- Yt
1886
- ] }) : qt, St = ue(
1887
- new ResizeObserver(en(En))
1888
- );
1889
- tt(() => {
1890
- const n = V.current || le.current;
1891
- return n && St.current.observe(n), () => {
1892
- n && St.current.unobserve(n), St.current.disconnect();
1893
- };
1894
- }, [V.current, le.current]);
1895
- function In() {
1896
- const n = q(y) && y.x === "max-content" && !!y.y && ie(C) && C.length > 0;
1897
- return ke && !_ ? /* @__PURE__ */ u(
1898
- He,
1899
- {
1900
- ref: V,
1901
- className: `${i}-body`,
1902
- style: Vt,
1903
- children: /* @__PURE__ */ pe(Re, { style: bt, children: [
1904
- /* @__PURE__ */ u(
1905
- mt,
1906
- {
1907
- columns: J,
1908
- prefixCls: i,
1909
- producer: n,
1910
- onSetColumnWidths: M,
1911
- expandedRowKeys: Ut,
1912
- data: C
1913
- }
1914
- ),
1915
- Gt
1916
- ] })
1917
- }
1918
- ) : Gt;
1919
- }
1920
- function Pn() {
1921
- let n = {};
1922
- y && q(y) && y.x && (n = {
1923
- width: y.x
1924
- });
1925
- const c = /* @__PURE__ */ u("div", { className: `${i}-tfoot`, ref: te, children: /* @__PURE__ */ pe(Re, { style: n, children: [
1926
- /* @__PURE__ */ u(mt, { columns: J, prefixCls: i }),
1927
- Yt
1928
- ] }) }), m = Ze && ke && wt === "top", R = Ze && ke && wt === "bottom", F = /* @__PURE__ */ pe(xt, { children: [
1929
- O ? _n() : null,
1930
- m && c,
1931
- In(),
1932
- R && c
1933
- ] });
1934
- return /* @__PURE__ */ pe(xt, { children: [
1935
- typeof j == "function" && /* @__PURE__ */ u("div", { className: `${i}-header-`, children: j(Ue) }),
1936
- /* @__PURE__ */ u("div", { className: `${i}-container`, children: /* @__PURE__ */ u("div", { className: `${i}-content-scroll`, children: /* @__PURE__ */ u(
1937
- "div",
1938
- {
1939
- className: `${i}-content-inner`,
1940
- onScroll: ke ? void 0 : vn,
1941
- children: ke || _ ? F : /* @__PURE__ */ pe(Re, { ref: ce, style: n, children: [
1942
- /* @__PURE__ */ u(mt, { prefixCls: i, columns: J }),
1943
- F
1944
- ] })
1945
- }
1946
- ) }) }),
1947
- typeof f == "function" && /* @__PURE__ */ u("div", { className: `${i}-footer`, children: f(Ue) })
1948
- ] });
1949
- }
1950
- if (!T.length)
1951
- return null;
1952
- const An = q(v) ? v.wrapper : v, Rt = q(v) ? v.cell : E, On = q(v) ? v.cell || v.headerCell : E, Fn = q(v) ? v.cell || v.bodyCell : E, Ln = Z(
1953
- i,
1954
- `${i}-size-${oe}`,
1955
- {
1956
- [`${i}-border`]: An,
1957
- [`${i}-border-cell`]: Rt,
1958
- [`${i}-border-header-cell`]: !Rt && On,
1959
- [`${i}-border-body-cell`]: !Rt && Fn,
1960
- [`${i}-stripe`]: U,
1961
- [`${i}-hover`]: Q,
1962
- [`${i}-type-radio`]: A && A.type === "radio",
1963
- [`${i}-layout-fixed`]: D || y && (y.x || y.y) || T.find((n) => n.ellipsis),
1964
- [`${i}-fixed-column`]: lt,
1965
- [`${i}-virtualized`]: _,
1966
- [`${i}-rtl`]: s
1967
- },
1968
- N
1969
- ), Tt = I === "tl" || I === "tr" || I === "topCenter", Bn = Z(`${i}-pagination`, {
1970
- [`${i}-pagination-left`]: I === "tl" || I === "bl",
1971
- [`${i}-pagination-center`]: I === "topCenter" || I === "bottomCenter",
1972
- [`${i}-pagination-top`]: Tt
1973
- });
1974
- let ut = w.loading;
1975
- typeof ut == "boolean" && (ut = { loading: ut });
1976
- const Xt = typeof b == "function" ? b(/* @__PURE__ */ u(nn, { ...ct })) : /* @__PURE__ */ u("div", { className: Bn, children: /* @__PURE__ */ u(nn, { ...ct }) }), Qt = W !== !1 && (We.length !== 0 || ct.total > 0);
1977
- return /* @__PURE__ */ u(
1978
- "div",
1979
- {
1980
- ref: ae,
1981
- style: h,
1982
- className: Ln,
1983
- ...jn(w),
1984
- children: /* @__PURE__ */ pe(
1985
- Un,
1986
- {
1987
- className: `${i}-spin`,
1988
- element: p,
1989
- ...ut,
1990
- children: [
1991
- Qt && Tt && Xt,
1992
- Pn(),
1993
- Qt && !Tt && Xt
1994
- ]
1995
- }
1996
- )
1997
- }
1998
- );
1999
- }
2000
- const pn = Ot(Oo);
2001
- pn.displayName = "Table";
2002
- function hn(t) {
2003
- const { children: o, ...r } = t;
2004
- return /* @__PURE__ */ u("td", { ...lo(r, ["$$PqbTableSummaryCell"]), children: o });
2005
- }
2006
- hn.__PQB_TABLE_SUMMARY_CELL__ = !0;
2007
- function Fo(t) {
2008
- const { rtl: o } = Le(Ge), { columns: r, stickyOffsets: p, stickyClassNames: e, prefixCls: d } = Le(un), { children: l, ...a } = t, s = Ee.Children.map(
2009
- l,
2010
- (x) => x.props.colSpan || 1
2011
- ), w = Ee.Children.map(l, (x, h) => {
2012
- var O, U;
2013
- const N = x, g = Ct(N, "type.__PQB_TABLE_SUMMARY_CELL__") || Ct(N, "props.$$PqbTableSummaryCell"), v = (O = N == null ? void 0 : N.props) == null ? void 0 : O.style, E = (U = N == null ? void 0 : N.props) == null ? void 0 : U.className, C = s.slice(0, h).reduce((Q, W) => Q + W, 0), y = r[C].fixed === "left" ? { [o ? "right" : "left"]: p[C] } : r[C].fixed === "right" ? { [o ? "left" : "right"]: p[C] } : {}, $ = r[C].fixed === "left" || r[C].fixed === "right" ? e[C] : "";
2014
- return g ? Ee.cloneElement(N, {
2015
- ...N.props,
2016
- className: Z(`${d}-td`, $, E),
2017
- style: { ...v, ...y }
2018
- }) : x;
2019
- });
2020
- return /* @__PURE__ */ u("tr", { ...a, children: w });
2021
- }
2022
- function Bt(t) {
2023
- return t.children;
2024
- }
2025
- Bt.Row = Fo;
2026
- Bt.Cell = hn;
2027
- const Lo = pn;
2028
- Lo.Summary = Bt;
1
+ import { u as s, a as l, b as o, c as u, d as t, e as b, f as m } from "./chunk/CzQObzKd.js";
2
+ import { defaultComponent as r } from "./table/constant.js";
3
+ import { TableSummary as n, TableSummaryCell as p, TableSummaryRow as S, default as C, useTableThResizable as y } from "./table/index.js";
2029
4
  export {
2030
- Bt as TableSummary,
2031
- hn as TableSummaryCell,
2032
- Fo as TableSummaryRow,
2033
- Lo as default
5
+ n as TableSummary,
6
+ p as TableSummaryCell,
7
+ S as TableSummaryRow,
8
+ C as default,
9
+ r as tableDefaultComponent,
10
+ s as useTableColumns,
11
+ l as useTableComponent,
12
+ o as useTableExpand,
13
+ u as useTableRowSelection,
14
+ t as useTableSorter,
15
+ b as useTableStickyClassNames,
16
+ m as useTableStickyOffsets,
17
+ y as useTableThResizable
2034
18
  };