@antdv-vue/pro-table 0.0.0-stage → 2.0.3

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 (86) hide show
  1. package/CHANGELOG.md +255 -0
  2. package/README.md +106 -2
  3. package/dist/InternalTable.d.ts +360 -0
  4. package/dist/InternalTable.js +444 -0
  5. package/dist/RenderTypings.d.ts +33 -0
  6. package/dist/RenderTypings.js +1 -0
  7. package/dist/ResizableTableTitle.d.ts +24 -0
  8. package/dist/ResizableTableTitle.js +89 -0
  9. package/dist/Store/Provide.d.ts +68 -0
  10. package/dist/Store/Provide.js +132 -0
  11. package/dist/Table.d.ts +363 -0
  12. package/dist/Table.js +151 -0
  13. package/dist/TableRender.d.ts +54 -0
  14. package/dist/TableRender.js +295 -0
  15. package/dist/components/Alert/index.d.ts +45 -0
  16. package/dist/components/Alert/index.js +94 -0
  17. package/dist/components/Alert/style/index.d.ts +8 -0
  18. package/dist/components/Alert/style/index.js +11 -0
  19. package/dist/components/ColumnSetting/CheckboxList.d.ts +24 -0
  20. package/dist/components/ColumnSetting/CheckboxList.js +138 -0
  21. package/dist/components/ColumnSetting/CheckboxListItem.d.ts +17 -0
  22. package/dist/components/ColumnSetting/CheckboxListItem.js +84 -0
  23. package/dist/components/ColumnSetting/GroupCheckboxList.d.ts +22 -0
  24. package/dist/components/ColumnSetting/GroupCheckboxList.js +82 -0
  25. package/dist/components/ColumnSetting/ToolTipIcon.d.ts +12 -0
  26. package/dist/components/ColumnSetting/ToolTipIcon.js +47 -0
  27. package/dist/components/ColumnSetting/index.d.ts +26 -0
  28. package/dist/components/ColumnSetting/index.js +117 -0
  29. package/dist/components/ColumnSetting/style/index.d.ts +8 -0
  30. package/dist/components/ColumnSetting/style/index.js +73 -0
  31. package/dist/components/DragSortTable/index.d.ts +375 -0
  32. package/dist/components/DragSortTable/index.js +166 -0
  33. package/dist/components/DragSortTable/style/index.d.ts +8 -0
  34. package/dist/components/DragSortTable/style/index.js +25 -0
  35. package/dist/components/Dropdown/Button.d.ts +20 -0
  36. package/dist/components/Dropdown/Button.js +155 -0
  37. package/dist/components/Dropdown/index.d.ts +27 -0
  38. package/dist/components/Dropdown/index.js +149 -0
  39. package/dist/components/EditableTable/CellEditorTable.d.ts +63 -0
  40. package/dist/components/EditableTable/CellEditorTable.js +167 -0
  41. package/dist/components/EditableTable/EditableTable.d.ts +67 -0
  42. package/dist/components/EditableTable/EditableTable.js +141 -0
  43. package/dist/components/EditableTable/InternalEditableTable.d.ts +189 -0
  44. package/dist/components/EditableTable/InternalEditableTable.js +508 -0
  45. package/dist/components/EditableTable/RowEditorTable.d.ts +63 -0
  46. package/dist/components/EditableTable/RowEditorTable.js +147 -0
  47. package/dist/components/EditableTable/context.d.ts +9 -0
  48. package/dist/components/EditableTable/context.js +11 -0
  49. package/dist/components/EditableTable/index.d.ts +5 -0
  50. package/dist/components/EditableTable/index.js +5 -0
  51. package/dist/components/Form/FormRender.d.ts +77 -0
  52. package/dist/components/Form/FormRender.js +198 -0
  53. package/dist/components/Form/index.d.ts +33 -0
  54. package/dist/components/Form/index.js +91 -0
  55. package/dist/components/ToolBar/DensityIcon.d.ts +22 -0
  56. package/dist/components/ToolBar/DensityIcon.js +71 -0
  57. package/dist/components/ToolBar/FullScreenIcon.d.ts +6 -0
  58. package/dist/components/ToolBar/FullScreenIcon.js +30 -0
  59. package/dist/components/ToolBar/HeaderMenu.d.ts +22 -0
  60. package/dist/components/ToolBar/HeaderMenu.js +84 -0
  61. package/dist/components/ToolBar/index.d.ts +102 -0
  62. package/dist/components/ToolBar/index.js +322 -0
  63. package/dist/components/ToolBar/style/index.d.ts +8 -0
  64. package/dist/components/ToolBar/style/index.js +116 -0
  65. package/dist/index.d.ts +11 -0
  66. package/dist/index.js +10 -0
  67. package/dist/pro-table.esm.js +3274 -0
  68. package/dist/style/index.d.ts +11 -0
  69. package/dist/style/index.js +162 -0
  70. package/dist/typing.d.ts +409 -0
  71. package/dist/typing.js +1 -0
  72. package/dist/useFetchData.d.ts +10 -0
  73. package/dist/useFetchData.js +243 -0
  74. package/dist/utils/cellRenderToFromItem.d.ts +52 -0
  75. package/dist/utils/cellRenderToFromItem.js +163 -0
  76. package/dist/utils/columnRender.d.ts +54 -0
  77. package/dist/utils/columnRender.js +148 -0
  78. package/dist/utils/columnSort.d.ts +7 -0
  79. package/dist/utils/columnSort.js +17 -0
  80. package/dist/utils/genProColumnsToColumns.d.ts +69 -0
  81. package/dist/utils/genProColumnsToColumns.js +197 -0
  82. package/dist/utils/index.d.ts +122 -0
  83. package/dist/utils/index.js +227 -0
  84. package/dist/utils/useDragSort.d.ts +182 -0
  85. package/dist/utils/useDragSort.js +162 -0
  86. package/package.json +67 -3
@@ -0,0 +1,3274 @@
1
+ import { Fragment as e, cloneVNode as t, computed as n, createTextVNode as r, createVNode as i, defineComponent as a, inject as o, isVNode as s, markRaw as c, mergeProps as l, onBeforeUnmount as u, provide as d, reactive as f, ref as p, shallowReactive as m, shallowRef as h, toRef as g, watchEffect as _ } from "vue";
2
+ import { ValueTypeToComponent as v, proFieldParsingValueEnumToArray as y } from "@antdv-vue/pro-field";
3
+ import { ProConfigProvider as b, proTheme as x, useIntl as S, useProConfig as C, useStyle as w, useToken as T } from "@antdv-vue/pro-provider";
4
+ import { ErrorBoundary as E, FormItem as D, InlineErrorFormItem as O, LabelIconTip as k, childrenToArray as A, editableRowByKey as j, genCopyable as M, getFieldPropsOrFormItemProps as N, isBrowser as P, isNil as F, isSpecialNode as I, merge as L, omitBoolean as R, omitUndefined as z, omitUndefinedAndEmptyArr as ee, recordKeyToString as te, runFunction as B, stringify as V, transformBooleanProps as ne, useDebounceFn as re, useEditableArray as ie, useEffect as H, useMemo as ae, useMountMergeState as U, usePrevious as oe, useState as se } from "@antdv-vue/pro-utils";
5
+ import { Alert as ce, Button as le, Checkbox as W, ConfigProvider as ue, Divider as de, Dropdown as fe, Flex as pe, InputSearch as me, Popover as he, Space as ge, Table as _e, TableSummary as ve, Tabs as ye, Tooltip as G, Tree as be, TypographyText as xe } from "antdv-next";
6
+ import Se, { ProForm as Ce, ProFormDependency as we, ProFormField as Te, SchemaForm as Ee, useFieldContextInject as De, useProFormInstanceExpose as Oe } from "@antdv-vue/pro-form";
7
+ import { classNames as K, get as q, omit as J, set as Y, useMergedState as ke } from "@v-c/util";
8
+ import Ae from "@v-c/util/dist/isEqual";
9
+ import { useConfig as X } from "antdv-next/config-provider/context";
10
+ import { Keyframes as je, mergeToken as Me, unit as Z } from "@antdv-next/cssinjs";
11
+ import Ne from "@v-c/util/dist/utils/get";
12
+ import Pe from "@antdv-vue/pro-card";
13
+ import { ColumnHeightOutlined as Fe, DownOutlined as Ie, EllipsisOutlined as Le, FullscreenExitOutlined as Re, FullscreenOutlined as ze, HolderOutlined as Be, PlusOutlined as Ve, ReloadOutlined as He, SettingOutlined as Ue, VerticalAlignBottomOutlined as We, VerticalAlignMiddleOutlined as Ge, VerticalAlignTopOutlined as Ke } from "@antdv-next/icons";
14
+ import qe from "@v-c/resize-observer";
15
+ import { FastColor as Je } from "@ant-design/fast-color";
16
+ import { RestrictToVerticalAxis as Ye } from "@dnd-kit/abstract/modifiers";
17
+ import { PointerSensor as Xe } from "@dnd-kit/dom";
18
+ import { arrayMove as Ze } from "@dnd-kit/helpers";
19
+ import { DragDropProvider as Qe } from "@dnd-kit/vue";
20
+ import { isSortable as $e, isSortableOperation as et, useSortable as tt } from "@dnd-kit/vue/sortable";
21
+ // src/components/Alert/style/index.ts
22
+ var nt = (e) => ({ [`${e.componentCls}${e.antCls}-alert`]: { marginBlockEnd: e.margin } }), rt = w("ProTableAlert", (e) => [nt(Me(e, {}))]);
23
+ // src/components/Alert/index.tsx
24
+ function it(e) {
25
+ let { intl: t, onCleanSelected: n } = e;
26
+ return i("a", {
27
+ onClick: n,
28
+ key: "0"
29
+ }, [t.getMessage({
30
+ id: "alert.clear",
31
+ defaultMessage: "清空"
32
+ })]);
33
+ }
34
+ var at = /* @__PURE__ */ a((e) => {
35
+ let t = X(), a = n(() => e.prefixCls || t.value.getPrefixCls("pro")), o = n(() => `${a.value}-table-alert`), [s, c] = rt(o), l = S();
36
+ return () => {
37
+ let { selectedRowKeys: t = [], onCleanSelected: n, alwaysShowAlert: a, selectedRows: u, alertInfoRender: d = ({ intl: e }) => i(ge, null, { default: () => [
38
+ e.getMessage({
39
+ id: "alert.selected",
40
+ defaultMessage: "已选择"
41
+ }),
42
+ t.length,
43
+ e.getMessage({
44
+ id: "alert.item",
45
+ defaultMessage: "项"
46
+ }),
47
+ r("\xA0\xA0")
48
+ ] }), alertOptionRender: f = it } = e, p = f && f({
49
+ onCleanSelected: n,
50
+ selectedRowKeys: t,
51
+ selectedRows: u,
52
+ intl: l.value
53
+ });
54
+ if (d === !1) return null;
55
+ let m = d({
56
+ intl: l.value,
57
+ selectedRowKeys: t,
58
+ selectedRows: u,
59
+ onCleanSelected: n
60
+ });
61
+ return m === !1 || t.length < 1 && !a ? null : i(ce, { class: K(o.value, s.value, c.value) }, {
62
+ message: () => m,
63
+ action: () => p
64
+ });
65
+ };
66
+ }, {
67
+ name: "TableAlert",
68
+ inheritAttrs: !1,
69
+ props: /* @__PURE__ */ "action.afterClose.alertInfoRender.alertOptionRender.alwaysShowAlert.banner.classes.closable.closeIcon.description.icon.id.message.onCleanSelected.icon.id.message.onCleanSelected.onClick.onClose.onMouseenter.onMouseleave.prefixCls.role.rootClass.selectedRowKeys.selectedRows.showIcon.styles.title.type".split(".")
70
+ });
71
+ // src/utils/cellRenderToFromItem.tsx
72
+ function ot(e) {
73
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !s(e);
74
+ }
75
+ var st = [
76
+ "",
77
+ null,
78
+ void 0
79
+ ];
80
+ function ct(...e) {
81
+ return e.filter((e) => e !== void 0).map((e) => typeof e == "number" ? e.toString() : e).flat(1);
82
+ }
83
+ var lt = /* @__PURE__ */ a((t, { expose: n }) => {
84
+ let r = S(), a = De(), o = Ce.useFormInstance();
85
+ return n({}), () => {
86
+ let { columnProps: n, prefixName: s, text: c, counter: u, rowData: d, index: f, recordKey: p, subName: m, proFieldProps: h, editableUtils: g } = t, _ = p || f, v = g?.getRealIndex?.(d) ?? f, y = ct(s, s ? m : [], s ? v : _, n?.key ?? n?.dataIndex ?? f), b = y.slice(0, -1), x = [o, {
87
+ ...n,
88
+ rowKey: b,
89
+ rowIndex: f,
90
+ isEditable: !0
91
+ }], S = () => {
92
+ let m = { ...N(n?.formItemProps, ...x) };
93
+ m.messageVariables = {
94
+ label: n?.title || r.value.getMessage({
95
+ id: "editableTable.defaultFieldLabel",
96
+ defaultMessage: "此项"
97
+ }),
98
+ type: n?.valueType || r.value.getMessage({
99
+ id: "editableTable.defaultFieldType",
100
+ defaultMessage: "文本"
101
+ }),
102
+ ...m?.messageVariables
103
+ }, m.initialValue = (s ? null : c) ?? m?.initialValue ?? n?.initialValue;
104
+ let g = i(Te, l({
105
+ key: y.join("-"),
106
+ name: y,
107
+ proFormFieldKey: _,
108
+ ignoreFormItem: !0,
109
+ fieldProps: {
110
+ style: { width: "100%" },
111
+ ...N(n?.fieldProps, ...x)
112
+ }
113
+ }, h), null);
114
+ return n?.formItemRender && (g = n.formItemRender({
115
+ ...n,
116
+ index: f,
117
+ isEditable: !0,
118
+ type: "table"
119
+ }, {
120
+ defaultRender: () => i(e, null, [g]),
121
+ type: "form",
122
+ recordKey: p,
123
+ record: {
124
+ ...d,
125
+ ...o?.getFieldValue(b)
126
+ },
127
+ isEditable: !0
128
+ }, o, t.editableUtils), n.ignoreFormItem) ? i(e, null, [g]) : i(O, l({ key: y.join("-") }, m, {
129
+ errorType: "popover",
130
+ popoverProps: { getPopupContainer: a.getPopupContainer?.value || (() => u?.rootDomRef?.value || document.body) },
131
+ name: y
132
+ }), ot(g) ? g : { default: () => [g] });
133
+ };
134
+ return y.length === 0 ? null : typeof n?.formItemRender == "function" || typeof n?.fieldProps == "function" || typeof n?.formItemProps == "function" ? i(D, { noStyle: !0 }, { default: () => S() }) : S();
135
+ };
136
+ }, {
137
+ name: "CellRenderFromItem",
138
+ inheritAttrs: !1,
139
+ props: [
140
+ "columnEmptyText",
141
+ "columnProps",
142
+ "counter",
143
+ "editableUtils",
144
+ "index",
145
+ "mode",
146
+ "mode",
147
+ "prefixName",
148
+ "proFieldProps",
149
+ "recordKey",
150
+ "rowData",
151
+ "subName",
152
+ "text",
153
+ "type",
154
+ "valueType"
155
+ ]
156
+ });
157
+ function ut(e) {
158
+ let { text: t, valueType: n, rowData: r, columnProps: a, index: o } = e;
159
+ if ((!n || ["textarea", "text"].includes(n.toString())) && !a?.valueEnum && e.mode === "read") return st.includes(t) ? e.columnEmptyText : t;
160
+ if (typeof n == "function" && r) return ut({
161
+ ...e,
162
+ valueType: n(r, e.type) || "text"
163
+ });
164
+ let s = a?.key || a?.dataIndex?.toString(), c = a?.dependencies ? [
165
+ e.prefixName,
166
+ e.prefixName ? o?.toString() : e.recordKey?.toString(),
167
+ a?.dependencies
168
+ ].filter(Boolean).flat(1) : [], u = {
169
+ valueEnum: B(a?.valueEnum, r),
170
+ request: a?.request,
171
+ dependencies: a?.dependencies ? [c] : void 0,
172
+ originDependencies: a?.dependencies ? [a?.dependencies] : void 0,
173
+ params: B(a?.params, r, a),
174
+ readonly: a?.readonly,
175
+ text: n === "index" || n === "indexBorder" ? o : t,
176
+ mode: e.mode,
177
+ formItemRender: void 0,
178
+ valueType: n,
179
+ record: r,
180
+ proFieldProps: {
181
+ emptyText: e.columnEmptyText,
182
+ proFieldKey: s ? `table-field-${s}` : void 0
183
+ }
184
+ };
185
+ return e.mode === "edit" ? i(lt, l({ key: e.recordKey }, e, { proFieldProps: u }), null) : i(Te, l({
186
+ mode: "read",
187
+ ignoreFormItem: !0,
188
+ fieldProps: N(a?.fieldProps, null, a)
189
+ }, u), null);
190
+ }
191
+ // src/utils/columnRender.tsx
192
+ function dt(e) {
193
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !s(e);
194
+ }
195
+ function ft(e) {
196
+ return e && s(e) && e?.props?.colSpan;
197
+ }
198
+ function pt(t) {
199
+ let { title: n } = t, r = typeof t?.ellipsis == "boolean" ? t?.ellipsis : t?.ellipsis?.showTitle;
200
+ return n && typeof n == "function" ? i(e, null, [n(t, "table", i(k, {
201
+ label: null,
202
+ tooltip: t.tooltip
203
+ }, null))]) : i(k, {
204
+ label: n,
205
+ tooltip: t.tooltip,
206
+ ellipsis: r
207
+ }, null);
208
+ }
209
+ function mt(e, t, n, r) {
210
+ return typeof r == "boolean" ? !r : r?.(e, t, n) === !1;
211
+ }
212
+ function ht(e, t, n) {
213
+ let r = Array.isArray(n) ? Ne(t, n) : t[n];
214
+ return String(String(r)) === String(e);
215
+ }
216
+ var gt = /* @__PURE__ */ a((e, { expose: t }) => (t({}), () => {
217
+ let { editableUtils: t, rowData: n, index: r, columnProps: a, marginSM: o, type: s } = e, c = t?.actionRender?.({
218
+ ...n,
219
+ index: r
220
+ });
221
+ return c ? s === "table" ? i(ge, {
222
+ align: "center",
223
+ size: 0,
224
+ separator: i(de, { orientation: "vertical" }, null)
225
+ }, dt(c) ? c : { default: () => [c] }) : i(pe, {
226
+ align: "center",
227
+ gap: o,
228
+ justify: a?.align === "center" ? "center" : "flex-start"
229
+ }, dt(c) ? c : { default: () => [c] }) : null;
230
+ }), {
231
+ name: "EditableOptionActions",
232
+ inheritAttrs: !1,
233
+ props: [
234
+ "editableUtils",
235
+ "rowData",
236
+ "index",
237
+ "columnProps",
238
+ "type",
239
+ "marginSM"
240
+ ]
241
+ });
242
+ function _t({ columnProps: e, text: t, rowData: n, index: r, columnEmptyText: a, counter: o, type: c, marginSM: l, subName: u, editableUtils: d }) {
243
+ let { action: f, prefixName: p } = o, { isEditable: m, recordKey: h } = d?.isEditable?.({
244
+ ...n,
245
+ index: r
246
+ }), { renderText: g = (e) => e } = e, _ = g(t, n, r, f?.value), v = m && !mt(t, n, r, e?.editable) ? "edit" : "read", y = ut({
247
+ text: _,
248
+ valueType: e.valueType || "text",
249
+ index: r,
250
+ rowData: n,
251
+ subName: u,
252
+ columnProps: {
253
+ ...e,
254
+ entity: n
255
+ },
256
+ counter: o,
257
+ columnEmptyText: a,
258
+ type: c,
259
+ recordKey: h,
260
+ mode: v,
261
+ prefixName: p?.value,
262
+ editableUtils: d
263
+ }), b = v === "edit" ? y : M(y, e, _, t);
264
+ if (v === "edit") return e.valueType === "option" ? i(gt, {
265
+ type: c,
266
+ marginSM: l,
267
+ columnProps: e,
268
+ editableUtils: d,
269
+ rowData: n,
270
+ index: e.index || r
271
+ }, null) : b;
272
+ if (!e.render) {
273
+ let e = s(b) || ["string", "number"].includes(typeof b);
274
+ return !F(b) && e ? b : null;
275
+ }
276
+ let x = e.render(b, n, r, {
277
+ ...f?.value,
278
+ ...d
279
+ }, {
280
+ ...e,
281
+ isEditable: m,
282
+ type: "table"
283
+ });
284
+ return ft(x) ? x : x && e.valueType === "option" && Array.isArray(x) ? c === "table" ? i(ge, {
285
+ align: "center",
286
+ size: 0,
287
+ separator: i(de, { orientation: "vertical" }, null)
288
+ }, dt(x) ? x : { default: () => [x] }) : i(pe, {
289
+ gap: 8,
290
+ align: "center",
291
+ justify: "flex-start"
292
+ }, dt(x) ? x : { default: () => [x] }) : x;
293
+ }
294
+ // src/utils/genProColumnsToColumns.ts
295
+ var vt = /* @__PURE__ */ new WeakMap();
296
+ function yt(e, t) {
297
+ if (t) return t;
298
+ if (!e) return m({});
299
+ let n = vt.get(e);
300
+ if (n) return n;
301
+ let r = m({});
302
+ return vt.set(e, r), r;
303
+ }
304
+ function bt(e, t) {
305
+ return e ? Array.isArray(e) ? e.join("-") : e.toString() : `${t}`;
306
+ }
307
+ function xt(e) {
308
+ return Array.isArray(e) ? e.join(",") : e?.toString();
309
+ }
310
+ function St(e, t) {
311
+ return !!e && !!t;
312
+ }
313
+ function Ct(e) {
314
+ return typeof e == "function" || typeof e == "object" && typeof e.compare == "function";
315
+ }
316
+ function wt(e, t) {
317
+ let { sorter: n, sortOrder: r, dataIndex: i } = t || {};
318
+ if (r !== void 0) return r;
319
+ if (n == null || Ct(n)) return;
320
+ let a = typeof n == "string" ? n : xt(i);
321
+ return a ? e?.[a] : void 0;
322
+ }
323
+ function Tt(e, t) {
324
+ let { filters: n, onFilter: r, filteredValue: i, dataIndex: a } = t || {};
325
+ if (i !== void 0) return i;
326
+ if (n == null || St(n, r)) return;
327
+ let o = xt(a);
328
+ return o ? e?.[o] : void 0;
329
+ }
330
+ function Et(e, t, n) {
331
+ return {
332
+ filteredValue: Tt(e, n),
333
+ sortOrder: wt(t, n)
334
+ };
335
+ }
336
+ function Dt(e) {
337
+ let { onFilter: t, dataIndex: n } = e;
338
+ return t === !0 ? (e, t) => ht(e, t, n) : R(t);
339
+ }
340
+ function Ot(e) {
341
+ let { filters: t = [], valueEnum: n } = e;
342
+ return t === !0 ? y(B(n, void 0)).filter((e) => e && e.value !== "all") : t;
343
+ }
344
+ function kt(e, t, n) {
345
+ return { fixed: (e?.[t] || { fixed: n.fixed }).fixed };
346
+ }
347
+ function At(e, t, n, r, i) {
348
+ if (Object.prototype.toString.call(e) !== "[object Object]" || e === null || !Reflect.has(e, n)) return;
349
+ let a = e, o = a?.[n], s = i.get(o) || [];
350
+ return (a?.[r])?.forEach((e) => {
351
+ let a = e[n];
352
+ i.has(a) || i.set(a, s.concat([t, r]));
353
+ }), o;
354
+ }
355
+ function jt(e, t, n) {
356
+ let r = t.rowKey ?? "id";
357
+ return (i, a, o) => {
358
+ typeof t.rowKey == "function" && (r = t.rowKey(a, o));
359
+ let s = At(a, o, r, t.childrenColumnName, n);
360
+ return _t({
361
+ columnProps: e,
362
+ text: i,
363
+ rowData: a,
364
+ index: o,
365
+ columnEmptyText: t.columnEmptyText,
366
+ counter: t.counter,
367
+ type: t.type,
368
+ marginSM: t.marginSM,
369
+ subName: n.get(s),
370
+ editableUtils: t.editableUtils
371
+ });
372
+ };
373
+ }
374
+ function Mt(e, t) {
375
+ let { columns: n, counter: r, proFilter: i, proSort: a, columnEmptyText: o, marginSM: s, editableUtils: c, rowKey: l = "id", type: u = "table", childrenColumnName: d = "children" } = e, f = /* @__PURE__ */ new Map(), p = yt(n, e.columnResizeWidthMap);
376
+ return n?.map((n, m) => {
377
+ if (n === _e.EXPAND_COLUMN || n === _e.SELECTION_COLUMN) return n;
378
+ let { key: h, dataIndex: g, valueEnum: _, valueType: v = "text", children: y } = n, b = bt(h || g?.toString(), [t?.key, m].filter(Boolean).join("-"));
379
+ if (!_ && !v && !y) return {
380
+ index: m,
381
+ ...n
382
+ };
383
+ let { filteredValue: x, sortOrder: S } = Et(i, a, n), { fixed: C } = kt(r?.columnsMap?.value, b, n), w = p[b] ?? n.width ?? (n.fixed ? 200 : void 0), T = {
384
+ index: m,
385
+ key: b,
386
+ ...n,
387
+ title: pt(n),
388
+ valueEnum: _,
389
+ filters: Ot(n),
390
+ onFilter: Dt(n),
391
+ filteredValue: x,
392
+ sortOrder: S,
393
+ fixed: C,
394
+ width: w,
395
+ children: n.children ? Mt({
396
+ ...e,
397
+ columns: n.children || [],
398
+ columnResizeWidthMap: p
399
+ }, {
400
+ ...n,
401
+ key: b
402
+ }) : void 0,
403
+ render: jt(n, {
404
+ rowKey: l,
405
+ type: u,
406
+ childrenColumnName: d,
407
+ counter: r,
408
+ marginSM: s,
409
+ columnEmptyText: o,
410
+ editableUtils: c
411
+ }, f)
412
+ }, E = ee(T);
413
+ return n.resizable && (E.onHeaderCell = (e, t) => {
414
+ let r = n.onHeaderCell?.(e, t);
415
+ return {
416
+ ...r,
417
+ resizable: !0,
418
+ width: E.width,
419
+ onResize: (e, { size: t }) => {
420
+ p[b] = t.width, E.width = t.width, r?.onResize?.(e, { size: t });
421
+ }
422
+ };
423
+ }), E;
424
+ })?.filter((e) => !e?.hideInTable);
425
+ }
426
+ // src/utils/index.ts
427
+ function Nt(e, t, n) {
428
+ if (e === !1) return !1;
429
+ let { total: r, current: i, pageSize: a, setPageInfo: o } = t;
430
+ return {
431
+ showTotal: (e, t) => `${n.getMessage({
432
+ id: "pagination.total.range",
433
+ defaultMessage: "第"
434
+ })} ${t[0]}-${t[1]} ${n.getMessage({
435
+ id: "pagination.total.total",
436
+ defaultMessage: "条/总共"
437
+ })} ${e} ${n.getMessage({
438
+ id: "pagination.total.item",
439
+ defaultMessage: "条"
440
+ })}`,
441
+ total: r,
442
+ ...typeof e == "object" ? e : {},
443
+ current: e !== !0 && e ? e.current ?? i : i,
444
+ pageSize: e !== !0 && e ? e.pageSize ?? a : a,
445
+ onChange: (t, n) => {
446
+ let { onChange: r } = e;
447
+ r?.(t, n || 20), (n !== a || i !== t) && o({
448
+ pageSize: n,
449
+ current: t
450
+ });
451
+ }
452
+ };
453
+ }
454
+ function Pt(e, t) {
455
+ return t.filter((e) => e).length < 1 ? e : t.reduce((e, t) => t(e), e);
456
+ }
457
+ function Ft(e, t) {
458
+ return t === void 0 ? !1 : typeof t == "boolean" ? t : t[e];
459
+ }
460
+ function It(e, t) {
461
+ let { messageContextHolder: n, ...r } = t.editableUtils;
462
+ return {
463
+ ...r,
464
+ get pageInfo() {
465
+ return e.pageInfo.value;
466
+ },
467
+ get nativeElement() {
468
+ return t.nativeElement.value;
469
+ },
470
+ focus: () => t.focus(),
471
+ reload: async (t) => {
472
+ t && await e.setPageInfo({ current: 1 }), await e?.reload();
473
+ },
474
+ reloadAndRest: async () => {
475
+ await t.onCleanSelected(), await e.setPageInfo({ current: 1 }), await e?.reload();
476
+ },
477
+ reset: async () => {
478
+ await t.resetAll(), await e?.reset?.(), await e?.reload();
479
+ },
480
+ fullScreen: async () => await t.fullScreen(),
481
+ clearSelected: async () => await t.onCleanSelected(),
482
+ setPageInfo: async (t) => await e.setPageInfo(t)
483
+ };
484
+ }
485
+ function Lt(e, t) {
486
+ return e ? Array.isArray(e) ? e.join("-") : e.toString() : `${t}`;
487
+ }
488
+ function Rt(e) {
489
+ return Array.isArray(e) ? e.join(",") : e?.toString();
490
+ }
491
+ function zt(e) {
492
+ let t = [];
493
+ return e?.forEach((e) => {
494
+ e.children ? t.push(...zt(e.children)) : t.push(e);
495
+ }), t;
496
+ }
497
+ function Bt(e, t) {
498
+ return Object.entries(e).reduce((e, [n, r]) => {
499
+ let i = t.find((e) => Rt(e.dataIndex) === n);
500
+ return i != null && !St(i.filters, i.onFilter) && (e[n] = r), e;
501
+ }, {});
502
+ }
503
+ function Vt(e) {
504
+ return (Array.isArray(e) ? e : [e]).reduce((e, t) => {
505
+ let n = t.column?.sorter;
506
+ if (n != null && Ct(n)) return e;
507
+ let r = typeof n == "string" ? n : Rt(t.column?.dataIndex);
508
+ return r != null && (e[r] = t.order), e;
509
+ }, {});
510
+ }
511
+ function Ht(e) {
512
+ let t = {}, n = {};
513
+ return e.forEach((e) => {
514
+ let r = Rt(e.dataIndex);
515
+ r && (e.filters && !St(e.filters, e.onFilter) && (t[r] = e.defaultFilteredValue ?? null), e.sorter && !Ct(e.sorter) && (typeof e.sorter == "string" ? n[e.sorter] = e.defaultSortOrder ?? null : n[r] = e.defaultSortOrder ?? null));
516
+ }), {
517
+ sort: n,
518
+ filter: t
519
+ };
520
+ }
521
+ function Ut(e) {
522
+ return {
523
+ get nativeElement() {
524
+ return e.value?.nativeElement;
525
+ },
526
+ get pageInfo() {
527
+ return e.value?.pageInfo;
528
+ },
529
+ get formRef() {
530
+ return e.value?.formRef?.nativeElement ? e.value?.formRef : null;
531
+ },
532
+ preEditableKeys: n(() => e.value?.preEditableKeys?.value),
533
+ focus: () => e.value?.focus?.(),
534
+ fullScreen: async () => await e.value?.fullScreen(),
535
+ cleanSelected: async () => await e.value?.clearSelected?.(),
536
+ addEditRecord: async (t, n) => await e.value?.addEditRecord?.(t, n),
537
+ cancelEditable: async (t, n) => await e.value?.cancelEditable?.(t, n),
538
+ getRealIndex: (t) => e.value?.getRealIndex?.(t),
539
+ isEditable: (t) => e.value?.isEditable?.(t),
540
+ onValuesChange: (t, n) => e.value?.onValuesChange?.(t, n),
541
+ reload: async (t) => await e.value?.reload?.(t),
542
+ reloadAndRest: async () => await e.value?.reloadAndRest?.(),
543
+ reset: async () => await e.value?.reset?.(),
544
+ saveEditable: async (t, n) => await e.value?.saveEditable?.(t, n),
545
+ scrollTo: (t) => e.value?.scrollTo?.(t),
546
+ setPageInfo: async (t) => e.value?.setPageInfo(t),
547
+ startEditable: async (t, n) => await e.value?.startEditable?.(t, n)
548
+ };
549
+ }
550
+ function Wt(e, t, n, r, i = "children") {
551
+ let a = e.filter((e) => e !== void 0), o = /* @__PURE__ */ new Map(), s = (e) => {
552
+ e.forEach((e, t) => {
553
+ let r = n(e, t);
554
+ o.set(r, e), e && typeof e == "object" && i in e && s(e[i] || []);
555
+ });
556
+ };
557
+ s(t ?? []);
558
+ let c = a.map((e) => o.get(e)).filter((e) => e !== void 0);
559
+ return (r || "single") === "single" ? c[0] : c;
560
+ }
561
+ // src/components/Form/FormRender.tsx
562
+ function Gt(e) {
563
+ let t = e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
564
+ return t.startsWith("-") && (t = t.slice(1)), t;
565
+ }
566
+ function Kt(e, t) {
567
+ return !e && t !== !1 ? t?.filterType === "light" ? "LightFilter" : "QueryFilter" : "Form";
568
+ }
569
+ function qt(e, t, n) {
570
+ return !e && n === "LightFilter" ? J({ ...t }, [
571
+ "labelWidth",
572
+ "defaultCollapsed",
573
+ "cardProps",
574
+ "filterType"
575
+ ]) : e ? {} : J({
576
+ labelWidth: t ? t?.labelWidth : void 0,
577
+ defaultCollapsed: !0,
578
+ ...t
579
+ }, ["filterType", "cardProps"]);
580
+ }
581
+ function Jt(e, t) {
582
+ return e ? J(t, ["ignoreRules"]) : {
583
+ ignoreRules: !0,
584
+ ...t
585
+ };
586
+ }
587
+ var Yt = /* @__PURE__ */ a((e, { expose: t }) => {
588
+ let r = X(), a = C(), o = h(), s = n(() => e.prefixCls || r.value.getPrefixCls("pro")), c = n(() => `${s.value}-table-search`), u = n(() => e.type === "form"), d = n(() => Kt(u.value, e.search)), f = (t, n) => {
589
+ e.onSubmit && e.onSubmit(t, n);
590
+ }, p = n(() => e.columns?.filter((t) => t === _e.EXPAND_COLUMN || t === _e.SELECTION_COLUMN || t.search === !1 && e.type !== "form" ? !1 : !(e.type === "form" && t.hideInForm)).map((t) => {
591
+ let n = !t.valueType || [
592
+ "textarea",
593
+ "jsonCode",
594
+ "code"
595
+ ].includes(t?.valueType) && e.type === "table" ? "text" : t?.valueType, r = t?.key || t?.dataIndex?.toString();
596
+ return {
597
+ ...t,
598
+ width: void 0,
599
+ ...t.search && typeof t.search == "object" ? t.search : {},
600
+ valueType: n,
601
+ proFieldProps: {
602
+ ...t.proFieldProps,
603
+ proFieldKey: r ? `table-field-${r}` : void 0
604
+ }
605
+ };
606
+ }));
607
+ return t(Oe(o)), () => {
608
+ let { type: t, dateFormatter: n = "string", submitButtonLoading: r, action: m, ghost: h, manualRequest: g, onReset: _, search: v, form: y, bordered: b } = e, x = typeof v == "boolean" ? {} : v?.cardProps || {};
609
+ return i(Pe, l(x, {
610
+ ghost: h,
611
+ class: K(c.value, a.value.hashId, {
612
+ [`${c.value}-${Gt(d.value)}`]: !0,
613
+ [`${s.value}-table-form`]: u.value,
614
+ [v?.class]: v !== !1 && v?.class
615
+ }),
616
+ style: v !== !1 && v?.style,
617
+ variant: b ? "outlined" : "borderless",
618
+ styles: {
619
+ ...x?.styles,
620
+ body: {
621
+ ...x.styles && "body" in x?.styles ? x?.styles?.body : {},
622
+ padding: 0,
623
+ borderRadius: 0
624
+ }
625
+ }
626
+ }), { default: () => [i(Ee, l({
627
+ ref: o,
628
+ layoutType: d.value,
629
+ columns: p.value,
630
+ type: t,
631
+ submitter: { submitButtonProps: { loading: r } }
632
+ }, qt(u.value, typeof v == "boolean" ? {} : v, d.value), Jt(u.value, y || {}), {
633
+ action: m,
634
+ dateFormatter: n,
635
+ onInit: async (e, n) => {
636
+ if (o.value = n, t !== "form") {
637
+ let t = m?.pageInfo, { current: n = t?.current, pageSize: r = t?.pageSize } = e;
638
+ if (await m?.setPageInfo?.({
639
+ ...t,
640
+ current: Number.parseInt(n, 10),
641
+ pageSize: Number.parseInt(r, 10)
642
+ }), g) return;
643
+ f(e, !0);
644
+ }
645
+ },
646
+ onReset: _,
647
+ onFinish: (e) => f(e, !1),
648
+ model: y?.model
649
+ }), null)] });
650
+ };
651
+ }, {
652
+ name: "FormRender",
653
+ inheritAttrs: !1,
654
+ props: /* @__PURE__ */ "action.bordered.colon.columns.dateFormatter.dependencies.extra.fieldId.form.ghost.hasFeedback.help.hidden.htmlFor.id.initialValue.isListField.label.labelAlign.labelCol.layout.manualRequest.messageVariables.name.noStyle.onReset.onSubmit.prefixCls.required.rootClass.rules.search.status.submitButtonLoading.tooltip.trigger.type.validateDebounce.validateFirst.validateStatus.validateTrigger.valuePropName.vertical.wrapperCol".split(".")
655
+ }), Xt = /* @__PURE__ */ a((e, { expose: t }) => {
656
+ let r = h(), a = n(() => e.pagination ? z({
657
+ current: e.pagination.current,
658
+ pageSize: e.pagination.pageSize
659
+ }) : {}), o = async (t, n) => {
660
+ let { action: i, onFormSearchSubmit: o, onSubmit: s, beforeSearchSubmit: c = (e) => e } = e;
661
+ e.form?.ignoreRules === !1 && n && await r?.value?.validateFields();
662
+ let l = {
663
+ ...t,
664
+ _timestamp: Date.now(),
665
+ ...a.value
666
+ }, u = J(c(l), Object.keys(a.value));
667
+ o?.(u), n || i?.setPageInfo?.({ current: 1 }), s && !n && s?.(t);
668
+ }, s = async (t) => {
669
+ let { action: n, onReset: i, onFormSearchSubmit: o, beforeSearchSubmit: s = (e) => e } = e;
670
+ e.form?.ignoreRules === !1 && await r?.value?.validateFields(), (() => {
671
+ let e = J(s({
672
+ ...t,
673
+ ...a.value
674
+ }), Object.keys(a.value));
675
+ o?.(e), n?.setPageInfo?.({ current: 1 }), i?.();
676
+ })();
677
+ };
678
+ return t(Oe(r)), () => {
679
+ let { action: t, columns: n, loading: a, type: c, ghost: l, pagination: u, form: d, manualRequest: f, search: p, cardBordered: m, dateFormatter: h } = e, g = u ? z({
680
+ current: u.current,
681
+ pageSize: u.pageSize
682
+ }) : {};
683
+ return i(Yt, {
684
+ ref: r,
685
+ submitButtonLoading: a,
686
+ columns: n,
687
+ type: c,
688
+ ghost: l,
689
+ onSubmit: o,
690
+ manualRequest: f,
691
+ onReset: s,
692
+ dateFormatter: h,
693
+ search: p,
694
+ form: {
695
+ autoFocusFirstInput: !1,
696
+ ...d,
697
+ extraUrlParams: {
698
+ ...g,
699
+ ...d?.extraUrlParams
700
+ }
701
+ },
702
+ action: t,
703
+ bordered: Ft("search", m)
704
+ }, null);
705
+ };
706
+ }, {
707
+ name: "FormSearch",
708
+ inheritAttrs: !1,
709
+ props: [
710
+ "action",
711
+ "beforeSearchSubmit",
712
+ "cardBordered",
713
+ "columns",
714
+ "dateFormatter",
715
+ "form",
716
+ "loading",
717
+ "manualRequest",
718
+ "onFormSearchSubmit",
719
+ "onReset",
720
+ "onSubmit",
721
+ "pagination",
722
+ "search",
723
+ "type"
724
+ ]
725
+ });
726
+ // src/Store/Provide.tsx
727
+ function Zt(e = {}) {
728
+ let t = h(), r = h(null), i = h(), a = h(), [o, s] = se(""), c = h([]), [l, u] = ke(() => e.size || e.defaultSize || "medium", {
729
+ value: n(() => e.size),
730
+ onChange: e.onSizeChange
731
+ }), d = n(() => {
732
+ if (e?.columnsState?.defaultValue) return e.columnsState.defaultValue;
733
+ let t = {};
734
+ return e.columns?.forEach(({ key: e, dataIndex: n, fixed: r, disable: i }, a) => {
735
+ let o = bt(e ?? n, a);
736
+ o && (t[o] = {
737
+ show: !0,
738
+ fixed: r,
739
+ disable: i
740
+ });
741
+ }), t;
742
+ }), [f, p] = ke(() => {
743
+ let { persistenceType: t, persistenceKey: n } = e.columnsState || {};
744
+ if (n && t && typeof window < "u") {
745
+ let r = window[t];
746
+ try {
747
+ let t = r?.getItem(n);
748
+ if (t) return e?.columnsState?.defaultValue ? L({}, e?.columnsState?.defaultValue, JSON.parse(t)) : JSON.parse(t);
749
+ } catch (e) {
750
+ console.warn(e);
751
+ }
752
+ }
753
+ return e.columnsState?.value || e.columnsState?.defaultValue || d.value;
754
+ }, {
755
+ value: n(() => e.columnsState?.value),
756
+ onChange: e.columnsState?.onChange || e.onColumnsStateChange
757
+ });
758
+ H(() => {
759
+ let { persistenceType: t, persistenceKey: n } = e.columnsState || {};
760
+ if (n && t && typeof window < "u") {
761
+ let r = window[t];
762
+ try {
763
+ let t = r?.getItem(n);
764
+ t ? e?.columnsState?.defaultValue ? p(L({}, e?.columnsState?.defaultValue, JSON.parse(t))) : p(JSON.parse(t)) : p(d.value);
765
+ } catch (e) {
766
+ console.warn(e);
767
+ }
768
+ }
769
+ }, [
770
+ () => e.columnsState?.persistenceKey,
771
+ () => e.columnsState?.persistenceType,
772
+ () => d.value
773
+ ]);
774
+ let m = () => {
775
+ let { persistenceType: t, persistenceKey: n } = e.columnsState || {};
776
+ if (!n || !t || typeof window > "u") return;
777
+ let r = window[t];
778
+ try {
779
+ r?.removeItem(n);
780
+ } catch (e) {
781
+ console.warn(e);
782
+ }
783
+ };
784
+ return H(() => {
785
+ if (!e.columnsState?.persistenceKey || !e.columnsState?.persistenceType || typeof window > "u") return;
786
+ let { persistenceType: t, persistenceKey: n } = e.columnsState, r = window[t];
787
+ try {
788
+ r?.setItem(n, JSON.stringify(f.value));
789
+ } catch (e) {
790
+ console.warn(e), m();
791
+ }
792
+ }, [
793
+ () => e.columnsState?.persistenceKey,
794
+ () => f.value,
795
+ () => e.columnsState?.persistenceType
796
+ ]), {
797
+ action: t,
798
+ setAction: (e) => {
799
+ t.value = e;
800
+ },
801
+ sortKeyColumns: c,
802
+ setSortKeyColumns: (e) => {
803
+ c.value = e;
804
+ },
805
+ propsRef: i,
806
+ tableSize: l,
807
+ setTableSize: u,
808
+ prefixName: a,
809
+ setPrefixName: (e) => {
810
+ a.value = e;
811
+ },
812
+ columnsMap: f,
813
+ setColumnsMap: p,
814
+ keyWords: o,
815
+ setKeyWords: s,
816
+ columns: e.columns,
817
+ clearPersistenceStorage: m,
818
+ defaultColumnKeyMap: d,
819
+ rootDomRef: r
820
+ };
821
+ }
822
+ var Qt = Symbol("tableContext");
823
+ function $t(e) {
824
+ return d(Qt, e);
825
+ }
826
+ var Q = () => o(Qt, {}), en = /* @__PURE__ */ a((e, { slots: t }) => {
827
+ let { columnsMap: n, setColumnsMap: r } = Q();
828
+ return () => e.show ? i(G, { title: e.title }, { default: () => [i("span", { onClick: (t) => {
829
+ t.stopPropagation(), t.preventDefault();
830
+ let i = n?.value?.[e.columnKey] || {}, a = {
831
+ ...n?.value,
832
+ [e.columnKey]: f({
833
+ ...i,
834
+ fixed: e.fixed
835
+ })
836
+ };
837
+ r?.(a);
838
+ } }, [t.default?.()])] }) : null;
839
+ }, {
840
+ props: {
841
+ title: {
842
+ type: String,
843
+ required: !1
844
+ },
845
+ columnKey: {
846
+ type: [String, Number],
847
+ required: !1
848
+ },
849
+ show: {
850
+ type: Boolean,
851
+ required: !1,
852
+ default: void 0
853
+ },
854
+ fixed: {
855
+ type: String,
856
+ required: !1
857
+ }
858
+ },
859
+ name: "ToolTipIcon",
860
+ inheritAttrs: !1
861
+ }), tn = /* @__PURE__ */ a((e, { attrs: t }) => {
862
+ let n = S(), r = C();
863
+ return () => {
864
+ let { isLeaf: a, columnKey: o, fixed: s, title: c, showListItemOption: l } = e;
865
+ return i("span", {
866
+ class: K(`${t.class}-list-item`, r.value.hashId),
867
+ key: o
868
+ }, [i("span", { class: K(`${t.class}-list-item-title`, r.value.hashId) }, [c]), l && !a ? i("span", { class: K(`${t.class}-list-item-option`, r.value.hashId) }, [
869
+ i(en, {
870
+ columnKey: o,
871
+ fixed: "start",
872
+ title: n.value.getMessage({
873
+ id: "tableToolBar.startPin",
874
+ defaultMessage: "固定在列首"
875
+ }),
876
+ show: e.fixed !== "start"
877
+ }, { default: () => [i(Ke, null, null)] }),
878
+ i(en, {
879
+ columnKey: o,
880
+ fixed: void 0,
881
+ title: n.value.getMessage({
882
+ id: "tableToolBar.noPin",
883
+ defaultMessage: "不固定"
884
+ }),
885
+ show: !!s
886
+ }, { default: () => [i(Ge, null, null)] }),
887
+ i(en, {
888
+ columnKey: o,
889
+ fixed: "end",
890
+ title: n.value.getMessage({
891
+ id: "tableToolBar.endPin",
892
+ defaultMessage: "固定在列尾"
893
+ }),
894
+ show: s !== "end"
895
+ }, { default: () => [i(We, null, null)] })
896
+ ]) : null]);
897
+ };
898
+ }, {
899
+ props: {
900
+ columnKey: {
901
+ type: [String, Number],
902
+ required: !0
903
+ },
904
+ title: {
905
+ type: [
906
+ Object,
907
+ Function,
908
+ String,
909
+ Number,
910
+ null,
911
+ Boolean,
912
+ Array
913
+ ],
914
+ required: !1,
915
+ default: void 0
916
+ },
917
+ fixed: {
918
+ type: [Boolean, String],
919
+ required: !1,
920
+ default: void 0
921
+ },
922
+ showListItemOption: {
923
+ type: Boolean,
924
+ required: !1,
925
+ default: void 0
926
+ },
927
+ isLeaf: {
928
+ type: Boolean,
929
+ required: !1,
930
+ default: void 0
931
+ }
932
+ },
933
+ name: "CheckboxListItem",
934
+ inheritAttrs: !1
935
+ });
936
+ // src/components/ColumnSetting/CheckboxList.tsx
937
+ function nn(e) {
938
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !s(e);
939
+ }
940
+ var rn = /* @__PURE__ */ a((t, { attrs: r }) => {
941
+ let a = C(), { columnsMap: o, sortKeyColumns: s, setColumnsMap: c, setSortKeyColumns: u } = Q(), d = n(() => t.list && t.list.length > 0), f = n(() => {
942
+ if (!d.value) return {};
943
+ let e = [], n = /* @__PURE__ */ new Map(), r = (t, i) => t.map(({ key: t, dataIndex: a, children: s, title: c, ...l }) => {
944
+ let u = bt(t, [i?.columnKey, l.index].filter(Boolean).join("-")), d = o?.value?.[u || "null"] || { show: !0 };
945
+ d.show !== !1 && !s && e.push(u);
946
+ let f = {
947
+ key: u,
948
+ ...J(l, ["className"]),
949
+ title: c,
950
+ selectable: !1,
951
+ disabled: d.disable === !0,
952
+ disableCheckbox: typeof d.disable == "boolean" ? d.disable : d.disable?.checkbox,
953
+ isLeaf: i ? !0 : void 0
954
+ };
955
+ return s && (f.children = r(s, {
956
+ ...d,
957
+ columnKey: u
958
+ }), f.children?.every((t) => e?.includes(t.key)) && e.push(u)), n.set(t, {
959
+ ...f,
960
+ parentKey: i?.columnKey
961
+ }), f;
962
+ });
963
+ return {
964
+ list: r(t.list),
965
+ keys: e,
966
+ map: n
967
+ };
968
+ }), p = (e, t, n) => {
969
+ let r = { ...o?.value }, i = [...s?.value || []], a = i.findIndex((t) => t === e), l = i.findIndex((e) => e === t), d = n >= a;
970
+ if (a < 0) return;
971
+ let f = i[a];
972
+ i.splice(a, 1), n === 0 ? i.unshift(f) : i.splice(d ? l : l + 1, 0, f), i.forEach((e, t) => {
973
+ r[e] = {
974
+ ...r[e] || {},
975
+ order: t
976
+ };
977
+ }), c?.(r), u?.(i);
978
+ };
979
+ return () => {
980
+ let { showTitle: n = !0, title: s, draggable: u, listsHeight: m = 280, showListItemOption: h, checkable: g } = t;
981
+ if (!d.value) return null;
982
+ let _ = i(be, {
983
+ itemHeight: 24,
984
+ draggable: u && !!f.value.list?.length && f.value.list?.length > 1,
985
+ checkable: g,
986
+ onDrop: (e) => {
987
+ let t = e.node.key, n = e.dragNode?.key, { dropPosition: r, dropToGap: i } = e, a = r === -1 || !i ? r + 1 : r;
988
+ p(n, t, a);
989
+ },
990
+ blockNode: !0,
991
+ height: m,
992
+ onCheck: (e, t) => {
993
+ let n = { ...o?.value }, r = (e) => {
994
+ let i = { ...n[e] };
995
+ i.show = t.checked, f.value.map?.get(e)?.children && f.value.map.get(e)?.children?.forEach((e) => r(e.key)), n[e] = i;
996
+ };
997
+ r(t.node.key), c?.({ ...n });
998
+ },
999
+ checkedKeys: f.value.keys,
1000
+ showLine: !1,
1001
+ titleRender: (e) => {
1002
+ let t = {
1003
+ ...e,
1004
+ children: void 0
1005
+ };
1006
+ if (!t.title) return null;
1007
+ let n = B(t.title, t), a = i(xe, {
1008
+ style: { width: Z(80) },
1009
+ ellipsis: { tooltip: n }
1010
+ }, nn(n) ? n : { default: () => [n] });
1011
+ return i(tn, l({ class: r.class }, J(t, ["key"]), {
1012
+ showListItemOption: h,
1013
+ title: a,
1014
+ columnKey: t.key
1015
+ }), null);
1016
+ },
1017
+ treeData: f.value.list?.map(({ disabled: e, ...t }) => t)
1018
+ }, null);
1019
+ return i(e, null, [n && i("span", { class: K(`${r.class}-list-title`, a.value.hashId) }, [s]), _]);
1020
+ };
1021
+ }, {
1022
+ name: "CheckboxList",
1023
+ inheritAttrs: !1,
1024
+ props: [
1025
+ "checkable",
1026
+ "draggable",
1027
+ "list",
1028
+ "listsHeight",
1029
+ "showListItemOption",
1030
+ "showTitle",
1031
+ "title"
1032
+ ]
1033
+ }), an = /* @__PURE__ */ a((e, { attrs: t }) => {
1034
+ let n = C(), r = S();
1035
+ return () => {
1036
+ let { columns: a, draggable: o, checkable: s, showListItemOption: c, listsHeight: l } = e, u = [], d = [], f = [];
1037
+ a?.forEach((e) => {
1038
+ let { fixed: t, hideInSetting: n } = e;
1039
+ n || (t === "start" ? d.push(e) : t === "end" ? u.push(e) : f.push(e));
1040
+ });
1041
+ let p = u && u.length > 0, m = d && d.length > 0;
1042
+ return i("div", { class: K(`${t.class}-list`, n.value.hashId, { [`${t.class}-list-group`]: p || m }) }, [
1043
+ i(rn, {
1044
+ title: r.value.getMessage({
1045
+ id: "tableToolBar.startFixedTitle",
1046
+ defaultMessage: "固定在左侧"
1047
+ }),
1048
+ list: d,
1049
+ class: t.class,
1050
+ draggable: o,
1051
+ checkable: s,
1052
+ showListItemOption: c,
1053
+ listsHeight: l
1054
+ }, null),
1055
+ i(rn, {
1056
+ list: f,
1057
+ draggable: o,
1058
+ checkable: s,
1059
+ showListItemOption: c,
1060
+ title: r.value.getMessage({
1061
+ id: "tableToolBar.noFixedTitle",
1062
+ defaultMessage: "不固定"
1063
+ }),
1064
+ showTitle: m || p,
1065
+ class: t.class,
1066
+ listsHeight: l
1067
+ }, null),
1068
+ i(rn, {
1069
+ title: r.value.getMessage({
1070
+ id: "tableToolBar.endFixedTitle",
1071
+ defaultMessage: "固定在右侧"
1072
+ }),
1073
+ list: u,
1074
+ draggable: o,
1075
+ checkable: s,
1076
+ showListItemOption: c,
1077
+ class: t.class,
1078
+ listsHeight: l
1079
+ }, null)
1080
+ ]);
1081
+ };
1082
+ }, {
1083
+ name: "GroupCheckboxList",
1084
+ inheritAttrs: !1,
1085
+ props: [
1086
+ "checkable",
1087
+ "columns",
1088
+ "draggable",
1089
+ "listsHeight",
1090
+ "showListItemOption"
1091
+ ]
1092
+ }), on = (e) => ({
1093
+ [e.componentCls]: {
1094
+ width: "auto",
1095
+ "&-title": {
1096
+ display: "flex",
1097
+ alignItems: "center",
1098
+ justifyContent: "space-between",
1099
+ height: 32
1100
+ },
1101
+ "&-overlay": {
1102
+ [`${e.antCls}-popover-inner-content`]: {
1103
+ width: 200,
1104
+ paddingBlock: 0,
1105
+ paddingInline: 0,
1106
+ paddingBlockEnd: 8,
1107
+ [`${e.antCls}-tree-node-content-wrapper`]: { "&-normal": { "&:hover": { backgroundColor: "transparent" } } }
1108
+ },
1109
+ [`${e.antCls}-tree-draggable-icon`]: { cursor: "grab" },
1110
+ [`${e.antCls}-tree-treenode`]: {
1111
+ alignItems: "center",
1112
+ "&:hover": { [`${e.componentCls}-list-item-option`]: { display: "block" } },
1113
+ [`${e.antCls}-tree-checkbox`]: { marginInlineEnd: 4 },
1114
+ [`${e.antCls}-tree-title`]: { width: "100%" }
1115
+ }
1116
+ }
1117
+ },
1118
+ [`${e.componentCls}-action-rest-button`]: { color: e.colorPrimary },
1119
+ [`${e.componentCls}-list`]: {
1120
+ display: "flex",
1121
+ flexDirection: "column",
1122
+ width: "100%",
1123
+ paddingBlockStart: 8,
1124
+ [`&${e.componentCls}-list-group`]: { paddingBlockStart: 0 },
1125
+ "&-title": {
1126
+ marginBlockStart: 6,
1127
+ marginBlockEnd: 6,
1128
+ paddingInlineStart: 24,
1129
+ color: e.colorTextSecondary,
1130
+ fontSize: 12
1131
+ },
1132
+ "&-item": {
1133
+ display: "flex",
1134
+ alignItems: "center",
1135
+ maxHeight: 24,
1136
+ justifyContent: "space-between",
1137
+ "&-title": {
1138
+ flex: 1,
1139
+ maxWidth: 80,
1140
+ textOverflow: "ellipsis",
1141
+ overflow: "hidden",
1142
+ wordBreak: "break-all",
1143
+ whiteSpace: "nowrap"
1144
+ },
1145
+ "&-option": {
1146
+ display: "none",
1147
+ float: "right",
1148
+ cursor: "pointer",
1149
+ "> span": { "> span.anticon": { color: e.colorPrimary } },
1150
+ "> span + span": { marginInlineStart: 4 }
1151
+ }
1152
+ }
1153
+ }
1154
+ }), sn = w("ProTableColumnSetting", (e) => [on(Me(e, {}))]);
1155
+ // src/components/ColumnSetting/index.tsx
1156
+ function cn(e) {
1157
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !s(e);
1158
+ }
1159
+ var ln = /* @__PURE__ */ a((e, { slots: t }) => {
1160
+ let r = S(), a = X(), o = n(() => e.prefixCls || a.value.getPrefixCls("pro")), s = n(() => `${o.value}-table-column-setting`), [c, l] = sn(s), u = Q(), d = h(null), f = (t = !0) => {
1161
+ let n = {}, r = (e) => {
1162
+ e?.forEach(({ key: e, fixed: i, index: a, children: o, disable: s }) => {
1163
+ let c = bt(e, a);
1164
+ c && (n[c] = {
1165
+ show: s ? u.columnsMap?.value?.[c]?.show : t,
1166
+ fixed: i,
1167
+ disable: s,
1168
+ order: u.columnsMap?.value?.[c]?.order
1169
+ }), o && r(o);
1170
+ });
1171
+ };
1172
+ r(e.columns), u.setColumnsMap?.(n);
1173
+ };
1174
+ H(() => {
1175
+ u.propsRef?.value?.columnsState?.value && (d.value = JSON.parse(JSON.stringify(u.propsRef.value?.columnsState?.value || {})));
1176
+ }, [() => u.propsRef?.value?.columnsState?.value]);
1177
+ let p = () => {
1178
+ u.clearPersistenceStorage?.(), u.setColumnsMap?.(u.propsRef?.value?.columnsState?.defaultValue || d.value || u.defaultColumnKeyMap?.value);
1179
+ };
1180
+ return () => {
1181
+ let n, { settingIcon: a, checkable: o, draggable: d, checkedReset: m = !0, extra: h, listsHeight: g, showListItemOption: _, columns: v = [] } = e, y = Object.values(u.columnsMap?.value || {}).filter((e) => !e || e.show === !1), b = y.length > 0 && y.length !== v.length;
1182
+ return i(he, {
1183
+ arrow: !1,
1184
+ trigger: "click",
1185
+ placement: "bottomRight",
1186
+ title: i("div", { class: K(`${s.value}-title`, c.value, l.value) }, [
1187
+ o === !1 ? null : i(W, {
1188
+ indeterminate: b,
1189
+ checked: y.length === 0 && y.length !== v.length,
1190
+ onChange: (e) => {
1191
+ e.target.checked ? f() : f(!1);
1192
+ }
1193
+ }, cn(n = r.value.getMessage({
1194
+ id: "tableToolBar.columnDisplay",
1195
+ defaultMessage: "列展示"
1196
+ })) ? n : { default: () => [n] }),
1197
+ m ? i("a", {
1198
+ class: K(`${s.value}-action-rest-button`, c.value, l.value),
1199
+ onClick: p
1200
+ }, [r.value.getMessage({
1201
+ id: "tableToolBar.reset",
1202
+ defaultMessage: "重置"
1203
+ })]) : null,
1204
+ h ? i(ge, {
1205
+ size: 12,
1206
+ align: "center"
1207
+ }, cn(h) ? h : { default: () => [h] }) : null
1208
+ ]),
1209
+ classes: { root: K(`${s.value}-overlay`, c.value, l.value) },
1210
+ content: i(an, {
1211
+ class: s.value,
1212
+ checkable: o ?? !0,
1213
+ draggable: d ?? !0,
1214
+ showListItemOption: _ ?? !0,
1215
+ columns: v,
1216
+ listsHeight: g
1217
+ }, null)
1218
+ }, { default: () => [t.default?.() || i(G, { title: r.value.getMessage({
1219
+ id: "tableToolBar.columnSetting",
1220
+ defaultMessage: "列设置"
1221
+ }) }, { default: () => [a ?? i(Ue, null, null)] })] });
1222
+ };
1223
+ }, {
1224
+ name: "ColumnSetting",
1225
+ inheritAttrs: !1,
1226
+ props: [
1227
+ "checkable",
1228
+ "checkedReset",
1229
+ "columns",
1230
+ "draggable",
1231
+ "extra",
1232
+ "listsHeight",
1233
+ "prefixCls",
1234
+ "settingIcon",
1235
+ "showListItemOption"
1236
+ ]
1237
+ });
1238
+ // src/components/ToolBar/DensityIcon.tsx
1239
+ function un(e) {
1240
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !s(e);
1241
+ }
1242
+ var dn = /* @__PURE__ */ a((e) => {
1243
+ let t = S(), { tableSize: n, setTableSize: r } = Q();
1244
+ return () => {
1245
+ let { icon: a = i(Fe, null, null) } = e;
1246
+ return i(fe, {
1247
+ menu: {
1248
+ style: { width: Z(80) },
1249
+ selectedKeys: [n?.value],
1250
+ onClick: ({ key: e }) => {
1251
+ r?.(e);
1252
+ },
1253
+ items: [
1254
+ {
1255
+ key: "large",
1256
+ label: t.value.getMessage({
1257
+ id: "tableToolBar.densityLarger",
1258
+ defaultMessage: "宽松"
1259
+ })
1260
+ },
1261
+ {
1262
+ key: "medium",
1263
+ label: t.value.getMessage({
1264
+ id: "tableToolBar.densityMedium",
1265
+ defaultMessage: "中等"
1266
+ })
1267
+ },
1268
+ {
1269
+ key: "small",
1270
+ label: t.value.getMessage({
1271
+ id: "tableToolBar.densitySmall",
1272
+ defaultMessage: "紧凑"
1273
+ })
1274
+ }
1275
+ ]
1276
+ },
1277
+ trigger: ["click"]
1278
+ }, { default: () => [i(G, { title: t.value.getMessage({
1279
+ id: "tableToolBar.density",
1280
+ defaultMessage: "表格密度"
1281
+ }) }, un(a) ? a : { default: () => [a] })] });
1282
+ };
1283
+ }, {
1284
+ props: { icon: {
1285
+ type: [
1286
+ Object,
1287
+ Function,
1288
+ String,
1289
+ Number,
1290
+ null,
1291
+ Boolean,
1292
+ Array
1293
+ ],
1294
+ required: !1,
1295
+ default: void 0
1296
+ } },
1297
+ name: "DensityIcon",
1298
+ inheritAttrs: !1
1299
+ }), fn = /* @__PURE__ */ a(() => {
1300
+ let e = S(), [t, n] = se(!1);
1301
+ return H(() => {
1302
+ P() && (document.onfullscreenchange = () => {
1303
+ n(!!document.fullscreenElement);
1304
+ });
1305
+ }, []), () => t.value ? i(G, { title: e.value.getMessage({
1306
+ id: "tableToolBar.exitFullScreen",
1307
+ defaultMessage: "全屏"
1308
+ }) }, { default: () => [i(Re, null, null)] }) : i(G, { title: e.value.getMessage({
1309
+ id: "tableToolBar.fullScreen",
1310
+ defaultMessage: "全屏"
1311
+ }) }, { default: () => [i(ze, null, null)] });
1312
+ }, {
1313
+ name: "FullScreenIcon",
1314
+ inheritAttrs: !1
1315
+ }), pn = /* @__PURE__ */ a((e) => {
1316
+ let [t, n] = ke(e.activeKey || e.defaultActiveKey, {
1317
+ value: g(() => e.activeKey),
1318
+ onChange: e.onChange
1319
+ });
1320
+ return () => {
1321
+ let { items: r = [], hashId: a, cssVarCls: o, type: s = "inline", prefixCls: c } = e;
1322
+ if (r.length < 1) return null;
1323
+ let l = r.find((e) => e.key === t.value) || r[0];
1324
+ return s === "inline" ? i("div", { class: K(`${c}-menu`, `${c}-inline-menu`, a, o) }, [r.map((e, t) => i("div", {
1325
+ key: e.key || t,
1326
+ onClick: () => n(e.key),
1327
+ class: K(`${c}-inline-menu-item`, l?.key === e.key ? `${c}-inline-menu-item-active` : void 0, a, o)
1328
+ }, [e.label]))]) : s === "tab" ? i(ye, {
1329
+ activeKey: l?.key,
1330
+ items: r.map((e) => ({
1331
+ ...e,
1332
+ key: e.key?.toString()
1333
+ })),
1334
+ onTabClick: (e) => n(e)
1335
+ }, null) : i("div", { class: K(`${c}-menu`, `${c}-dropdownmenu`, a, o) }, [i(fe, {
1336
+ trigger: ["click"],
1337
+ menu: {
1338
+ selectedKeys: [l?.key],
1339
+ onClick: (e) => {
1340
+ n(e.key);
1341
+ },
1342
+ items: r.map((e, t) => ({
1343
+ key: e.key || t,
1344
+ disabled: e.disabled,
1345
+ label: e.label
1346
+ }))
1347
+ }
1348
+ }, { default: () => i(ge, { class: K(`${c}-dropdownmenu-label`, a, o) }, { default: () => [l?.label, i(Ie, null, null)] }) })]);
1349
+ };
1350
+ }, {
1351
+ props: {
1352
+ type: {
1353
+ type: String,
1354
+ required: !1
1355
+ },
1356
+ activeKey: {
1357
+ type: [String, Number],
1358
+ required: !1
1359
+ },
1360
+ defaultActiveKey: {
1361
+ type: [String, Number],
1362
+ required: !1
1363
+ },
1364
+ items: {
1365
+ type: Array,
1366
+ required: !1
1367
+ },
1368
+ onChange: {
1369
+ type: Function,
1370
+ required: !1
1371
+ },
1372
+ prefixCls: {
1373
+ type: String,
1374
+ required: !1
1375
+ },
1376
+ hashId: {
1377
+ type: String,
1378
+ required: !1
1379
+ },
1380
+ cssVarCls: {
1381
+ type: String,
1382
+ required: !1
1383
+ }
1384
+ },
1385
+ name: "ToolBarHeaderMenu",
1386
+ inheritAttrs: !1
1387
+ }), mn = (e) => ({ [e.componentCls]: {
1388
+ lineHeight: "1",
1389
+ "&-container": {
1390
+ display: "flex",
1391
+ justifyContent: "space-between",
1392
+ paddingBlock: e.padding,
1393
+ paddingInline: 0,
1394
+ "&-mobile": { flexDirection: "column" }
1395
+ },
1396
+ "&-title": {
1397
+ display: "flex",
1398
+ alignItems: "center",
1399
+ justifyContent: "flex-start",
1400
+ color: e.colorTextHeading,
1401
+ fontWeight: "500",
1402
+ fontSize: e.fontSizeLG
1403
+ },
1404
+ "&-search:not(:last-child)": {
1405
+ display: "flex",
1406
+ alignItems: "center",
1407
+ justifyContent: "flex-start"
1408
+ },
1409
+ "&-setting-item": {
1410
+ marginBlock: 0,
1411
+ marginInline: 4,
1412
+ color: e.colorIconHover,
1413
+ fontSize: e.fontSizeLG,
1414
+ cursor: "pointer",
1415
+ "> span": {
1416
+ display: "block",
1417
+ width: "100%",
1418
+ height: "100%"
1419
+ },
1420
+ "&:hover": { color: e.colorPrimary }
1421
+ },
1422
+ "&-left": {
1423
+ display: "flex",
1424
+ flexWrap: "wrap",
1425
+ alignItems: "center",
1426
+ gap: e.marginXS,
1427
+ justifyContent: "flex-start",
1428
+ maxWidth: "calc(100% - 200px)",
1429
+ [`${e.antCls}-tabs`]: { width: "100%" },
1430
+ "&-has-tabs": { overflow: "hidden" }
1431
+ },
1432
+ "&-right": {
1433
+ flex: 1,
1434
+ display: "flex",
1435
+ flexWrap: "wrap",
1436
+ justifyContent: "flex-end",
1437
+ gap: e.marginXS
1438
+ },
1439
+ "&-extra-line": { marginBlockEnd: e.margin },
1440
+ "&-setting-items": {
1441
+ display: "flex",
1442
+ gap: e.marginXS,
1443
+ lineHeight: "32px",
1444
+ alignItems: "center"
1445
+ },
1446
+ "&-filter": {
1447
+ "&:not(:last-child)": { marginInlineEnd: e.margin },
1448
+ display: "flex",
1449
+ alignItems: "center",
1450
+ [`div$${e.antCls}-pro-table-search`]: {
1451
+ marginBlock: 0,
1452
+ marginInline: 0,
1453
+ paddingBlock: 0,
1454
+ paddingInline: 0
1455
+ }
1456
+ },
1457
+ "&-inline-menu-item": {
1458
+ display: "inline-block",
1459
+ marginInlineEnd: e.marginLG,
1460
+ cursor: "pointer",
1461
+ opacity: "0.75",
1462
+ "&-active": {
1463
+ fontWeight: "bold",
1464
+ opacity: "1"
1465
+ }
1466
+ },
1467
+ [`${e.antCls}-tabs-top > ${e.antCls}-tabs-nav`]: {
1468
+ marginBlockEnd: 0,
1469
+ "&::before": { borderBlockEnd: 0 },
1470
+ [`${e.antCls}-tabs-nav-list`]: {
1471
+ marginBlockStart: 0,
1472
+ "${token.antCls}-tabs-tab": { paddingBlockStart: 0 }
1473
+ }
1474
+ },
1475
+ "&-dropdownmenu-label": {
1476
+ fontWeight: "bold",
1477
+ fontSize: e.fontSizeIcon,
1478
+ textAlign: "center",
1479
+ cursor: "pointer"
1480
+ },
1481
+ "@media (max-width: 768px)": { [e.componentCls]: {
1482
+ "&-container": {
1483
+ display: "flex",
1484
+ flexWrap: "wrap",
1485
+ flexDirection: "column"
1486
+ },
1487
+ "&-left": {
1488
+ marginBlockEnd: "16px",
1489
+ maxWidth: "100%"
1490
+ }
1491
+ } }
1492
+ } }), hn = w("ProTableToolBar", (e) => [mn(Me(e, {}))]);
1493
+ // src/components/ToolBar/index.tsx
1494
+ function gn(e) {
1495
+ if (s(e)) return e;
1496
+ if (e) {
1497
+ let { icon: t, tooltip: n, onClick: r, key: a } = e;
1498
+ return t && n ? s(n) || typeof n == "string" || typeof n == "number" || typeof n == "boolean" || typeof n == "function" ? i(G, { title: n }, { default: () => [i("span", {
1499
+ key: a,
1500
+ onClick: () => {
1501
+ r && r(a);
1502
+ }
1503
+ }, [t])] }) : n : i("span", {
1504
+ key: a,
1505
+ onClick: () => {
1506
+ r && r(a);
1507
+ }
1508
+ }, [t]);
1509
+ }
1510
+ return null;
1511
+ }
1512
+ var _n = ({ prefixCls: e, hashId: t, tabs: n, multipleLine: r, filtersNode: a }) => r ? i("div", { class: K(`${e}-extra-line`, t) }, [n?.items && n?.items.length ? i(ye, {
1513
+ style: { width: "100%" },
1514
+ defaultActiveKey: n.defaultActiveKey,
1515
+ activeKey: n.activeKey,
1516
+ items: n.items?.map((e, t) => ({
1517
+ label: e.tab,
1518
+ ...e,
1519
+ key: e.key?.toString() || t?.toString()
1520
+ })),
1521
+ onChange: n.onChange,
1522
+ tabBarExtraContent: a
1523
+ }, null) : a]) : null;
1524
+ function vn({ intl: e }, t) {
1525
+ return {
1526
+ reload: {
1527
+ text: e.getMessage({
1528
+ id: "tableToolBar.reload",
1529
+ defaultMessage: "刷新"
1530
+ }),
1531
+ icon: t.reloadIcon ?? i(He, null, null)
1532
+ },
1533
+ density: {
1534
+ text: e.getMessage({
1535
+ id: "tableToolBar.density",
1536
+ defaultMessage: "表格密度"
1537
+ }),
1538
+ icon: i(dn, { icon: t.densityIcon }, null)
1539
+ },
1540
+ fullScreen: {
1541
+ text: e.getMessage({
1542
+ id: "tableToolBar.fullScreen",
1543
+ defaultMessage: "全屏"
1544
+ }),
1545
+ icon: i(fn, null, null)
1546
+ }
1547
+ };
1548
+ }
1549
+ function yn(e, n, r, a, o) {
1550
+ return Object.keys(e).filter((e) => e).map((s) => {
1551
+ let c = e[s];
1552
+ if (!c) return null;
1553
+ let u = c === !0 ? n[s] : (e) => c?.(e, r);
1554
+ if (typeof u != "function" && (u = () => {}), s === "setting") return i(ln, l(e[s], {
1555
+ columns: a,
1556
+ key: s
1557
+ }), null);
1558
+ if (s === "fullScreen") return i("span", {
1559
+ key: s,
1560
+ onClick: u
1561
+ }, [i(fn, null, null)]);
1562
+ let d = vn(n, e)[s];
1563
+ return d ? i("span", {
1564
+ key: s,
1565
+ onClick: u
1566
+ }, [i(G, { title: d.text }, { default: () => [s === "reload" ? t(d.icon, {
1567
+ ...d.icon.props,
1568
+ spin: o
1569
+ }) : d.icon] })]) : null;
1570
+ }).filter((e) => e);
1571
+ }
1572
+ var bn = /* @__PURE__ */ a((r, { expose: a, attrs: o }) => {
1573
+ let c = Q(), u = S(), d = X(), f = n(() => r.prefixCls || d.value.getPrefixCls("pro")), p = n(() => `${f.value}-table-list-toolbar`), { token: m } = x.useToken(), [h, g] = hn(p), [_, v] = se(!1), y = n(() => {
1574
+ if (r.toolbar?.search !== void 0) return r.toolbar.search;
1575
+ if (!r.options || !r.options.search) return !1;
1576
+ let e = {
1577
+ value: c.keyWords?.value,
1578
+ onChange: (e) => c.setKeyWords?.(e.target.value)
1579
+ };
1580
+ return r.options.search === !0 ? e : {
1581
+ ...e,
1582
+ ...r.options.search
1583
+ };
1584
+ }), b = n(() => {
1585
+ if (!y.value) return null;
1586
+ if (s(y.value)) return y.value;
1587
+ let { onSearch: e, ...t } = y.value;
1588
+ return i(me, l(t, {
1589
+ style: { width: Z(200) },
1590
+ placeholder: u.value.getMessage({
1591
+ id: "tableForm.inputPlaceholder",
1592
+ defaultMessage: "请输入"
1593
+ }),
1594
+ onSearch: async (...t) => {
1595
+ await e?.(...t) !== !1 && r.onSearch?.(t?.[0]);
1596
+ }
1597
+ }), null);
1598
+ }), C = n(() => r.searchNode || r.toolbar?.filter ? i("div", { class: K(`${p.value}-filter`, h.value, g.value) }, [r.searchNode, r.toolbar?.filter]) : null), w = n(() => r.toolbar?.menu || r.headerTitle || r.toolbar?.title || r.toolbar?.subTitle || r.toolbar?.tooltip), T = n(() => [...r.toolbar?.actions || [], ...r.toolBarRender ? r.toolBarRender(r.action, {
1599
+ selectedRowKeys: r.selectedRowKeys,
1600
+ selectedRows: r.selectedRows
1601
+ }) : []]), E = n(() => Array.isArray(T.value) ? T.value.length < 1 ? null : i("div", { style: {
1602
+ display: "flex",
1603
+ alignItems: "center",
1604
+ gap: `${m.value.marginXS}px`
1605
+ } }, [T.value.map((n, r) => !s(n) || s(n) && I(n) ? i(e, { key: r }, [n]) : t(n, { ...n?.props }))]) : T.value), D = async (e) => {
1606
+ let { options: t, onFormSearchSubmit: n, action: i } = r;
1607
+ if (!t || !t.search) return;
1608
+ let { name: a = "keyword" } = t.search === !0 ? {} : t.search;
1609
+ await t.search?.onSearch?.(e) !== !1 && (i?.setPageInfo?.({ current: 1 }), n?.(z({
1610
+ _timestamp: Date.now(),
1611
+ [a]: e
1612
+ })));
1613
+ };
1614
+ H(() => {
1615
+ c.keyWords?.value === void 0 && D?.("");
1616
+ }, [() => c.keyWords?.value]);
1617
+ let O = n(() => {
1618
+ if (r.toolbar?.settings !== void 0) return r.toolbar.settings;
1619
+ let e = {
1620
+ reload: () => r.action?.reload?.(),
1621
+ density: !0,
1622
+ setting: !0,
1623
+ search: !1,
1624
+ fullScreen: () => r.action?.fullScreen?.()
1625
+ };
1626
+ if (r.options === !1) return [];
1627
+ let t = yn({
1628
+ ...e,
1629
+ fullScreen: !1,
1630
+ ...r.options
1631
+ }, {
1632
+ ...e,
1633
+ intl: u.value
1634
+ }, r.action, r.columns, r.loading);
1635
+ return r.optionsRender ? r.optionsRender({
1636
+ headerTitle: r.headerTitle,
1637
+ tooltip: r.tooltip,
1638
+ toolBarRender: r.toolBarRender,
1639
+ action: r.action,
1640
+ options: r.options,
1641
+ selectedRowKeys: r.selectedRowKeys,
1642
+ selectedRows: r.selectedRows,
1643
+ toolbar: {
1644
+ filter: r.searchNode,
1645
+ ...r.toolbar
1646
+ },
1647
+ onSearch: D,
1648
+ columns: r.columns,
1649
+ optionsRender: r.optionsRender
1650
+ }, t) : t;
1651
+ }), A = n(() => !!(w.value && b.value || !r.toolbar?.multipleLine && C.value || E.value || O.value?.length)), j = n(() => r.tooltip || r.headerTitle || r.toolbar?.title || r.toolbar?.subTitle || r.toolbar?.menu || !w.value && b.value), M = n(() => !j.value && A.value ? i("div", { class: K(`${p.value}-left`, h.value, g.value) }, null) : !r.toolbar?.menu && (w.value || !b.value) ? i("div", { class: K(`${p.value}-left`, h.value, g.value) }, [i("div", { class: K(`${p.value}-title`, h.value, g.value) }, [i(k, {
1652
+ tooltip: r.tooltip || r.toolbar?.tooltip,
1653
+ label: r.headerTitle || r.toolbar?.title,
1654
+ subTitle: r.toolbar?.subTitle
1655
+ }, null)])]) : i("div", { class: K(`${p.value}-left`, h.value, g.value, {
1656
+ [`${p.value}-left-has-tabs`]: r.toolbar?.menu?.type === "tab",
1657
+ [`${p.value}-left-has-dropdown`]: r.toolbar?.menu?.type === "dropdown",
1658
+ [`${p.value}-left-has-inline-menu`]: r.toolbar?.menu?.type === "inline"
1659
+ }) }, [
1660
+ w.value && !r.toolbar?.menu && i("div", { class: K(`${p.value}-title`, h.value, g.value) }, [i(k, {
1661
+ tooltip: r.tooltip,
1662
+ label: r.toolbar?.title,
1663
+ subTitle: r.toolbar?.subTitle
1664
+ }, null)]),
1665
+ r.toolbar?.menu && i(pn, l(r.toolbar?.menu, {
1666
+ prefixCls: p.value,
1667
+ hashId: h.value,
1668
+ cssVarCls: g.value
1669
+ }), null),
1670
+ !w.value && b.value ? i("div", { class: K(`${f.value}-search`, h.value, g.value) }, [b.value]) : null
1671
+ ])), N = n(() => A.value ? i("div", {
1672
+ class: K(`${p.value}-right`, h.value),
1673
+ style: _.value ? {} : { alignItems: "center" }
1674
+ }, [
1675
+ r.toolbar?.multipleLine ? null : C.value,
1676
+ w.value && b.value ? i("div", { class: K(`${p.value}-search`, h.value) }, [b.value]) : null,
1677
+ E.value,
1678
+ O.value?.length ? i("div", { class: K(`${p.value}-setting-items`, h.value) }, [O.value.map((e, t) => {
1679
+ let n = gn(e);
1680
+ return i("div", {
1681
+ key: t,
1682
+ class: K(`${p.value}-setting-item`, h.value)
1683
+ }, [n]);
1684
+ })]) : null
1685
+ ]) : null), P = n(() => {
1686
+ if (!A.value && !j.value) return null;
1687
+ let e = K(`${p.value}-container`, h.value, { [`${p.value}-container-mobile`]: _.value });
1688
+ return i("div", { class: e }, [M.value, N.value]);
1689
+ });
1690
+ return a({}), () => {
1691
+ let { hideToolbar: e, toolbar: t } = r;
1692
+ return e ? null : i(qe, { onResize: ({ width: e }) => {
1693
+ e < 375 !== _.value && v(e < 375);
1694
+ } }, { default: () => [i("div", {
1695
+ class: K(p.value, h.value, o.class),
1696
+ style: o.style
1697
+ }, [P.value, i(_n, {
1698
+ filtersNode: C.value,
1699
+ hashId: h.value,
1700
+ prefixCls: f.value,
1701
+ tabs: t?.tabs,
1702
+ multipleLine: t?.multipleLine
1703
+ }, null)])] });
1704
+ };
1705
+ }, {
1706
+ name: "Toolbar",
1707
+ inheritAttrs: !1,
1708
+ props: [
1709
+ "action",
1710
+ "type",
1711
+ "columns",
1712
+ "headerTitle",
1713
+ "onSearch",
1714
+ "options",
1715
+ "optionsRender",
1716
+ "selectedRowKeys",
1717
+ "selectedRows",
1718
+ "toolBarRender",
1719
+ "toolbar",
1720
+ "tooltip",
1721
+ "searchNode",
1722
+ "hideToolbar",
1723
+ "loading"
1724
+ ]
1725
+ }), xn = new je("turn", {
1726
+ "0%": { transform: "rotate(0deg)" },
1727
+ "25%": { transform: "rotate(90deg)" },
1728
+ "50%": { transform: "rotate(180deg)" },
1729
+ "75%": { transform: "rotate(270deg)" },
1730
+ "100%": { transform: "rotate(360deg)" }
1731
+ }), Sn = (e) => ({
1732
+ [e.componentCls]: {
1733
+ zIndex: 1,
1734
+ [`${e.antCls}-table-wrapper ${e.antCls}-table-pagination${e.antCls}-pagination`]: { marginBlockEnd: 0 },
1735
+ "&:not(:root):fullscreen": {
1736
+ minHeight: "100vh",
1737
+ overflow: "auto",
1738
+ background: e.colorBgContainer
1739
+ },
1740
+ "&-extra": { marginBlockEnd: e.margin },
1741
+ "&-polling": { [`${e.componentCls}-list-toolbar-setting-item`]: { ".anticon.anticon-reload": {
1742
+ transform: "rotate(0deg)",
1743
+ animationName: xn,
1744
+ animationDuration: "1s",
1745
+ animationTimingFunction: "linear",
1746
+ animationIterationCount: "infinite"
1747
+ } } },
1748
+ [`td${e.antCls}-table-cell`]: { ">a": { fontSize: e.fontSize } },
1749
+ [`${e.antCls}-table${e.antCls}-table-tbody${e.antCls}-table-wrapper:only-child${e.antCls}-table`]: {
1750
+ marginBlock: 0,
1751
+ marginInline: 0
1752
+ },
1753
+ [`${e.antCls}-table${e.antCls}-table-middle ${e.componentCls}`]: {
1754
+ marginBlock: 0,
1755
+ marginInline: -8,
1756
+ [`${e.proComponentsCls}-card`]: { backgroundColor: "initial" }
1757
+ },
1758
+ "& &-search": {
1759
+ marginBlockEnd: e.margin,
1760
+ background: e.colorBgContainer,
1761
+ "&-ghost": { background: "transparent" },
1762
+ [`&${e.componentCls}-form`]: {
1763
+ marginBlock: 0,
1764
+ marginInline: 0,
1765
+ paddingBlock: 0,
1766
+ paddingInline: 16,
1767
+ overflow: "unset"
1768
+ },
1769
+ "&-light-filter": {
1770
+ marginBlockEnd: 0,
1771
+ paddingBlock: 0,
1772
+ paddingInline: 0
1773
+ },
1774
+ "&-form-option": {
1775
+ [`${e.antCls}-form-item`]: {},
1776
+ [`${e.antCls}-form-item-label`]: {},
1777
+ [`${e.antCls}-form-item-control-input`]: {}
1778
+ },
1779
+ "@media (max-width: 575px)": { [e.componentCls]: {
1780
+ height: "auto !important",
1781
+ paddingBlockEnd: e.paddingLG,
1782
+ [`${e.antCls}-form-item-label`]: {
1783
+ minWidth: 80,
1784
+ textAlign: "start"
1785
+ }
1786
+ } }
1787
+ },
1788
+ "&-toolbar": {
1789
+ display: "flex",
1790
+ alignItems: "center",
1791
+ justifyContent: "space-between",
1792
+ height: 64,
1793
+ paddingInline: e.paddingLG,
1794
+ paddingBlock: 0,
1795
+ "&-option": {
1796
+ display: "flex",
1797
+ alignItems: "center",
1798
+ justifyContent: "flex-end"
1799
+ },
1800
+ "&-title": {
1801
+ flex: "1",
1802
+ color: e.colorTextLabel,
1803
+ fontWeight: "500",
1804
+ fontSize: 16,
1805
+ lineHeight: "24px",
1806
+ opacity: "0.85"
1807
+ }
1808
+ },
1809
+ [`${e.antCls}-table-cell`]: { [`${e.antCls}-form-item`]: {
1810
+ marginBlockStart: -5,
1811
+ marginBlockEnd: -5,
1812
+ marginInlineStart: 0,
1813
+ marginInlineEnd: 0
1814
+ } },
1815
+ [`${e.antCls}-table-cell-resizable`]: {
1816
+ position: "relative",
1817
+ [`${e.antCls}-table-cell-resizable-handle`]: {
1818
+ position: "absolute",
1819
+ top: 0,
1820
+ insetInlineEnd: -4,
1821
+ zIndex: 10,
1822
+ width: 12,
1823
+ height: "100%",
1824
+ cursor: "col-resize",
1825
+ userSelect: "none",
1826
+ touchAction: "none",
1827
+ "&::before": {
1828
+ position: "absolute",
1829
+ top: "50%",
1830
+ height: "1.6em",
1831
+ insetInlineEnd: 4,
1832
+ transform: "translateY(-50%)",
1833
+ width: 1,
1834
+ background: e.colorPrimary,
1835
+ opacity: 0,
1836
+ transition: `opacity ${e.motionDurationMid}`,
1837
+ content: "\"\""
1838
+ },
1839
+ "&:hover::before": { opacity: 1 }
1840
+ }
1841
+ }
1842
+ },
1843
+ [`@media (max-width: ${e.screenXS})`]: { [e.componentCls]: { [`${e.antCls}-table`]: {
1844
+ width: "100%",
1845
+ overflowX: "auto",
1846
+ "&-thead > tr,&-tbody > tr": { "> th,> td": {
1847
+ whiteSpace: "pre",
1848
+ ">span": { display: "block" }
1849
+ } }
1850
+ } } },
1851
+ "@media (max-width: 575px)": { [`${e.componentCls}-toolbar`]: {
1852
+ flexDirection: "column",
1853
+ alignItems: "flex-start",
1854
+ justifyContent: "flex-start",
1855
+ height: "auto",
1856
+ marginBlockEnd: 16,
1857
+ marginInlineStart: 16,
1858
+ paddingBlock: 8,
1859
+ paddingInline: 8,
1860
+ paddingBlockStart: 16,
1861
+ lineHeight: "normal",
1862
+ "&-title": { marginBlockEnd: 16 },
1863
+ "&-option": {
1864
+ display: "flex",
1865
+ justifyContent: "space-between",
1866
+ width: "100%"
1867
+ },
1868
+ "&-default-option": {
1869
+ display: "flex",
1870
+ flex: "1",
1871
+ alignItems: "center",
1872
+ justifyContent: "flex-end"
1873
+ }
1874
+ } }
1875
+ }), Cn = w("ProTable", (e) => [Sn(Me(e, {}))]);
1876
+ // src/ResizableTableTitle.tsx
1877
+ function wn(e, t) {
1878
+ if (typeof e == "number") return e;
1879
+ if (typeof e == "string") {
1880
+ let t = Number.parseFloat(e);
1881
+ if (Number.isFinite(t)) return t;
1882
+ }
1883
+ return t?.offsetWidth ?? 0;
1884
+ }
1885
+ var Tn = /* @__PURE__ */ a((e, { attrs: t, slots: r, emit: a }) => {
1886
+ let o = h(), s = 0, c = 0, d = "", f, p, m = n(() => !!e.resizable);
1887
+ function g() {
1888
+ document.removeEventListener("mousemove", y), document.removeEventListener("mouseup", b), document.body.style.userSelect = d, f !== void 0 && (cancelAnimationFrame(f), f = void 0), p = void 0;
1889
+ }
1890
+ function _() {
1891
+ if (f = void 0, !p) return;
1892
+ let { event: e, width: t } = p;
1893
+ p = void 0, a("resize", e, { size: { width: t } });
1894
+ }
1895
+ function v(e, t) {
1896
+ p = {
1897
+ event: e,
1898
+ width: t
1899
+ }, f === void 0 && (f = requestAnimationFrame(_));
1900
+ }
1901
+ function y(e) {
1902
+ v(e, Math.max(c + e.clientX - s, 40));
1903
+ }
1904
+ function b() {
1905
+ f !== void 0 && (cancelAnimationFrame(f), _()), g();
1906
+ }
1907
+ function x(t) {
1908
+ t.preventDefault(), t.stopPropagation(), s = t.clientX, c = wn(e.width, o.value), d = document.body.style.userSelect, document.body.style.userSelect = "none", document.addEventListener("mousemove", y), document.addEventListener("mouseup", b);
1909
+ }
1910
+ return u(g), () => {
1911
+ let { class: n, className: a, style: s, ...c } = t, u = e.width == null ? void 0 : { width: typeof e.width == "number" ? `${e.width}px` : e.width };
1912
+ return i("th", l(c, {
1913
+ ref: o,
1914
+ class: K(n, a, { "ant-table-cell-resizable": m.value }),
1915
+ style: {
1916
+ ...s,
1917
+ ...u,
1918
+ position: m.value ? "relative" : s?.position
1919
+ }
1920
+ }), [r.default?.(), m.value && i("span", {
1921
+ class: "ant-table-cell-resizable-handle",
1922
+ onMousedown: x
1923
+ }, null)]);
1924
+ };
1925
+ }, {
1926
+ name: "ResizableTableTitle",
1927
+ inheritAttrs: !1,
1928
+ props: ["resizable", "width"],
1929
+ emits: ["resize"]
1930
+ });
1931
+ // src/TableRender.tsx
1932
+ function En(e) {
1933
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !s(e);
1934
+ }
1935
+ function Dn({ dataSource: e, editableUtils: t, pagination: n, getRowKey: r, childrenColumnName: i }) {
1936
+ let a = Array.isArray(e) ? [...e] : [], o = t?.newLineRecord, s = o?.value?.defaultValue;
1937
+ if (!o?.value || !s) return a;
1938
+ let { options: c } = o.value, l = i || "children";
1939
+ if (c?.parentKey) {
1940
+ let e = {
1941
+ ...s,
1942
+ map_row_parentKey: te(typeof c.parentKey == "function" ? c.parentKey() : c.parentKey)?.toString()
1943
+ }, t = {
1944
+ data: a,
1945
+ getRowKey: r,
1946
+ row: e,
1947
+ key: c?.recordKey ?? r?.(e, -1),
1948
+ childrenColumnName: l
1949
+ };
1950
+ return j(t, c?.position === "top" ? "top" : "update");
1951
+ }
1952
+ if (c?.position === "top") return [s, ...a];
1953
+ let u = n && typeof n == "object" ? n : void 0;
1954
+ if (u?.current && u?.pageSize) {
1955
+ if (u.pageSize > a.length) return a.push(s), a;
1956
+ let e = u.current * u.pageSize - 1;
1957
+ return a.splice(e, 0, s), a;
1958
+ }
1959
+ return a.push(s), a;
1960
+ }
1961
+ function On({ propsCardProps: e, notNeedCardDom: t, name: n, hideToolbar: r, toolbarDom: i }) {
1962
+ return e === !1 || t || n ? {} : r ? { padding: 0 } : i ? { paddingBlockStart: 0 } : { padding: 0 };
1963
+ }
1964
+ function kn(e) {
1965
+ return e?.header?.cell ? e : {
1966
+ ...e,
1967
+ header: {
1968
+ ...e?.header,
1969
+ cell: Tn
1970
+ }
1971
+ };
1972
+ }
1973
+ var An = /* @__PURE__ */ a((t, { slots: r, expose: a, attrs: o }) => {
1974
+ let s = Q(), c = n(() => {
1975
+ let e = (t) => Array.isArray(t) ? t?.map((t) => {
1976
+ let n = Lt(t.key, t.index), r = s.columnsMap?.value?.[n];
1977
+ return r && r.show === !1 ? !1 : t.children ? {
1978
+ ...t,
1979
+ children: e(t.children)
1980
+ } : t;
1981
+ }).filter(Boolean) : [];
1982
+ return e(t.tableColums) ?? [];
1983
+ }), u = n(() => Dn({
1984
+ dataSource: t.action?.dataSource.value,
1985
+ editableUtils: t.editableUtils,
1986
+ pagination: t.pagination,
1987
+ getRowKey: t.getRowKey,
1988
+ childrenColumnName: t.expandable?.childrenColumnName || "children"
1989
+ })), d = n(() => zt(c.value).filter((e) => !!e.filters));
1990
+ return a({}), () => {
1991
+ let { tableViewRender: n, cardProps: a, isLightFilter: f, options: p, type: m = "table", search: h, headerTitle: g, tableRender: _, toolBarRender: v, rowKey: y, size: b, columnsState: x, dateFormatter: S, debounceTime: C, defaultData: w, onSizeChange: T, form: E, prefixCls: D, ghost: O, hideToolbar: k, editableUtils: A, searchNode: j, action: M, pagination: N, tableColums: P, rowSelection: F, name: I, manualRequest: L, onDataSourceChange: R, tableExtraRender: ee, alertDom: te, beforeSearchSubmit: B, cardBordered: V, onLoad: ne, onSubmit: re, optionsRender: ie, params: H, polling: ae, postData: U, toolbar: oe, tooltip: se, tableClass: ce, tableStyle: le, toolbarDom: W, revalidateOnFocus: de, searchFormRender: fe, onLoadingChange: pe, onRequestError: me, onReset: he, getRowKey: ge, tableAlertOptionRender: ve, tableAlertRender: ye, columnEmptyText: G, onFilterChange: be, onSortChange: xe, editable: Ce, columns: we, ...Te } = t, Ee = A?.messageContextHolder, De = {
1992
+ ...Te,
1993
+ size: s.tableSize?.value,
1994
+ rowSelection: F === !1 ? void 0 : F,
1995
+ class: ce,
1996
+ style: le,
1997
+ columns: c.value,
1998
+ components: kn(Te.components),
1999
+ loading: M?.loading.value,
2000
+ dataSource: u.value,
2001
+ pagination: N,
2002
+ onChange: (e, t, n, r) => {
2003
+ Te.onChange?.(e, t, n, r);
2004
+ let i = Bt(t, d.value);
2005
+ be?.(z(i));
2006
+ let a = Vt(n);
2007
+ xe?.(z(a));
2008
+ }
2009
+ }, Oe = i(_e, l(De, { rowKey: typeof y == "function" ? (e, t) => y(e, t) : y?.toString() }), r), q = n ? n({
2010
+ ...De,
2011
+ rowSelection: F === !1 ? void 0 : F
2012
+ }, Oe) : Oe, J = Ce && !I ? i(e, null, [
2013
+ W,
2014
+ te,
2015
+ i(Se, l({ ref: Ce?.formProps?.formRef }, Ce?.formProps, {
2016
+ key: "table",
2017
+ submitter: !1,
2018
+ omitNil: !1,
2019
+ onValuesChange: (e, t) => A?.onValuesChange?.(e, t),
2020
+ dateFormatter: S
2021
+ }), En(q) ? q : { default: () => [q] })
2022
+ ]) : i(e, null, [
2023
+ W,
2024
+ te,
2025
+ q
2026
+ ]), Y = h === !1 && !g && v === !1, ke = On({
2027
+ propsCardProps: a,
2028
+ notNeedCardDom: Y,
2029
+ name: t.name,
2030
+ hideToolbar: k,
2031
+ toolbarDom: W
2032
+ }), Ae = a !== !1 && !I && !Y || a !== !1 && m === "listy", X = a === !1 ? {} : a ?? {}, je = Ae ? i(Pe, l(X, {
2033
+ ghost: O,
2034
+ variant: Ft("table", typeof V == "string" || V) ? "outlined" : "borderless",
2035
+ styles: {
2036
+ ...X.styles,
2037
+ body: {
2038
+ ...ke,
2039
+ ...X.styles?.body ?? {}
2040
+ }
2041
+ }
2042
+ }), En(J) ? J : { default: () => [J] }) : J, Me = () => _ ? _(t, je, {
2043
+ toolbar: W || void 0,
2044
+ alert: te || void 0,
2045
+ table: q || void 0
2046
+ }) : je, Z = i("div", {
2047
+ class: K(o.class, { [`${D}-polling`]: M?.pollingLoading.value }),
2048
+ style: o.style,
2049
+ ref: s.rootDomRef
2050
+ }, [
2051
+ f ? null : j,
2052
+ m !== "form" && t.tableExtraRender && i("div", { class: K(o.class, `${D}-extra`) }, [t.tableExtraRender(t, M?.dataSource.value || [])]),
2053
+ m !== "form" && Me(),
2054
+ Ee ? i(Ee, null, null) : null
2055
+ ]);
2056
+ return !p || !p?.fullScreen ? Z : i(ue, { getPopupContainer: () => s.rootDomRef?.value || document.body }, En(Z) ? Z : { default: () => [Z] });
2057
+ };
2058
+ }, {
2059
+ name: "TableRender",
2060
+ inheritAttrs: !1,
2061
+ props: /* @__PURE__ */ "searchNode.isLightFilter.editableUtils.hideToolbar.action.alertDom.getRowKey.toolbarDom.beforeSearchSubmit.tableColums.columnEmptyText.editable.options.tooltip.search.headerTitle.tableStyle.toolBarRender.optionsRender.columnsState.onSizeChange.toolbar.bodyCell.bordered.caption.cardBordered.cardProps.childrenColumnName.classes.columns.components.dateFormatter.debounceTime.defaultData.defaultExpandAllRows.defaultExpandedRowKeys.direction.dropdownPrefixCls.expandIcon.expandIconColumnIndex.expandRowByClick.expandable.expandedRowClassName.expandedRowKeys.expandedRowRender.footer.form.getContainerWidth.getPopupContainer.ghost.headerCell.id.indentSize.loading.locale.manualRequest.measureRowRender.name.onDataSourceChange.onExpand.onExpandedRowsChange.onHeaderRow.onLoad.onLoadingChange.onRequestError.onReset.onRow.onSubmit.pagination.params.polling.postData.prefixCls.revalidateOnFocus.rootClass.rowClassName.rowHoverable.rowKey.rowSelection.scroll.searchFormRender.showHeader.showSorterTooltip.size.sortDirections.sticky.styles.summary.tableClass.tableExtraRender.tableLayout.tableRender.tableViewRender.tailor.title.type.virtual.tableAlertRender.tableAlertOptionRender.onSortChange.onFilterChange.defaultSize".split(".")
2062
+ });
2063
+ // src/useFetchData.ts
2064
+ function jn({ pageInfo: e }) {
2065
+ if (e.value) {
2066
+ let { current: t, pageSize: n, defaultPageSize: r } = e.value;
2067
+ return {
2068
+ current: t || 1,
2069
+ total: 0,
2070
+ pageSize: n || r || 20
2071
+ };
2072
+ }
2073
+ return {
2074
+ current: 1,
2075
+ total: 0,
2076
+ pageSize: 20
2077
+ };
2078
+ }
2079
+ function Mn(e, t, r) {
2080
+ let i = p(!1), a = p(null), { onLoad: o, manual: s, polling: c, onRequestError: l, debounceTime: u = p(20), effects: d = [], dataSource: f, loading: m, pageInfo: h, onLoadingChange: g, onPageInfoChange: _, onDataSourceChange: v } = r || {}, y = p(s.value), b = p(null), [x, S] = U(() => t, {
2081
+ value: f,
2082
+ defaultValue: t,
2083
+ onChange: v
2084
+ }), [C, w] = U(() => !1, {
2085
+ value: n(() => typeof m.value == "object" ? m.value?.spinning : m.value),
2086
+ onChange: g
2087
+ }), [T, E] = U(() => jn(r), { onChange: _ }), D = (e) => {
2088
+ (e.current !== T.value.current || e.pageSize !== T.value.pageSize || e.total !== T.value.total) && E(e);
2089
+ }, [O, k] = U(!1), A = (e, t) => {
2090
+ S(e), T?.value.total !== t && D({
2091
+ ...T.value,
2092
+ total: t || e.length
2093
+ });
2094
+ }, j = oe(n(() => T.value.current)), M = oe(n(() => T.value.pageSize)), N = oe(c), P = () => {
2095
+ w(!1), k(!1);
2096
+ }, F = async (t, n) => {
2097
+ if (y.value) {
2098
+ y.value = !1;
2099
+ return;
2100
+ }
2101
+ t ? k(!0) : w(!0);
2102
+ let { pageSize: i, current: a } = T.value || {};
2103
+ try {
2104
+ let t = h.value === !1 ? void 0 : {
2105
+ current: a,
2106
+ pageSize: i
2107
+ }, { data: s = [], success: c, total: l = 0, ...u } = await e.value?.(t) || {};
2108
+ if (n?.aborted || c === !1) return [];
2109
+ let d = Pt(s, [r.postData].filter((e) => e));
2110
+ return n?.aborted ? [] : (A(d, l), o?.(d, u), d);
2111
+ } catch (e) {
2112
+ if (n?.aborted) return [];
2113
+ if (l === void 0) throw Error(e);
2114
+ x.value === void 0 && S([]), l(e);
2115
+ } finally {
2116
+ n?.aborted || P();
2117
+ }
2118
+ return [];
2119
+ }, I = re(async (t) => {
2120
+ if (b.value &&= (clearTimeout(b.value), null), !e.value) return;
2121
+ let n = new AbortController();
2122
+ a.value = n;
2123
+ try {
2124
+ let e = await Promise.race([F(t, n.signal), new Promise((e, t) => {
2125
+ a.value?.signal.addEventListener("abort", () => {
2126
+ t(/* @__PURE__ */ Error("aborted")), I.cancel(), P();
2127
+ });
2128
+ })]);
2129
+ if (n.signal.aborted) return;
2130
+ let r = B(c?.value, e);
2131
+ return r && !i.value && (b.value = setTimeout(() => I.run(r), Math.max(r, 2e3))), e;
2132
+ } catch (e) {
2133
+ if (e === "aborted") return;
2134
+ throw e;
2135
+ }
2136
+ }, u.value || 30), L = () => {
2137
+ a.value?.abort(), I.cancel(), P();
2138
+ };
2139
+ return H(() => (!c.value && b.value && (clearTimeout(b.value), b.value = null), !N.value && c.value && (async () => await I.run(!0))(), () => {
2140
+ b.value &&= (clearTimeout(b.value), null);
2141
+ }), [c]), H(() => (i.value = !1, () => {
2142
+ i.value = !0;
2143
+ }), []), H(() => {
2144
+ let { current: e, pageSize: t } = T.value || {};
2145
+ (j.value && j.value !== e || M.value && M.value !== t) && (h.value && x.value && x.value.length > t || e !== void 0 && x.value && x.value.length <= t && (L(), (async () => await I.run(!1))()));
2146
+ }, [() => T?.value.current]), H(() => {
2147
+ M.value && (L(), (async () => await I.run(!1))());
2148
+ }, [() => T.value.pageSize]), H(() => (L(), (async () => await I.run(!1))(), s.value || (y.value = !1), () => L()), [...d, s]), {
2149
+ dataSource: x,
2150
+ setDataSource: S,
2151
+ loading: n(() => typeof m.value == "object" ? {
2152
+ ...m.value,
2153
+ spinning: C.value
2154
+ } : C.value),
2155
+ reload: async () => {
2156
+ L(), await I.run(!1);
2157
+ },
2158
+ pageInfo: T,
2159
+ pollingLoading: O,
2160
+ reset: async () => {
2161
+ let { defaultPageSize: e = 20, current: t = 1 } = h.value || {};
2162
+ D({
2163
+ current: t,
2164
+ total: 0,
2165
+ pageSize: e
2166
+ });
2167
+ },
2168
+ setPageInfo: async (e) => D({
2169
+ ...T.value,
2170
+ ...e
2171
+ })
2172
+ };
2173
+ }
2174
+ // src/utils/columnSort.ts
2175
+ function Nn(e) {
2176
+ return (t, n) => {
2177
+ let { fixed: r, index: i } = t, { fixed: a, index: o } = n;
2178
+ if (r === "start" && a !== "start" || a === "end" && r !== "end") return -2;
2179
+ if (a === "start" && r !== "start" || r === "end" && a !== "end") return 2;
2180
+ let s = t.key || `${i}`, c = n.key || `${o}`;
2181
+ return e && (e[s]?.order || e[c]?.order) ? (e[s]?.order || 0) - (e[c]?.order || 0) : (t.index || 0) - (n.index || 0);
2182
+ };
2183
+ }
2184
+ // src/InternalTable.tsx
2185
+ function Pn(e) {
2186
+ return n(() => typeof e.rowKey == "function" ? e.rowKey : (t, n) => n === -1 ? t[e.rowKey] : e.name ? n?.toString() : t[e.rowKey] ?? n?.toString());
2187
+ }
2188
+ function Fn({ pagination: e, action: t, intl: r, request: i, type: a }) {
2189
+ return n(() => {
2190
+ let n = e !== !1 && { ...e || {} }, o = {
2191
+ ...t.pageInfo.value,
2192
+ setPageInfo: ({ pageSize: e, current: n }) => {
2193
+ let { pageInfo: r } = t;
2194
+ e === r.value.pageSize || r.value.current === 1 ? t.setPageInfo({
2195
+ pageSize: e,
2196
+ current: n
2197
+ }) : (i && t.setDataSource([]), t.setPageInfo({
2198
+ pageSize: e,
2199
+ current: a === "listy" ? n : 1
2200
+ }));
2201
+ }
2202
+ };
2203
+ return i && n && (delete n.onChange, delete n.onShowSizeChange), Nt(n, o, r.value);
2204
+ });
2205
+ }
2206
+ var In = /* @__PURE__ */ a((e, { slots: r, expose: a }) => {
2207
+ let o = X(), s = h(), c = n(() => e.prefixCls ?? o.value.getPrefixCls("pro")), u = n(() => `${c.value}-table`), d = S(), { token: f } = x?.useToken(), p = h(), m = Q(), [v, y] = Cn(u), [b, C] = U(e.rowSelection ? e.rowSelection?.defaultSelectedRowKeys || [] : void 0, { value: n(() => e.rowSelection ? e.rowSelection.selectedRowKeys : void 0) }), [w, T] = U(() => {
2208
+ if (!(e.manualRequest || e.search !== !1)) return {};
2209
+ }), [E, D] = U({}), [O, k] = U({}), A = n(() => {
2210
+ let { sort: t, filter: n } = Ht(zt(e.columns));
2211
+ return {
2212
+ defaultProFilter: n,
2213
+ defaultProSort: t
2214
+ };
2215
+ });
2216
+ H(() => {
2217
+ D(A.value.defaultProFilter), k(A.value.defaultProSort);
2218
+ }, [() => A.value.defaultProFilter, () => A.value.defaultProSort]);
2219
+ let j = n(() => typeof e.pagination == "object" ? e.pagination : {
2220
+ defaultCurrent: 1,
2221
+ defaultPageSize: 20,
2222
+ pageSize: 20,
2223
+ current: 1
2224
+ }), M = n(() => {
2225
+ if (e.request) return async (t) => {
2226
+ let n = {
2227
+ ...t || {},
2228
+ ...w.value,
2229
+ ...e.params
2230
+ };
2231
+ return delete n._timestamp, await e.request?.(n, O.value, E.value);
2232
+ };
2233
+ }), N = Mn(M, e.defaultData, {
2234
+ pageInfo: n(() => e.pagination !== !1 && j.value),
2235
+ loading: g(() => e.loading),
2236
+ dataSource: g(() => e.dataSource),
2237
+ onDataSourceChange: e.onDataSourceChange,
2238
+ onLoad: e.onLoad,
2239
+ onLoadingChange: e.onLoadingChange,
2240
+ onRequestError: e.onRequestError,
2241
+ postData: e.postData,
2242
+ revalidateOnFocus: g(() => e.revalidateOnFocus || !1),
2243
+ manual: n(() => w.value === void 0),
2244
+ polling: g(() => e.polling),
2245
+ effects: [
2246
+ () => V(e.params),
2247
+ () => V(w.value),
2248
+ () => V(E.value),
2249
+ () => V(O.value)
2250
+ ],
2251
+ debounceTime: g(() => e.debounceTime),
2252
+ onPageInfoChange: (t) => {
2253
+ e.pagination && M.value && (e.pagination?.onChange?.(t.current, t.pageSize), e.pagination?.onShowSizeChange?.(t.current, t.pageSize));
2254
+ }
2255
+ });
2256
+ H(() => {
2257
+ if (e.manualRequest || !e.request || !e.revalidateOnFocus || e.form?.ignoreRules) return;
2258
+ let t = async () => {
2259
+ document.visibilityState === "visible" && await N.reload();
2260
+ };
2261
+ return document.addEventListener("visibilitychange", t), () => document.removeEventListener("visibilitychange", t);
2262
+ }, []);
2263
+ let P = h(/* @__PURE__ */ new Map()), F = Pn(e);
2264
+ _(() => {
2265
+ N.dataSource.value?.length && N.dataSource.value.forEach((e) => {
2266
+ let t = F.value(e, -1);
2267
+ P.value.set(t, e);
2268
+ });
2269
+ });
2270
+ let I = () => {
2271
+ e.rowSelection && e.rowSelection.onChange && e.rowSelection.onChange([], [], { type: "all" }), C([]);
2272
+ };
2273
+ m.propsRef && (m.propsRef.value = e), m.setPrefixName && m.setPrefixName(e.name);
2274
+ let L = ie({
2275
+ ...e.editable,
2276
+ type: n(() => e.editable?.type),
2277
+ editableKeys: n(() => e.editable?.editableKeys),
2278
+ tableName: n(() => e.name),
2279
+ getRowKey: F,
2280
+ childrenColumnName: n(() => e.expandable?.childrenColumnName || "children"),
2281
+ dataSource: n(() => N?.dataSource.value || []),
2282
+ setDataSource: (t) => {
2283
+ e.editable?.onValuesChange?.(void 0, t), N?.setDataSource(t);
2284
+ }
2285
+ });
2286
+ p.value = It(N, {
2287
+ nativeElement: n(() => m.rootDomRef?.value),
2288
+ focus: () => {
2289
+ m.rootDomRef?.value?.focus();
2290
+ },
2291
+ fullScreen: async () => {
2292
+ m.rootDomRef?.value && document.fullscreenEnabled && (document.fullscreenElement ? await document.exitFullscreen() : await m.rootDomRef?.value.requestFullscreen());
2293
+ },
2294
+ onCleanSelected: async () => {
2295
+ I();
2296
+ },
2297
+ resetAll: async () => {
2298
+ I(), m.setKeyWords?.(void 0), N.setPageInfo({ current: 1 }), D(A.value.defaultProFilter), k(A.value.defaultProSort), s.value?.resetFields(), T({});
2299
+ },
2300
+ editableUtils: L
2301
+ }), m.setAction?.(p.value);
2302
+ let R = n(() => Mt({
2303
+ columns: e.columns,
2304
+ counter: m,
2305
+ columnEmptyText: e.columnEmptyText || "-",
2306
+ type: e.type,
2307
+ editableUtils: L,
2308
+ marginSM: f.value.marginSM,
2309
+ rowKey: e.rowKey || "id",
2310
+ childrenColumnName: e.expandable?.childrenColumnName ?? "children",
2311
+ proFilter: E.value,
2312
+ proSort: O.value
2313
+ })?.sort(Nn(m.columnsMap?.value)));
2314
+ H(() => {
2315
+ if (R.value && R.value.length > 0) {
2316
+ let e = R.value.map((e) => Lt(e.key, e.index));
2317
+ m.setSortKeyColumns?.(e);
2318
+ }
2319
+ }, [() => R.value]);
2320
+ let z = n(() => b.value?.map((e) => P.value?.get(e))), ee = Fn({
2321
+ pagination: e.pagination,
2322
+ action: N,
2323
+ intl: d,
2324
+ request: e.request,
2325
+ type: e.type || "table"
2326
+ }), te = async (t) => {
2327
+ if (e.options && e.options.search) {
2328
+ let { name: n = "keyword" } = e.options.search === !0 ? {} : e.options.search;
2329
+ if (typeof e.options.search != "boolean" && await e.options.search?.onSearch?.(m.keyWords?.value)) {
2330
+ T({
2331
+ ...t,
2332
+ [n]: m.keyWords?.value
2333
+ });
2334
+ return;
2335
+ }
2336
+ }
2337
+ T(t);
2338
+ }, B = n(() => typeof N.loading.value == "object" ? N.loading.value.spinning || !1 : N.loading.value), ne = n(() => e.search !== !1 && e.search?.filterType === "light"), re = n(() => e.options === !1 && !e.headerTitle && !e.toolBarRender && !e.toolbar && !ne.value);
2339
+ return a({
2340
+ ...p.value,
2341
+ get nativeElement() {
2342
+ return p.value?.nativeElement;
2343
+ },
2344
+ get pageInfo() {
2345
+ return p.value?.pageInfo;
2346
+ },
2347
+ formRef: Oe(s)
2348
+ }), () => {
2349
+ let { name: n, tableAlertRender: a, tableAlertOptionRender: o, rowSelection: c = !1, toolBarRender: d, headerTitle: f, toolbar: h, ghost: g, search: _, columns: x, form: S, type: A = "table", manualRequest: j, onReset: M, onSubmit: P, searchFormRender: V, optionsRender: ie, dateFormatter: H, beforeSearchSubmit: ae, cardBordered: U, options: oe, tooltip: se } = e, ce = {
2350
+ selectedRowKeys: b.value,
2351
+ ...e.rowSelection,
2352
+ onChange: (t, n) => {
2353
+ e.rowSelection && e.rowSelection.onChange && e.rowSelection.onChange(t, n, { type: "all" }), C(t);
2354
+ }
2355
+ }, le = _ === !1 && A !== "form" ? null : i(Xt, {
2356
+ pagination: ee.value,
2357
+ beforeSearchSubmit: ae,
2358
+ action: p.value,
2359
+ columns: x,
2360
+ onFormSearchSubmit: te,
2361
+ ghost: g,
2362
+ onReset: M,
2363
+ onSubmit: P,
2364
+ loading: !!B.value,
2365
+ manualRequest: j,
2366
+ search: _,
2367
+ form: S,
2368
+ type: A,
2369
+ cardBordered: typeof U == "string" || U,
2370
+ dateFormatter: H
2371
+ }, null), W = V && le ? V(e, le) : le, ue = d === !1 ? null : i(bn, {
2372
+ headerTitle: f,
2373
+ hideToolbar: re.value,
2374
+ selectedRows: z.value,
2375
+ loading: B.value,
2376
+ selectedRowKeys: b.value,
2377
+ columns: R.value,
2378
+ tooltip: se,
2379
+ toolbar: h,
2380
+ onFormSearchSubmit: (e) => T({
2381
+ ...w.value,
2382
+ ...e
2383
+ }),
2384
+ searchNode: ne.value && W !== null ? t(W, { ref: s }) : null,
2385
+ options: oe,
2386
+ optionsRender: ie,
2387
+ action: p.value,
2388
+ toolBarRender: d
2389
+ }, null), de = c ? i(at, {
2390
+ selectedRowKeys: b.value,
2391
+ selectedRows: z.value,
2392
+ onCleanSelected: I,
2393
+ alertOptionRender: o,
2394
+ alertInfoRender: a,
2395
+ alwaysShowAlert: c?.alwaysShowAlert
2396
+ }, null) : null;
2397
+ return i(An, l(e, {
2398
+ class: K(u.value, v.value, y.value),
2399
+ name: n,
2400
+ prefixCls: u.value,
2401
+ size: m.tableSize?.value,
2402
+ onSizeChange: m.setTableSize,
2403
+ pagination: ee.value,
2404
+ searchNode: W === null ? null : t(W, { ref: s }),
2405
+ rowSelection: c ? ce : void 0,
2406
+ tableColums: R.value,
2407
+ isLightFilter: ne.value,
2408
+ action: N,
2409
+ alertDom: de,
2410
+ toolbarDom: ue,
2411
+ hideToolbar: re.value,
2412
+ onSortChange: (e) => {
2413
+ Ae(O.value, e) || k(e ?? {});
2414
+ },
2415
+ onFilterChange: (e) => {
2416
+ Ae(e, E.value) || D(e ?? {});
2417
+ },
2418
+ editableUtils: L,
2419
+ getRowKey: F.value
2420
+ }), r);
2421
+ };
2422
+ }, {
2423
+ name: "InternalProTable",
2424
+ props: /* @__PURE__ */ "beforeSearchSubmit.bodyCell.bordered.caption.cardBordered.cardProps.childrenColumnName.classes.columnEmptyText.columns.columnsState.components.dataSource.dateFormatter.debounceTime.defaultData.defaultExpandAllRows.defaultExpandedRowKeys.defaultSize.direction.dropdownPrefixCls.editable.errorBoundaryRender.expandIcon.expandIconColumnIndex.expandRowByClick.expandable.expandedRowClassName.expandedRowKeys.expandedRowRender.footer.form.getContainerWidth.getPopupContainer.ghost.headerCell.headerTitle.id.indentSize.loading.locale.manualRequest.measureRowRender.name.onDataSourceChange.onExpand.onExpandedRowsChange.onHeaderRow.onLoad.onLoadingChange.onRequestError.onReset.onRow.onSizeChange.onSubmit.options.optionsRender.pagination.params.polling.postData.prefixCls.request.revalidateOnFocus.rootClass.rowClassName.rowHoverable.rowKey.rowSelection.scroll.search.searchFormRender.showHeader.showSorterTooltip.size.sortDirections.sticky.styles.summary.tableAlertOptionRender.tableAlertRender.tableClass.tableExtraRender.tableLayout.tableRender.tableStyle.tableViewRender.tailor.title.toolBarRender.toolbar.tooltip.type.virtual".split(".")
2425
+ }), $ = /* @__PURE__ */ a((t, { slots: n, expose: r, attrs: a }) => {
2426
+ let o = C(), s = Zt(t), c = h(null), u = ne([
2427
+ "manualRequest",
2428
+ "showSorterTooltip",
2429
+ "showHeader",
2430
+ "rowHoverable",
2431
+ "revalidateOnFocus",
2432
+ "loading",
2433
+ "virtual",
2434
+ "sticky",
2435
+ "tailor",
2436
+ "bordered",
2437
+ "cardBordered",
2438
+ "ghost"
2439
+ ], t);
2440
+ return $t(s), r(Ut(c)), () => {
2441
+ let { errorBoundaryRender: r } = t, s = r === !1 ? e : E;
2442
+ return i(b, {
2443
+ valueTypeMap: {
2444
+ ...o.value.valueTypeMap,
2445
+ ...v
2446
+ },
2447
+ needDeps: !0
2448
+ }, { default: () => [i(s, null, { default: () => [i(In, l({ ref: c }, a, t, u, {
2449
+ manualRequest: typeof t.manualRequest == "string" || t.manualRequest,
2450
+ bordered: typeof t.bordered == "string" || t.bordered,
2451
+ cardBordered: typeof t.cardBordered == "string" || t.cardBordered,
2452
+ ghost: typeof t.ghost == "string" || t.ghost
2453
+ }), n)] })] });
2454
+ };
2455
+ }, {
2456
+ name: "ProTable",
2457
+ inheritAttrs: !1,
2458
+ props: /* @__PURE__ */ "tableAlertRender.tableAlertOptionRender.beforeSearchSubmit.columnEmptyText.editable.options.tooltip.search.headerTitle.tableStyle.toolBarRender.optionsRender.columnsState.onSizeChange.toolbar.bodyCell.bordered.caption.cardBordered.cardProps.childrenColumnName.classes.columns.components.dataSource.dateFormatter.debounceTime.defaultData.defaultExpandAllRows.defaultExpandedRowKeys.direction.dropdownPrefixCls.expandIcon.expandIconColumnIndex.expandRowByClick.expandable.expandedRowClassName.expandedRowKeys.expandedRowRender.footer.form.getContainerWidth.getPopupContainer.ghost.headerCell.id.indentSize.loading.locale.manualRequest.measureRowRender.name.onDataSourceChange.onExpand.onExpandedRowsChange.onHeaderRow.onLoad.onLoadingChange.onRequestError.onReset.onRow.onSubmit.pagination.params.polling.postData.prefixCls.request.revalidateOnFocus.rootClass.rowClassName.rowHoverable.rowKey.rowSelection.scroll.searchFormRender.showHeader.showSorterTooltip.size.sortDirections.sticky.styles.summary.tableClass.tableExtraRender.tableLayout.tableRender.tableViewRender.tailor.title.type.virtual".split(".")
2459
+ });
2460
+ $.Summary = ve, $.install = (e) => (e.component($.Summary.name, ve), e.component($.name, $), e);
2461
+ // src/components/EditableTable/context.ts
2462
+ var Ln = Symbol("editableTableActionContext");
2463
+ function Rn(e) {
2464
+ return d(Ln, e);
2465
+ }
2466
+ function zn() {
2467
+ return o(Ln);
2468
+ }
2469
+ // src/components/EditableTable/InternalEditableTable.tsx
2470
+ var Bn = ({ record: e, position: n, newRecordType: r, parentKey: i }, { slots: a }) => {
2471
+ let o = zn();
2472
+ return A(a.default?.(), !0).map((a) => s(a) && !I(a) ? t(a, {
2473
+ ...a.props,
2474
+ onClick: async (t) => {
2475
+ await a.props?.onClick?.(t) !== !1 && o && o.value?.addEditRecord?.(e, {
2476
+ position: n,
2477
+ newRecordType: r,
2478
+ parentKey: i
2479
+ });
2480
+ }
2481
+ }) : a);
2482
+ };
2483
+ Bn.displayName = "RecordCreator", Bn.inheritAttrs = !1;
2484
+ function Vn(e, t, n) {
2485
+ return typeof e == "number" && e <= t ? !1 : n !== !1;
2486
+ }
2487
+ function Hn(e, t, n) {
2488
+ let { record: r, position: a, creatorButtonText: o, newRecordType: s, parentKey: c, style: u, ...d } = e;
2489
+ return i(Bn, {
2490
+ record: B(r, t?.length, t) || {},
2491
+ position: a,
2492
+ parentKey: B(c, t?.length, t),
2493
+ newRecordType: s
2494
+ }, { default: () => [i(le, l({
2495
+ type: "dashed",
2496
+ style: {
2497
+ display: "block",
2498
+ margin: "10px 0",
2499
+ width: "100%",
2500
+ ...u
2501
+ },
2502
+ icon: i(Ve, null, null)
2503
+ }, d), { default: () => [o || n.getMessage({
2504
+ id: "editableTable.action.add",
2505
+ defaultMessage: "添加一行数据"
2506
+ })] })] });
2507
+ }
2508
+ function Un(e, t) {
2509
+ return { components: { header: { wrapper: (n, { attrs: r, slots: a }) => i("thead", { class: r.class }, [a.default?.(), i("tr", { style: { position: "relative" } }, [i("td", {
2510
+ "col-span": 0,
2511
+ style: { visibility: "hidden" }
2512
+ }, [e]), i("td", {
2513
+ style: {
2514
+ position: "absolute",
2515
+ left: 0,
2516
+ width: "100%"
2517
+ },
2518
+ "col-span": t
2519
+ }, [e])])]) } } };
2520
+ }
2521
+ function Wn(t, n) {
2522
+ return { tableViewRender: (r, a) => i(e, null, [n?.(r, a) ?? a, t]) };
2523
+ }
2524
+ function Gn({ recordCreatorProps: e, maxLength: t, value: r, intl: i, columnsLength: a, tableViewRender: o }) {
2525
+ let s = n(() => !Vn(t.value, r.value?.length || 0, e.value) || !e.value ? !1 : Hn(e.value, r.value, i.value));
2526
+ return {
2527
+ creatorButtonDom: s,
2528
+ buttonRenderProps: n(() => {
2529
+ if (!e.value) return {};
2530
+ let { position: t } = e.value;
2531
+ return s ? t === "top" ? Un(s.value, a.value) : Wn(s.value, o) : {};
2532
+ })
2533
+ };
2534
+ }
2535
+ function Kn(e) {
2536
+ return {
2537
+ ...Ut(e),
2538
+ get nativeElement() {
2539
+ return e.value?.nativeElement;
2540
+ },
2541
+ get pageInfo() {
2542
+ return e.value?.pageInfo;
2543
+ },
2544
+ get formRef() {
2545
+ return e.value?.formRef?.nativeElement ? e.value?.formRef : null;
2546
+ },
2547
+ get editableFormRef() {
2548
+ return e.value?.editableFormRef;
2549
+ },
2550
+ getRowData: (t) => e.value?.getRowData?.(t),
2551
+ getRowsData: () => e.value?.getRowsData?.(),
2552
+ setRowData: (t, n) => e.value?.setRowData?.(t, n)
2553
+ };
2554
+ }
2555
+ var qn = /* @__PURE__ */ a((t, { slots: r, expose: a }) => {
2556
+ let o = S(), s = p(void 0), c = h(null), u = h(null), d = p(!1), f = ne([
2557
+ "manualRequest",
2558
+ "showSorterTooltip",
2559
+ "showHeader",
2560
+ "rowHoverable",
2561
+ "revalidateOnFocus",
2562
+ "loading",
2563
+ "virtual",
2564
+ "sticky",
2565
+ "tailor",
2566
+ "bordered",
2567
+ "cardBordered",
2568
+ "ghost"
2569
+ ], t), [m, _] = ke(() => t.value || t.defaultValue || [], {
2570
+ value: g(() => t.value),
2571
+ defaultValue: t.defaultValue,
2572
+ onChange: (e) => {
2573
+ t.onChange?.(e), t["onUpdate:value"]?.(e);
2574
+ }
2575
+ }), v = ae(() => typeof t.rowKey == "function" ? t.rowKey : (e, n) => e[t.rowKey] || n, [() => t.rowKey]), y = (e) => {
2576
+ if (typeof e == "number" && !t.name) {
2577
+ if (e >= m.value.length) return e;
2578
+ let t = m.value && m.value[e];
2579
+ return v.value?.(t, e);
2580
+ }
2581
+ if ((typeof e == "string" || e >= m.value.length) && t.name) {
2582
+ let t = m.value.findIndex((t, n) => v.value?.(t, n)?.toString() === e?.toString());
2583
+ if (t !== -1) return t;
2584
+ }
2585
+ return e;
2586
+ };
2587
+ H(() => {
2588
+ if (!u.value || !t.controlled && (t.name || d.value)) return;
2589
+ let e = (m.value || []).reduce((e, t, n) => (e[String(v.value(t, n))] = t, e), {});
2590
+ Object.keys(e).length !== 0 && (u.value.setFieldsValue(e), d.value = !0);
2591
+ }, [
2592
+ () => V(m.value),
2593
+ () => t.controlled,
2594
+ () => u.value
2595
+ ]), H(() => {
2596
+ t.name && t?.editable?.form && (u.value = t?.editable?.form);
2597
+ }, [() => t.editable?.form, () => t.name]);
2598
+ let b = (e, n) => {
2599
+ t.editable?.onValuesChange?.(e, n || []), t.onValuesChange?.(n || [], e), t.controlled && t?.onChange && t.onChange(n);
2600
+ };
2601
+ Rn(c);
2602
+ let x = (e) => {
2603
+ if (e === void 0) throw Error("rowIndex is required");
2604
+ let n = y(e), r = [t.name, n?.toString() ?? ""].flat(1).filter(Boolean);
2605
+ return u.value?.getFieldValue(r);
2606
+ }, C = () => {
2607
+ let e = [t.name].flat(1).filter(Boolean);
2608
+ if (Array.isArray(e) && e.length === 0) {
2609
+ let e = u.value?.getFieldsValue();
2610
+ return Array.isArray(e) ? e : Object.keys(e || {}).map((t) => e?.[t]);
2611
+ }
2612
+ return u.value?.getFieldValue(e);
2613
+ }, w = (e, n) => {
2614
+ if (e === void 0) throw Error("rowIndex is required");
2615
+ let r = y(e), i = [t.name, r?.toString() ?? ""].flat(1).filter(Boolean), a = Object.assign({}, {
2616
+ ...x(e),
2617
+ ...n || {}
2618
+ });
2619
+ if (t.name) {
2620
+ let e = [t.name].flat(1).filter(Boolean), n = t.value || u.value?.getFieldValue(e);
2621
+ if (Array.isArray(n)) {
2622
+ let i = typeof r == "number" ? r : n.findIndex((e, t) => {
2623
+ let n = v.value?.(e, t);
2624
+ return n === r || n?.toString() === r?.toString();
2625
+ });
2626
+ if (i >= 0 && i < n.length) {
2627
+ let r = [...n];
2628
+ r[i] = a;
2629
+ let o = Y({}, e, r);
2630
+ u.value?.setFieldsValue(o), t.controlled && t.onChange && t.onChange(r);
2631
+ }
2632
+ } else {
2633
+ let e = Y({}, i, a);
2634
+ u.value?.setFieldsValue(e);
2635
+ }
2636
+ } else {
2637
+ let e = Y({}, i, a);
2638
+ u.value?.setFieldsValue(e);
2639
+ }
2640
+ return !0;
2641
+ }, { buttonRenderProps: T } = Gn({
2642
+ recordCreatorProps: n(() => t.recordCreatorProps),
2643
+ maxLength: n(() => t.maxLength),
2644
+ value: m,
2645
+ intl: o,
2646
+ columnsLength: n(() => t.columns?.length),
2647
+ tableViewRender: t.tableViewRender
2648
+ }), E = (e) => new Set((e || []).map((e) => String(e))), D = (e, t, n) => {
2649
+ if (u.value) try {
2650
+ if (n && n.length > 0) {
2651
+ let r = u.value.getFieldsValue() || {}, i = q(r, n);
2652
+ if (i && Array.isArray(i)) {
2653
+ let r = /* @__PURE__ */ new Map();
2654
+ i.forEach((e, t) => {
2655
+ let n = v.value(e, t);
2656
+ r.set(String(n), e);
2657
+ });
2658
+ let a = e.map((e, n) => {
2659
+ let i = v.value(e, n), a = String(i);
2660
+ return t.has(a) && r.get(a) || e;
2661
+ }), o = Y({}, n, a);
2662
+ u.value.setFieldsValue(o);
2663
+ } else {
2664
+ let t = Y({}, n, e);
2665
+ u.value.setFieldsValue(t);
2666
+ }
2667
+ } else {
2668
+ let n = {};
2669
+ e.forEach((e, r) => {
2670
+ let i = v.value(e, r), a = String(i);
2671
+ t.has(a) || (n[a] = e);
2672
+ }), Object.keys(n).length > 0 && u.value.setFieldsValue(n);
2673
+ }
2674
+ } catch (e) {
2675
+ console.warn("Failed to sync form values:", e);
2676
+ }
2677
+ };
2678
+ return a({
2679
+ ...Ut(c),
2680
+ get nativeElement() {
2681
+ return c.value?.nativeElement;
2682
+ },
2683
+ get pageInfo() {
2684
+ return c.value?.pageInfo;
2685
+ },
2686
+ get formRef() {
2687
+ return c.value?.formRef?.nativeElement ? c.value?.formRef : null;
2688
+ },
2689
+ get editableFormRef() {
2690
+ return u.value;
2691
+ },
2692
+ getRowData: x,
2693
+ getRowsData: C,
2694
+ setRowData: w
2695
+ }), () => {
2696
+ let { onTableChange: n, maxLength: a, formItemProps: o, recordCreatorProps: d, rowKey: p, controlled: h, defaultValue: g, onChange: v, onDataSourceChange: y, ...x } = t, S = t.name ? {
2697
+ ...t.editable,
2698
+ form: c.value?.formRef
2699
+ } : { ...t.editable };
2700
+ return (t?.onValuesChange || t.editable?.onValuesChange || t.controlled && t?.onChange) && (S.onValuesChange = b), i(e, null, [i($, l({ ref: c }, x, f, {
2701
+ search: x.search || !1,
2702
+ options: x.options || !1,
2703
+ pagination: x.pagination || !1,
2704
+ rowKey: p,
2705
+ scroll: t.scroll || { x: "max-content" },
2706
+ revalidateOnFocus: x.revalidateOnFocus || !1,
2707
+ tableLayout: t.tableLayout || "fixed"
2708
+ }, T.value, {
2709
+ editable: {
2710
+ ...S,
2711
+ formProps: {
2712
+ formRef: u,
2713
+ ...S.formProps
2714
+ }
2715
+ },
2716
+ dataSource: m.value,
2717
+ onDataSourceChange: (e) => {
2718
+ if (_(e), t.name && u.value) {
2719
+ let n = t.editable?.editableKeys, r = E(n), i = [t.name].flat(1).filter(Boolean);
2720
+ D(e, r, i);
2721
+ }
2722
+ !t.controlled && t.onChange && t.onChange(e);
2723
+ }
2724
+ }), r), t.name ? i(we, { name: [t.name] }, { default: (e) => {
2725
+ if (!s.value) return s.value = m.value, null;
2726
+ let n = [t.name].flat(1), r = q(e, n);
2727
+ if (!r || !Array.isArray(r)) return s.value = m.value, null;
2728
+ let i = r.findIndex((e, t) => !Ae(e, s.value?.[t]));
2729
+ if (i !== -1) {
2730
+ let e = r[i];
2731
+ t?.editable?.onValuesChange?.(e, r);
2732
+ }
2733
+ return s.value = r, null;
2734
+ } }) : null]);
2735
+ };
2736
+ }, {
2737
+ name: "InternalEditableTable",
2738
+ inheritAttrs: !1,
2739
+ props: /* @__PURE__ */ "beforeSearchSubmit.bodyCell.bordered.caption.cardBordered.cardProps.childrenColumnName.classes.columnEmptyText.columns.columnsState.components.controlled.dataSource.dateFormatter.debounceTime.defaultData.defaultExpandAllRows.defaultExpandedRowKeys.defaultSize.defaultValue.direction.dropdownPrefixCls.editable.errorBoundaryRender.expandIcon.expandIconColumnIndex.expandRowByClick.expandable.expandedRowClassName.expandedRowKeys.expandedRowRender.footer.form.formItemProps.getContainerWidth.getPopupContainer.ghost.headerCell.headerTitle.id.indentSize.loading.locale.manualRequest.maxLength.measureRowRender.name.onChange.onDataSourceChange.onExpand.onExpandedRowsChange.onHeaderRow.onLoad.onLoadingChange.onRequestError.onReset.onRow.onSizeChange.onSubmit.onTableChange.onValuesChange.options.optionsRender.pagination.params.polling.postData.prefixCls.recordCreatorProps.request.revalidateOnFocus.rootClass.rowClassName.rowHoverable.rowKey.rowSelection.scroll.search.searchFormRender.showHeader.showSorterTooltip.size.sortDirections.sticky.styles.summary.tableAlertOptionRender.tableAlertRender.tableClass.tableExtraRender.tableLayout.tableRender.tableStyle.tableViewRender.tailor.title.toolBarRender.toolbar.tooltip.type.value.virtual".split(".")
2740
+ }), Jn = /* @__PURE__ */ a((e, { slots: t, attrs: n, expose: r }) => {
2741
+ let a = Se.useFormInstance(), o = h(null);
2742
+ return r(Kn(o)), () => e.name ? i(D, l({ style: { maxWidth: "100%" } }, e?.formItemProps, { name: e.name }), { default: () => [i(qn, l(n, e, {
2743
+ ref: o,
2744
+ tableLayout: e.tableLayout || "fixed",
2745
+ scroll: e.scroll || { x: "max-content" },
2746
+ editable: {
2747
+ ...e.editable,
2748
+ form: a
2749
+ }
2750
+ }), t)] }) : i(qn, l(n, { ref: o }, e, {
2751
+ tableLayout: e.tableLayout || "fixed",
2752
+ scroll: e.scroll || { x: "max-content" }
2753
+ }), t);
2754
+ }, {
2755
+ name: "EditableProTable",
2756
+ inheritAttrs: !1,
2757
+ props: /* @__PURE__ */ "beforeSearchSubmit.bodyCell.bordered.caption.cardBordered.cardProps.childrenColumnName.classes.columnEmptyText.columns.columnsState.components.controlled.dataSource.dateFormatter.debounceTime.defaultData.defaultExpandAllRows.defaultExpandedRowKeys.defaultSize.defaultValue.direction.dropdownPrefixCls.editable.errorBoundaryRender.expandIcon.expandIconColumnIndex.expandRowByClick.expandable.expandedRowClassName.expandedRowKeys.expandedRowRender.footer.form.formItemProps.getContainerWidth.getPopupContainer.ghost.headerCell.headerTitle.id.indentSize.loading.locale.manualRequest.maxLength.measureRowRender.name.onChange.onDataSourceChange.onExpand.onExpandedRowsChange.onHeaderRow.onLoad.onLoadingChange.onRequestError.onReset.onRow.onSizeChange.onSubmit.onTableChange.onValuesChange.options.optionsRender.pagination.params.polling.postData.prefixCls.recordCreatorProps.request.revalidateOnFocus.rootClass.rowClassName.rowHoverable.rowKey.rowSelection.scroll.search.searchFormRender.showHeader.showSorterTooltip.size.sortDirections.sticky.styles.summary.tableAlertOptionRender.tableAlertRender.tableClass.tableExtraRender.tableLayout.tableRender.tableStyle.tableViewRender.tailor.title.toolBarRender.toolbar.tooltip.type.value.virtual".split(".")
2758
+ });
2759
+ Jn.RecordCreator = Bn, Jn.install = (e) => (e.component(Jn.name, Jn), e.component(Bn.displayName, Bn), e);
2760
+ // src/components/EditableTable/CellEditorTable.tsx
2761
+ var Yn = /* @__PURE__ */ a((e, { slots: t, expose: r }) => {
2762
+ let a = h(null), [o, s] = se(e.editable?.editableKeys ?? []), [c, u] = se([]), d = n(() => e.rowKey || "id"), f = h(), p = ae(() => typeof d.value == "function" ? d.value : (t, n) => n === -1 ? t?.[d.value] : e.name ? n?.toString() : t?.[d.value] ?? n?.toString(), [() => e.name, d]), m = () => {
2763
+ f.value &&= (clearTimeout(f.value), void 0);
2764
+ }, g = (t) => {
2765
+ let n = t.filter((e) => e !== void 0);
2766
+ s(n);
2767
+ let r = Wt(n, e.value, p.value, e.editable?.type);
2768
+ e.editable?.onChange?.(n, r);
2769
+ };
2770
+ return r(Kn(a)), () => i(Jn, l({ ref: a }, e, {
2771
+ bordered: e.bordered || !0,
2772
+ pagination: e.pagination || !1,
2773
+ editable: {
2774
+ ...e.editable,
2775
+ editableKeys: o.value
2776
+ },
2777
+ columns: e?.columns?.map((e) => ({
2778
+ ...e,
2779
+ editable: c.value.flat(1).join(".") === [e.dataIndex || e.key].flat(1).join(".") && void 0,
2780
+ onCell: (t, n) => ({
2781
+ onDblclick: () => {
2782
+ m(), g([p.value(t, n)]), u([e.dataIndex || e.key]);
2783
+ },
2784
+ onBlur: () => s([]),
2785
+ onFocus: m
2786
+ })
2787
+ })) || []
2788
+ }), t);
2789
+ }, {
2790
+ name: "CellEditorProTable",
2791
+ inheritAttrs: !1,
2792
+ props: /* @__PURE__ */ "beforeSearchSubmit.bodyCell.bordered.caption.cardBordered.cardProps.childrenColumnName.classes.columnEmptyText.columns.columnsState.components.controlled.dataSource.dateFormatter.debounceTime.defaultData.defaultExpandAllRows.defaultExpandedRowKeys.defaultSize.defaultValue.direction.dropdownPrefixCls.editable.errorBoundaryRender.expandIcon.expandIconColumnIndex.expandRowByClick.expandable.expandedRowClassName.expandedRowKeys.expandedRowRender.footer.form.formItemProps.getContainerWidth.getPopupContainer.ghost.headerCell.headerTitle.id.indentSize.loading.locale.manualRequest.maxLength.measureRowRender.name.onChange.onDataSourceChange.onExpand.onExpandedRowsChange.onHeaderRow.onLoad.onLoadingChange.onRequestError.onReset.onRow.onSizeChange.onSubmit.onTableChange.onValuesChange.options.optionsRender.pagination.params.polling.postData.prefixCls.recordCreatorProps.request.revalidateOnFocus.rootClass.rowClassName.rowHoverable.rowKey.rowSelection.scroll.search.searchFormRender.showHeader.showSorterTooltip.size.sortDirections.sticky.styles.summary.tableAlertOptionRender.tableAlertRender.tableClass.tableExtraRender.tableLayout.tableRender.tableStyle.tableViewRender.tailor.title.toolBarRender.toolbar.tooltip.type.value.virtual".split(".")
2793
+ }), Xn = /* @__PURE__ */ a((e, { slots: t, expose: r }) => {
2794
+ let [a, o] = se([]), s = n(() => e.rowKey || "id"), c = h(null), u = ae(() => typeof s.value == "function" ? s.value : (t, n) => n === -1 ? t?.[s.value] : e.name ? n?.toString() : t?.[s.value] ?? n?.toString(), [() => e.name, s]);
2795
+ return r(Kn(c)), () => i(Jn, l(e, {
2796
+ ref: c,
2797
+ bordered: e.bordered || !0,
2798
+ pagination: e.pagination || !1,
2799
+ editable: {
2800
+ editableKeys: a.value,
2801
+ ...e.editable
2802
+ },
2803
+ columns: e?.columns?.map((e) => ({
2804
+ ...e,
2805
+ onCell: (e, t) => ({
2806
+ onDblclick: () => o([u.value(e, t)]),
2807
+ onBlur: () => o([])
2808
+ })
2809
+ })) || []
2810
+ }), t);
2811
+ }, {
2812
+ name: "RowEditorTable",
2813
+ inheritAttrs: !1,
2814
+ props: /* @__PURE__ */ "beforeSearchSubmit.bodyCell.bordered.caption.cardBordered.cardProps.childrenColumnName.classes.columnEmptyText.columns.columnsState.components.controlled.dataSource.dateFormatter.debounceTime.defaultData.defaultExpandAllRows.defaultExpandedRowKeys.defaultSize.defaultValue.direction.dropdownPrefixCls.editable.errorBoundaryRender.expandIcon.expandIconColumnIndex.expandRowByClick.expandable.expandedRowClassName.expandedRowKeys.expandedRowRender.footer.form.formItemProps.getContainerWidth.getPopupContainer.ghost.headerCell.headerTitle.id.indentSize.loading.locale.manualRequest.maxLength.measureRowRender.name.onChange.onDataSourceChange.onExpand.onExpandedRowsChange.onHeaderRow.onLoad.onLoadingChange.onRequestError.onReset.onRow.onSizeChange.onSubmit.onTableChange.onValuesChange.options.optionsRender.pagination.params.polling.postData.prefixCls.recordCreatorProps.request.revalidateOnFocus.rootClass.rowClassName.rowHoverable.rowKey.rowSelection.scroll.search.searchFormRender.showHeader.showSorterTooltip.size.sortDirections.sticky.styles.summary.tableAlertOptionRender.tableAlertRender.tableClass.tableExtraRender.tableLayout.tableRender.tableStyle.tableViewRender.tailor.title.toolBarRender.toolbar.tooltip.type.value.virtual".split(".")
2815
+ });
2816
+ // src/utils/useDragSort.tsx
2817
+ function Zn(e) {
2818
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !s(e);
2819
+ }
2820
+ var Qn = Symbol("sortableItemValueContext"), $n = { Provider: /* @__PURE__ */ a({
2821
+ name: "Provider",
2822
+ inheritAttrs: !1,
2823
+ props: { value: {
2824
+ type: Object,
2825
+ default: void 0
2826
+ } },
2827
+ setup(e, { slots: t }) {
2828
+ return d(Qn, { handle: e.value?.handle }), () => t.default?.();
2829
+ }
2830
+ }) };
2831
+ function er(e, { slots: n }) {
2832
+ let { dragHandle: r, sortable: a, token: o, dragSortKey: c, handleRef: l, ...u } = e;
2833
+ if (c) {
2834
+ let e = [];
2835
+ return A(n.default?.()).forEach((n, u) => {
2836
+ if (s(n) && !I(n) && n.props?.column?.key === c) {
2837
+ let s;
2838
+ e.push(i($n.Provider, {
2839
+ key: n.key || u,
2840
+ value: { handle: i(r, {
2841
+ ref: l,
2842
+ rowData: n?.props?.record,
2843
+ index: n?.props?.index
2844
+ }, null) }
2845
+ }, Zn(s = t(n, {
2846
+ ...n.props,
2847
+ sortable: a,
2848
+ token: o
2849
+ })) ? s : { default: () => [s] }));
2850
+ } else e.push(t(n, {
2851
+ ...n.props,
2852
+ sortable: a,
2853
+ token: o
2854
+ }));
2855
+ }), i("tr", u, [e]);
2856
+ }
2857
+ return i("tr", u, [n.default?.()]);
2858
+ }
2859
+ function tr(e, { slots: t }) {
2860
+ let { ref: n, ...r } = e;
2861
+ return i("tbody", l(r, { ref: n }), [t.default?.()]);
2862
+ }
2863
+ function nr(e, { slots: t }) {
2864
+ let { dragSortKey: n, sortable: r, token: a, ...s } = e, c = new Je(a.colorFillAlter).onBackground(a.colorBgContainer).toHexString(), { handle: u } = o(Qn, { handle: null });
2865
+ return u ? i("td", l(s, { style: {
2866
+ ...s.style,
2867
+ background: r?.isDragging?.value ? c : void 0
2868
+ } }), [i("div", { style: {
2869
+ display: "flex",
2870
+ alignItems: "center"
2871
+ } }, [u, t.default?.()])]) : i("td", l(s, { style: {
2872
+ ...s.style,
2873
+ background: r?.isDragging?.value ? c : void 0
2874
+ } }), [t.default?.()]);
2875
+ }
2876
+ function rr(e) {
2877
+ let t = f(e.components?.value || {}), r = p(null), o = (e, t) => tr({
2878
+ ...e,
2879
+ ref: r
2880
+ }, t), s = /* @__PURE__ */ a((t, { attrs: r, slots: i }) => {
2881
+ let a = h(null), o = h(null), s = n(() => r["data-row-key"]), c = n(() => {
2882
+ let t = e.dataSource?.value || [], n = e.rowKey.value ?? "index";
2883
+ return t.findIndex((e, t) => {
2884
+ let r = typeof n == "function" ? n(e, t) : e?.[n];
2885
+ return r === s.value || String(r) === String(s.value);
2886
+ });
2887
+ }), l = tt({
2888
+ id: s,
2889
+ index: c,
2890
+ type: "row",
2891
+ accept: "row",
2892
+ element: a,
2893
+ handle: o
2894
+ });
2895
+ return () => er({
2896
+ ...r,
2897
+ id: s.value,
2898
+ dragSortKey: e.dragSortKey?.value,
2899
+ dragHandle: e.dragHandle,
2900
+ ref: a,
2901
+ token: e.token.value,
2902
+ handleRef: o,
2903
+ sortable: l
2904
+ }, { slots: i });
2905
+ }, {
2906
+ name: "DraggableBodyRow",
2907
+ inheritAttrs: !1
2908
+ });
2909
+ H(() => {
2910
+ e.dragSortKey?.value && (t.body = {
2911
+ ...e.components?.value?.body || {},
2912
+ wrapper: (e.components?.value?.body || {}).wrapper || o,
2913
+ row: (e.components?.value?.body || {}).row || c(s),
2914
+ cell: (e.components?.value?.body || {}).cell || nr
2915
+ });
2916
+ }, [e.dragSortKey]);
2917
+ let l = (t) => {
2918
+ if (!t.canceled && et(t.operation)) {
2919
+ let { source: n } = t.operation;
2920
+ if ($e(n)) {
2921
+ let { initialIndex: t, index: r } = n;
2922
+ if (t !== r) {
2923
+ let n = Ze(e.dataSource?.value || [], t, r);
2924
+ e.onDragSortEnd?.(t, r, n || []);
2925
+ }
2926
+ }
2927
+ }
2928
+ };
2929
+ return {
2930
+ DndContext: (e, { slots: t }) => i(Qe, {
2931
+ onDragEnd: l,
2932
+ sensors: [Xe],
2933
+ modifiers: [Ye]
2934
+ }, t),
2935
+ components: t
2936
+ };
2937
+ }
2938
+ // src/components/DragSortTable/style/index.ts
2939
+ var ir = (e) => ({ [e.componentCls]: {
2940
+ "&-icon": {
2941
+ marginInlineEnd: 8,
2942
+ color: e.colorTextSecondary,
2943
+ cursor: "grab !important",
2944
+ padding: 4,
2945
+ fontSize: 12,
2946
+ borderRadius: e.borderRadius,
2947
+ "&:hover": {
2948
+ color: e.colorText,
2949
+ backgroundColor: e.colorInfoBg
2950
+ }
2951
+ },
2952
+ [`${e.antCls}-table-wrapper`]: { [`${e.antCls}-table`]: { "&-tbody": { [`${e.antCls}-table-row`]: { [`${e.antCls}-table-cell`]: {} } } } }
2953
+ } }), ar = w("ProDragSortTable", (e) => [ir(Me(e, {}))]);
2954
+ // src/components/DragSortTable/index.tsx
2955
+ function or(e) {
2956
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !s(e);
2957
+ }
2958
+ var sr = /* @__PURE__ */ a((e, { slots: t, attrs: r, expose: a }) => {
2959
+ let o = X(), s = h(null), [c, u] = ke(() => e.defaultData || [], {
2960
+ value: n(() => e.dataSource),
2961
+ onChange: e.onDataSourceChange
2962
+ }), { token: d } = T(), f = n(() => e.prefixCls || o.value.getPrefixCls("pro")), p = n(() => `${f.value}-table-drag`), [m, _] = ar(p), { DndContext: v, components: y } = rr({
2963
+ dataSource: n(() => c.value?.slice()),
2964
+ dragSortKey: g(() => e.dragSortKey),
2965
+ onDragSortEnd: e.onDragSortEnd,
2966
+ token: d,
2967
+ components: g(() => e.components),
2968
+ rowKey: g(() => e.rowKey),
2969
+ dragHandle: (t) => {
2970
+ let { rowData: n, index: r, className: a, ref: o, ...s } = t, c = i(Be, l(s, { class: K(`${p.value}-icon`, a, m.value, _.value) }), null), u = e.dragSortHandlerRender ? e.dragSortHandlerRender(t?.rowData, t?.index) : c;
2971
+ return i("div", l({ ref: o }, s), [u]);
2972
+ }
2973
+ }), b = async (t) => (u(t), e.onLoad?.(t));
2974
+ return a(Ut(s)), () => {
2975
+ let { rowKey: n, dragSortKey: a, dragSortHandlerRender: o, onDragSortEnd: u, onDataSourceChange: d, defaultData: f, dataSource: h, onLoad: g, ...x } = e;
2976
+ return i($, l(x, {
2977
+ ref: s,
2978
+ class: K(r.class, p.value, m.value, _.value),
2979
+ columns: x.columns?.map((e) => ((e.dataIndex === a || e.key === a) && (e.render ||= () => null), e)),
2980
+ onLoad: b,
2981
+ rowKey: n,
2982
+ tableViewRender: (e, t) => i(v, null, or(t) ? t : { default: () => [t] }),
2983
+ components: y,
2984
+ dataSource: c.value,
2985
+ onDataSourceChange: d
2986
+ }), t);
2987
+ };
2988
+ }, {
2989
+ name: "DragSortTable",
2990
+ inheritAttrs: !1,
2991
+ props: /* @__PURE__ */ "tableAlertRender.dragSortKey.dragSortHandlerRender.onDragSortEnd.tableAlertOptionRender.beforeSearchSubmit.columnEmptyText.editable.options.tooltip.search.headerTitle.tableStyle.toolBarRender.optionsRender.columnsState.onSizeChange.toolbar.bodyCell.bordered.caption.cardBordered.cardProps.childrenColumnName.classes.columns.components.dataSource.dateFormatter.debounceTime.defaultData.defaultExpandAllRows.defaultExpandedRowKeys.direction.dropdownPrefixCls.expandIcon.expandIconColumnIndex.expandRowByClick.expandable.expandedRowClassName.expandedRowKeys.expandedRowRender.footer.form.getContainerWidth.getPopupContainer.ghost.headerCell.id.indentSize.loading.locale.manualRequest.measureRowRender.name.onDataSourceChange.onExpand.onExpandedRowsChange.onHeaderRow.onLoad.onLoadingChange.onRequestError.onReset.onRow.onSubmit.pagination.params.polling.postData.prefixCls.request.revalidateOnFocus.rootClass.rowClassName.rowHoverable.rowKey.rowSelection.scroll.searchFormRender.showHeader.showSorterTooltip.size.sortDirections.sticky.styles.summary.tableClass.tableExtraRender.tableLayout.tableRender.tableViewRender.tailor.title.type.virtual".split(".")
2992
+ }), cr = /* @__PURE__ */ a((e, { slots: t, attrs: r }) => {
2993
+ let a = X(), o = n(() => e.prefixCls || a.value.getPrefixCls("pro")), s = n(() => `${o.value}-table-dropdown-button`);
2994
+ return () => {
2995
+ let { menus: n = [], onSelect: a, ...o } = e;
2996
+ return i(fe, l(o, {
2997
+ class: K(s.value, r.class),
2998
+ menu: {
2999
+ onClick: (e) => {
3000
+ a?.(e.key);
3001
+ },
3002
+ items: n.map(({ key: e, name: t, ...n }) => ({
3003
+ ...n,
3004
+ key: e,
3005
+ title: n.title,
3006
+ label: t
3007
+ }))
3008
+ }
3009
+ }), {
3010
+ ...t,
3011
+ default: () => i(le, {
3012
+ "icon-placement": "end",
3013
+ style: r.style
3014
+ }, {
3015
+ default: () => [t.default?.()],
3016
+ icon: () => i(Ie, null, null)
3017
+ })
3018
+ });
3019
+ };
3020
+ }, {
3021
+ props: {
3022
+ classes: {
3023
+ type: [Object, Function],
3024
+ required: !1
3025
+ },
3026
+ styles: {
3027
+ type: [Object, Function],
3028
+ required: !1
3029
+ },
3030
+ menu: {
3031
+ type: Object,
3032
+ required: !1
3033
+ },
3034
+ autoFocus: {
3035
+ type: Boolean,
3036
+ required: !1,
3037
+ default: void 0
3038
+ },
3039
+ arrow: {
3040
+ type: [Boolean, Object],
3041
+ required: !1,
3042
+ default: void 0
3043
+ },
3044
+ trigger: {
3045
+ type: Array,
3046
+ required: !1
3047
+ },
3048
+ popupRender: {
3049
+ type: Function,
3050
+ required: !1
3051
+ },
3052
+ open: {
3053
+ type: Boolean,
3054
+ required: !1,
3055
+ default: void 0
3056
+ },
3057
+ disabled: {
3058
+ type: Boolean,
3059
+ required: !1,
3060
+ default: void 0
3061
+ },
3062
+ destroyOnHidden: {
3063
+ type: Boolean,
3064
+ required: !1,
3065
+ default: void 0
3066
+ },
3067
+ align: {
3068
+ type: Object,
3069
+ required: !1
3070
+ },
3071
+ getPopupContainer: {
3072
+ type: Function,
3073
+ required: !1
3074
+ },
3075
+ prefixCls: {
3076
+ type: String,
3077
+ required: !1
3078
+ },
3079
+ transitionName: {
3080
+ type: String,
3081
+ required: !1
3082
+ },
3083
+ placement: {
3084
+ type: String,
3085
+ required: !1
3086
+ },
3087
+ forceRender: {
3088
+ type: Boolean,
3089
+ required: !1,
3090
+ default: void 0
3091
+ },
3092
+ mouseEnterDelay: {
3093
+ type: Number,
3094
+ required: !1
3095
+ },
3096
+ mouseLeaveDelay: {
3097
+ type: Number,
3098
+ required: !1
3099
+ },
3100
+ openClassName: {
3101
+ type: String,
3102
+ required: !1
3103
+ },
3104
+ autoAdjustOverflow: {
3105
+ type: [Boolean, Object],
3106
+ required: !1,
3107
+ default: void 0
3108
+ },
3109
+ rootClass: {
3110
+ type: String,
3111
+ required: !1
3112
+ },
3113
+ "onUpdate:open": {
3114
+ type: Function,
3115
+ required: !1
3116
+ },
3117
+ onOpenChange: {
3118
+ type: Function,
3119
+ required: !1
3120
+ },
3121
+ onMenuClick: {
3122
+ type: Function,
3123
+ required: !1
3124
+ },
3125
+ menus: {
3126
+ type: Array,
3127
+ required: !1
3128
+ },
3129
+ onSelect: {
3130
+ type: Function,
3131
+ required: !1
3132
+ }
3133
+ },
3134
+ name: "TableDropdownButton",
3135
+ inheritAttrs: !1
3136
+ }), lr = /* @__PURE__ */ a((e, { slots: t, attrs: r }) => {
3137
+ let a = X(), o = n(() => e.prefixCls || a.value.getPrefixCls("pro")), s = n(() => `${o.value}-table-dropdown`);
3138
+ return () => {
3139
+ let { menus: n = [], onSelect: a, ...o } = e;
3140
+ return i(fe, l(o, {
3141
+ class: K(s.value, r.class),
3142
+ menu: {
3143
+ onClick: (e) => a?.(e.key),
3144
+ items: n.map(({ key: e, name: t, ...n }) => ({
3145
+ key: e,
3146
+ ...n,
3147
+ title: n.title,
3148
+ label: t
3149
+ }))
3150
+ }
3151
+ }), {
3152
+ ...t,
3153
+ default: () => i("a", { style: r.style }, [t.default?.() || i(Le, null, null)])
3154
+ });
3155
+ };
3156
+ }, {
3157
+ props: {
3158
+ classes: {
3159
+ type: [Object, Function],
3160
+ required: !1
3161
+ },
3162
+ styles: {
3163
+ type: [Object, Function],
3164
+ required: !1
3165
+ },
3166
+ menu: {
3167
+ type: Object,
3168
+ required: !1
3169
+ },
3170
+ autoFocus: {
3171
+ type: Boolean,
3172
+ required: !1,
3173
+ default: void 0
3174
+ },
3175
+ arrow: {
3176
+ type: [Boolean, Object],
3177
+ required: !1,
3178
+ default: void 0
3179
+ },
3180
+ trigger: {
3181
+ type: Array,
3182
+ required: !1
3183
+ },
3184
+ popupRender: {
3185
+ type: Function,
3186
+ required: !1
3187
+ },
3188
+ open: {
3189
+ type: Boolean,
3190
+ required: !1,
3191
+ default: void 0
3192
+ },
3193
+ disabled: {
3194
+ type: Boolean,
3195
+ required: !1,
3196
+ default: void 0
3197
+ },
3198
+ destroyOnHidden: {
3199
+ type: Boolean,
3200
+ required: !1,
3201
+ default: void 0
3202
+ },
3203
+ align: {
3204
+ type: Object,
3205
+ required: !1
3206
+ },
3207
+ getPopupContainer: {
3208
+ type: Function,
3209
+ required: !1
3210
+ },
3211
+ prefixCls: {
3212
+ type: String,
3213
+ required: !1
3214
+ },
3215
+ transitionName: {
3216
+ type: String,
3217
+ required: !1
3218
+ },
3219
+ placement: {
3220
+ type: String,
3221
+ required: !1
3222
+ },
3223
+ forceRender: {
3224
+ type: Boolean,
3225
+ required: !1,
3226
+ default: void 0
3227
+ },
3228
+ mouseEnterDelay: {
3229
+ type: Number,
3230
+ required: !1
3231
+ },
3232
+ mouseLeaveDelay: {
3233
+ type: Number,
3234
+ required: !1
3235
+ },
3236
+ openClassName: {
3237
+ type: String,
3238
+ required: !1
3239
+ },
3240
+ autoAdjustOverflow: {
3241
+ type: [Boolean, Object],
3242
+ required: !1,
3243
+ default: void 0
3244
+ },
3245
+ rootClass: {
3246
+ type: String,
3247
+ required: !1
3248
+ },
3249
+ "onUpdate:open": {
3250
+ type: Function,
3251
+ required: !1
3252
+ },
3253
+ onOpenChange: {
3254
+ type: Function,
3255
+ required: !1
3256
+ },
3257
+ onMenuClick: {
3258
+ type: Function,
3259
+ required: !1
3260
+ },
3261
+ menus: {
3262
+ type: Array,
3263
+ required: !1
3264
+ },
3265
+ onSelect: {
3266
+ type: Function,
3267
+ required: !1
3268
+ }
3269
+ },
3270
+ name: "TableDropdown",
3271
+ inheritAttrs: !1
3272
+ });
3273
+ lr.Button = cr;
3274
+ export { Yn as CellEditorTable, sr as DragSortProTable, Jn as EditableProTable, Bn as EditableProTableRecordCreator, $ as ProTable, $ as default, Xn as RowEditorTable, lr as TableDropdown, cr as TableDropdownButton, Ut as useProTableInstanceExpose };