bitz-react-admin-ui 2.4.9 → 2.5.1

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