bitz-react-admin-ui 2.5.0 → 2.5.2

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