@unicom-cloud/ui 0.8.111 → 0.8.112

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