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