@hkyhy/marsun-components-core 0.1.76 → 0.1.78
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.
- package/dist/components/FormInfo/Form.js +11 -10
- package/dist/components/FormInfo/Form.js.map +1 -1
- package/dist/components/FormInfo/style.module.scss.js +51 -51
- package/dist/components/Table/Table.d.ts +27 -11
- package/dist/components/Table/Table.js +271 -225
- package/dist/components/Table/Table.js.map +1 -1
- package/dist/components/Table/index.d.ts +1 -1
- package/dist/components/Table/useTableFetch.d.ts +49 -0
- package/dist/components/Table/useTableFetch.js +124 -0
- package/dist/components/Table/useTableFetch.js.map +1 -0
- package/dist/marsun-components-core.css +1 -1
- package/dist/styles/global.css +1 -1
- package/package.json +1 -1
|
@@ -1,238 +1,274 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import {
|
|
14
|
-
import
|
|
15
|
-
|
|
16
|
-
|
|
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
|
|
21
|
+
function It(e) {
|
|
20
22
|
var i;
|
|
21
23
|
if (!(e != null && e.length)) return 0;
|
|
22
|
-
let
|
|
23
|
-
for (const
|
|
24
|
-
const
|
|
25
|
-
if (
|
|
26
|
-
if ((i =
|
|
27
|
-
|
|
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 =
|
|
31
|
-
typeof l == "number" && Number.isFinite(l) && l > 0 ?
|
|
32
|
+
const l = r.width;
|
|
33
|
+
typeof l == "number" && Number.isFinite(l) && l > 0 ? c += l : c += Se;
|
|
32
34
|
}
|
|
33
|
-
return
|
|
35
|
+
return c;
|
|
34
36
|
}
|
|
35
|
-
function
|
|
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_${
|
|
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
|
|
39
|
-
if (typeof i == "function") return String(i(e,
|
|
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
|
|
42
|
-
if (
|
|
43
|
+
const r = e[i];
|
|
44
|
+
if (r != null && r !== "") return String(r);
|
|
43
45
|
}
|
|
44
|
-
return String(
|
|
46
|
+
return String(c);
|
|
45
47
|
}
|
|
46
|
-
const
|
|
47
|
-
function
|
|
48
|
+
const xe = 6;
|
|
49
|
+
function Ot(e, c, i, r = [], f = 0, l) {
|
|
48
50
|
let k = 0;
|
|
49
|
-
return e.map((
|
|
50
|
-
var
|
|
51
|
-
const
|
|
52
|
-
if (
|
|
53
|
-
const
|
|
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
|
-
|
|
56
|
-
const
|
|
57
|
-
/* @__PURE__ */
|
|
58
|
-
/* @__PURE__ */
|
|
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:
|
|
64
|
+
className: m.headerEyeBtn,
|
|
63
65
|
"aria-label": "隐藏此列",
|
|
64
|
-
onClick: (
|
|
65
|
-
|
|
66
|
+
onClick: (v) => {
|
|
67
|
+
v.stopPropagation(), c(H);
|
|
66
68
|
},
|
|
67
|
-
children: /* @__PURE__ */
|
|
69
|
+
children: /* @__PURE__ */ d(Ht, { size: 12 })
|
|
68
70
|
}
|
|
69
71
|
) })
|
|
70
|
-
] }),
|
|
71
|
-
const
|
|
72
|
+
] }), g = (v) => {
|
|
73
|
+
const C = typeof I == "function" ? I(v) : I || {};
|
|
72
74
|
return {
|
|
73
|
-
...
|
|
74
|
-
className:
|
|
75
|
+
...C,
|
|
76
|
+
className: $(C.className, F, E)
|
|
75
77
|
};
|
|
76
78
|
};
|
|
77
|
-
return (
|
|
78
|
-
...
|
|
79
|
-
title:
|
|
80
|
-
onHeaderCell:
|
|
81
|
-
children:
|
|
82
|
-
|
|
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
|
-
|
|
85
|
-
|
|
86
|
-
L + 1,
|
|
87
|
+
H,
|
|
88
|
+
f + 1,
|
|
87
89
|
p
|
|
88
90
|
)
|
|
89
91
|
} : {
|
|
90
|
-
...
|
|
91
|
-
title:
|
|
92
|
-
onHeaderCell:
|
|
92
|
+
...s,
|
|
93
|
+
title: O,
|
|
94
|
+
onHeaderCell: g
|
|
93
95
|
};
|
|
94
96
|
});
|
|
95
97
|
}
|
|
96
|
-
function
|
|
98
|
+
function He({
|
|
97
99
|
className: e,
|
|
98
|
-
style:
|
|
100
|
+
style: c,
|
|
99
101
|
scroll: i,
|
|
100
|
-
pagination:
|
|
101
|
-
locale:
|
|
102
|
+
pagination: r,
|
|
103
|
+
locale: f,
|
|
102
104
|
columns: l,
|
|
103
105
|
dataSource: k,
|
|
104
|
-
rowKey:
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
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
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
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
|
|
133
|
-
var
|
|
168
|
+
return Q(!1), (async () => {
|
|
169
|
+
var S;
|
|
134
170
|
try {
|
|
135
|
-
if (
|
|
136
|
-
const
|
|
137
|
-
t ||
|
|
138
|
-
} else if (
|
|
139
|
-
const
|
|
140
|
-
t ||
|
|
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 ||
|
|
179
|
+
t || j(null);
|
|
144
180
|
} finally {
|
|
145
|
-
t ||
|
|
181
|
+
t || Q(!0);
|
|
146
182
|
}
|
|
147
183
|
})(), () => {
|
|
148
184
|
t = !0;
|
|
149
185
|
};
|
|
150
|
-
}, [
|
|
151
|
-
const
|
|
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 =
|
|
154
|
-
|
|
189
|
+
const n = K(t, o);
|
|
190
|
+
_ === void 0 && Xt(n), v == null || v(n);
|
|
155
191
|
},
|
|
156
|
-
[
|
|
157
|
-
), P =
|
|
192
|
+
[_, o, v]
|
|
193
|
+
), P = W(
|
|
158
194
|
async (t) => {
|
|
159
|
-
if (
|
|
160
|
-
await
|
|
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
|
-
|
|
199
|
+
a && I && await I(a, t.columns);
|
|
164
200
|
},
|
|
165
|
-
[
|
|
166
|
-
),
|
|
201
|
+
[a, F, I, O, p]
|
|
202
|
+
), lt = L(() => {
|
|
167
203
|
const t = l || [];
|
|
168
|
-
return
|
|
169
|
-
}, [l,
|
|
170
|
-
() =>
|
|
171
|
-
|
|
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
|
-
),
|
|
211
|
+
), at = W(
|
|
176
212
|
async (t) => {
|
|
177
|
-
await P(
|
|
213
|
+
await P(Lt(u, { columns: t }));
|
|
178
214
|
},
|
|
179
215
|
[u, P]
|
|
180
|
-
),
|
|
216
|
+
), ct = W(
|
|
181
217
|
async (t) => {
|
|
182
|
-
var
|
|
218
|
+
var S;
|
|
183
219
|
if (!t.length) return;
|
|
184
|
-
const n = (
|
|
185
|
-
|
|
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(
|
|
223
|
+
await P(Lt(u, { columns: ue(n, t) }));
|
|
188
224
|
},
|
|
189
225
|
[u, l, P]
|
|
190
|
-
),
|
|
191
|
-
const t = (
|
|
192
|
-
t.length &&
|
|
193
|
-
}, [
|
|
194
|
-
|
|
195
|
-
}, [
|
|
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 && ((
|
|
234
|
+
n && ((o || []).map(String).includes(n) || A([...x, n]));
|
|
199
235
|
},
|
|
200
|
-
[
|
|
201
|
-
),
|
|
202
|
-
let t =
|
|
203
|
-
if (
|
|
204
|
-
t =
|
|
205
|
-
|
|
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:
|
|
209
|
-
width:
|
|
244
|
+
key: de,
|
|
245
|
+
width: b,
|
|
210
246
|
fixed: "right",
|
|
211
247
|
align: "center",
|
|
212
|
-
className:
|
|
248
|
+
className: St.configCol,
|
|
213
249
|
onHeaderCell: () => ({
|
|
214
|
-
className:
|
|
250
|
+
className: St.configColHeader,
|
|
215
251
|
style: {
|
|
216
|
-
width:
|
|
217
|
-
minWidth:
|
|
218
|
-
maxWidth:
|
|
252
|
+
width: b,
|
|
253
|
+
minWidth: b,
|
|
254
|
+
maxWidth: b
|
|
219
255
|
}
|
|
220
256
|
}),
|
|
221
257
|
onCell: () => ({
|
|
222
258
|
style: {
|
|
223
|
-
width:
|
|
224
|
-
minWidth:
|
|
225
|
-
maxWidth:
|
|
259
|
+
width: b,
|
|
260
|
+
minWidth: b,
|
|
261
|
+
maxWidth: b
|
|
226
262
|
}
|
|
227
263
|
}),
|
|
228
|
-
title: /* @__PURE__ */
|
|
229
|
-
|
|
264
|
+
title: /* @__PURE__ */ d(
|
|
265
|
+
ie,
|
|
230
266
|
{
|
|
231
|
-
open:
|
|
232
|
-
onOpenChange:
|
|
233
|
-
defaultItems:
|
|
234
|
-
savedConfig:
|
|
235
|
-
onConfirm:
|
|
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
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
]),
|
|
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:
|
|
255
|
-
...
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
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 && !
|
|
262
|
-
}),
|
|
263
|
-
|
|
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:
|
|
310
|
+
className: $("marsun-table-row-config", m["marsun-table-row-config"]),
|
|
267
311
|
children: [
|
|
268
|
-
/* @__PURE__ */
|
|
269
|
-
/* @__PURE__ */
|
|
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
|
-
|
|
315
|
+
ut ? `(${x.length})` : ""
|
|
272
316
|
] })
|
|
273
317
|
]
|
|
274
318
|
}
|
|
275
|
-
) : null,
|
|
276
|
-
if (!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,
|
|
282
|
-
var
|
|
283
|
-
const
|
|
284
|
-
return /* @__PURE__ */
|
|
285
|
-
|
|
286
|
-
/* @__PURE__ */
|
|
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:
|
|
291
|
-
"aria-label":
|
|
292
|
-
disabled:
|
|
293
|
-
onClick: (
|
|
294
|
-
|
|
334
|
+
className: m.rowEyeBtn,
|
|
335
|
+
"aria-label": w ? "主对标不可隐藏" : "隐藏此行",
|
|
336
|
+
disabled: w,
|
|
337
|
+
onClick: (te) => {
|
|
338
|
+
te.stopPropagation(), ot(ht);
|
|
295
339
|
},
|
|
296
|
-
children: /* @__PURE__ */
|
|
340
|
+
children: /* @__PURE__ */ d(Ht, { size: 14 })
|
|
297
341
|
}
|
|
298
342
|
) })
|
|
299
343
|
] });
|
|
300
344
|
}
|
|
301
345
|
};
|
|
302
|
-
}, [y,
|
|
303
|
-
const t =
|
|
346
|
+
}, [y, g, s, V, ot]), z = L(() => {
|
|
347
|
+
const t = It(R);
|
|
304
348
|
if (!t) return 0;
|
|
305
|
-
const n =
|
|
349
|
+
const n = N ? typeof N.columnWidth == "number" ? N.columnWidth : 48 : 0;
|
|
306
350
|
return t + n;
|
|
307
|
-
}, [
|
|
308
|
-
const t = i === void 0 ? { ...
|
|
309
|
-
return
|
|
310
|
-
}, [i,
|
|
311
|
-
return /* @__PURE__ */
|
|
312
|
-
|
|
313
|
-
/* @__PURE__ */
|
|
314
|
-
|
|
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:
|
|
360
|
+
className: $("marsun-table", m["marsun-table"], e),
|
|
317
361
|
style: {
|
|
318
|
-
...
|
|
319
|
-
|
|
362
|
+
...c,
|
|
363
|
+
...z > 0 ? { "--marsun-table-scroll-x": `${z}px` } : null
|
|
320
364
|
},
|
|
321
|
-
scroll:
|
|
322
|
-
pagination:
|
|
323
|
-
locale:
|
|
324
|
-
columns:
|
|
325
|
-
dataSource:
|
|
326
|
-
rowKey:
|
|
327
|
-
|
|
328
|
-
|
|
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
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
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
|