bitz-react-admin-ui 2.3.2 → 2.3.3

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,5 +1,5 @@
1
1
  import { j as o } from "../../../node_modules/.store/react@18.2.0/node_modules/react/jsx-runtime.mjs";
2
- import { useContext as Ne, useRef as V, useState as k, useEffect as ke, useMemo as c, useCallback as K } from "react";
2
+ import { useContext as Ne, useRef as q, useState as k, useEffect as ke, useMemo as c, useCallback as K } from "react";
3
3
  import { isMobile as O } from "../../../node_modules/.store/react-device-detect@2.2.3/node_modules/react-device-detect/dist/lib.mjs";
4
4
  import { Skeleton as gt, Typography as Se, Table as wt } from "antd";
5
5
  import oe from "../../../node_modules/.store/classnames@2.5.1/node_modules/classnames/index.mjs";
@@ -22,18 +22,18 @@ import Rt from "../../../node_modules/.store/antd@5.16.2/node_modules/antd/local
22
22
  import { getColumnsWithTool as Ht, loopBuildSkeleton as $t } from "./utils.mjs";
23
23
  import { getCssVar as Ft } from "./style.mjs";
24
24
  import Vt from "./SortableRow.mjs";
25
- import Kt from "./SortTableContext.mjs";
25
+ import qt from "./SortTableContext.mjs";
26
26
  import "./index.less.mjs";
27
- import { ConfigContext as Ot } from "../../../node_modules/.store/antd@5.16.2/node_modules/antd/es/config-provider/context.mjs";
28
- import qt from "../../../node_modules/.store/lodash-es@4.17.21/node_modules/lodash-es/at.mjs";
27
+ import { ConfigContext as Kt } from "../../../node_modules/.store/antd@5.16.2/node_modules/antd/es/config-provider/context.mjs";
28
+ import Ot from "../../../node_modules/.store/lodash-es@4.17.21/node_modules/lodash-es/at.mjs";
29
29
  function Dt({
30
- showPagination: v = !0,
31
- height: R,
30
+ showPagination: R = !0,
31
+ height: H,
32
32
  dataSource: b,
33
33
  total: j = 0,
34
- columns: q,
34
+ columns: D,
35
35
  loading: l,
36
- skeletonNum: D = {
36
+ skeletonNum: _ = {
37
37
  pc: 10,
38
38
  mobile: 10
39
39
  },
@@ -41,53 +41,53 @@ function Dt({
41
41
  skeletonRowNum: Le = 4,
42
42
  skeletonRowsWidth: Pe = ["35%", "100%", "100%", "60%"],
43
43
  // mobileLoadEmit,
44
- mobileRefreshEmit: ie,
45
- operationFilter: _,
44
+ mobileRefreshEmit: le,
45
+ operationFilter: G,
46
46
  enableControlPage: ve,
47
- pagination: y,
48
- paginationEmit: $ = () => {
47
+ pagination: x,
48
+ paginationEmit: F = () => {
49
49
  },
50
50
  enabledRowDragSort: S,
51
- onRowDragEnd: G,
51
+ onRowDragEnd: I,
52
52
  mobilePageHeight: _t = 500,
53
53
  mobileCancelText: Re = "取消",
54
54
  noDataTitle: He,
55
55
  noDataImg: $e,
56
56
  color: Gt,
57
- size: le,
57
+ size: ie,
58
58
  showTableTool: Fe = !0,
59
59
  tableAction: Ve,
60
- tableToolbar: Ke,
61
- selectionBar: Oe,
60
+ tableToolbar: qe,
61
+ selectionBar: Ke,
62
62
  scroll: i,
63
63
  components: z,
64
64
  expandable: g,
65
65
  rowSelection: T,
66
66
  selectionAlert: u,
67
- resetPage: qe,
67
+ resetPage: Oe,
68
68
  ...f
69
69
  }) {
70
70
  var We;
71
71
  const { token: w } = Lt.useToken(), { Table: h } = w, {
72
72
  tableSpaceBetweenPage: ae = 10,
73
73
  cellPaddingInline: De = Pt
74
- } = h, { showColumnBorder: _e, hideRowBorder: ce, rowHoverable: Ge, ...m } = Ne(Nt), C = V(void 0), [I, Ie] = k(0), [J, Je] = k(0), [Q, Qe] = k(0), [Ue, U] = k(!1), [x, Xe] = k([]);
74
+ } = h, { showColumnBorder: _e, hideRowBorder: ce, rowHoverable: Ge, ...m } = Ne(Nt), C = q(void 0), [J, Ie] = k(0), [Q, Je] = k(0), [U, Qe] = k(0), [Ue, X] = k(!1), [y, Xe] = k([]);
75
75
  ke(() => {
76
76
  let e = [...b ?? []];
77
- (y == null ? void 0 : y.page) !== 1 && (e = [...x, ...e]), Xe(e);
77
+ (x == null ? void 0 : x.page) !== 1 && (e = [...y, ...e]), Xe(e);
78
78
  }, [b]);
79
- const Ye = c(() => !!(x != null && x.length) && (x == null ? void 0 : x.length) >= j, [x, j]), [Ze, Ee] = k([]), Ae = (e, t) => {
79
+ const Ye = c(() => !!(y != null && y.length) && (y == null ? void 0 : y.length) >= j, [y, j]), [Ze, Ee] = k([]), Ae = (e, t) => {
80
80
  var s;
81
- const r = (s = _ == null ? void 0 : _(e, t)) == null ? void 0 : s.filter(
81
+ const r = (s = G == null ? void 0 : G(e, t)) == null ? void 0 : s.filter(
82
82
  (n) => n.type !== "divider"
83
83
  );
84
- r != null && r.length && (Ee(r), U(!0));
84
+ r != null && r.length && (Ee(r), X(!0));
85
85
  }, he = () => {
86
- U(!1);
86
+ X(!1);
87
87
  }, et = (e) => {
88
88
  var t;
89
- U(!1), (t = e.onClick) == null || t.call(e);
90
- }, B = V(null), X = ne(B), de = V(null), Y = ne(de), Z = V(null), M = ne(Z), tt = () => {
89
+ X(!1), (t = e.onClick) == null || t.call(e);
90
+ }, B = q(null), Y = ne(B), de = q(null), Z = ne(de), E = q(null), M = ne(E), tt = () => {
91
91
  var r;
92
92
  const e = (r = B.current) == null ? void 0 : r.querySelectorAll(
93
93
  "& > .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)"
@@ -100,16 +100,20 @@ function Dt({
100
100
  }), t.length)
101
101
  return Math.ceil(Math.max(...t)) + De * 2;
102
102
  }, ue = () => {
103
- var a, d, P;
104
- const e = (a = B.current) == null ? void 0 : a.querySelector(
105
- (i == null ? void 0 : i.x) === 1 ? ".ant-table-content" : ".ant-table-body"
106
- ), t = e == null ? void 0 : e.clientWidth, s = ((e == null ? void 0 : e.offsetWidth) || 0) - t > 0, n = (P = (d = B.current) == null ? void 0 : d.querySelector(
103
+ var a, d, P, v;
104
+ let e = (a = B.current) == null ? void 0 : a.querySelector(
105
+ ".ant-table-content"
106
+ );
107
+ e || (e = (d = B.current) == null ? void 0 : d.querySelector(
108
+ ".ant-table-body"
109
+ ));
110
+ const t = e == null ? void 0 : e.clientWidth, s = ((e == null ? void 0 : e.offsetWidth) || 0) - t > 0, n = (v = (P = B.current) == null ? void 0 : P.querySelector(
107
111
  ".ant-table-cell-scrollbar"
108
- )) == null ? void 0 : P.offsetWidth;
112
+ )) == null ? void 0 : v.offsetWidth;
109
113
  return { tbodyWidth: t, hasScrollBar: s, scrollbarSize: n };
110
- }, { y: E, tbodyWidth: L, hasScrollBar: F, scrollbarSize: H } = c(() => {
114
+ }, { y: A, tbodyWidth: L, hasScrollBar: V, scrollbarSize: $ } = c(() => {
111
115
  const { tbodyWidth: e, hasScrollBar: t, scrollbarSize: r } = ue();
112
- if (typeof R > "u")
116
+ if (typeof H > "u")
113
117
  return {
114
118
  tbodyWidth: e,
115
119
  hasScrollBar: t,
@@ -121,17 +125,17 @@ function Dt({
121
125
  s = parseInt(W.getPropertyValue("--cell-height")), n = parseInt(W.getPropertyValue("--toolbar-height"));
122
126
  }
123
127
  const a = (M == null ? void 0 : M.height) || 0, d = a ? ae : 0;
124
- return { y: (m.fullscreen ? window.innerHeight : R) - a - d - n - s, tbodyWidth: e, hasScrollBar: t, scrollbarSize: r };
128
+ return { y: (m.fullscreen ? window.innerHeight : H) - a - d - n - s, tbodyWidth: e, hasScrollBar: t, scrollbarSize: r };
125
129
  }, [
126
130
  m.fullscreen,
127
- R,
131
+ H,
128
132
  M == null ? void 0 : M.height,
129
- X == null ? void 0 : X.height,
130
- Y == null ? void 0 : Y.height
131
- ]), A = c(() => {
133
+ Y == null ? void 0 : Y.height,
134
+ Z == null ? void 0 : Z.height
135
+ ]), ee = c(() => {
132
136
  let e = (i == null ? void 0 : i.x) ?? 1e3;
133
- return I && (e -= I), J && C.current && (e -= J * C.current), L && (i != null && i.x && e < L && (i == null ? void 0 : i.x) > L && Qe(L - e), e = Math.max(e, L)), i != null && i.x ? { x: e, y: i.y || E } : i != null && i.y ? { x: e, y: i.y } : { x: e, y: E };
134
- }, [i, E, L, I, J]), rt = () => {
137
+ return J && (e -= J), Q && C.current && (e -= Q * C.current), L && (i != null && i.x && e < L && (i == null ? void 0 : i.x) > L && Qe(L - e), e = Math.max(e, L)), i != null && i.x ? { x: e, y: i.y || A } : i != null && i.y ? { x: e, y: i.y } : { x: e, y: A };
138
+ }, [i, A, L, J, Q]), rt = () => {
135
139
  let e = 0;
136
140
  if (B.current) {
137
141
  const r = window.getComputedStyle(B.current), s = parseInt(
@@ -142,38 +146,38 @@ function Dt({
142
146
  let t = 0;
143
147
  return T && (t += e), g && (t += e), S && (t += e), t;
144
148
  }, ot = (e, t) => {
145
- const r = e.length, s = e.filter((W) => W.width), a = s.map((W) => W.width).reduce((W, yt) => W + yt, 0), { tbodyWidth: d } = ue(), re = Math.max((i == null ? void 0 : i.x) ?? 0, d ?? 0) - a - t, Te = r - s.length;
146
- return re >= 0 ? Math.floor(re / Te) : 0;
149
+ const r = e.length, s = e.filter((W) => W.width), a = s.map((W) => W.width).reduce((W, xt) => W + xt, 0), { tbodyWidth: d } = ue(), v = Math.max((i == null ? void 0 : i.x) ?? 0, d ?? 0) - a - t, Te = r - s.length;
150
+ return v >= 0 ? Math.floor(v / Te) : 0;
147
151
  }, { sortColumns: p, toolColWidth: fe } = c(() => {
148
- const t = (q ?? []).filter((P) => !kt.includes(P)), { filterColumns: r, hiddenTotalWidth: s, autoWidthColLength: n } = St(
152
+ const t = (D ?? []).filter((P) => !kt.includes(P)), { filterColumns: r, hiddenTotalWidth: s, autoWidthColLength: n } = St(
149
153
  t,
150
154
  m.columnsMap
151
155
  ), a = r.sort(Mt(m.columnsMap));
152
156
  let d = 0;
153
157
  return O || (d = rt(), C.current = ot(t, d), Ie(s), Je(n)), { sortColumns: a, toolColWidth: d };
154
- }, [m.columnsMap, q]), [ee, nt] = k([]);
158
+ }, [m.columnsMap, D]), [te, nt] = k([]);
155
159
  ke(() => {
156
160
  if (C.current) {
157
161
  let e = 0;
158
- if (Q) {
162
+ if (U) {
159
163
  const n = p == null ? void 0 : p.filter(
160
164
  (a) => !a.width && !(a != null && a.isOperationCol)
161
165
  ).length;
162
- e = Math.floor(Q / n);
166
+ e = Math.floor(U / n);
163
167
  }
164
168
  let t = 0, r = -1;
165
169
  const s = p.map((n, a) => {
166
170
  let d = n.width;
167
171
  return n != null && n.isOperationCol && (r = a, n != null && n.useMaxWidth && (d = tt() ?? n.width)), !d && (C != null && C.current) && (d = C.current + e), t += d ?? 0, d;
168
172
  });
169
- if (t < A.x - fe) {
170
- const n = A.x - fe - t;
173
+ if (t < ee.x - fe) {
174
+ const n = ee.x - fe - t;
171
175
  let a = 0;
172
176
  r === 0 && s.length > 1 && a++, s[a] = (s[a] ?? 0) + n;
173
177
  }
174
178
  nt(s);
175
179
  }
176
- }, [p, Q]);
180
+ }, [p, U]);
177
181
  const N = c(() => {
178
182
  if (O)
179
183
  return p;
@@ -182,25 +186,25 @@ function Dt({
182
186
  // ...(sortColumns[i + 1]?.isOperationCol && {
183
187
  // className: classNames(v.className, 'disabledResize'),
184
188
  // }),
185
- width: ee.length ? ee[r] : C == null ? void 0 : C.current
189
+ width: te.length ? te[r] : C == null ? void 0 : C.current
186
190
  // onHeaderCell: (column: BitzTableColumnsType<T>[number]) => ({
187
191
  // width: column.width,
188
192
  // onResize: handleResize(i) as React.ReactEventHandler<any>,
189
193
  // }),
190
194
  }));
191
195
  return Ht(
192
- q,
196
+ D,
193
197
  e,
194
198
  S,
195
199
  !!T,
196
200
  !!g
197
201
  );
198
- }, [p, ee]), me = c(() => $t(N), [N]), st = c(() => l ? me : N, [l, N, me]), be = c(() => {
199
- const e = (b ?? []).length, t = e > (D.pc ?? 10) ? e >= 20 ? 20 : e : D.pc ?? 10;
202
+ }, [p, te]), me = c(() => $t(N), [N]), st = c(() => l ? me : N, [l, N, me]), be = c(() => {
203
+ const e = (b ?? []).length, t = e > (_.pc ?? 10) ? e >= 20 ? 20 : e : _.pc ?? 10;
200
204
  return Array.from({ length: t }).map((s, n) => ({
201
205
  key: `${Date.now()}${n}`
202
206
  }));
203
- }, [b]), Ce = c(() => l ? be : b ?? [], [l, b, be]), { table: te, locale: it = Rt } = Ne(Ot), lt = { ...it.Table }, at = ((We = te == null ? void 0 : te.expandable) == null ? void 0 : We.expandIcon) || (g == null ? void 0 : g.expandIcon) || vt(lt), xe = c(() => {
207
+ }, [b]), Ce = c(() => l ? be : b ?? [], [l, b, be]), { table: re, locale: lt = Rt } = Ne(Kt), it = { ...lt.Table }, at = ((We = re == null ? void 0 : re.expandable) == null ? void 0 : We.expandIcon) || (g == null ? void 0 : g.expandIcon) || vt(it), ye = c(() => {
204
208
  if (g)
205
209
  return {
206
210
  ...g,
@@ -220,14 +224,14 @@ function Dt({
220
224
  };
221
225
  }
222
226
  };
223
- }, [g]), ct = c(() => l ? xe : g, [l, g, xe]), ye = c(() => {
227
+ }, [g]), ct = c(() => l ? ye : g, [l, g, ye]), xe = c(() => {
224
228
  if (T)
225
229
  return {
226
230
  ...T,
227
231
  selectedRowKeys: [],
228
232
  getCheckboxProps: () => ({ disabled: !0 })
229
233
  };
230
- }, [T]), ht = c(() => l ? ye : T, [l, T, ye]), ge = c(() => l ? "key" : f.rowKey, [l, f.rowKey]), we = c(() => `${le ?? m.stylesConfig.size}BitzTable`, [le, m.stylesConfig.size]), dt = K(
234
+ }, [T]), ht = c(() => l ? xe : T, [l, T, xe]), ge = c(() => l ? "key" : f.rowKey, [l, f.rowKey]), we = c(() => `${ie ?? m.stylesConfig.size}BitzTable`, [ie, m.stylesConfig.size]), dt = K(
231
235
  (e, t) => {
232
236
  var s;
233
237
  if (!f.onRow || l)
@@ -239,21 +243,21 @@ function Dt({
239
243
  ), ut = c(() => oe(
240
244
  "bitzTableContainer",
241
245
  { hideBorder: ce },
242
- { hasScrollBar: F },
246
+ { hasScrollBar: V },
243
247
  we,
244
248
  f.className
245
249
  ), [
246
250
  f.className,
247
251
  we,
248
- F,
252
+ V,
249
253
  m.fullscreen,
250
254
  ce
251
255
  ]), ft = c(() => ({
252
256
  "--container-bgColor": w.colorBgContainer
253
257
  }), [w.colorBgContainer]), mt = c(() => {
254
- const e = m.fullscreen ? "100%" : R;
258
+ const e = m.fullscreen ? "100%" : H;
255
259
  let t;
256
- return (H ?? 0) > 0 && (t = H), Ft({
260
+ return ($ ?? 0) > 0 && (t = $), Ft({
257
261
  height: e,
258
262
  fontFamily: w.fontFamily,
259
263
  evenRowBgColor: m.zebra ? h == null ? void 0 : h.evenRowBgColor : w.colorBgContainer,
@@ -267,10 +271,10 @@ function Dt({
267
271
  }, [
268
272
  f.style,
269
273
  m.fullscreen,
270
- R,
274
+ H,
271
275
  h,
272
276
  m == null ? void 0 : m.zebra,
273
- H
277
+ $
274
278
  ]), bt = K(
275
279
  (e, t, r) => {
276
280
  const s = t % 2 === 0 ? "oddRow" : "evenRow";
@@ -287,7 +291,7 @@ function Dt({
287
291
  finished: Ye,
288
292
  onLoad: async () => (
289
293
  // @ts-ignore
290
- !l && ($ == null ? void 0 : $((y == null ? void 0 : y.page) + 1, y == null ? void 0 : y.size))
294
+ !l && (F == null ? void 0 : F((x == null ? void 0 : x.page) + 1, x == null ? void 0 : x.size))
291
295
  ),
292
296
  loadingText: "加载中...",
293
297
  finishedText: "没有更多了",
@@ -298,7 +302,7 @@ function Dt({
298
302
  className: "mobileList",
299
303
  style: { backgroundColor: h == null ? void 0 : h.mobileListBgColor },
300
304
  children: [
301
- x == null ? void 0 : x.map((e, t) => /* @__PURE__ */ o.jsx(
305
+ y == null ? void 0 : y.map((e, t) => /* @__PURE__ */ o.jsx(
302
306
  "div",
303
307
  {
304
308
  className: "listItem",
@@ -318,7 +322,7 @@ function Dt({
318
322
  ] }),
319
323
  /* @__PURE__ */ o.jsx("div", { className: "value", children: ((n = r == null ? void 0 : r.render) == null ? void 0 : n.call(
320
324
  r,
321
- qt(e, (r == null ? void 0 : r.dataIndex) || ""),
325
+ Ot(e, (r == null ? void 0 : r.dataIndex) || ""),
322
326
  e,
323
327
  t
324
328
  )) || (e == null ? void 0 : e[r.dataIndex]) })
@@ -330,7 +334,7 @@ function Dt({
330
334
  },
331
335
  t
332
336
  )),
333
- Array.from({ length: D.mobile ?? 2 }).map((e, t) => /* @__PURE__ */ o.jsx(
337
+ Array.from({ length: _.mobile ?? 2 }).map((e, t) => /* @__PURE__ */ o.jsx(
334
338
  "div",
335
339
  {
336
340
  className: "listItem",
@@ -386,8 +390,7 @@ function Dt({
386
390
  )
387
391
  ] })
388
392
  ] }), [j, u]), Ct = (e) => {
389
- var t;
390
- l || e.active.id !== ((t = e.over) == null ? void 0 : t.id) && (G == null || G(e));
393
+ l || I == null || I(e);
391
394
  }, ze = K(() => S ? {
392
395
  row: (e) => Vt({ ...e, loading: l == null ? void 0 : l.toString() })
393
396
  } : {}, [S, S ? l : !1]), pe = K(
@@ -396,10 +399,10 @@ function Dt({
396
399
  const t = { ...e };
397
400
  return ((s = t.className) == null ? void 0 : s.includes(
398
401
  "ant-table-cell-fix-right"
399
- )) && !F && ((n = t.style) != null && n.right) && (t.style = { ...t.style ?? {} }, t.style.right = Number(t.style.right ?? 0) - (H || 0)), /* @__PURE__ */ o.jsx("th", { ...t });
402
+ )) && !V && ((n = t.style) != null && n.right) && (t.style = { ...t.style ?? {} }, t.style.right = Number(t.style.right ?? 0) - ($ || 0)), /* @__PURE__ */ o.jsx("th", { ...t });
400
403
  },
401
- [F, H]
402
- ), xt = c(() => ({
404
+ [V, $]
405
+ ), yt = c(() => ({
403
406
  ...z,
404
407
  header: {
405
408
  ...z == null ? void 0 : z.header,
@@ -422,11 +425,11 @@ function Dt({
422
425
  /* @__PURE__ */ o.jsxs("div", { className: "bitzTableContainerBody", ref: de, children: [
423
426
  Fe && /* @__PURE__ */ o.jsxs("div", { className: "bitzTableToolbarBlock", children: [
424
427
  Ve || /* @__PURE__ */ o.jsx("div", {}),
425
- Ke,
426
- Oe
428
+ qe,
429
+ Ke
427
430
  ] }),
428
431
  /* @__PURE__ */ o.jsx(
429
- Kt,
432
+ qt,
430
433
  {
431
434
  enabledRowDragSort: S,
432
435
  dataSource: Ce,
@@ -441,45 +444,45 @@ function Dt({
441
444
  dataSource: Ce,
442
445
  loading: !1,
443
446
  pagination: !1,
444
- scroll: A,
447
+ scroll: ee,
445
448
  expandable: ct,
446
449
  rowSelection: ht,
447
450
  onRow: dt,
448
451
  rowHoverable: Ge,
449
452
  rowClassName: bt,
450
453
  className: "bitzTable",
451
- components: xt,
454
+ components: yt,
452
455
  rowKey: ge
453
456
  }
454
457
  )
455
458
  }
456
459
  )
457
460
  ] }),
458
- v && !!j && /* @__PURE__ */ o.jsxs("div", { className: "bitzTablePagination", ref: Z, children: [
461
+ R && !!j && /* @__PURE__ */ o.jsxs("div", { className: "bitzTablePagination", ref: E, children: [
459
462
  je,
460
463
  /* @__PURE__ */ o.jsx(
461
464
  jt,
462
465
  {
463
466
  size: "small",
464
467
  enableControl: ve,
465
- pagination: y,
468
+ pagination: x,
466
469
  total: j,
467
470
  dataSource: b,
468
- resetPage: qe,
471
+ resetPage: Oe,
469
472
  hideTotalText: !0,
470
- paginationEmit: $
473
+ paginationEmit: F
471
474
  }
472
475
  )
473
476
  ] }),
474
- !v && !!u && !!j && /* @__PURE__ */ o.jsx("div", { className: "bitzTablePagination", ref: Z, children: je })
477
+ !R && !!u && !!j && /* @__PURE__ */ o.jsx("div", { className: "bitzTablePagination", ref: E, children: je })
475
478
  ] }),
476
479
  O && /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
477
- (l || !!(b != null && b.length)) && /* @__PURE__ */ o.jsx(o.Fragment, { children: ie ? (
480
+ (l || !!(b != null && b.length)) && /* @__PURE__ */ o.jsx(o.Fragment, { children: le ? (
478
481
  // @ts-ignore
479
482
  /* @__PURE__ */ o.jsx(
480
483
  Wt,
481
484
  {
482
- onRefresh: async () => !l && ie(),
485
+ onRefresh: async () => !l && le(),
483
486
  children: Be
484
487
  }
485
488
  )
@@ -517,7 +520,7 @@ function Dt({
517
520
  }
518
521
  );
519
522
  }
520
- const gr = (v) => /* @__PURE__ */ o.jsx(Tt, { initValue: v, children: /* @__PURE__ */ o.jsx(Dt, { ...v }) });
523
+ const gr = (R) => /* @__PURE__ */ o.jsx(Tt, { initValue: R, children: /* @__PURE__ */ o.jsx(Dt, { ...R }) });
521
524
  export {
522
525
  gr as default
523
526
  };
@@ -1,11 +1,11 @@
1
1
  import { j as r } from "../../../../node_modules/.store/react@18.2.0/node_modules/react/jsx-runtime.mjs";
2
- import { Modal as N, Typography as k, Card as B, Flex as u } from "antd";
3
- import { useMemo as m, useState as F, useRef as f } from "react";
2
+ import { Modal as N, Typography as k, Card as B, Flex as m } from "antd";
3
+ import { useMemo as f, useState as F, useRef as h } from "react";
4
4
  import H from "../../../BitzTheme/index.mjs";
5
5
  import R from "../../../../node_modules/.store/classnames@2.5.1/node_modules/classnames/index.mjs";
6
6
  import { styles as T } from "./style.mjs";
7
7
  function $({
8
- open: h,
8
+ open: l,
9
9
  title: C,
10
10
  close: g,
11
11
  closeAfter: p,
@@ -14,11 +14,11 @@ function $({
14
14
  extra: t,
15
15
  children: j
16
16
  }) {
17
- const { token: o } = H.useToken(), n = m(() => o.mode === "dark", [o.mode]), [l, b] = F(0), M = () => {
18
- p(), b(l + 1);
19
- }, e = f(null), s = f(null), i = m(() => {
20
- var c, a, d;
21
- return e.current && s.current ? ((c = e.current) == null ? void 0 : c.clientHeight) - ((a = s.current) == null ? void 0 : a.clientHeight) - 24 : e.current && !t ? (d = e.current) == null ? void 0 : d.clientHeight : "100%";
17
+ const { token: o } = H.useToken(), n = f(() => o.mode === "dark", [o.mode]), [i, b] = F(0), M = () => {
18
+ p(), b(i + 1);
19
+ }, e = h(null), s = h(null), c = f(() => {
20
+ var a, d, u;
21
+ return e.current && s.current ? ((a = e.current) == null ? void 0 : a.clientHeight) - ((d = s.current) == null ? void 0 : d.clientHeight) - 24 : e.current && !t ? (u = e.current) == null ? void 0 : u.clientHeight : "100%";
22
22
  }, [e.current, s.current, t]);
23
23
  return /* @__PURE__ */ r.jsx(
24
24
  N,
@@ -26,7 +26,7 @@ function $({
26
26
  className: R(T(o), "tableConfigModal"),
27
27
  title: /* @__PURE__ */ r.jsx(k.Title, { style: { fontSize: 16, margin: 0 }, children: C }),
28
28
  getContainer: x,
29
- open: h,
29
+ open: l,
30
30
  onCancel: g,
31
31
  afterClose: M,
32
32
  style: {
@@ -38,7 +38,7 @@ function $({
38
38
  width: 700,
39
39
  footer: y,
40
40
  children: /* @__PURE__ */ r.jsx(B, { className: "container", bordered: !1, children: /* @__PURE__ */ r.jsxs(
41
- u,
41
+ m,
42
42
  {
43
43
  ref: e,
44
44
  vertical: !0,
@@ -47,10 +47,17 @@ function $({
47
47
  style: { height: "100%" },
48
48
  children: [
49
49
  t && /* @__PURE__ */ r.jsx("div", { className: "extraContent", ref: s, children: t }),
50
- /* @__PURE__ */ r.jsx(u, { className: "containerBody", style: { height: i || "100%" }, children: j(i) })
50
+ l && /* @__PURE__ */ r.jsx(
51
+ m,
52
+ {
53
+ className: "containerBody",
54
+ style: { height: c || "100%" },
55
+ children: j(c)
56
+ }
57
+ )
51
58
  ]
52
59
  },
53
- l
60
+ i
54
61
  ) })
55
62
  }
56
63
  );
@@ -1,76 +1,79 @@
1
- import { j as s } from "../../../../node_modules/.store/react@18.2.0/node_modules/react/jsx-runtime.mjs";
2
- import { useContext as l, useMemo as m } from "react";
3
- import { Space as x } from "antd";
4
- import u from "../RefreshIcon/index.mjs";
5
- import g from "../ColConfigIcon/index.mjs";
6
- import C from "../FullscreenIcon/index.mjs";
7
- import j from "../ExportIcon/index.mjs";
8
- import { BitzConfigContext as z } from "../../../BitzConfigProvider/context.mjs";
9
- import { BitzToolBarContext as B } from "./context.mjs";
10
- import { BitzTableContext as I } from "../../Store/index.mjs";
11
- const T = ["export", "refresh", "fullscreen", "config"], A = ({
12
- size: E,
13
- tools: i,
14
- toolsConfig: c,
1
+ import { j as r } from "../../../../node_modules/.store/react@18.2.0/node_modules/react/jsx-runtime.mjs";
2
+ import { useContext as c, useMemo as h, useRef as g, useEffect as C } from "react";
3
+ import { Flex as j, Space as z } from "antd";
4
+ import B from "../RefreshIcon/index.mjs";
5
+ import T from "../ColConfigIcon/index.mjs";
6
+ import E from "../FullscreenIcon/index.mjs";
7
+ import I from "../ExportIcon/index.mjs";
8
+ import { BitzConfigContext as R } from "../../../BitzConfigProvider/context.mjs";
9
+ import { BitzToolBarContext as b } from "./context.mjs";
10
+ import { BitzTableContext as k } from "../../Store/index.mjs";
11
+ const F = ["export", "refresh", "fullscreen", "config"], J = ({
12
+ size: W,
13
+ tools: l,
14
+ toolsConfig: m,
15
15
  exclude: t,
16
- onExport: h,
17
- onRefresh: p,
18
- onColumnChange: d
16
+ onExport: p,
17
+ onRefresh: d,
18
+ onColumnChange: a
19
19
  }) => {
20
- const { Table: r } = l(z), { selected: a } = l(I), f = m(() => {
21
- const e = i || (r == null ? void 0 : r.toolbar) || T;
22
- return t != null && t.length ? e.filter((n) => !t.includes(n)) : e;
23
- }, [r == null ? void 0 : r.toolbar, t, i]), o = m(() => {
24
- const e = {
20
+ const { Table: e } = c(R), { selected: u, setToolbarWidth: x } = c(k), i = h(() => {
21
+ const s = l || (e == null ? void 0 : e.toolbar) || F;
22
+ return t != null && t.length ? s.filter((n) => !t.includes(n)) : s;
23
+ }, [e == null ? void 0 : e.toolbar, t, l]), o = h(() => {
24
+ const s = {
25
25
  export: { order: 1, show: !1 },
26
26
  refresh: { order: 2, show: !1 },
27
27
  fullscreen: { order: 3, show: !1 },
28
28
  config: { order: 4, show: !1 }
29
29
  };
30
- return f.forEach((n, w) => {
31
- e[n].order = w + 1, e[n].show = f.includes(n);
32
- }), e;
33
- }, [f]);
34
- return /* @__PURE__ */ s.jsx(B.Provider, { value: c ?? {}, children: /* @__PURE__ */ s.jsxs(
35
- x.Compact,
30
+ return i.forEach((n, w) => {
31
+ s[n].order = w + 1, s[n].show = i.includes(n);
32
+ }), s;
33
+ }, [i]), f = g(null);
34
+ return C(() => {
35
+ f.current && x(f.current.clientWidth);
36
+ }, [f.current]), /* @__PURE__ */ r.jsx(b.Provider, { value: m ?? {}, children: /* @__PURE__ */ r.jsx(
37
+ j,
36
38
  {
37
- style: { height: "100%", ...a && { zIndex: 10 } },
38
- children: [
39
- /* @__PURE__ */ s.jsx(
40
- j,
39
+ ref: f,
40
+ style: { height: "100%", ...u && { zIndex: 10 } },
41
+ children: /* @__PURE__ */ r.jsxs(z.Compact, { children: [
42
+ /* @__PURE__ */ r.jsx(
43
+ I,
41
44
  {
42
45
  order: o.export.order,
43
46
  show: o.export.show,
44
- onClick: h
47
+ onClick: p
45
48
  }
46
49
  ),
47
- /* @__PURE__ */ s.jsx(
48
- u,
50
+ /* @__PURE__ */ r.jsx(
51
+ B,
49
52
  {
50
53
  order: o.refresh.order,
51
54
  show: o.refresh.show,
52
- onClick: p
55
+ onClick: d
53
56
  }
54
57
  ),
55
- /* @__PURE__ */ s.jsx(
56
- C,
58
+ /* @__PURE__ */ r.jsx(
59
+ E,
57
60
  {
58
61
  order: o.fullscreen.order,
59
62
  show: o.fullscreen.show
60
63
  }
61
64
  ),
62
- /* @__PURE__ */ s.jsx(
63
- g,
65
+ /* @__PURE__ */ r.jsx(
66
+ T,
64
67
  {
65
68
  order: o.config.order,
66
69
  show: o.config.show,
67
- onChange: d
70
+ onChange: a
68
71
  }
69
72
  )
70
- ]
73
+ ] })
71
74
  }
72
75
  ) });
73
76
  };
74
77
  export {
75
- A as default
78
+ J as default
76
79
  };
@@ -25,7 +25,7 @@ const R = (o, n, e) => {
25
25
  title: "序号",
26
26
  // rowScope: 'row',
27
27
  className: "numRow",
28
- width: 80,
28
+ width: 60,
29
29
  render: (r, t, c) => c + 1 + (e.page - 1) * e.size
30
30
  },
31
31
  ...l
@@ -221,7 +221,7 @@ function He({
221
221
  rowKey: t.value,
222
222
  loading: p,
223
223
  bordered: "row-column",
224
- scroll: { x: 2, y: 400 },
224
+ scroll: { x: 1, y: 400 },
225
225
  showPagination: !1,
226
226
  showTableTool: !1,
227
227
  rowSelection: N,
@@ -1,5 +1,5 @@
1
1
  import { getDefaultExportFromCjs as u } from "../../../../../_virtual/_commonjsHelpers.mjs";
2
- import { __module as i } from "../../../../../_virtual/index.mjs";
2
+ import { __module as i } from "../../../../../_virtual/index2.mjs";
3
3
  /*!
4
4
  Copyright (c) 2018 Jed Watson.
5
5
  Licensed under the MIT License (MIT), see
@@ -1,5 +1,5 @@
1
1
  import { getDefaultExportFromCjs as e } from "../../../../../_virtual/_commonjsHelpers.mjs";
2
- import { __module as r } from "../../../../../_virtual/index2.mjs";
2
+ import { __module as r } from "../../../../../_virtual/index.mjs";
3
3
  import { __require as o } from "../../../react-is@16.13.1/node_modules/react-is/index.mjs";
4
4
  import { __require as t } from "./factoryWithTypeCheckers.mjs";
5
5
  import { __require as p } from "./factoryWithThrowingShims.mjs";