@hkyhy/marsun-components-core 0.1.81 → 0.1.89

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