bitz-react-admin-ui 2.7.6 → 2.7.8

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