bitz-react-admin-ui 2.2.9 → 2.3.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,20 +1,20 @@
1
1
  import { j as y } from "../../../node_modules/.store/react@18.2.0/node_modules/react/jsx-runtime.mjs";
2
2
  import { useContext as D, useRef as Z, useMemo as o, useCallback as I } from "react";
3
- import { Table as ee } from "antd";
4
- import te from "../../../node_modules/.store/classnames@2.5.1/node_modules/classnames/index.mjs";
5
- import { BitzTableContext as re, toolCols as ne } from "../Store/index.mjs";
6
- import oe from "../../../node_modules/.store/ahooks@3.7.11/node_modules/ahooks/es/useSize/index.mjs";
7
- import se from "../ActionCol/style.mjs";
8
- import ae from "../../BitzTheme/index.mjs";
9
- import le from "../../../node_modules/.store/antd@5.16.2/node_modules/antd/es/table/ExpandIcon.mjs";
3
+ import { Table as tt } from "antd";
4
+ import et from "../../../node_modules/.store/classnames@2.5.1/node_modules/classnames/index.mjs";
5
+ import { BitzTableContext as rt, toolCols as nt } from "../Store/index.mjs";
6
+ import ot from "../../../node_modules/.store/ahooks@3.7.11/node_modules/ahooks/es/useSize/index.mjs";
7
+ import st from "../ActionCol/style.mjs";
8
+ import at from "../../BitzTheme/index.mjs";
9
+ import lt from "../../../node_modules/.store/antd@5.16.2/node_modules/antd/es/table/ExpandIcon.mjs";
10
10
  import "../../../node_modules/.store/antd@5.16.2/node_modules/antd/es/config-provider/index.mjs";
11
- import ce from "../../../node_modules/.store/antd@5.16.2/node_modules/antd/locale/en_US.mjs";
12
- import { getColumnsWithTool as ie, loopBuildSkeleton as ue } from "../Table/utils.mjs";
13
- import { ConfigContext as me } from "../../../node_modules/.store/antd@5.16.2/node_modules/antd/es/config-provider/context.mjs";
14
- function Be({
15
- dataSource: u = [],
11
+ import ct from "../../../node_modules/.store/antd@5.16.2/node_modules/antd/locale/en_US.mjs";
12
+ import { getColumnsWithTool as it, loopBuildSkeleton as ut } from "../Table/utils.mjs";
13
+ import { ConfigContext as mt } from "../../../node_modules/.store/antd@5.16.2/node_modules/antd/es/config-provider/context.mjs";
14
+ function Bt({
15
+ dataSource: u,
16
16
  columns: g,
17
- loading: l = !1,
17
+ loading: l,
18
18
  scroll: s,
19
19
  components: f,
20
20
  expandable: c,
@@ -22,66 +22,66 @@ function Be({
22
22
  ...a
23
23
  }) {
24
24
  var T, p;
25
- const { token: L } = ae.useToken(), { gap: j } = se(), { showColumnBorder: K, rowHoverable: M } = D(re), h = Z(null), C = oe((T = h.current) == null ? void 0 : T.nativeElement), q = o(() => {
26
- let e = (s == null ? void 0 : s.x) ?? 1e3;
27
- return s != null && s.x ? { x: e, y: s.y || 400 } : s != null && s.y ? { x: e, y: s.y } : { x: e, y: 400 };
25
+ const { token: L } = at.useToken(), { gap: j } = st(), { showColumnBorder: K, rowHoverable: M } = D(rt), h = Z(null), C = ot((T = h.current) == null ? void 0 : T.nativeElement), q = o(() => {
26
+ let t = (s == null ? void 0 : s.x) ?? 1e3;
27
+ return s != null && s.x ? { x: t, y: s.y || 400 } : s != null && s.y ? { x: t, y: s.y } : { x: t, y: 400 };
28
28
  }, [s]), P = () => {
29
29
  var n, r;
30
- const e = (r = (n = h.current) == null ? void 0 : n.nativeElement) == null ? void 0 : r.querySelectorAll(
30
+ const t = (r = (n = h.current) == null ? void 0 : n.nativeElement) == null ? void 0 : r.querySelectorAll(
31
31
  "& > .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)"
32
- ), t = [];
33
- if (e == null || e.forEach((i) => {
32
+ ), e = [];
33
+ if (t == null || t.forEach((i) => {
34
34
  var b;
35
- t.push(
35
+ e.push(
36
36
  ((b = i.querySelector("& > .operationCol .actionGroup")) == null ? void 0 : b.clientWidth) || 0
37
37
  );
38
- }), t.length)
39
- return Math.ceil(Math.max(...t)) + j * 2;
38
+ }), e.length)
39
+ return Math.ceil(Math.max(...e)) + j * 2;
40
40
  }, A = () => {
41
41
  var b, W, E, v, N;
42
- const e = (W = (b = h.current) == null ? void 0 : b.nativeElement) == null ? void 0 : W.querySelector(
42
+ const t = (W = (b = h.current) == null ? void 0 : b.nativeElement) == null ? void 0 : W.querySelector(
43
43
  ".ant-table-body"
44
- ), t = e == null ? void 0 : e.clientWidth, r = ((e == null ? void 0 : e.offsetWidth) || 0) - t > 0, i = (N = (v = (E = h.current) == null ? void 0 : E.nativeElement) == null ? void 0 : v.querySelector(
44
+ ), e = t == null ? void 0 : t.clientWidth, r = ((t == null ? void 0 : t.offsetWidth) || 0) - e > 0, i = (N = (v = (E = h.current) == null ? void 0 : E.nativeElement) == null ? void 0 : v.querySelector(
45
45
  ".ant-table-cell-scrollbar"
46
46
  )) == null ? void 0 : N.offsetWidth;
47
- return { tbodyWidth: t, scrollbarSize: i, hasScrollBar: r };
47
+ return { tbodyWidth: e, scrollbarSize: i, hasScrollBar: r };
48
48
  }, { hasScrollBar: x, scrollbarSize: R } = o(() => {
49
- const { hasScrollBar: e, scrollbarSize: t } = A();
49
+ const { hasScrollBar: t, scrollbarSize: e } = A();
50
50
  return {
51
- hasScrollBar: e,
52
- scrollbarSize: t
51
+ hasScrollBar: t,
52
+ scrollbarSize: e
53
53
  };
54
54
  }, [C == null ? void 0 : C.height]), d = o(() => {
55
- const e = g ?? [], n = e.filter((r) => !ne.includes(r)).map((r) => ({
55
+ const t = g ?? [], n = t.filter((r) => !nt.includes(r)).map((r) => ({
56
56
  ...r,
57
57
  width: r.useMaxWidth ? P() ?? r.width : r.width
58
58
  }));
59
- return ie(
60
- e,
59
+ return it(
60
+ t,
61
61
  n,
62
62
  !1,
63
63
  !!m,
64
64
  !!c
65
65
  );
66
- }, [g]), k = o(() => ue(d), [d]), G = o(() => l ? k : d, [l, d, k]), S = o(() => {
67
- const e = u == null ? void 0 : u.length, t = e > 4 ? e >= 8 ? 8 : e : 4;
68
- return Array.from({ length: t }).map((r, i) => ({
66
+ }, [g]), k = o(() => ut(d), [d]), G = o(() => l ? k : d, [l, d, k]), S = o(() => {
67
+ const t = (u == null ? void 0 : u.length) ?? 0, e = t > 4 ? t >= 8 ? 8 : t : 4;
68
+ return Array.from({ length: e }).map((r, i) => ({
69
69
  key: `${Date.now()}${i}`
70
70
  }));
71
- }, [u]), $ = o(() => l ? S : u, [l, u, S]), { table: w, locale: F = ce } = D(me), H = { ...F.Table }, _ = ((p = w == null ? void 0 : w.expandable) == null ? void 0 : p.expandIcon) || (c == null ? void 0 : c.expandIcon) || le(H), z = o(() => {
71
+ }, [u]), $ = o(() => l ? S : u, [l, u, S]), { table: w, locale: F = ct } = D(mt), H = { ...F.Table }, _ = ((p = w == null ? void 0 : w.expandable) == null ? void 0 : p.expandIcon) || (c == null ? void 0 : c.expandIcon) || lt(H), z = o(() => {
72
72
  if (c)
73
73
  return {
74
74
  ...c,
75
75
  expandedRowRender: () => /* @__PURE__ */ y.jsx(y.Fragment, {}),
76
- expandIcon: (e) => {
77
- const t = _(e);
76
+ expandIcon: (t) => {
77
+ const e = _(t);
78
78
  return {
79
- ...t,
79
+ ...e,
80
80
  props: {
81
- ...t.props,
81
+ ...e.props,
82
82
  disabled: !0,
83
83
  style: {
84
- ...t.props.style,
84
+ ...e.props.style,
85
85
  backgroundColor: L.colorBgContainerDisabled
86
86
  }
87
87
  }
@@ -96,31 +96,31 @@ function Be({
96
96
  getCheckboxProps: () => ({ disabled: !0 })
97
97
  };
98
98
  }, [m]), O = o(() => l ? B : m, [l, m, B]), Q = o(() => l ? void 0 : a.rowKey, [l, a.rowKey]), U = I(
99
- (e, t) => {
99
+ (t, e) => {
100
100
  var r;
101
101
  if (!a.onRow)
102
102
  return {};
103
- const n = (r = a.onRow) == null ? void 0 : r.call(a, e, t);
103
+ const n = (r = a.onRow) == null ? void 0 : r.call(a, t, e);
104
104
  return n.onClick && (n.className = "rowPointerCursor"), n;
105
105
  },
106
106
  [a.onRow]
107
107
  ), V = I(
108
- (e, t, n) => {
109
- const r = t % 2 === 0 ? "oddRow" : "evenRow";
108
+ (t, e, n) => {
109
+ const r = e % 2 === 0 ? "oddRow" : "evenRow";
110
110
  if (a.rowClassName) {
111
- const i = a.rowClassName(e, t, n);
112
- return te(r, i);
111
+ const i = a.rowClassName(t, e, n);
112
+ return et(r, i);
113
113
  }
114
114
  return r;
115
115
  },
116
116
  [a.rowClassName]
117
- ), X = (e) => {
117
+ ), X = (t) => {
118
118
  var n;
119
- const t = { ...e };
120
- return t.className.includes("ant-table-cell-fix-right") && !x && ((n = t.style) != null && n.right) && (t.style = {
121
- ...t.style,
122
- right: t.style.right - (R || 0)
123
- }), /* @__PURE__ */ y.jsx("th", { ...t });
119
+ const e = { ...t };
120
+ return e.className.includes("ant-table-cell-fix-right") && !x && ((n = e.style) != null && n.right) && (e.style = {
121
+ ...e.style,
122
+ right: e.style.right - (R || 0)
123
+ }), /* @__PURE__ */ y.jsx("th", { ...e });
124
124
  }, Y = o(() => ({
125
125
  ...f,
126
126
  header: {
@@ -129,7 +129,7 @@ function Be({
129
129
  }
130
130
  }), [f, x, R]);
131
131
  return /* @__PURE__ */ y.jsx(
132
- ee,
132
+ tt,
133
133
  {
134
134
  ...a,
135
135
  bordered: K,
@@ -150,5 +150,5 @@ function Be({
150
150
  );
151
151
  }
152
152
  export {
153
- Be as default
153
+ Bt as default
154
154
  };