bitz-react-admin-ui 2.6.5 → 2.6.7

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