bitz-react-admin-ui 2.4.8 → 2.5.0

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