@hkyhy/marsun-components-core 0.1.75 → 0.1.77

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,238 +1,274 @@
1
- import { jsxs as j, jsx as f } from "react/jsx-runtime";
2
- import { useRef as zt, useState as U, useEffect as ot, useMemo as S, useCallback as E } from "react";
3
- import { Space as Ft, Button as dt, Tooltip as pt, Table as kt } from "antd";
4
- import M from "classnames";
5
- import { ColumnConfigTrigger as Ct } from "./ColumnConfigPanel.js";
6
- import { applyColumnConfig as Dt, columnsToPanelItems as $t, columnsToConfig as jt, hideColumnAtPath as Bt, COLUMN_CONFIG_COL_KEY as Gt, isInternalColumnKey as ht, shortChildId as Pt } from "./columnConfigUtils.js";
7
- import { FLEX_SPACER_COL_KEY as fe } from "./columnConfigUtils.js";
8
- import { emptyTablePrefs as Ut } from "./tablePrefsTypes.js";
9
- import { normalizeHiddenRowKeys as Q, mergeTablePrefs as mt, applyHiddenRows as Mt } from "./tablePrefsUtils.js";
10
- import { parseTablePrefs as he, serializeTablePrefs as ye } from "./tablePrefsUtils.js";
11
- import o from "./style.module.scss.js";
12
- import ft from "./columnConfig.module.scss.js";
13
- import { Eye as yt } from "../Icons/Eye.js";
14
- import Xt from "../Empty/Empty.js";
15
- const Yt = { x: "max-content" }, T = 40, qt = 64;
16
- function Zt(e) {
1
+ import { jsx as d, jsxs as D } from "react/jsx-runtime";
2
+ import { Space as ee, Button as gt, Tooltip as vt, Table as ne } from "antd";
3
+ import $ from "classnames";
4
+ import { forwardRef as re, useImperativeHandle as se, useRef as le, useState as U, useEffect as yt, useMemo as L, useCallback as W } from "react";
5
+ import St from "./columnConfig.module.scss.js";
6
+ import { ColumnConfigTrigger as ie } from "./ColumnConfigPanel.js";
7
+ import { applyColumnConfig as ae, columnsToPanelItems as ce, columnsToConfig as oe, hideColumnAtPath as ue, COLUMN_CONFIG_COL_KEY as de, isInternalColumnKey as xt, shortChildId as me } from "./columnConfigUtils.js";
8
+ import { FLEX_SPACER_COL_KEY as $e } from "./columnConfigUtils.js";
9
+ import m from "./style.module.scss.js";
10
+ import { emptyTablePrefs as fe } from "./tablePrefsTypes.js";
11
+ import { normalizeHiddenRowKeys as K, mergeTablePrefs as Lt, applyHiddenRows as he } from "./tablePrefsUtils.js";
12
+ import { parseTablePrefs as Xe, serializeTablePrefs as Ye } from "./tablePrefsUtils.js";
13
+ import { useTableFetch as pe } from "./useTableFetch.js";
14
+ import { useMarsunFetch as ge } from "../../provider/context.js";
15
+ import _t from "../Empty/Empty.js";
16
+ import { Eye as Ht } from "../Icons/Eye.js";
17
+ const ye = { x: "max-content" }, b = 40, Se = 64;
18
+ function Le(e) {
17
19
  return `共 ${e} 项`;
18
20
  }
19
- function gt(e) {
21
+ function It(e) {
20
22
  var i;
21
23
  if (!(e != null && e.length)) return 0;
22
- let a = 0;
23
- for (const s of e) {
24
- const L = s.key != null ? String(s.key) : "";
25
- if (L && ht(L)) continue;
26
- if ((i = s.children) != null && i.length) {
27
- a += gt(s.children);
24
+ let c = 0;
25
+ for (const r of e) {
26
+ const f = r.key != null ? String(r.key) : "";
27
+ if (f && xt(f)) continue;
28
+ if ((i = r.children) != null && i.length) {
29
+ c += It(r.children);
28
30
  continue;
29
31
  }
30
- const l = s.width;
31
- typeof l == "number" && Number.isFinite(l) && l > 0 ? a += l : a += qt;
32
+ const l = r.width;
33
+ typeof l == "number" && Number.isFinite(l) && l > 0 ? c += l : c += Se;
32
34
  }
33
- return a;
35
+ return c;
34
36
  }
35
- function Jt(e, a) {
36
- return e.key != null && String(e.key) !== "" ? String(e.key) : e.dataIndex != null ? Array.isArray(e.dataIndex) ? e.dataIndex.join(".") : String(e.dataIndex) : `__col_${a}`;
37
+ function _e(e, c) {
38
+ return e.key != null && String(e.key) !== "" ? String(e.key) : e.dataIndex != null ? Array.isArray(e.dataIndex) ? e.dataIndex.join(".") : String(e.dataIndex) : `__col_${c}`;
37
39
  }
38
- function Qt(e, a, i) {
39
- if (typeof i == "function") return String(i(e, a));
40
+ function ve(e, c, i) {
41
+ if (typeof i == "function") return String(i(e, c));
40
42
  if (typeof i == "string" && i) {
41
- const s = e[i];
42
- if (s != null && s !== "") return String(s);
43
+ const r = e[i];
44
+ if (r != null && r !== "") return String(r);
43
45
  }
44
- return String(a);
46
+ return String(c);
45
47
  }
46
- const Vt = 6;
47
- function Lt(e, a, i, s = [], L = 0, l) {
48
+ const xe = 6;
49
+ function Ot(e, c, i, r = [], f = 0, l) {
48
50
  let k = 0;
49
- return e.map((r, d) => {
50
- var O, x;
51
- const b = Jt(r, d);
52
- if (ht(b)) return r;
53
- const A = i ? Pt(i, b) : b, N = [...s, A], _ = r.onHeaderCell;
51
+ return e.map((s, G) => {
52
+ var o, _;
53
+ const a = _e(s, G);
54
+ if (xt(a)) return s;
55
+ const X = i ? me(i, a) : a, H = [...r, X], I = s.onHeaderCell;
54
56
  let p = l;
55
- L === 0 && (p = (O = r.children) != null && O.length ? k++ : void 0);
56
- const C = p == null ? void 0 : L === 0 ? o.headerDepth0 : L === 1 ? o.headerDepth1 : o.headerDepth2, z = p == null ? void 0 : o[`headerGroup${p % Vt}`], h = /* @__PURE__ */ j("span", { className: o.headerTitleWithEye, children: [
57
- /* @__PURE__ */ f("span", { className: o.headerTitleText, children: r.title }),
58
- /* @__PURE__ */ f(pt, { title: "隐藏此列", children: /* @__PURE__ */ f(
57
+ f === 0 && (p = (o = s.children) != null && o.length ? k++ : void 0);
58
+ const E = p == null ? void 0 : f === 0 ? m.headerDepth0 : f === 1 ? m.headerDepth1 : m.headerDepth2, F = p == null ? void 0 : m[`headerGroup${p % xe}`], O = /* @__PURE__ */ D("span", { className: m.headerTitleWithEye, children: [
59
+ /* @__PURE__ */ d("span", { className: m.headerTitleText, children: s.title }),
60
+ /* @__PURE__ */ d(vt, { title: "隐藏此列", children: /* @__PURE__ */ d(
59
61
  "button",
60
62
  {
61
63
  type: "button",
62
- className: o.headerEyeBtn,
64
+ className: m.headerEyeBtn,
63
65
  "aria-label": "隐藏此列",
64
- onClick: (H) => {
65
- H.stopPropagation(), a(N);
66
+ onClick: (v) => {
67
+ v.stopPropagation(), c(H);
66
68
  },
67
- children: /* @__PURE__ */ f(yt, { size: 12 })
69
+ children: /* @__PURE__ */ d(Ht, { size: 12 })
68
70
  }
69
71
  ) })
70
- ] }), c = (H) => {
71
- const I = typeof _ == "function" ? _(H) : _ || {};
72
+ ] }), g = (v) => {
73
+ const C = typeof I == "function" ? I(v) : I || {};
72
74
  return {
73
- ...I,
74
- className: M(I.className, z, C)
75
+ ...C,
76
+ className: $(C.className, F, E)
75
77
  };
76
78
  };
77
- return (x = r.children) != null && x.length ? {
78
- ...r,
79
- title: h,
80
- onHeaderCell: c,
81
- children: Lt(
82
- r.children,
79
+ return (_ = s.children) != null && _.length ? {
80
+ ...s,
81
+ title: O,
82
+ onHeaderCell: g,
83
+ children: Ot(
84
+ s.children,
85
+ c,
83
86
  a,
84
- b,
85
- N,
86
- L + 1,
87
+ H,
88
+ f + 1,
87
89
  p
88
90
  )
89
91
  } : {
90
- ...r,
91
- title: h,
92
- onHeaderCell: c
92
+ ...s,
93
+ title: O,
94
+ onHeaderCell: g
93
95
  };
94
96
  });
95
97
  }
96
- function oe({
98
+ function He({
97
99
  className: e,
98
- style: a,
100
+ style: c,
99
101
  scroll: i,
100
- pagination: s,
101
- locale: L,
102
+ pagination: r,
103
+ locale: f,
102
104
  columns: l,
103
105
  dataSource: k,
104
- rowKey: r,
105
- tableName: d,
106
- columnConfigEnabled: b,
107
- fetchColumnConfig: A,
108
- saveColumnConfig: N,
109
- onColumnConfigChange: _,
110
- fetchTablePrefs: p,
111
- saveTablePrefs: C,
112
- onTablePrefsChange: z,
113
- rowConfigEnabled: h = !1,
114
- lockedRowKeys: c,
115
- hiddenRowKeys: O,
116
- onHiddenRowKeysChange: x,
117
- rowHideSelectedKeys: H,
118
- rowConfigToolbar: I,
106
+ rowKey: s,
107
+ loading: G,
108
+ tableName: a,
109
+ columnConfigEnabled: X,
110
+ fetchColumnConfig: H,
111
+ saveColumnConfig: I,
112
+ onColumnConfigChange: p,
113
+ fetchTablePrefs: E,
114
+ saveTablePrefs: F,
115
+ onTablePrefsChange: O,
116
+ rowConfigEnabled: g = !1,
117
+ lockedRowKeys: o,
118
+ hiddenRowKeys: _,
119
+ onHiddenRowKeysChange: v,
120
+ rowHideSelectedKeys: C,
121
+ rowConfigToolbar: M,
119
122
  rowSelection: y,
120
- ...St
121
- }) {
122
- var it;
123
- const v = b ?? !!d, X = zt(l), [u, B] = U(null), [V, _t] = U(!1), [R, Y] = U(!v), [K, Ot] = U([]);
124
- ot(() => {
125
- X.current = l;
126
- }, [l]), ot(() => {
127
- if (!v || !d || !(p || A)) {
128
- Y(!0);
123
+ fetchData: Tt,
124
+ fetchUrl: Wt,
125
+ fetchOptions: bt,
126
+ transformData: Et,
127
+ fetchParams: Ct,
128
+ enabled: At = !0,
129
+ defaultPageSize: Ft = 20,
130
+ onFetched: Nt,
131
+ ...zt
132
+ }, Dt) {
133
+ var mt;
134
+ const Y = ge(), {
135
+ fetchMode: q,
136
+ rows: kt,
137
+ total: Mt,
138
+ loading: jt,
139
+ error: tt,
140
+ currentPage: Bt,
141
+ pageSize: Pt,
142
+ setPage: Ut,
143
+ reload: et
144
+ } = pe({
145
+ dataSource: k,
146
+ fetchData: Tt,
147
+ fetchUrl: Wt,
148
+ fetchOptions: bt,
149
+ transformData: Et,
150
+ fetchParams: Ct,
151
+ enabled: At,
152
+ defaultPageSize: Ft,
153
+ baseUrl: Y.baseUrl,
154
+ defaultHeaders: Y.headers,
155
+ timeoutMs: Y.timeoutMs,
156
+ onFetched: Nt
157
+ });
158
+ se(Dt, () => ({ reload: et }), [et]);
159
+ const Z = q ? kt : k, $t = !!G || q && jt, T = X ?? !!a, J = le(l), [u, j] = U(null), [nt, Gt] = U(!1), [rt, Q] = U(!T), [st, Xt] = U([]);
160
+ yt(() => {
161
+ J.current = l;
162
+ }, [l]), yt(() => {
163
+ if (!T || !a || !(E || H)) {
164
+ Q(!0);
129
165
  return;
130
166
  }
131
167
  let t = !1;
132
- return Y(!1), (async () => {
133
- var g;
168
+ return Q(!1), (async () => {
169
+ var S;
134
170
  try {
135
- if (p) {
136
- const m = await p(d);
137
- t || B((g = m == null ? void 0 : m.columns) != null && g.length ? m : null);
138
- } else if (A) {
139
- const m = await A(d);
140
- t || B(m != null && m.length ? Ut(m) : null);
171
+ if (E) {
172
+ const h = await E(a);
173
+ t || j((S = h == null ? void 0 : h.columns) != null && S.length ? h : null);
174
+ } else if (H) {
175
+ const h = await H(a);
176
+ t || j(h != null && h.length ? fe(h) : null);
141
177
  }
142
178
  } catch {
143
- t || B(null);
179
+ t || j(null);
144
180
  } finally {
145
- t || Y(!0);
181
+ t || Q(!0);
146
182
  }
147
183
  })(), () => {
148
184
  t = !0;
149
185
  };
150
- }, [v, d, p, A]);
151
- const G = (it = u == null ? void 0 : u.columns) != null && it.length ? u.columns : null, W = S(() => O !== void 0 ? Q(O, c) : Q(K, c), [O, K, c]), F = E(
186
+ }, [T, a, E, H]);
187
+ const B = (mt = u == null ? void 0 : u.columns) != null && mt.length ? u.columns : null, x = L(() => _ !== void 0 ? K(_, o) : K(st, o), [_, st, o]), A = W(
152
188
  (t) => {
153
- const n = Q(t, c);
154
- O === void 0 && Ot(n), x == null || x(n);
189
+ const n = K(t, o);
190
+ _ === void 0 && Xt(n), v == null || v(n);
155
191
  },
156
- [O, c, x]
157
- ), P = E(
192
+ [_, o, v]
193
+ ), P = W(
158
194
  async (t) => {
159
- if (B(t), z == null || z(t), _ == null || _(t.columns), d && C) {
160
- await C(d, t);
195
+ if (j(t), O == null || O(t), p == null || p(t.columns), a && F) {
196
+ await F(a, t);
161
197
  return;
162
198
  }
163
- d && N && await N(d, t.columns);
199
+ a && I && await I(a, t.columns);
164
200
  },
165
- [d, C, N, z, _]
166
- ), w = S(() => {
201
+ [a, F, I, O, p]
202
+ ), lt = L(() => {
167
203
  const t = l || [];
168
- return v ? Dt(t, G) : t;
169
- }, [l, v, G]), tt = S(
170
- () => $t(
171
- X.current || l
204
+ return T ? ae(t, B) : t;
205
+ }, [l, T, B]), it = L(
206
+ () => ce(
207
+ J.current || l
172
208
  ),
173
209
  // eslint-disable-next-line react-hooks/exhaustive-deps -- 随 columns 结构变
174
210
  [l]
175
- ), et = E(
211
+ ), at = W(
176
212
  async (t) => {
177
- await P(mt(u, { columns: t }));
213
+ await P(Lt(u, { columns: t }));
178
214
  },
179
215
  [u, P]
180
- ), nt = E(
216
+ ), ct = W(
181
217
  async (t) => {
182
- var g;
218
+ var S;
183
219
  if (!t.length) return;
184
- const n = (g = u == null ? void 0 : u.columns) != null && g.length && u.columns.length ? u.columns : jt(
185
- X.current || l
220
+ const n = (S = u == null ? void 0 : u.columns) != null && S.length && u.columns.length ? u.columns : oe(
221
+ J.current || l
186
222
  );
187
- await P(mt(u, { columns: Bt(n, t) }));
223
+ await P(Lt(u, { columns: ue(n, t) }));
188
224
  },
189
225
  [u, l, P]
190
- ), Wt = E(() => {
191
- const t = (H || []).map(String);
192
- t.length && F([...W, ...t]);
193
- }, [H, W, F]), xt = E(() => {
194
- F([]);
195
- }, [F]), rt = E(
226
+ ), Yt = W(() => {
227
+ const t = (C || []).map(String);
228
+ t.length && A([...x, ...t]);
229
+ }, [C, x, A]), qt = W(() => {
230
+ A([]);
231
+ }, [A]), ot = W(
196
232
  (t) => {
197
233
  const n = String(t);
198
- n && ((c || []).map(String).includes(n) || F([...W, n]));
234
+ n && ((o || []).map(String).includes(n) || A([...x, n]));
199
235
  },
200
- [c, W, F]
201
- ), q = S(() => {
202
- let t = w;
203
- if (v && R) {
204
- t = Lt(t, (g) => {
205
- nt(g);
236
+ [o, x, A]
237
+ ), R = L(() => {
238
+ let t = lt;
239
+ if (T && rt) {
240
+ t = Ot(t, (S) => {
241
+ ct(S);
206
242
  });
207
243
  const n = {
208
- key: Gt,
209
- width: T,
244
+ key: de,
245
+ width: b,
210
246
  fixed: "right",
211
247
  align: "center",
212
- className: ft.configCol,
248
+ className: St.configCol,
213
249
  onHeaderCell: () => ({
214
- className: ft.configColHeader,
250
+ className: St.configColHeader,
215
251
  style: {
216
- width: T,
217
- minWidth: T,
218
- maxWidth: T
252
+ width: b,
253
+ minWidth: b,
254
+ maxWidth: b
219
255
  }
220
256
  }),
221
257
  onCell: () => ({
222
258
  style: {
223
- width: T,
224
- minWidth: T,
225
- maxWidth: T
259
+ width: b,
260
+ minWidth: b,
261
+ maxWidth: b
226
262
  }
227
263
  }),
228
- title: /* @__PURE__ */ f(
229
- Ct,
264
+ title: /* @__PURE__ */ d(
265
+ ie,
230
266
  {
231
- open: V,
232
- onOpenChange: _t,
233
- defaultItems: tt,
234
- savedConfig: G,
235
- onConfirm: et
267
+ open: nt,
268
+ onOpenChange: Gt,
269
+ defaultItems: it,
270
+ savedConfig: B,
271
+ onConfirm: at
236
272
  }
237
273
  ),
238
274
  render: () => null
@@ -241,108 +277,118 @@ function oe({
241
277
  }
242
278
  return t;
243
279
  }, [
244
- v,
245
- R,
246
- w,
247
- V,
248
- tt,
249
- G,
250
- et,
251
- nt
252
- ]), Ht = S(() => h ? Mt(k, W, typeof r == "function" || typeof r == "string" ? r : void 0, c) : k, [h, k, W, r, c]), It = s === !1 ? !1 : {
280
+ T,
281
+ rt,
282
+ lt,
283
+ nt,
284
+ it,
285
+ B,
286
+ at,
287
+ ct
288
+ ]), Zt = L(() => g ? he(Z, x, typeof s == "function" || typeof s == "string" ? s : void 0, o) : Z, [g, Z, x, s, o]), Jt = r === !1 ? !1 : {
253
289
  showSizeChanger: !0,
254
- showTotal: Zt,
255
- ...s && typeof s == "object" ? s : {}
256
- }, vt = {
257
- emptyText: /* @__PURE__ */ f(Xt, { iconType: "simple", description: "暂无数据" }),
258
- ...L
259
- }, Z = S(() => new Set((c || []).map(String)), [c]), Et = h && (H || []).some((t) => {
290
+ showTotal: Le,
291
+ ...r && typeof r == "object" ? r : {},
292
+ ...q ? {
293
+ current: Bt,
294
+ pageSize: Pt,
295
+ total: Mt,
296
+ onChange: (t, n) => {
297
+ Ut(t, n), r && typeof r == "object" && r.onChange && r.onChange(t, n);
298
+ }
299
+ } : null
300
+ }, Qt = {
301
+ ...f,
302
+ emptyText: (f == null ? void 0 : f.emptyText) ?? (tt ? /* @__PURE__ */ d(_t, { iconType: "simple", description: tt.message || "加载失败" }) : /* @__PURE__ */ d(_t, { iconType: "simple", description: "暂无数据" }))
303
+ }, V = L(() => new Set((o || []).map(String)), [o]), Rt = g && (C || []).some((t) => {
260
304
  const n = String(t);
261
- return n && !Z.has(n);
262
- }), st = h && W.length > 0, Tt = h && I !== !1 ? /* @__PURE__ */ j(
263
- Ft,
305
+ return n && !V.has(n);
306
+ }), ut = g && x.length > 0, Vt = g && M !== !1 ? /* @__PURE__ */ D(
307
+ ee,
264
308
  {
265
309
  size: "small",
266
- className: M("marsun-table-row-config", o["marsun-table-row-config"]),
310
+ className: $("marsun-table-row-config", m["marsun-table-row-config"]),
267
311
  children: [
268
- /* @__PURE__ */ f(dt, { size: "small", disabled: !Et, onClick: Wt, children: "隐藏选中行" }),
269
- /* @__PURE__ */ j(dt, { size: "small", disabled: !st, onClick: xt, children: [
312
+ /* @__PURE__ */ d(gt, { size: "small", disabled: !Rt, onClick: Yt, children: "隐藏选中行" }),
313
+ /* @__PURE__ */ D(gt, { size: "small", disabled: !ut, onClick: qt, children: [
270
314
  "恢复隐藏行",
271
- st ? `(${W.length})` : ""
315
+ ut ? `(${x.length})` : ""
272
316
  ] })
273
317
  ]
274
318
  }
275
- ) : null, lt = I === !1 ? null : I !== void 0 ? I : Tt, D = S(() => {
276
- if (!y || !h) return y;
319
+ ) : null, dt = M === !1 ? null : M !== void 0 ? M : Vt, N = L(() => {
320
+ if (!y || !g) return y;
277
321
  const t = typeof y.columnWidth == "number" ? y.columnWidth : 48;
278
322
  return {
279
323
  ...y,
280
324
  columnWidth: t + 20,
281
- renderCell: (n, g, m, at) => {
282
- var ut;
283
- const At = ((ut = y.renderCell) == null ? void 0 : ut.call(y, n, g, m, at)) ?? at, ct = Qt(g, m, r), J = Z.has(ct);
284
- return /* @__PURE__ */ j("span", { className: o.rowSelectWithEye, children: [
285
- At,
286
- /* @__PURE__ */ f(pt, { title: J ? "主对标不可隐藏" : "隐藏此行", children: /* @__PURE__ */ f(
325
+ renderCell: (n, S, h, ft) => {
326
+ var pt;
327
+ const Kt = ((pt = y.renderCell) == null ? void 0 : pt.call(y, n, S, h, ft)) ?? ft, ht = ve(S, h, s), w = V.has(ht);
328
+ return /* @__PURE__ */ D("span", { className: m.rowSelectWithEye, children: [
329
+ Kt,
330
+ /* @__PURE__ */ d(vt, { title: w ? "主对标不可隐藏" : "隐藏此行", children: /* @__PURE__ */ d(
287
331
  "button",
288
332
  {
289
333
  type: "button",
290
- className: o.rowEyeBtn,
291
- "aria-label": J ? "主对标不可隐藏" : "隐藏此行",
292
- disabled: J,
293
- onClick: (Nt) => {
294
- Nt.stopPropagation(), rt(ct);
334
+ className: m.rowEyeBtn,
335
+ "aria-label": w ? "主对标不可隐藏" : "隐藏此行",
336
+ disabled: w,
337
+ onClick: (te) => {
338
+ te.stopPropagation(), ot(ht);
295
339
  },
296
- children: /* @__PURE__ */ f(yt, { size: 14 })
340
+ children: /* @__PURE__ */ d(Ht, { size: 14 })
297
341
  }
298
342
  ) })
299
343
  ] });
300
344
  }
301
345
  };
302
- }, [y, h, r, Z, rt]), $ = S(() => {
303
- const t = gt(q);
346
+ }, [y, g, s, V, ot]), z = L(() => {
347
+ const t = It(R);
304
348
  if (!t) return 0;
305
- const n = D ? typeof D.columnWidth == "number" ? D.columnWidth : 48 : 0;
349
+ const n = N ? typeof N.columnWidth == "number" ? N.columnWidth : 48 : 0;
306
350
  return t + n;
307
- }, [q, D]), bt = S(() => {
308
- const t = i === void 0 ? { ...Yt } : { ...i };
309
- return $ > 0 ? { ...t, x: $ } : t;
310
- }, [i, $]);
311
- return /* @__PURE__ */ j("div", { className: M("marsun-table-shell", o["marsun-table-shell"]), children: [
312
- lt ? /* @__PURE__ */ f("div", { className: o["marsun-table-toolbar"], children: lt }) : null,
313
- /* @__PURE__ */ f(
314
- kt,
351
+ }, [R, N]), wt = L(() => {
352
+ const t = i === void 0 ? { ...ye } : { ...i };
353
+ return z > 0 ? { ...t, x: z } : t;
354
+ }, [i, z]);
355
+ return /* @__PURE__ */ D("div", { className: $("marsun-table-shell", m["marsun-table-shell"]), children: [
356
+ dt ? /* @__PURE__ */ d("div", { className: m["marsun-table-toolbar"], children: dt }) : null,
357
+ /* @__PURE__ */ d(
358
+ ne,
315
359
  {
316
- className: M("marsun-table", o["marsun-table"], e),
360
+ className: $("marsun-table", m["marsun-table"], e),
317
361
  style: {
318
- ...a,
319
- ...$ > 0 ? { "--marsun-table-scroll-x": `${$}px` } : null
362
+ ...c,
363
+ ...z > 0 ? { "--marsun-table-scroll-x": `${z}px` } : null
320
364
  },
321
- scroll: bt,
322
- pagination: It,
323
- locale: vt,
324
- columns: q,
325
- dataSource: Ht,
326
- rowKey: r,
327
- rowSelection: D,
328
- ...St
365
+ scroll: wt,
366
+ pagination: Jt,
367
+ locale: Qt,
368
+ columns: R,
369
+ dataSource: Zt,
370
+ rowKey: s,
371
+ loading: $t,
372
+ rowSelection: N,
373
+ ...zt
329
374
  }
330
375
  )
331
376
  ] });
332
377
  }
378
+ const Be = re(He);
333
379
  export {
334
- Gt as COLUMN_CONFIG_COL_KEY,
335
- fe as FLEX_SPACER_COL_KEY,
336
- Dt as applyColumnConfig,
337
- Mt as applyHiddenRows,
338
- jt as columnsToConfig,
339
- oe as default,
340
- Ut as emptyTablePrefs,
341
- Bt as hideColumnAtPath,
342
- ht as isInternalColumnKey,
343
- mt as mergeTablePrefs,
344
- Q as normalizeHiddenRowKeys,
345
- he as parseTablePrefs,
346
- ye as serializeTablePrefs
380
+ de as COLUMN_CONFIG_COL_KEY,
381
+ $e as FLEX_SPACER_COL_KEY,
382
+ ae as applyColumnConfig,
383
+ he as applyHiddenRows,
384
+ oe as columnsToConfig,
385
+ Be as default,
386
+ fe as emptyTablePrefs,
387
+ ue as hideColumnAtPath,
388
+ xt as isInternalColumnKey,
389
+ Lt as mergeTablePrefs,
390
+ K as normalizeHiddenRowKeys,
391
+ Xe as parseTablePrefs,
392
+ Ye as serializeTablePrefs
347
393
  };
348
394
  //# sourceMappingURL=Table.js.map