bitz-react-admin-ui 2.4.3 → 2.4.4

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,15 +1,15 @@
1
1
  import { j as n } from "../../../node_modules/.store/react@18.3.1/node_modules/react/jsx-runtime.mjs";
2
2
  import T from "../../../node_modules/.store/ahooks@3.7.11/node_modules/ahooks/es/useSize/index.mjs";
3
3
  import { Space as I, Skeleton as R, theme as P } from "antd";
4
- import { forwardRef as E, useContext as L, useMemo as f, Fragment as M, useRef as D } from "react";
4
+ import { forwardRef as E, useContext as L, useMemo as C, Fragment as M, useRef as D } from "react";
5
5
  import x from "../../BitzButton/index.mjs";
6
6
  import F, { actionColBtnGap as H } from "./style.mjs";
7
7
  import "../index.mjs";
8
8
  import w from "../Dropdown/index.mjs";
9
9
  import { tablePaddingInline as O } from "../../BitzConfigProvider/context.mjs";
10
- import { BitzTableContext as _ } from "../Store/index.mjs";
11
- const B = ({
12
- skeletonCls: c,
10
+ import { BitzTableContext as W } from "../Store/index.mjs";
11
+ const b = ({
12
+ skeletonCls: m,
13
13
  ...l
14
14
  }) => /* @__PURE__ */ n.jsxs(x, { type: "text", ...l, children: [
15
15
  /* @__PURE__ */ n.jsx("span", { children: l.children }),
@@ -18,115 +18,115 @@ const B = ({
18
18
  {
19
19
  active: !0,
20
20
  title: !1,
21
- className: c,
21
+ className: m,
22
22
  paragraph: {
23
23
  rows: 1,
24
24
  width: "100%"
25
25
  }
26
26
  }
27
27
  )
28
- ] }), q = E(
29
- ({ loading: c, actionGroup: l, customActions: s }, d) => {
30
- const { loading: u, fullscreen: k } = L(_), r = f(() => c ?? u, [c, u]), {
31
- primaryBtnClassName: o,
32
- dangerBtnClassName: m,
33
- secondaryBtnClassName: N,
34
- maskClassName: C,
35
- skeletonBtnClassName: g,
36
- skeletonClassName: p
37
- } = F(), j = f(() => {
38
- const i = l.length >= 4 ? 2 : l.length, a = l.slice(0, i), t = [];
39
- if (a != null && a.length && a.forEach((e, h) => {
28
+ ] }), _ = E(
29
+ ({ loading: m, actionGroup: l, customActions: r }, p) => {
30
+ const { loading: f, fullscreen: y } = L(W), o = C(() => m ?? f, [m, f]), {
31
+ primaryBtnClassName: d,
32
+ dangerBtnClassName: a,
33
+ secondaryBtnClassName: u,
34
+ maskClassName: B,
35
+ skeletonBtnClassName: h,
36
+ skeletonClassName: g
37
+ } = F(), j = C(() => {
38
+ const i = l.length >= 4 ? 2 : l.length, c = l.slice(0, i), t = [];
39
+ if (c != null && c.length && c.forEach((e, s) => {
40
40
  t.push(
41
- r ? /* @__PURE__ */ n.jsx(
42
- B,
41
+ o ? /* @__PURE__ */ n.jsx(
42
+ b,
43
43
  {
44
- className: g,
45
- skeletonCls: p,
44
+ className: h,
45
+ skeletonCls: g,
46
46
  children: e == null ? void 0 : e.label
47
47
  },
48
- h
48
+ s
49
49
  ) : e.children ? /* @__PURE__ */ n.jsx(w, { menu: { items: e.children }, children: /* @__PURE__ */ n.jsx(
50
50
  x,
51
51
  {
52
52
  type: "text",
53
- className: e.danger ? m : o,
53
+ className: e.danger ? a : d,
54
54
  children: e == null ? void 0 : e.label
55
55
  }
56
- ) }, h) : /* @__PURE__ */ n.jsx(
56
+ ) }, s) : /* @__PURE__ */ n.jsx(
57
57
  x,
58
58
  {
59
59
  type: "text",
60
- className: e.danger ? m : o,
60
+ className: e.danger ? a : d,
61
61
  onClick: e == null ? void 0 : e.onClick,
62
62
  children: e == null ? void 0 : e.label
63
63
  },
64
- h
64
+ s
65
65
  )
66
66
  );
67
67
  }), i === 2 && l.length >= 4) {
68
68
  const e = l.slice(2, l.length);
69
69
  t.push(
70
- r ? /* @__PURE__ */ n.jsx(
71
- B,
70
+ o ? /* @__PURE__ */ n.jsx(
71
+ b,
72
72
  {
73
- className: g,
74
- skeletonCls: p,
73
+ className: h,
74
+ skeletonCls: g,
75
75
  children: "更多"
76
76
  },
77
77
  5
78
- ) : /* @__PURE__ */ n.jsx(w, { menu: { items: e }, children: /* @__PURE__ */ n.jsx(x, { type: "text", className: N, children: "更多" }) }, 5)
78
+ ) : /* @__PURE__ */ n.jsx(w, { menu: { items: e }, children: /* @__PURE__ */ n.jsx(x, { type: "text", className: u, children: "更多" }) }, 5)
79
79
  );
80
80
  }
81
81
  return t;
82
- }, [r, l]), b = f(() => {
83
- if (!(s != null && s.length))
82
+ }, [o, l]), k = C(() => {
83
+ if (!(r != null && r.length))
84
84
  return;
85
- const i = s.map((t, e) => /* @__PURE__ */ n.jsx(
86
- B,
85
+ const i = r.map((t, e) => /* @__PURE__ */ n.jsx(
86
+ b,
87
87
  {
88
- className: g,
89
- skeletonCls: p,
88
+ className: h,
89
+ skeletonCls: g,
90
90
  children: t == null ? void 0 : t.label
91
91
  },
92
92
  e
93
- )), a = s.map((t, e) => {
94
- let h = /* @__PURE__ */ n.jsx(
93
+ )), c = r.map((t, e) => {
94
+ let s = /* @__PURE__ */ n.jsx(
95
95
  x,
96
96
  {
97
97
  type: "text",
98
- className: t.danger ? m : o,
98
+ className: t.danger ? a : d,
99
99
  onClick: t.onClick,
100
100
  children: t == null ? void 0 : t.label
101
101
  },
102
102
  e
103
103
  );
104
- t.type === "secondary" && (h = /* @__PURE__ */ n.jsx(
104
+ t.type === "secondary" && (s = /* @__PURE__ */ n.jsx(
105
105
  x,
106
106
  {
107
107
  type: "text",
108
- className: N,
108
+ className: u,
109
109
  onClick: t.onClick,
110
110
  children: t == null ? void 0 : t.label
111
111
  },
112
112
  e
113
113
  ));
114
- const y = t.render ?? ((z, S) => /* @__PURE__ */ n.jsx(M, { children: z }, S));
115
- return y == null ? void 0 : y(h, e);
114
+ const N = t.render ?? ((z, S) => /* @__PURE__ */ n.jsx(M, { children: z }, S));
115
+ return N == null ? void 0 : N(s, e);
116
116
  });
117
- return r ? i : a;
118
- }, [r, s]);
117
+ return o ? i : c;
118
+ }, [o, r]);
119
119
  return /* @__PURE__ */ n.jsxs("div", { onClick: (i) => i.stopPropagation(), children: [
120
- /* @__PURE__ */ n.jsx(I, { size: H, ref: d, className: "actionGroup", children: b ?? j }),
121
- /* @__PURE__ */ n.jsx("div", { className: C })
120
+ /* @__PURE__ */ n.jsx(I, { size: H, ref: p, className: "actionGroup", children: k ?? j }),
121
+ /* @__PURE__ */ n.jsx("div", { className: B })
122
122
  ] });
123
123
  }
124
124
  );
125
- function $(c) {
126
- var C;
127
- const { actionGroup: l, loading: s, customActions: d, ...u } = c, k = ((C = P.useToken().token.Table) == null ? void 0 : C.cellPaddingInline) ?? O, r = D(null), o = T(r), m = f(() => o != null && o.width ? o.width + k * 2 + 1 : 141, [o, k]);
128
- return f(() => ({
129
- width: Math.floor(m),
125
+ function $(m) {
126
+ var h;
127
+ const { actionGroup: l, loading: r, customActions: p, defaultWidth: f, ...y } = m, o = ((h = P.useToken().token.Table) == null ? void 0 : h.cellPaddingInline) ?? O, d = D(null), a = T(d), u = C(() => a != null && a.width ? a.width + o * 2 + 1 : f ?? 141, [a, o, f]);
128
+ return C(() => ({
129
+ width: Math.floor(u),
130
130
  mobileHide: !0,
131
131
  isOperationCol: !0,
132
132
  title: "操作",
@@ -135,23 +135,23 @@ function $(c) {
135
135
  dataIndex: "operationCol",
136
136
  className: "operationCol",
137
137
  disabled: !0,
138
- render: (g, p, j) => {
139
- var a, t;
140
- const b = ((a = d == null ? void 0 : d(p, j)) == null ? void 0 : a.filter((e) => e.type != "detail")) ?? [], i = ((t = l == null ? void 0 : l(p, j)) == null ? void 0 : t.filter((e) => e.type != "detail")) ?? [];
138
+ render: (g, j, k) => {
139
+ var t, e;
140
+ const i = ((t = p == null ? void 0 : p(j, k)) == null ? void 0 : t.filter((s) => s.type != "detail")) ?? [], c = ((e = l == null ? void 0 : l(j, k)) == null ? void 0 : e.filter((s) => s.type != "detail")) ?? [];
141
141
  return /* @__PURE__ */ n.jsx(
142
- q,
142
+ _,
143
143
  {
144
- actionGroup: i,
145
- customActions: b,
146
- loading: s,
147
- ref: r
144
+ actionGroup: c,
145
+ customActions: i,
146
+ loading: r,
147
+ ref: d
148
148
  }
149
149
  );
150
150
  },
151
- ...u
152
- }), [m, r, s, l, d]);
151
+ ...y
152
+ }), [u, d, r, l, p]);
153
153
  }
154
154
  export {
155
- q as BitzTableAction,
155
+ _ as BitzTableAction,
156
156
  $ as default
157
157
  };
@@ -18,7 +18,7 @@ export interface BitzTableProps<RecordType = any> extends Omit<TableProps<Record
18
18
  showPagination?: boolean;
19
19
  /** PC端:BitzTable组件的整体高度,由外部通过视口高度减去其他元素高度和间隙的结果 */
20
20
  height?: number;
21
- /** PC端:当height小于minHeight时使用minHeight */
21
+ /** PC端:当height小于minHeight时使用minHeight替代height */
22
22
  minHeight?: number;
23
23
  /** table可滚动区域的最大宽高的值 */
24
24
  scroll?: {