@hkyhy/marsun-components-core 0.1.81 → 0.1.82

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.
@@ -1,95 +1,97 @@
1
1
  import { jsx as y, jsxs as et } from "react/jsx-runtime";
2
- import { Space as ve, Button as kt, Tooltip as Ut, Table as _e } from "antd";
2
+ import { Space as ve, Button as jt, Tooltip as Ut, Table as _e } from "antd";
3
3
  import at from "classnames";
4
4
  import { forwardRef as Pe, useImperativeHandle as Ie, useMemo as x, useRef as yt, useState as tt, useEffect as gt, useCallback as z } from "react";
5
5
  import { flushSync as Ee } from "react-dom";
6
- import Mt from "./columnConfig.module.scss.js";
6
+ import kt from "./columnConfig.module.scss.js";
7
7
  import { ColumnConfigTrigger as Te } from "./ColumnConfigPanel.js";
8
- import { COLUMN_RESIZE_MAX_WIDTH as Ae, COLUMN_RESIZE_MIN_WIDTH as Ne, columnsLeafPathSignature as je, applyColumnConfig as ke, applyLeafWidthOverrides as Ft, columnsToPanelItems as Me, copyColumnWidths as Fe, columnsToConfig as Dt, clampColumnWidth as St, setColumnWidthAtPath as De, clearColumnWidthAtPath as Be, hideColumnAtPath as Ue, configHasLeafWidths as $e, FLEX_SPACER_COL_KEY as Ge, COLUMN_CONFIG_COL_KEY as qe, isInternalColumnKey as Ct, shortChildId as $t } from "./columnConfigUtils.js";
9
- import Xe from "./ResizableHeaderCell.js";
8
+ import { COLUMN_RESIZE_MAX_WIDTH as Ae, COLUMN_RESIZE_MIN_WIDTH as Ne, columnsLeafPathSignature as Fe, applyColumnConfig as je, applyLeafWidthOverrides as Mt, columnsToPanelItems as ke, copyColumnWidths as Me, columnsToConfig as Bt, clampColumnWidth as St, setColumnWidthAtPath as Be, clearColumnWidthAtPath as De, hideColumnAtPath as Ue, configHasLeafWidths as $e, insertBeforeFixedRight as Ge, FLEX_SPACER_COL_KEY as qe, COLUMN_CONFIG_COL_KEY as Xe, isInternalColumnKey as Wt, isFixedColumn as Ze, shortChildId as $t } from "./columnConfigUtils.js";
9
+ import Ye from "./ResizableHeaderCell.js";
10
10
  import p from "./style.module.scss.js";
11
- import { emptyTablePrefs as Ze } from "./tablePrefsTypes.js";
12
- import { normalizeHiddenRowKeys as Wt, mergeTablePrefs as lt, applyHiddenRows as Ye } from "./tablePrefsUtils.js";
13
- import { parseTablePrefs as Hn, serializeTablePrefs as On } from "./tablePrefsUtils.js";
14
- import { useTableFetch as Je } from "./useTableFetch.js";
15
- import { useMarsunFetch as Qe } from "../../provider/context.js";
16
- import Bt from "../Empty/Empty.js";
11
+ import { emptyTablePrefs as Je } from "./tablePrefsTypes.js";
12
+ import { normalizeHiddenRowKeys as Ct, mergeTablePrefs as lt, applyHiddenRows as Qe } from "./tablePrefsUtils.js";
13
+ import { parseTablePrefs as Rn, serializeTablePrefs as bn } from "./tablePrefsUtils.js";
14
+ import { useTableFetch as Ve } from "./useTableFetch.js";
15
+ import { useMarsunFetch as we } from "../../provider/context.js";
16
+ import Dt from "../Empty/Empty.js";
17
17
  import { Eye as Gt } from "../Icons/Eye.js";
18
- const Ve = { x: "max-content" }, G = 40, we = 64;
19
- function Ke(i) {
20
- return `共 ${i} 项`;
18
+ const Ke = { x: "max-content" }, G = 40, tn = 64;
19
+ function en(l) {
20
+ return `共 ${l} 项`;
21
21
  }
22
- function qt(i) {
22
+ function qt(l) {
23
23
  var f;
24
- if (!(i != null && i.length)) return 0;
25
- let l = 0;
26
- for (const o of i) {
27
- const a = o.key != null ? String(o.key) : "";
28
- if (a && Ct(a)) continue;
24
+ if (!(l != null && l.length)) return 0;
25
+ let a = 0;
26
+ for (const o of l) {
27
+ const s = o.key != null ? String(o.key) : "";
28
+ if (s && Wt(s)) continue;
29
29
  if ((f = o.children) != null && f.length) {
30
- l += qt(o.children);
30
+ a += qt(o.children);
31
31
  continue;
32
32
  }
33
33
  const c = o.width;
34
- typeof c == "number" && Number.isFinite(c) && c > 0 ? l += c : l += we;
34
+ typeof c == "number" && Number.isFinite(c) && c > 0 ? a += c : a += tn;
35
35
  }
36
- return l;
36
+ return a;
37
37
  }
38
- function Xt(i, l) {
39
- return i.key != null && String(i.key) !== "" ? String(i.key) : i.dataIndex != null ? Array.isArray(i.dataIndex) ? i.dataIndex.join(".") : String(i.dataIndex) : `__col_${l}`;
38
+ function Xt(l, a) {
39
+ return l.key != null && String(l.key) !== "" ? String(l.key) : l.dataIndex != null ? Array.isArray(l.dataIndex) ? l.dataIndex.join(".") : String(l.dataIndex) : `__col_${a}`;
40
40
  }
41
- function tn(i, l, f) {
42
- if (typeof f == "function") return String(f(i, l));
41
+ function nn(l, a, f) {
42
+ if (typeof f == "function") return String(f(l, a));
43
43
  if (typeof f == "string" && f) {
44
- const o = i[f];
44
+ const o = l[f];
45
45
  if (o != null && o !== "") return String(o);
46
46
  }
47
- return String(l);
47
+ return String(a);
48
48
  }
49
- function Zt(i, l, f, o = []) {
50
- return i.map((a, c) => {
51
- var b;
52
- const _ = Xt(a, c);
53
- if (Ct(_)) return a;
54
- const d = f ? $t(f, _) : _, O = [...o, d], u = a.onHeaderCell;
55
- if ((b = a.children) != null && b.length)
49
+ function Zt(l, a, f, o = []) {
50
+ return l.map((s, c) => {
51
+ var R;
52
+ const _ = Xt(s, c);
53
+ if (Wt(_)) return s;
54
+ const d = f ? $t(f, _) : _, O = [...o, d], u = s.onHeaderCell;
55
+ if ((R = s.children) != null && R.length)
56
56
  return {
57
- ...a,
57
+ ...s,
58
58
  children: Zt(
59
- a.children,
60
- l,
59
+ s.children,
60
+ a,
61
61
  _,
62
62
  O
63
63
  )
64
64
  };
65
- const q = O.join("/"), P = l.widthByPath[q] ?? (typeof a.width == "number" && Number.isFinite(a.width) ? a.width : void 0);
65
+ if (Ze(s))
66
+ return s;
67
+ const q = O.join("/"), P = a.widthByPath[q] ?? (typeof s.width == "number" && Number.isFinite(s.width) ? s.width : void 0);
66
68
  return {
67
- ...a,
68
- onHeaderCell: (C) => ({
69
- ...typeof u == "function" ? u(C) : u || {},
69
+ ...s,
70
+ onHeaderCell: (W) => ({
71
+ ...typeof u == "function" ? u(W) : u || {},
70
72
  "data-marsun-col-path": q,
71
73
  width: P,
72
- minWidth: l.minWidth,
73
- maxWidth: l.maxWidth,
74
- onResizeStart: () => l.onResizeStartPath(O),
75
- onResize: (I) => l.onResizePath(O, I),
76
- onResizeStop: (I) => l.onResizeStopPath(O, I),
77
- onReset: () => l.onResetPath(O)
74
+ minWidth: a.minWidth,
75
+ maxWidth: a.maxWidth,
76
+ onResizeStart: () => a.onResizeStartPath(O),
77
+ onResize: (I) => a.onResizePath(O, I),
78
+ onResizeStop: (I) => a.onResizeStopPath(O, I),
79
+ onReset: () => a.onResetPath(O)
78
80
  })
79
81
  };
80
82
  });
81
83
  }
82
- const en = 6;
83
- function Yt(i, l, f, o = [], a = 0, c) {
84
+ const rn = 6;
85
+ function Yt(l, a, f, o = [], s = 0, c) {
84
86
  let _ = 0;
85
- return i.map((d, O) => {
87
+ return l.map((d, O) => {
86
88
  var g, N;
87
89
  const u = Xt(d, O);
88
- if (Ct(u)) return d;
89
- const q = f ? $t(f, u) : u, P = [...o, q], b = d.onHeaderCell;
90
- let C = c;
91
- a === 0 && (C = (g = d.children) != null && g.length ? _++ : void 0);
92
- const B = C == null ? void 0 : a === 0 ? p.headerDepth0 : a === 1 ? p.headerDepth1 : p.headerDepth2, I = C == null ? void 0 : p[`headerGroup${C % en}`], U = /* @__PURE__ */ et("span", { className: p.headerTitleWithEye, children: [
90
+ if (Wt(u)) return d;
91
+ const q = f ? $t(f, u) : u, P = [...o, q], R = d.onHeaderCell;
92
+ let W = c;
93
+ s === 0 && (W = (g = d.children) != null && g.length ? _++ : void 0);
94
+ const D = W == null ? void 0 : s === 0 ? p.headerDepth0 : s === 1 ? p.headerDepth1 : p.headerDepth2, I = W == null ? void 0 : p[`headerGroup${W % rn}`], U = /* @__PURE__ */ et("span", { className: p.headerTitleWithEye, children: [
93
95
  /* @__PURE__ */ y("span", { className: p.headerTitleText, children: d.title }),
94
96
  /* @__PURE__ */ y(Ut, { title: "隐藏此列", children: /* @__PURE__ */ y(
95
97
  "button",
@@ -97,44 +99,44 @@ function Yt(i, l, f, o = [], a = 0, c) {
97
99
  type: "button",
98
100
  className: p.headerEyeBtn,
99
101
  "aria-label": "隐藏此列",
100
- onClick: (j) => {
101
- j.stopPropagation(), l(P);
102
+ onClick: (F) => {
103
+ F.stopPropagation(), a(P);
102
104
  },
103
105
  children: /* @__PURE__ */ y(Gt, { size: 12 })
104
106
  }
105
107
  ) })
106
- ] }), L = (j) => {
107
- const X = typeof b == "function" ? b(j) : b || {};
108
+ ] }), b = (F) => {
109
+ const X = typeof R == "function" ? R(F) : R || {};
108
110
  return {
109
111
  ...X,
110
- className: at(X.className, I, B)
112
+ className: at(X.className, I, D)
111
113
  };
112
114
  };
113
115
  return (N = d.children) != null && N.length ? {
114
116
  ...d,
115
117
  title: U,
116
- onHeaderCell: L,
118
+ onHeaderCell: b,
117
119
  children: Yt(
118
120
  d.children,
119
- l,
121
+ a,
120
122
  u,
121
123
  P,
122
- a + 1,
123
- C
124
+ s + 1,
125
+ W
124
126
  )
125
127
  } : {
126
128
  ...d,
127
129
  title: U,
128
- onHeaderCell: L
130
+ onHeaderCell: b
129
131
  };
130
132
  });
131
133
  }
132
- function nn({
133
- className: i,
134
- style: l,
134
+ function sn({
135
+ className: l,
136
+ style: a,
135
137
  scroll: f,
136
138
  pagination: o,
137
- locale: a,
139
+ locale: s,
138
140
  columns: c,
139
141
  dataSource: _,
140
142
  rowKey: d,
@@ -142,18 +144,18 @@ function nn({
142
144
  tableName: u,
143
145
  columnConfigEnabled: q,
144
146
  fetchColumnConfig: P,
145
- saveColumnConfig: b,
146
- onColumnConfigChange: C,
147
- fetchTablePrefs: B,
147
+ saveColumnConfig: R,
148
+ onColumnConfigChange: W,
149
+ fetchTablePrefs: D,
148
150
  saveTablePrefs: I,
149
151
  onTablePrefsChange: U,
150
- rowConfigEnabled: L = !1,
152
+ rowConfigEnabled: b = !1,
151
153
  lockedRowKeys: g,
152
154
  hiddenRowKeys: N,
153
- onHiddenRowKeysChange: j,
155
+ onHiddenRowKeysChange: F,
154
156
  rowHideSelectedKeys: X,
155
157
  rowConfigToolbar: nt,
156
- rowSelection: R,
158
+ rowSelection: L,
157
159
  columnResizeEnabled: Jt,
158
160
  columnResizeMinWidth: Qt = Ne,
159
161
  columnResizeMaxWidth: Vt = Ae,
@@ -168,8 +170,8 @@ function nn({
168
170
  components: Z,
169
171
  ...le
170
172
  }, ae) {
171
- var jt;
172
- const ot = Qe(), {
173
+ var Ft;
174
+ const ot = we(), {
173
175
  fetchMode: ct,
174
176
  rows: oe,
175
177
  total: ce,
@@ -179,7 +181,7 @@ function nn({
179
181
  pageSize: he,
180
182
  setPage: fe,
181
183
  reload: zt
182
- } = Je({
184
+ } = Ve({
183
185
  dataSource: _,
184
186
  fetchData: wt,
185
187
  fetchUrl: Kt,
@@ -194,21 +196,21 @@ function nn({
194
196
  onFetched: ie
195
197
  });
196
198
  Ie(ae, () => ({ reload: zt }), [zt]);
197
- const ut = ct ? oe : _, me = !!O || ct && ue, k = q ?? !!u, v = Jt ?? !!u, E = Qt, T = Vt, Y = x(
199
+ const ut = ct ? oe : _, me = !!O || ct && ue, j = q ?? !!u, v = Jt ?? !!u, E = Qt, T = Vt, Y = x(
198
200
  () => ({ minWidth: E, maxWidth: T }),
199
201
  [E, T]
200
- ), rt = yt(c), dt = yt(null), [s, st] = tt(null), [Ht, pe] = tt(!1), [ht, ft] = tt(!k), [Ot, ye] = tt([]), [M, Q] = tt({}), $ = yt(M);
201
- $.current = M, gt(() => {
202
+ ), rt = yt(c), dt = yt(null), [i, st] = tt(null), [Ht, pe] = tt(!1), [ht, ft] = tt(!j), [Ot, ye] = tt([]), [k, Q] = tt({}), $ = yt(k);
203
+ $.current = k, gt(() => {
202
204
  rt.current = c;
203
205
  }, [c]);
204
206
  const ge = x(
205
- () => je(c || []),
207
+ () => Fe(c || []),
206
208
  [c]
207
209
  );
208
210
  gt(() => {
209
211
  Q({}), $.current = {};
210
212
  }, [ge]), gt(() => {
211
- if (!k && !v || !u || !(B || P)) {
213
+ if (!j && !v || !u || !(D || P)) {
212
214
  ft(!0);
213
215
  return;
214
216
  }
@@ -216,12 +218,12 @@ function nn({
216
218
  return ft(!1), (async () => {
217
219
  var n;
218
220
  try {
219
- if (B) {
220
- const r = await B(u);
221
+ if (D) {
222
+ const r = await D(u);
221
223
  t || st((n = r == null ? void 0 : r.columns) != null && n.length ? r : null);
222
224
  } else if (P) {
223
225
  const r = await P(u);
224
- t || st(r != null && r.length ? Ze(r) : null);
226
+ t || st(r != null && r.length ? Je(r) : null);
225
227
  }
226
228
  } catch {
227
229
  t || st(null);
@@ -231,57 +233,57 @@ function nn({
231
233
  })(), () => {
232
234
  t = !0;
233
235
  };
234
- }, [k, v, u, B, P]);
235
- const A = (jt = s == null ? void 0 : s.columns) != null && jt.length ? s.columns : null, F = x(() => N !== void 0 ? Wt(N, g) : Wt(Ot, g), [N, Ot, g]), J = z(
236
+ }, [j, v, u, D, P]);
237
+ const A = (Ft = i == null ? void 0 : i.columns) != null && Ft.length ? i.columns : null, M = x(() => N !== void 0 ? Ct(N, g) : Ct(Ot, g), [N, Ot, g]), J = z(
236
238
  (t) => {
237
- const e = Wt(t, g);
238
- N === void 0 && ye(e), j == null || j(e);
239
+ const e = Ct(t, g);
240
+ N === void 0 && ye(e), F == null || F(e);
239
241
  },
240
- [N, g, j]
241
- ), D = z(
242
+ [N, g, F]
243
+ ), B = z(
242
244
  async (t) => {
243
- if (st(t), U == null || U(t), C == null || C(t.columns), u && I) {
245
+ if (st(t), U == null || U(t), W == null || W(t.columns), u && I) {
244
246
  await I(u, t);
245
247
  return;
246
248
  }
247
- u && b && await b(u, t.columns);
249
+ u && R && await R(u, t.columns);
248
250
  },
249
- [u, I, b, U, C]
250
- ), bt = x(() => {
251
+ [u, I, R, U, W]
252
+ ), Rt = x(() => {
251
253
  const t = c || [];
252
254
  let e;
253
- if (k)
254
- e = ke(t, A, Y);
255
+ if (j)
256
+ e = je(t, A, Y);
255
257
  else if (v && (A != null && A.length)) {
256
258
  const n = {}, r = (h, S) => {
257
259
  var H;
258
260
  for (const m of h) {
259
- const W = S ? `${S}/${m.id}` : m.id;
260
- typeof m.width == "number" && Number.isFinite(m.width) && (n[W] = m.width), (H = m.children) != null && H.length && r(m.children, W);
261
+ const C = S ? `${S}/${m.id}` : m.id;
262
+ typeof m.width == "number" && Number.isFinite(m.width) && (n[C] = m.width), (H = m.children) != null && H.length && r(m.children, C);
261
263
  }
262
264
  };
263
- r(A, ""), e = Ft(t, n, Y);
265
+ r(A, ""), e = Mt(t, n, Y);
264
266
  } else
265
267
  e = t;
266
- return v && Object.keys(M).length && (e = Ft(e, M, Y)), e;
267
- }, [c, k, v, A, Y, M]), Lt = x(
268
- () => Me(
268
+ return v && Object.keys(k).length && (e = Mt(e, k, Y)), e;
269
+ }, [c, j, v, A, Y, k]), bt = x(
270
+ () => ke(
269
271
  rt.current || c
270
272
  ),
271
273
  // eslint-disable-next-line react-hooks/exhaustive-deps -- 随 columns 结构变
272
274
  [c]
273
- ), Rt = z(
275
+ ), Lt = z(
274
276
  async (t) => {
275
- const e = Fe(t, s == null ? void 0 : s.columns);
276
- await D(lt(s, { columns: e }));
277
+ const e = Me(t, i == null ? void 0 : i.columns);
278
+ await B(lt(i, { columns: e }));
277
279
  },
278
- [s, D]
280
+ [i, B]
279
281
  ), it = z(() => {
280
282
  var t;
281
- return (t = s == null ? void 0 : s.columns) != null && t.length ? s.columns : Dt(
283
+ return (t = i == null ? void 0 : i.columns) != null && t.length ? i.columns : Bt(
282
284
  rt.current || c
283
285
  );
284
- }, [s, c]), vt = z((t, e) => {
286
+ }, [i, c]), vt = z((t, e) => {
285
287
  const n = t.join("/");
286
288
  Q((r) => {
287
289
  const h = { ...r, [n]: e };
@@ -309,17 +311,17 @@ function nn({
309
311
  async (t, e) => {
310
312
  const n = t.join("/"), r = St(e, E, T), h = dt.current, S = { ...$.current, [n]: r };
311
313
  h && h.querySelectorAll("[data-marsun-col-path]").forEach((m) => {
312
- const W = m.getAttribute("data-marsun-col-path");
313
- if (!W || W === n || S[W] != null) return;
314
+ const C = m.getAttribute("data-marsun-col-path");
315
+ if (!C || C === n || S[C] != null) return;
314
316
  const K = m.offsetWidth;
315
- K > 0 && (S[W] = St(K, E, T));
317
+ K > 0 && (S[C] = St(K, E, T));
316
318
  }), S[n] = r, $.current = S, Q(S);
317
319
  let H = it();
318
- for (const [m, W] of Object.entries(S))
319
- H = De(H, m.split("/"), W, Y);
320
- await D(lt(s, { columns: H }));
320
+ for (const [m, C] of Object.entries(S))
321
+ H = Be(H, m.split("/"), C, Y);
322
+ await B(lt(i, { columns: H }));
321
323
  },
322
- [it, D, s, T, E, Y]
324
+ [it, B, i, T, E, Y]
323
325
  ), It = z(
324
326
  async (t) => {
325
327
  const e = t.join("/");
@@ -328,39 +330,39 @@ function nn({
328
330
  const h = { ...r };
329
331
  return delete h[e], $.current = h, h;
330
332
  });
331
- const n = Be(it(), t);
332
- await D(lt(s, { columns: n }));
333
+ const n = De(it(), t);
334
+ await B(lt(i, { columns: n }));
333
335
  },
334
- [it, D, s]
336
+ [it, B, i]
335
337
  ), Et = z(
336
338
  async (t) => {
337
339
  var n;
338
340
  if (!t.length) return;
339
- const e = (n = s == null ? void 0 : s.columns) != null && n.length && s.columns.length ? s.columns : Dt(
341
+ const e = (n = i == null ? void 0 : i.columns) != null && n.length && i.columns.length ? i.columns : Bt(
340
342
  rt.current || c
341
343
  );
342
- await D(lt(s, { columns: Ue(e, t) }));
344
+ await B(lt(i, { columns: Ue(e, t) }));
343
345
  },
344
- [s, c, D]
346
+ [i, c, B]
345
347
  ), Se = z(() => {
346
348
  const t = (X || []).map(String);
347
- t.length && J([...F, ...t]);
348
- }, [X, F, J]), We = z(() => {
349
+ t.length && J([...M, ...t]);
350
+ }, [X, M, J]), Ce = z(() => {
349
351
  J([]);
350
352
  }, [J]), Tt = z(
351
353
  (t) => {
352
354
  const e = String(t);
353
- e && ((g || []).map(String).includes(e) || J([...F, e]));
355
+ e && ((g || []).map(String).includes(e) || J([...M, e]));
354
356
  },
355
- [g, F, J]
357
+ [g, M, J]
356
358
  ), mt = x(() => {
357
- let t = bt;
358
- if (k && ht && (t = Yt(t, (n) => {
359
+ let t = Rt;
360
+ if (j && ht && (t = Yt(t, (n) => {
359
361
  Et(n);
360
362
  })), v && (t = Zt(t, {
361
363
  minWidth: E,
362
364
  maxWidth: T,
363
- widthByPath: M,
365
+ widthByPath: k,
364
366
  onResizeStartPath: _t,
365
367
  onResizePath: vt,
366
368
  onResizeStopPath: (n, r) => {
@@ -369,26 +371,29 @@ function nn({
369
371
  onResetPath: (n) => {
370
372
  It(n);
371
373
  }
372
- })), v && (Object.keys(M).length > 0 || $e(A))) {
374
+ })), v && (Object.keys(k).length > 0 || $e(A))) {
373
375
  const n = {
374
- key: Ge,
376
+ key: qe,
375
377
  title: "",
376
378
  className: p.flexSpacerCol,
377
379
  onHeaderCell: () => ({ className: p.flexSpacerCol }),
378
380
  onCell: () => ({ className: p.flexSpacerCol }),
379
381
  render: () => null
380
382
  };
381
- t = [...t, n];
383
+ t = Ge(
384
+ t,
385
+ n
386
+ );
382
387
  }
383
- if (k && ht) {
388
+ if (j && ht) {
384
389
  const n = {
385
- key: qe,
390
+ key: Xe,
386
391
  width: G,
387
392
  fixed: "right",
388
393
  align: "center",
389
- className: Mt.configCol,
394
+ className: kt.configCol,
390
395
  onHeaderCell: () => ({
391
- className: Mt.configColHeader,
396
+ className: kt.configColHeader,
392
397
  style: {
393
398
  width: G,
394
399
  minWidth: G,
@@ -407,9 +412,9 @@ function nn({
407
412
  {
408
413
  open: Ht,
409
414
  onOpenChange: pe,
410
- defaultItems: Lt,
415
+ defaultItems: bt,
411
416
  savedConfig: A,
412
- onConfirm: Rt
417
+ onConfirm: Lt
413
418
  }
414
419
  ),
415
420
  render: () => null
@@ -418,14 +423,14 @@ function nn({
418
423
  }
419
424
  return t;
420
425
  }, [
421
- k,
426
+ j,
422
427
  v,
423
428
  ht,
424
- bt,
429
+ Rt,
425
430
  Ht,
426
- Lt,
431
+ bt,
427
432
  A,
428
- Rt,
433
+ Lt,
429
434
  Et,
430
435
  _t,
431
436
  vt,
@@ -433,10 +438,10 @@ function nn({
433
438
  It,
434
439
  E,
435
440
  T,
436
- M
437
- ]), Ce = x(() => L ? Ye(ut, F, typeof d == "function" || typeof d == "string" ? d : void 0, g) : ut, [L, ut, F, d, g]), xe = o === !1 ? !1 : {
441
+ k
442
+ ]), We = x(() => b ? Qe(ut, M, typeof d == "function" || typeof d == "string" ? d : void 0, g) : ut, [b, ut, M, d, g]), xe = o === !1 ? !1 : {
438
443
  showSizeChanger: !0,
439
- showTotal: Ke,
444
+ showTotal: en,
440
445
  ...o && typeof o == "object" ? o : {},
441
446
  ...ct ? {
442
447
  current: de,
@@ -447,44 +452,44 @@ function nn({
447
452
  }
448
453
  } : null
449
454
  }, ze = {
450
- ...a,
451
- emptyText: (a == null ? void 0 : a.emptyText) ?? (xt ? /* @__PURE__ */ y(Bt, { iconType: "simple", description: xt.message || "加载失败" }) : /* @__PURE__ */ y(Bt, { iconType: "simple", description: "暂无数据" }))
452
- }, pt = x(() => new Set((g || []).map(String)), [g]), He = L && (X || []).some((t) => {
455
+ ...s,
456
+ emptyText: (s == null ? void 0 : s.emptyText) ?? (xt ? /* @__PURE__ */ y(Dt, { iconType: "simple", description: xt.message || "加载失败" }) : /* @__PURE__ */ y(Dt, { iconType: "simple", description: "暂无数据" }))
457
+ }, pt = x(() => new Set((g || []).map(String)), [g]), He = b && (X || []).some((t) => {
453
458
  const e = String(t);
454
459
  return e && !pt.has(e);
455
- }), At = L && F.length > 0, Oe = L && nt !== !1 ? /* @__PURE__ */ et(
460
+ }), At = b && M.length > 0, Oe = b && nt !== !1 ? /* @__PURE__ */ et(
456
461
  ve,
457
462
  {
458
463
  size: "small",
459
464
  className: at("marsun-table-row-config", p["marsun-table-row-config"]),
460
465
  children: [
461
- /* @__PURE__ */ y(kt, { size: "small", disabled: !He, onClick: Se, children: "隐藏选中行" }),
462
- /* @__PURE__ */ et(kt, { size: "small", disabled: !At, onClick: We, children: [
466
+ /* @__PURE__ */ y(jt, { size: "small", disabled: !He, onClick: Se, children: "隐藏选中行" }),
467
+ /* @__PURE__ */ et(jt, { size: "small", disabled: !At, onClick: Ce, children: [
463
468
  "恢复隐藏行",
464
- At ? `(${F.length})` : ""
469
+ At ? `(${M.length})` : ""
465
470
  ] })
466
471
  ]
467
472
  }
468
473
  ) : null, Nt = nt === !1 ? null : nt !== void 0 ? nt : Oe, V = x(() => {
469
- if (!R || !L) return R;
470
- const t = typeof R.columnWidth == "number" ? R.columnWidth : 48;
474
+ if (!L || !b) return L;
475
+ const t = typeof L.columnWidth == "number" ? L.columnWidth : 48;
471
476
  return {
472
- ...R,
477
+ ...L,
473
478
  columnWidth: t + 20,
474
479
  renderCell: (e, n, r, h) => {
475
480
  var K;
476
- const H = ((K = R.renderCell) == null ? void 0 : K.call(R, e, n, r, h)) ?? h, m = tn(n, r, d), W = pt.has(m);
481
+ const H = ((K = L.renderCell) == null ? void 0 : K.call(L, e, n, r, h)) ?? h, m = nn(n, r, d), C = pt.has(m);
477
482
  return /* @__PURE__ */ et("span", { className: p.rowSelectWithEye, children: [
478
483
  H,
479
- /* @__PURE__ */ y(Ut, { title: W ? "主对标不可隐藏" : "隐藏此行", children: /* @__PURE__ */ y(
484
+ /* @__PURE__ */ y(Ut, { title: C ? "主对标不可隐藏" : "隐藏此行", children: /* @__PURE__ */ y(
480
485
  "button",
481
486
  {
482
487
  type: "button",
483
488
  className: p.rowEyeBtn,
484
- "aria-label": W ? "主对标不可隐藏" : "隐藏此行",
485
- disabled: W,
486
- onClick: (Re) => {
487
- Re.stopPropagation(), Tt(m);
489
+ "aria-label": C ? "主对标不可隐藏" : "隐藏此行",
490
+ disabled: C,
491
+ onClick: (Le) => {
492
+ Le.stopPropagation(), Tt(m);
488
493
  },
489
494
  children: /* @__PURE__ */ y(Gt, { size: 14 })
490
495
  }
@@ -492,21 +497,21 @@ function nn({
492
497
  ] });
493
498
  }
494
499
  };
495
- }, [R, L, d, pt, Tt]), w = x(() => {
500
+ }, [L, b, d, pt, Tt]), w = x(() => {
496
501
  const t = qt(mt);
497
502
  if (!t) return 0;
498
503
  const e = V ? typeof V.columnWidth == "number" ? V.columnWidth : 48 : 0;
499
504
  return t + e;
500
- }, [mt, V]), be = x(() => {
501
- const t = f === void 0 ? { ...Ve } : { ...f };
505
+ }, [mt, V]), Re = x(() => {
506
+ const t = f === void 0 ? { ...Ke } : { ...f };
502
507
  return w > 0 ? { ...t, x: w } : t;
503
- }, [f, w]), Le = x(() => {
508
+ }, [f, w]), be = x(() => {
504
509
  const t = Z == null ? void 0 : Z.header, e = t && "cell" in t ? t.cell : void 0;
505
510
  return v ? {
506
511
  ...Z,
507
512
  header: {
508
513
  ...t,
509
- cell: (r) => !(typeof r.onResize == "function") && e ? /* @__PURE__ */ y(e, { ...r }) : /* @__PURE__ */ y(Xe, { ...r })
514
+ cell: (r) => !(typeof r.onResize == "function") && e ? /* @__PURE__ */ y(e, { ...r }) : /* @__PURE__ */ y(Ye, { ...r })
510
515
  }
511
516
  } : Z;
512
517
  }, [Z, v]);
@@ -515,48 +520,50 @@ function nn({
515
520
  /* @__PURE__ */ y(
516
521
  _e,
517
522
  {
518
- className: at("marsun-table", p["marsun-table"], i),
523
+ className: at("marsun-table", p["marsun-table"], l),
519
524
  style: {
520
- ...l,
525
+ ...a,
521
526
  ...w > 0 ? { "--marsun-table-scroll-x": `${w}px` } : null
522
527
  },
523
- scroll: be,
528
+ scroll: Re,
524
529
  pagination: xe,
525
530
  locale: ze,
526
531
  columns: mt,
527
- dataSource: Ce,
532
+ dataSource: We,
528
533
  rowKey: d,
529
534
  loading: me,
530
535
  rowSelection: V,
531
- components: Le,
536
+ components: be,
532
537
  ...le
533
538
  }
534
539
  )
535
540
  ] });
536
541
  }
537
- const Cn = Pe(nn);
542
+ const zn = Pe(sn);
538
543
  export {
539
- qe as COLUMN_CONFIG_COL_KEY,
544
+ Xe as COLUMN_CONFIG_COL_KEY,
540
545
  Ae as COLUMN_RESIZE_MAX_WIDTH,
541
546
  Ne as COLUMN_RESIZE_MIN_WIDTH,
542
- Ge as FLEX_SPACER_COL_KEY,
543
- ke as applyColumnConfig,
544
- Ye as applyHiddenRows,
545
- Ft as applyLeafWidthOverrides,
547
+ qe as FLEX_SPACER_COL_KEY,
548
+ je as applyColumnConfig,
549
+ Qe as applyHiddenRows,
550
+ Mt as applyLeafWidthOverrides,
546
551
  St as clampColumnWidth,
547
- Be as clearColumnWidthAtPath,
548
- je as columnsLeafPathSignature,
549
- Dt as columnsToConfig,
552
+ De as clearColumnWidthAtPath,
553
+ Fe as columnsLeafPathSignature,
554
+ Bt as columnsToConfig,
550
555
  $e as configHasLeafWidths,
551
- Fe as copyColumnWidths,
552
- Cn as default,
553
- Ze as emptyTablePrefs,
556
+ Me as copyColumnWidths,
557
+ zn as default,
558
+ Je as emptyTablePrefs,
554
559
  Ue as hideColumnAtPath,
555
- Ct as isInternalColumnKey,
560
+ Ge as insertBeforeFixedRight,
561
+ Ze as isFixedColumn,
562
+ Wt as isInternalColumnKey,
556
563
  lt as mergeTablePrefs,
557
- Wt as normalizeHiddenRowKeys,
558
- Hn as parseTablePrefs,
559
- On as serializeTablePrefs,
560
- De as setColumnWidthAtPath
564
+ Ct as normalizeHiddenRowKeys,
565
+ Rn as parseTablePrefs,
566
+ bn as serializeTablePrefs,
567
+ Be as setColumnWidthAtPath
561
568
  };
562
569
  //# sourceMappingURL=Table.js.map