bitz-react-admin-ui 2.7.8 → 2.7.9

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,259 +1,259 @@
1
1
  import { j as n } from "../../../node_modules/react/jsx-runtime.mjs";
2
- import { useRef as K, useContext as Ye, useState as _, useEffect as we, useMemo as a, useLayoutEffect as Ee, useCallback as ie } from "react";
2
+ import { useRef as O, useContext as Ee, useState as D, useEffect as xe, useMemo as a, useLayoutEffect as Je, useCallback as ae } from "react";
3
3
  import { isMobile as j } from "../../../node_modules/react-device-detect/dist/lib.mjs";
4
- import { Typography as xe, Skeleton as Vt, Table as _t, Spin as It } from "antd";
5
- import ce from "../../../node_modules/classnames/index.mjs";
6
- import Dt from "../../BitzDrawer/index.mjs";
7
- import Gt from "../../BitzPagination/index.mjs";
8
- import Yt from "../../BitzNoData/index.mjs";
4
+ import { Typography as ge, Skeleton as _t, Alert as It, Table as Dt, Spin as Gt } from "antd";
5
+ import ue from "../../../node_modules/classnames/index.mjs";
6
+ import Yt from "../../BitzDrawer/index.mjs";
7
+ import Et from "../../BitzPagination/index.mjs";
8
+ import Jt from "../../BitzNoData/index.mjs";
9
9
  import "../../BitzList/index.less.mjs";
10
- import Et from "../../BitzList/List.mjs";
10
+ import Qt from "../../BitzList/List.mjs";
11
11
  import "../../BitzPullRefresh/style/index.less.mjs";
12
- import Jt from "../../BitzPullRefresh/PullRefresh.mjs";
13
- import Qt, { BitzTableContext as Ut, toolCols as Xt } from "../Store/index.mjs";
14
- import { loopFilter as Zt, columnSort as vt, genColumnKey as ge } from "../Store/utils/index.mjs";
15
- import Je from "../../../node_modules/ahooks/es/useSize/index.mjs";
16
- import At from "../../BitzTheme/index.mjs";
17
- import { tablePaddingInline as Ft } from "../../BitzConfigProvider/context.mjs";
18
- import Qe from "../../BitzHighlight/index.mjs";
19
- import es from "../../../node_modules/antd/es/table/ExpandIcon.mjs";
12
+ import Ut from "../../BitzPullRefresh/PullRefresh.mjs";
13
+ import Xt, { BitzTableContext as Zt, toolCols as vt } from "../Store/index.mjs";
14
+ import { loopFilter as At, columnSort as Ft, genColumnKey as Te } from "../Store/utils/index.mjs";
15
+ import Qe from "../../../node_modules/ahooks/es/useSize/index.mjs";
16
+ import es from "../../BitzTheme/index.mjs";
17
+ import { tablePaddingInline as ts } from "../../BitzConfigProvider/context.mjs";
18
+ import Ue from "../../BitzHighlight/index.mjs";
19
+ import ss from "../../../node_modules/antd/es/table/ExpandIcon.mjs";
20
20
  import "../../../node_modules/antd/es/config-provider/index.mjs";
21
- import ts from "../../../node_modules/antd/locale/en_US.mjs";
22
- import { getColumnsWithTool as ss, loopBuildSkeleton as ns, resetScroll as Ue } from "./utils.mjs";
23
- import { getCssVar as os } from "./style.mjs";
24
- import rs from "./SortableRow.mjs";
25
- import ls from "./SortTableContext.mjs";
26
- import is from "./ResizableTitle copy.mjs";
27
- import cs from "../TextOverflow/index.mjs";
21
+ import rs from "../../../node_modules/antd/locale/en_US.mjs";
22
+ import { getColumnsWithTool as ns, loopBuildSkeleton as os, resetScroll as Xe } from "./utils.mjs";
23
+ import { getCssVar as ls } from "./style.mjs";
24
+ import is from "./SortableRow.mjs";
25
+ import cs from "./SortTableContext.mjs";
26
+ import as from "./ResizableTitle copy.mjs";
27
+ import us from "../TextOverflow/index.mjs";
28
28
  import "./index.less.mjs";
29
- import { querySelectorAll as as, querySelector as ds } from "../../../utils/select-query.mjs";
30
- import { ConfigContext as us } from "../../../node_modules/antd/es/config-provider/context.mjs";
31
- import fs from "../../../node_modules/lodash-es/at.mjs";
32
- function hs({
33
- showPagination: J = !0,
34
- height: H,
35
- minHeight: Z,
29
+ import { querySelectorAll as ds, querySelector as fs } from "../../../utils/select-query.mjs";
30
+ import { ConfigContext as hs } from "../../../node_modules/antd/es/config-provider/context.mjs";
31
+ import ms from "../../../node_modules/lodash-es/at.mjs";
32
+ function bs({
33
+ showPagination: U = !0,
34
+ height: L,
35
+ minHeight: A,
36
36
  dataSource: g,
37
- total: L = 0,
38
- columns: ae,
37
+ total: $ = 0,
38
+ columns: de,
39
39
  loading: c,
40
- loadingType: Xe,
41
- dataProps: Ze = {},
42
- skeletonNum: v = {
40
+ loadingType: Ze,
41
+ dataProps: ve = {},
42
+ skeletonNum: F = {
43
43
  pc: 10,
44
44
  mobile: 10
45
45
  },
46
- skeletonRender: de,
47
- skeletonRowNum: ve = 4,
48
- skeletonRowsWidth: Ae = ["35%", "100%", "100%", "60%"],
46
+ skeletonRender: fe,
47
+ skeletonRowNum: Ae = 4,
48
+ skeletonRowsWidth: Fe = ["35%", "100%", "100%", "60%"],
49
49
  // mobileLoadEmit,
50
- mobileRefreshEmit: Te,
51
- operationFilter: d,
52
- enableControlPage: Fe,
50
+ mobileRefreshEmit: je,
51
+ operationFilter: u,
52
+ enableControlPage: et,
53
53
  pagination: N,
54
- paginationEmit: I = () => {
54
+ paginationEmit: G = () => {
55
55
  },
56
- onChange: ue,
57
- enabledRowDragSort: D,
58
- onRowDragEnd: fe,
59
- resizableColumns: A,
60
- mobilePageHeight: ms = 500,
61
- mobileCancelText: et = "取消",
62
- noDataTitle: tt,
63
- noDataImg: st,
64
- color: bs,
65
- size: je,
56
+ onChange: he,
57
+ enabledRowDragSort: Y,
58
+ onRowDragEnd: me,
59
+ resizableColumns: ee,
60
+ mobilePageHeight: ys = 500,
61
+ mobileCancelText: tt = "取消",
62
+ noDataTitle: st,
63
+ noDataImg: rt,
64
+ color: Cs,
65
+ size: ke,
66
66
  showTableTool: nt = !0,
67
67
  tableAction: ot,
68
- tableToolbar: rt,
69
- selectionBar: lt,
70
- scroll: u,
68
+ tableToolbar: lt,
69
+ selectionBar: it,
70
+ scroll: d,
71
71
  components: R,
72
- expandable: W,
73
- rowSelection: O,
72
+ expandable: B,
73
+ rowSelection: V,
74
74
  selectionAlert: m,
75
- resetPage: it,
75
+ resetPage: ct,
76
76
  ...b
77
77
  }) {
78
- var De;
79
- const { token: S } = At.useToken(), ke = K([]), { Table: f } = S, ze = f.tableSpaceBetweenPage ?? 10, ct = f.cellPaddingInline ?? Ft, F = f.minHeight ?? 500, { showColumnBorder: ee, hideRowBorder: Ne, rowHoverable: at, ...i } = Ye(Ut), [dt, te] = _(!1), [k, ut] = _([]);
80
- we(() => {
78
+ var Ge;
79
+ const { token: S } = es.useToken(), ze = O([]), { Table: f } = S, Ne = f.tableSpaceBetweenPage ?? 10, at = f.cellPaddingInline ?? ts, te = f.minHeight ?? 500, { showColumnBorder: se, hideRowBorder: We, rowHoverable: ut, ...i } = Ee(Zt), [dt, re] = D(!1), [k, ft] = D([]);
80
+ xe(() => {
81
81
  let e = [...g ?? []];
82
- (N == null ? void 0 : N.page) !== 1 && (e = [...k, ...e]), ut(e);
82
+ (N == null ? void 0 : N.page) !== 1 && (e = [...k, ...e]), ft(e);
83
83
  }, [j ? g : 0]);
84
- const Be = a(() => !!(k != null && k.length) && (k == null ? void 0 : k.length) >= L, [k, L]), [se, ft] = _([]), [ht, We] = _(!1), mt = async (e, t) => {
85
- var r, l, w;
86
- let s, o = !1;
87
- if (typeof d == "function")
88
- s = (r = d == null ? void 0 : d(e, t)) == null ? void 0 : r.filter(
84
+ const Be = a(() => !!(k != null && k.length) && (k == null ? void 0 : k.length) >= $, [k, $]), [ne, ht] = D([]), [mt, Se] = D(!1), bt = async (e, t) => {
85
+ var o, l, w;
86
+ let s, r = !1;
87
+ if (typeof u == "function")
88
+ s = (o = u == null ? void 0 : u(e, t)) == null ? void 0 : o.filter(
89
89
  (h) => h.type !== "divider"
90
90
  );
91
- else if (s = (l = d == null ? void 0 : d.custom) == null ? void 0 : l.call(d, e, t), d != null && d.request) {
92
- We(!0), te(!0), o = !0;
91
+ else if (s = (l = u == null ? void 0 : u.custom) == null ? void 0 : l.call(u, e, t), u != null && u.request) {
92
+ Se(!0), re(!0), r = !0;
93
93
  try {
94
- const h = await (d == null ? void 0 : d.request(e, t));
95
- (w = d.fieldsName) != null && w.label ? s = h == null ? void 0 : h.map((y) => {
94
+ const h = await (u == null ? void 0 : u.request(e, t));
95
+ (w = u.fieldsName) != null && w.label ? s = h == null ? void 0 : h.map((y) => {
96
96
  var z;
97
97
  return {
98
98
  ...y,
99
- label: y == null ? void 0 : y[((z = d.fieldsName) == null ? void 0 : z.label) ?? "label"]
99
+ label: y == null ? void 0 : y[((z = u.fieldsName) == null ? void 0 : z.label) ?? "label"]
100
100
  };
101
101
  }) : s = h ?? [];
102
102
  } finally {
103
- We(!1);
103
+ Se(!1);
104
104
  }
105
105
  }
106
- s != null && s.length && (ft(s), o || te(!0));
107
- }, Se = () => {
108
- te(!1);
109
- }, bt = (e, t) => {
110
- var s, o;
111
- te(!1), (s = e.onClick) == null || s.call(e), !(e != null && e.onClick) && typeof d != "function" && (d != null && d.onClick) && d.onClick((o = se == null ? void 0 : se[t]) == null ? void 0 : o.key);
112
- }, he = K(null), Me = K(null), P = K(null), me = K(null), G = Je(me), be = K(null), Y = Je(be), yt = (...e) => {
113
- Ue(he), ue == null || ue(...e);
114
- }, Ct = (...e) => {
115
- Ue(he), I == null || I(...e);
116
- }, E = a(() => !(u != null && u.auto) && A, [u == null ? void 0 : u.auto, A]), wt = () => {
106
+ s != null && s.length && (ht(s), r || re(!0));
107
+ }, Me = () => {
108
+ re(!1);
109
+ }, yt = (e, t) => {
110
+ var s, r;
111
+ re(!1), (s = e.onClick) == null || s.call(e), !(e != null && e.onClick) && typeof u != "function" && (u != null && u.onClick) && u.onClick((r = ne == null ? void 0 : ne[t]) == null ? void 0 : r.key);
112
+ }, be = O(null), pe = O(null), P = O(null), H = O(null), E = Qe(H), ye = O(null), J = Qe(ye), Ct = (...e) => {
113
+ Xe(be), he == null || he(...e);
114
+ }, wt = (...e) => {
115
+ Xe(be), G == null || G(...e);
116
+ }, Q = a(() => !(d != null && d.auto) && ee, [d == null ? void 0 : d.auto, ee]), xt = () => {
117
117
  var s;
118
- const e = as(
118
+ const e = ds(
119
119
  "& > .bitzTableContainerBody > .ant-table-wrapper.bitzTable > .ant-spin-nested-loading > .ant-spin-container > .ant-table > .ant-table-container > .ant-table-body > table > .ant-table-tbody > tr:not(.ant-table-measure-row, .ant-table-expanded-row)",
120
120
  (s = P.current) == null ? void 0 : s.querySelectorAll
121
121
  ), t = [];
122
- if (e == null || e.forEach((o) => {
123
- var r;
122
+ if (e == null || e.forEach((r) => {
123
+ var o;
124
124
  t.push(
125
- ((r = ds("& > .operationCol .actionGroup", o.querySelector)) == null ? void 0 : r.clientWidth) || 0
125
+ ((o = fs("& > .operationCol .actionGroup", r.querySelector)) == null ? void 0 : o.clientWidth) || 0
126
126
  );
127
127
  }), t.length)
128
128
  return Math.ceil(Math.max(...t));
129
- }, xt = () => {
130
- var r, l, w, h;
131
- let e = (r = P.current) == null ? void 0 : r.querySelector(
129
+ }, gt = () => {
130
+ var o, l, w, h;
131
+ let e = (o = P.current) == null ? void 0 : o.querySelector(
132
132
  ".ant-table-content"
133
133
  );
134
134
  e || (e = (l = P.current) == null ? void 0 : l.querySelector(
135
135
  ".ant-table-body"
136
136
  ));
137
- let t = 0, s = !1, o = 0;
138
- return e && (t = e.clientWidth - (ee ? 1 : 0), s = e.offsetWidth - e.clientWidth > 0, o = (h = (w = P.current) == null ? void 0 : w.querySelector(
137
+ let t = 0, s = !1, r = 0;
138
+ return e && (t = e.clientWidth - (se ? 1 : 0), s = e.offsetWidth - e.clientWidth > 0, r = (h = (w = P.current) == null ? void 0 : w.querySelector(
139
139
  ".ant-table-cell-scrollbar"
140
- )) == null ? void 0 : h.offsetWidth), { hasScrollBar: s, scrollbarSize: o, tbodyWidth: t };
141
- }, pe = a(() => {
142
- const e = (g ?? []).length, t = e > (v.pc ?? 10) ? e >= 15 ? 15 : e : v.pc ?? 10;
143
- return Array.from({ length: t }).map((o, r) => ({
144
- key: `${Date.now()}${r}`
140
+ )) == null ? void 0 : h.offsetWidth), { hasScrollBar: s, scrollbarSize: r, tbodyWidth: t };
141
+ }, Pe = a(() => {
142
+ const e = (g ?? []).length, t = e > (F.pc ?? 10) ? e >= 15 ? 15 : e : F.pc ?? 10;
143
+ return Array.from({ length: t }).map((r, o) => ({
144
+ key: `${Date.now()}${o}`
145
145
  }));
146
- }, [g]), ne = a(() => Xe === "normal" ? c ? ke.current : (ke.current = g, g) : c ? pe : g ?? [], [c, g, pe]), { hasScrollBar: M, scrollbarSize: B, tbodyWidth: Q } = a(() => xt(), [ne, i.fullscreen, G == null ? void 0 : G.height]), ye = a(() => {
147
- if (typeof H > "u")
146
+ }, [g]), oe = a(() => Ze === "normal" ? c ? ze.current : (ze.current = g, g) : c ? Pe : g ?? [], [c, g, Pe]), { hasScrollBar: M, scrollbarSize: W, tbodyWidth: X } = a(() => gt(), [oe, i.fullscreen, E == null ? void 0 : E.height]), Ce = a(() => {
147
+ if (typeof L > "u")
148
148
  return;
149
149
  let e = 40, t = 40;
150
150
  if (P.current) {
151
151
  const z = window.getComputedStyle(P.current);
152
152
  e = parseInt(z.getPropertyValue("--cell-height")), t = parseInt(z.getPropertyValue("--toolbar-height"));
153
153
  }
154
- const s = (Y == null ? void 0 : Y.height) || 0, o = s ? ze : 0, r = Z ?? F, l = H >= r ? H : r;
155
- return (i.fullscreen ? window.innerHeight : l) - s - o - t - e;
154
+ const s = (J == null ? void 0 : J.height) || 0, r = s ? Ne : 0, o = A ?? te, l = L >= o ? L : o;
155
+ return (i.fullscreen ? window.innerHeight : l) - s - r - t - e;
156
156
  }, [
157
157
  i.fullscreen,
158
- H,
159
- Z,
160
- F,
161
- Y == null ? void 0 : Y.height,
162
- ne,
163
- G == null ? void 0 : G.height,
158
+ L,
159
+ A,
160
+ te,
161
+ J == null ? void 0 : J.height,
162
+ oe,
163
+ E == null ? void 0 : E.height,
164
164
  i.tableSize
165
- ]), gt = () => {
165
+ ]), Tt = () => {
166
166
  let e = 0;
167
167
  if (P.current) {
168
- const s = window.getComputedStyle(P.current), o = parseInt(
168
+ const s = window.getComputedStyle(P.current), r = parseInt(
169
169
  s.getPropertyValue("--toolCell-paddingInline")
170
170
  );
171
- e = parseInt(s.getPropertyValue("--fontSize")) + 4 + 2 * o;
171
+ e = parseInt(s.getPropertyValue("--fontSize")) + 4 + 2 * r;
172
172
  }
173
173
  let t = 0;
174
- return O && (t += e), W && (t += e), D && (t += e), t;
175
- }, [T, Tt] = _([]), [U, jt] = _(0);
176
- Ee(() => {
174
+ return V && (t += e), B && (t += e), Y && (t += e), t;
175
+ }, [T, jt] = D([]), [Z, kt] = D(0);
176
+ Je(() => {
177
177
  var h;
178
- const e = ae ?? [], t = (h = e.find((y) => y.isOperationCol)) == null ? void 0 : h.width, s = e.filter((y) => !Xt.includes(y)), r = Zt(s, i.columnsMap).sort(vt(i.columnsMap)), l = r.findIndex((y) => y.isOperationCol);
179
- l >= 0 && (r[l].width = t);
178
+ const e = de ?? [], t = (h = e.find((y) => y.isOperationCol)) == null ? void 0 : h.width, s = e.filter((y) => !vt.includes(y)), o = At(s, i.columnsMap).sort(Ft(i.columnsMap)), l = o.findIndex((y) => y.isOperationCol);
179
+ l >= 0 && (o[l].width = t);
180
180
  let w = 0;
181
- j || (w = gt()), Tt(r), jt(w);
182
- }, [i.columnsMap, ae]);
183
- const [C, kt] = _([]);
184
- we(() => {
185
- if (E) {
181
+ j || (w = Tt()), jt(o), kt(w);
182
+ }, [i.columnsMap, de]);
183
+ const [C, zt] = D([]);
184
+ xe(() => {
185
+ if (Q) {
186
186
  const e = T.map((t, s) => {
187
- let o = t.width;
187
+ let r = t.width;
188
188
  if (t != null && t.isOperationCol && (t != null && t.useMaxWidth)) {
189
- const l = wt();
190
- l && (o = l + ct * 2);
189
+ const l = xt();
190
+ l && (r = l + at * 2);
191
191
  }
192
192
  return {
193
- key: ge(t, s),
194
- width: o ?? 0
193
+ key: Te(t, s),
194
+ width: r ?? 0
195
195
  };
196
196
  });
197
- kt(e);
197
+ zt(e);
198
198
  }
199
- }, [T, E]);
200
- const Pe = K(!1), He = K(!1), oe = a(() => {
199
+ }, [T, Q]);
200
+ const He = O(!1), Le = O(!1), le = a(() => {
201
201
  let e;
202
- if (typeof ye == "number" && (e = ye - 1), typeof (u == null ? void 0 : u.y) == "number" && (e = u.y - 2), u != null && u.auto)
202
+ if (typeof Ce == "number" && (e = Ce - 1), typeof (d == null ? void 0 : d.y) == "number" && (e = d.y - 2), d != null && d.auto)
203
203
  return {
204
204
  x: void 0,
205
205
  y: e
206
206
  };
207
- let t = u == null ? void 0 : u.x;
208
- return A && C.length && (t = C.reduce((r, l) => r + l.width, 0) + U, Q && t < Q - (M ? B : 0) && (Pe.current = !0, t = Q)), u != null && u.y ? { x: t, y: u.y } : { x: t, y: e };
207
+ let t = d == null ? void 0 : d.x;
208
+ return ee && C.length && (t = C.reduce((o, l) => o + l.width, 0) + Z, X && t < X - (M ? W : 0) && (He.current = !0, t = X)), d != null && d.y ? { x: t, y: d.y } : { x: t, y: e };
209
209
  }, [
210
- u,
211
- ye,
212
- A,
213
- C,
214
- U,
210
+ d,
211
+ Ce,
215
212
  ee,
213
+ C,
214
+ Z,
215
+ se,
216
216
  M,
217
- B
217
+ W
218
218
  ]);
219
- we(() => {
220
- if (E && C.length) {
221
- const t = C.reduce((r, l) => r + l.width, 0) + U, o = Q - (M ? B : 0);
222
- if (t < o || Pe.current && t > o && !He.current) {
223
- const r = /* @__PURE__ */ new Map(), l = T.findIndex(
219
+ xe(() => {
220
+ if (Q && C.length) {
221
+ const t = C.reduce((o, l) => o + l.width, 0) + Z, r = X - (M ? W : 0);
222
+ if (t < r || He.current && t > r && !Le.current) {
223
+ const o = /* @__PURE__ */ new Map(), l = T.findIndex(
224
224
  (x) => x == null ? void 0 : x.isOperationCol
225
225
  );
226
226
  let w = "";
227
- l >= 0 && (w = ge(
227
+ l >= 0 && (w = Te(
228
228
  T[l],
229
229
  l
230
- )), C.forEach((x) => r.set(x.key, x.width));
231
- let h = o - t, y = T.length;
230
+ )), C.forEach((x) => o.set(x.key, x.width));
231
+ let h = r - t, y = T.length;
232
232
  if (l >= 0 && y--, h >= y) {
233
233
  const x = Math.floor(h / y);
234
- r.forEach((re, le) => {
235
- r.set(le, re + (w === le ? 0 : x));
234
+ o.forEach((ie, ce) => {
235
+ o.set(ce, ie + (w === ce ? 0 : x));
236
236
  }), h = h - x * y;
237
237
  }
238
238
  let z = 0;
239
239
  l === 0 && T.length > 1 && z++;
240
- const V = ge(T[z]);
241
- r.set(V, r.get(V) + h);
240
+ const I = Te(T[z]);
241
+ o.set(I, o.get(I) + h);
242
242
  const p = { ...i.columnsMap };
243
243
  for (const x in p)
244
- p[x].show && (p[x].width = r.get(x));
244
+ p[x].show && (p[x].width = o.get(x));
245
245
  i.setColumnsMap(p);
246
246
  }
247
247
  }
248
248
  }, [
249
- E,
249
+ Q,
250
250
  C,
251
- U,
252
- ee,
251
+ Z,
252
+ se,
253
253
  M,
254
- B
254
+ W
255
255
  ]);
256
- const zt = a(() => {
256
+ const Nt = a(() => {
257
257
  var e;
258
258
  if (i.fullscreen) {
259
259
  const t = document.body.clientHeight, s = (e = document.fullscreenElement) != null && e.classList.contains(
@@ -262,16 +262,16 @@ function hs({
262
262
  return { y: t - 80 - s };
263
263
  }
264
264
  return {};
265
- }, [i.fullscreen]), $ = a(() => {
265
+ }, [i.fullscreen]), q = a(() => {
266
266
  if (j)
267
267
  return T;
268
- const e = T.length - 1, t = T.map((s, o) => {
269
- var r;
268
+ const e = T.length - 1, t = T.map((s, r) => {
269
+ var o;
270
270
  return {
271
271
  ...s,
272
272
  ...typeof s.title == "string" && {
273
273
  title: /* @__PURE__ */ n.jsx(
274
- xe.Paragraph,
274
+ ge.Paragraph,
275
275
  {
276
276
  className: "bitzTableTitle",
277
277
  ellipsis: { rows: 2 },
@@ -279,65 +279,65 @@ function hs({
279
279
  }
280
280
  )
281
281
  },
282
- ...e === o && {
283
- className: ce(s.className, "lastColumn")
282
+ ...e === r && {
283
+ className: ue(s.className, "lastColumn")
284
284
  },
285
- width: C.length ? (r = C[o]) == null ? void 0 : r.width : (s == null ? void 0 : s.width) || void 0,
286
- ...oe.x !== void 0 ? {
285
+ width: C.length ? (o = C[r]) == null ? void 0 : o.width : (s == null ? void 0 : s.width) || void 0,
286
+ ...le.x !== void 0 ? {
287
287
  onHeaderCell: (l) => {
288
288
  var w;
289
289
  return {
290
290
  ...(w = s.onHeaderCell) == null ? void 0 : w.call(s),
291
291
  width: l.width,
292
- stretchref: Me,
293
- datagridref: me,
294
- onResize: Nt(o)
292
+ stretchref: pe,
293
+ datagridref: H,
294
+ onResize: Wt(r)
295
295
  };
296
296
  }
297
297
  } : {},
298
298
  ...!(s != null && s.render) && s.copyable ? {
299
- render: (l) => ["number", "bigint"].includes(typeof l) ? l : /* @__PURE__ */ n.jsx(cs, { value: l })
299
+ render: (l) => ["number", "bigint"].includes(typeof l) ? l : /* @__PURE__ */ n.jsx(us, { value: l })
300
300
  } : {}
301
301
  };
302
302
  });
303
- return ss(
304
- ae,
303
+ return ns(
304
+ de,
305
305
  t,
306
- D,
307
- !!O,
308
- !!W
306
+ Y,
307
+ !!V,
308
+ !!B
309
309
  );
310
- }, [T, C]), Nt = (e) => (t, { size: s, minWidth: o }) => {
311
- const l = (s.width > o ? s.width : o) - C[e].width;
310
+ }, [T, C]), Wt = (e) => (t, { size: s, minWidth: r }) => {
311
+ const l = (s.width > r ? s.width : r) - C[e].width;
312
312
  if (l === 0)
313
313
  return;
314
- const h = C.reduce((X, q) => X + q.width, 0) + l + U, z = Q - (M ? B : 0);
315
- let V = "", p = -1, x = 0;
314
+ const h = C.reduce((v, K) => v + K.width, 0) + l + Z, z = X - (M ? W : 0);
315
+ let I = "", p = -1, x = 0;
316
316
  if (l < 0 && h < z) {
317
317
  p = e + 1;
318
- const X = T.length - 1, q = T[X];
319
- (e === X - 1 && (q != null && q.isOperationCol) || e === X && !(q != null && q.isOperationCol)) && (p = e - 1);
320
- let Ge = 0;
321
- oe.x > z && (Ge = oe.x - z), V = `${C[p].key}`, x = C[p].width - l - Ge;
318
+ const v = T.length - 1, K = T[v];
319
+ (e === v - 1 && (K != null && K.isOperationCol) || e === v && !(K != null && K.isOperationCol)) && (p = e - 1);
320
+ let Ye = 0;
321
+ le.x > z && (Ye = le.x - z), I = `${C[p].key}`, x = C[p].width - l - Ye;
322
322
  }
323
- const re = `${C[e].key}`, le = {
323
+ const ie = `${C[e].key}`, ce = {
324
324
  ...i.columnsMap,
325
- [re]: {
326
- ...i.columnsMap[re],
325
+ [ie]: {
326
+ ...i.columnsMap[ie],
327
327
  width: C[e].width + l
328
328
  },
329
- ...V && p >= 0 && {
330
- [V]: {
331
- ...i.columnsMap[V],
329
+ ...I && p >= 0 && {
330
+ [I]: {
331
+ ...i.columnsMap[I],
332
332
  width: x
333
333
  }
334
334
  }
335
335
  };
336
- i.setColumnsMap(le), He.current = !0, i.persistenceType === "online" && i.persistenceKey && i.startAutoSaveCountdown();
337
- }, Le = a(() => ns($), [$]), Bt = a(() => c ? Le : $, [c, $, Le]), { table: Ce, locale: Wt = ts } = Ye(us), St = { ...Wt.Table }, Mt = ((De = Ce == null ? void 0 : Ce.expandable) == null ? void 0 : De.expandIcon) || (W == null ? void 0 : W.expandIcon) || es(St), Re = a(() => {
338
- if (W)
336
+ i.setColumnsMap(ce), Le.current = !0, i.persistenceType === "online" && i.persistenceKey && i.startAutoSaveCountdown();
337
+ }, $e = a(() => os(q), [q]), _ = a(() => c ? $e : q, [c, q, $e]), { table: we, locale: Bt = rs } = Ee(hs), St = { ...Bt.Table }, Mt = ((Ge = we == null ? void 0 : we.expandable) == null ? void 0 : Ge.expandIcon) || (B == null ? void 0 : B.expandIcon) || ss(St), Re = a(() => {
338
+ if (B)
339
339
  return {
340
- ...W,
340
+ ...B,
341
341
  expandedRowRender: () => /* @__PURE__ */ n.jsx(n.Fragment, {}),
342
342
  expandIcon: (e) => {
343
343
  const t = Mt(e);
@@ -354,80 +354,80 @@ function hs({
354
354
  };
355
355
  }
356
356
  };
357
- }, [W]), pt = a(() => c ? Re : W, [c, W, Re]), $e = a(() => {
358
- if (O)
357
+ }, [B]), pt = a(() => c ? Re : B, [c, B, Re]), qe = a(() => {
358
+ if (V)
359
359
  return {
360
- ...O,
360
+ ...V,
361
361
  selectedRowKeys: [],
362
362
  getCheckboxProps: () => ({ disabled: !0 })
363
363
  };
364
- }, [O]), Pt = a(() => c ? $e : O, [c, O, $e]), qe = a(() => c ? "key" : b.rowKey, [c, b.rowKey]), Ke = a(() => `${je ?? i.stylesConfig.size}BitzTable`, [je, i.stylesConfig.size]), Ht = ie(
364
+ }, [V]), Pt = a(() => c ? qe : V, [c, V, qe]), Ke = a(() => c ? "key" : b.rowKey, [c, b.rowKey]), Oe = a(() => `${ke ?? i.stylesConfig.size}BitzTable`, [ke, i.stylesConfig.size]), Ht = ae(
365
365
  (e, t) => {
366
- var o;
366
+ var r;
367
367
  if (!b.onRow || c)
368
368
  return {};
369
- const s = (o = b.onRow) == null ? void 0 : o.call(b, e, t);
369
+ const s = (r = b.onRow) == null ? void 0 : r.call(b, e, t);
370
370
  return s.onClick && (s.className = "rowPointerCursor"), s;
371
371
  },
372
372
  [b.onRow, c]
373
- ), Lt = a(() => ce(
373
+ ), Lt = a(() => ue(
374
374
  "bitzTableContainer",
375
- { hideBorder: Ne },
375
+ { hideBorder: We },
376
376
  { hasScrollBar: M },
377
377
  { stickyTable: !!(b != null && b.sticky) },
378
- Ke,
378
+ Oe,
379
379
  b.className
380
380
  ), [
381
381
  b.className,
382
- Ke,
382
+ Oe,
383
383
  M,
384
384
  i.fullscreen,
385
- Ne,
385
+ We,
386
386
  b.sticky
387
- ]), Rt = a(() => ({
387
+ ]), $t = a(() => ({
388
388
  "--container-bgColor": S.colorBgContainer
389
- }), [S.colorBgContainer]), $t = a(() => {
390
- const e = Z ?? F;
389
+ }), [S.colorBgContainer]), Rt = a(() => {
390
+ const e = A ?? te;
391
391
  let t;
392
- H && (t = H >= e ? H : e);
392
+ L && (t = L >= e ? L : e);
393
393
  const s = i.fullscreen ? "100%" : t;
394
- let o;
395
- return (B ?? 0) > 0 && (o = B), os({
394
+ let r;
395
+ return (W ?? 0) > 0 && (r = W), ls({
396
396
  height: s ?? "auto",
397
397
  token: S,
398
398
  evenRowBgColor: i.zebra ? f == null ? void 0 : f.evenRowBgColor : S.colorBgContainer,
399
399
  table: f,
400
- gap: ze,
400
+ gap: Ne,
401
401
  borderColor: (f == null ? void 0 : f.borderColor) || S.colorBorderSecondary,
402
- scrollbarWidth: o,
402
+ scrollbarWidth: r,
403
403
  other: b.style
404
404
  });
405
405
  }, [
406
406
  b.style,
407
407
  i.fullscreen,
408
- H,
409
- Z,
410
- F,
408
+ L,
409
+ A,
410
+ te,
411
411
  f,
412
412
  i == null ? void 0 : i.zebra,
413
- B
414
- ]), qt = ie(
413
+ W
414
+ ]), qt = ae(
415
415
  (e, t, s) => {
416
- const o = t % 2 === 0 ? "oddRow" : "evenRow";
416
+ const r = t % 2 === 0 ? "oddRow" : "evenRow";
417
417
  if (b.rowClassName) {
418
- const r = b.rowClassName(e, t, s);
419
- return ce(o, r);
418
+ const o = b.rowClassName(e, t, s);
419
+ return ue(r, o);
420
420
  }
421
- return o;
421
+ return r;
422
422
  },
423
423
  [b.rowClassName]
424
- ), Oe = a(() => /* @__PURE__ */ n.jsx(
425
- Et,
424
+ ), Ve = a(() => /* @__PURE__ */ n.jsx(
425
+ Qt,
426
426
  {
427
427
  finished: Be,
428
428
  onLoad: async () => (
429
429
  // @ts-ignore
430
- !c && (I == null ? void 0 : I((N == null ? void 0 : N.page) + 1, N == null ? void 0 : N.size))
430
+ !c && (G == null ? void 0 : G((N == null ? void 0 : N.page) + 1, N == null ? void 0 : N.size))
431
431
  ),
432
432
  loadingText: "加载中...",
433
433
  finishedText: "没有更多了",
@@ -443,9 +443,9 @@ function hs({
443
443
  {
444
444
  className: "listItem",
445
445
  style: { backgroundColor: f == null ? void 0 : f.listItemBgColor },
446
- onClick: () => mt(e, t),
447
- children: $ == null ? void 0 : $.map((s, o) => {
448
- var r;
446
+ onClick: () => bt(e, t),
447
+ children: q == null ? void 0 : q.map((s, r) => {
448
+ var o;
449
449
  return !(s != null && s.mobileHide) && /* @__PURE__ */ n.jsxs(
450
450
  "div",
451
451
  {
@@ -456,21 +456,21 @@ function hs({
456
456
  `${s.title}`,
457
457
  ":"
458
458
  ] }),
459
- /* @__PURE__ */ n.jsx("div", { className: "value", children: ((r = s == null ? void 0 : s.render) == null ? void 0 : r.call(
459
+ /* @__PURE__ */ n.jsx("div", { className: "value", children: ((o = s == null ? void 0 : s.render) == null ? void 0 : o.call(
460
460
  s,
461
- fs(e, (s == null ? void 0 : s.dataIndex) || ""),
461
+ ms(e, (s == null ? void 0 : s.dataIndex) || ""),
462
462
  e,
463
463
  t
464
464
  )) || (e == null ? void 0 : e[s.dataIndex]) })
465
465
  ]
466
466
  },
467
- o
467
+ r
468
468
  );
469
469
  })
470
470
  },
471
471
  t
472
472
  )),
473
- Array.from({ length: v.mobile ?? 2 }).map((e, t) => /* @__PURE__ */ n.jsx(
473
+ Array.from({ length: F.mobile ?? 2 }).map((e, t) => /* @__PURE__ */ n.jsx(
474
474
  "div",
475
475
  {
476
476
  className: "listItem",
@@ -478,13 +478,13 @@ function hs({
478
478
  display: c ? "block" : "none",
479
479
  backgroundColor: f == null ? void 0 : f.listItemBgColor
480
480
  },
481
- children: /* @__PURE__ */ n.jsx("div", { className: "row", children: de ? de() : /* @__PURE__ */ n.jsx(
482
- Vt,
481
+ children: /* @__PURE__ */ n.jsx("div", { className: "row", children: fe ? fe() : /* @__PURE__ */ n.jsx(
482
+ _t,
483
483
  {
484
484
  title: !1,
485
485
  paragraph: {
486
- rows: ve,
487
- width: Ae
486
+ rows: Ae,
487
+ width: Fe
488
488
  },
489
489
  active: !0
490
490
  }
@@ -502,27 +502,27 @@ function hs({
502
502
  j ? N : 0,
503
503
  j ? f : 0,
504
504
  j ? k : 0,
505
- j ? $ : 0,
506
- j ? v : 0,
507
- j ? de : 0
505
+ j ? q : 0,
506
+ j ? F : 0,
507
+ j ? fe : 0
508
508
  ]);
509
- Ee(() => {
509
+ Je(() => {
510
510
  i.setSelected(!!(m != null && m.num));
511
511
  }, [m]);
512
- const Ve = a(() => /* @__PURE__ */ n.jsxs("div", { className: "alert", children: [
512
+ const _e = a(() => /* @__PURE__ */ n.jsxs("div", { className: "alert", children: [
513
513
  /* @__PURE__ */ n.jsx(
514
- Qe,
514
+ Ue,
515
515
  {
516
516
  highlightTag: "strong",
517
- keywords: `${L}`,
518
- sourceString: `共 ${L} 条`,
517
+ keywords: `${$}`,
518
+ sourceString: `共 ${$} 条`,
519
519
  tagClass: "totalText"
520
520
  }
521
521
  ),
522
522
  !!m && /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
523
- /* @__PURE__ */ n.jsx(xe.Text, { className: "splitBorder", children: "/" }),
523
+ /* @__PURE__ */ n.jsx(ge.Text, { className: "splitBorder", children: "/" }),
524
524
  /* @__PURE__ */ n.jsx(
525
- Qe,
525
+ Ue,
526
526
  {
527
527
  highlightTag: "strong",
528
528
  keywords: `${(m == null ? void 0 : m.num) ?? 0}`,
@@ -530,7 +530,7 @@ function hs({
530
530
  }
531
531
  ),
532
532
  !!(m != null && m.num) && /* @__PURE__ */ n.jsx(
533
- xe.Link,
533
+ ge.Link,
534
534
  {
535
535
  className: "cleanSelected",
536
536
  onClick: m == null ? void 0 : m.onClear,
@@ -538,53 +538,62 @@ function hs({
538
538
  }
539
539
  )
540
540
  ] })
541
- ] }), [L, m]), Kt = (e) => {
542
- c || fe == null || fe(e);
543
- }, _e = ie(() => D ? {
544
- row: (e) => rs({ ...e, loading: c == null ? void 0 : c.toString() })
545
- } : {}, [D, D ? c : !1]), Ie = ie(
541
+ ] }), [$, m]), Kt = (e) => {
542
+ c || me == null || me(e);
543
+ }, Ie = ae(() => Y ? {
544
+ row: (e) => is({ ...e, loading: c == null ? void 0 : c.toString() })
545
+ } : {}, [Y, Y ? c : !1]), De = ae(
546
546
  (e) => {
547
- var o, r;
548
- if (E)
549
- return is({ ...e, hasScrollBar: M, scrollbarSize: B });
547
+ var r, o;
548
+ if (Q)
549
+ return as({ ...e, hasScrollBar: M, scrollbarSize: W });
550
550
  const t = { ...e };
551
- return ((o = t.className) == null ? void 0 : o.includes(
551
+ return ((r = t.className) == null ? void 0 : r.includes(
552
552
  "ant-table-cell-fix-right"
553
- )) && !M && ((r = t.style) != null && r.right) && (t.style = { ...t.style ?? {} }, t.style.right = Number(t.style.right ?? 0) - (B || 0)), /* @__PURE__ */ n.jsx("th", { ...t });
553
+ )) && !M && ((o = t.style) != null && o.right) && (t.style = { ...t.style ?? {} }, t.style.right = Number(t.style.right ?? 0) - (W || 0)), /* @__PURE__ */ n.jsx("th", { ...t });
554
554
  },
555
- [M, B, E]
555
+ [M, W, Q]
556
556
  ), Ot = a(() => ({
557
557
  ...R,
558
558
  header: {
559
559
  ...R == null ? void 0 : R.header,
560
- cell: Ie
560
+ cell: De
561
561
  },
562
562
  body: {
563
563
  ...R == null ? void 0 : R.body,
564
- ..._e()
564
+ ...Ie()
565
+ }
566
+ }), [R, De, Ie]), Vt = a(() => {
567
+ var e;
568
+ if (console.log("mergeColumns--::>", _), (_ == null ? void 0 : _.length) > 5 && (H != null && H.current)) {
569
+ const t = _.reduce(
570
+ (r, o) => (o.fixed && (r += o.width), r),
571
+ 0
572
+ ), s = (e = H == null ? void 0 : H.current) == null ? void 0 : e.clientWidth;
573
+ return console.log("::::", t, s), t > s - 200;
565
574
  }
566
- }), [R, Ie, _e]);
575
+ }, [_]);
567
576
  return /* @__PURE__ */ n.jsxs(
568
577
  "div",
569
578
  {
570
- className: ce("bitzTableBlock", {
579
+ className: ue("bitzTableBlock", {
571
580
  fullscreen: i.fullscreen
572
581
  }),
573
- style: Rt,
574
- ...Ze,
582
+ style: $t,
583
+ ...ve,
575
584
  children: [
576
- !j && /* @__PURE__ */ n.jsxs("div", { ref: P, className: Lt, style: $t, children: [
577
- /* @__PURE__ */ n.jsxs("div", { className: "bitzTableContainerBody", ref: me, children: [
585
+ !j && /* @__PURE__ */ n.jsxs("div", { ref: P, className: Lt, style: Rt, children: [
586
+ /* @__PURE__ */ n.jsxs("div", { className: "bitzTableContainerBody", ref: H, children: [
578
587
  nt && /* @__PURE__ */ n.jsxs("div", { className: "bitzTableToolbarBlock", children: [
579
588
  ot || /* @__PURE__ */ n.jsx("div", {}),
580
- rt,
581
- lt
589
+ lt,
590
+ it
582
591
  ] }),
583
592
  /* @__PURE__ */ n.jsx(
584
593
  "div",
585
594
  {
586
595
  className: "stretchLine",
587
- ref: Me,
596
+ ref: pe,
588
597
  style: {
589
598
  background: S.colorPrimary,
590
599
  // bottom: hasScrollBar ? 'var(--scrollbar-width)' : 0,
@@ -592,83 +601,93 @@ function hs({
592
601
  }
593
602
  }
594
603
  ),
595
- /* @__PURE__ */ n.jsx(
596
- ls,
604
+ /* @__PURE__ */ n.jsxs(
605
+ cs,
597
606
  {
598
- enabledRowDragSort: D,
599
- dataSource: ne,
600
- mergeRowKey: qe,
607
+ enabledRowDragSort: Y,
608
+ dataSource: oe,
609
+ mergeRowKey: Ke,
601
610
  onDragEnd: Kt,
602
- children: /* @__PURE__ */ n.jsx(
603
- _t,
604
- {
605
- ...b,
606
- bordered: ee,
607
- columns: Bt,
608
- dataSource: ne,
609
- loading: !1,
610
- pagination: !1,
611
- scroll: { ...oe, ...zt },
612
- expandable: pt,
613
- rowSelection: Pt,
614
- onRow: Ht,
615
- rowHoverable: at,
616
- rowClassName: qt,
617
- className: "bitzTable",
618
- components: Ot,
619
- rowKey: qe,
620
- onChange: yt,
621
- ref: he
622
- }
623
- )
611
+ children: [
612
+ Vt && /* @__PURE__ */ n.jsx(
613
+ It,
614
+ {
615
+ closable: !0,
616
+ type: "error",
617
+ message: "表格固定列的宽度超过表格宽度,影响表格显示效果;请重新拖拽列宽度或点击表格设置调整固定列配置。"
618
+ }
619
+ ),
620
+ /* @__PURE__ */ n.jsx(
621
+ Dt,
622
+ {
623
+ ...b,
624
+ bordered: se,
625
+ columns: _,
626
+ dataSource: oe,
627
+ loading: !1,
628
+ pagination: !1,
629
+ scroll: { ...le, ...Nt },
630
+ expandable: pt,
631
+ rowSelection: Pt,
632
+ onRow: Ht,
633
+ rowHoverable: ut,
634
+ rowClassName: qt,
635
+ className: "bitzTable",
636
+ components: Ot,
637
+ rowKey: Ke,
638
+ onChange: Ct,
639
+ ref: be
640
+ }
641
+ )
642
+ ]
624
643
  }
625
644
  )
626
645
  ] }),
627
- J && !!L && /* @__PURE__ */ n.jsxs("div", { className: "bitzTablePagination", ref: be, children: [
628
- Ve,
646
+ U && !!$ && /* @__PURE__ */ n.jsxs("div", { className: "bitzTablePagination", ref: ye, children: [
647
+ _e,
629
648
  /* @__PURE__ */ n.jsx(
630
- Gt,
649
+ Et,
631
650
  {
632
651
  size: "small",
633
- enableControl: Fe,
652
+ enableControl: et,
634
653
  pagination: N,
635
- total: L,
654
+ total: $,
636
655
  dataSource: g,
637
- resetPage: it,
656
+ resetPage: ct,
638
657
  hideTotalText: !0,
639
- paginationEmit: Ct
658
+ paginationEmit: wt
640
659
  }
641
660
  )
642
661
  ] }),
643
- !J && !!m && !!L && /* @__PURE__ */ n.jsx("div", { className: "bitzTablePagination", ref: be, children: Ve })
662
+ !U && !!m && !!$ && /* @__PURE__ */ n.jsx("div", { className: "bitzTablePagination", ref: ye, children: _e })
644
663
  ] }),
645
664
  j && /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
646
- (c || !!(g != null && g.length)) && /* @__PURE__ */ n.jsx(n.Fragment, { children: Te ? (
665
+ (c || !!(g != null && g.length)) && /* @__PURE__ */ n.jsx(n.Fragment, { children: je ? (
647
666
  // @ts-ignore
648
667
  /* @__PURE__ */ n.jsx(
649
- Jt,
668
+ Ut,
650
669
  {
651
- onRefresh: async () => !c && Te(),
652
- children: Oe
670
+ onRefresh: async () => !c && je(),
671
+ children: Ve
653
672
  }
654
673
  )
655
- ) : Oe }),
656
- !c && /* @__PURE__ */ n.jsx(Yt, { data: g, title: tt, img: st }),
674
+ ) : Ve }),
675
+ !c && /* @__PURE__ */ n.jsx(Jt, { data: g, title: st, img: rt }),
657
676
  /* @__PURE__ */ n.jsx(
658
- Dt,
677
+ Yt,
659
678
  {
660
679
  className: "tableMobileDrawer",
661
680
  open: dt,
662
681
  placement: "bottom",
663
682
  height: "auto",
664
683
  closable: !1,
665
- onClose: Se,
684
+ onClose: Me,
666
685
  children: /* @__PURE__ */ n.jsxs("div", { className: "drawerBox", children: [
667
- /* @__PURE__ */ n.jsx("div", { className: "boxBody", children: ht ? /* @__PURE__ */ n.jsx("div", { className: "operaList", children: /* @__PURE__ */ n.jsx(It, {}) }) : se.map((e, t) => /* @__PURE__ */ n.jsx(
686
+ /* @__PURE__ */ n.jsx("div", { className: "boxBody", children: mt ? /* @__PURE__ */ n.jsx("div", { className: "operaList", children: /* @__PURE__ */ n.jsx(Gt, {}) }) : ne.map((e, t) => /* @__PURE__ */ n.jsx(
668
687
  "div",
669
688
  {
670
689
  className: "operaList",
671
- onClick: () => bt(e, t),
690
+ onClick: () => yt(e, t),
672
691
  ...e.danger && {
673
692
  style: { color: S.colorError }
674
693
  },
@@ -677,7 +696,7 @@ function hs({
677
696
  t
678
697
  )) }),
679
698
  /* @__PURE__ */ n.jsx("div", { className: "boxLine" }),
680
- /* @__PURE__ */ n.jsx("div", { className: "boxFooter", onClick: Se, children: et })
699
+ /* @__PURE__ */ n.jsx("div", { className: "boxFooter", onClick: Me, children: tt })
681
700
  ] })
682
701
  }
683
702
  )
@@ -686,7 +705,7 @@ function hs({
686
705
  }
687
706
  );
688
707
  }
689
- const Qs = (J) => /* @__PURE__ */ n.jsx(Qt, { initValue: J, children: /* @__PURE__ */ n.jsx(hs, { ...J }) });
708
+ const Xs = (U) => /* @__PURE__ */ n.jsx(Xt, { initValue: U, children: /* @__PURE__ */ n.jsx(bs, { ...U }) });
690
709
  export {
691
- Qs as default
710
+ Xs as default
692
711
  };