@unicom-cloud/ui 0.8.70 → 0.8.72

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