bitz-react-admin-ui 2.6.4 → 2.6.6

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,132 +1,155 @@
1
- import { j as l } from "../../../node_modules/.store/react@18.3.1/node_modules/react/jsx-runtime.mjs";
2
- import I from "../../../node_modules/.store/ahooks@3.8.0/node_modules/ahooks/es/useSize/index.mjs";
3
- import { Space as R, Skeleton as P, theme as E } from "antd";
4
- import { forwardRef as L, useContext as M, useMemo as g, Fragment as D, useRef as w } from "react";
5
- import f from "../../BitzButton/index.mjs";
6
- import F, { actionColBtnGap as H } from "./style.mjs";
1
+ import { j as n } from "../../../node_modules/.store/react@18.3.1/node_modules/react/jsx-runtime.mjs";
2
+ import P from "../../../node_modules/.store/ahooks@3.8.0/node_modules/ahooks/es/useSize/index.mjs";
3
+ import { Space as E, Skeleton as L, theme as D } from "antd";
4
+ import { forwardRef as F, useContext as H, useMemo as k, useState as M, Fragment as O, useRef as S } from "react";
5
+ import x from "../../BitzButton/index.mjs";
6
+ import _, { actionColBtnGap as q } from "./style.mjs";
7
7
  import "../index.mjs";
8
- import z from "../Dropdown/index.mjs";
9
- import { tablePaddingInline as O } from "../../BitzConfigProvider/context.mjs";
10
- import { BitzTableContext as W } from "../Store/index.mjs";
11
- const b = ({
12
- skeletonCls: p,
8
+ import T from "../Dropdown/index.mjs";
9
+ import { tablePaddingInline as G } from "../../BitzConfigProvider/context.mjs";
10
+ import { BitzTableContext as J } from "../Store/index.mjs";
11
+ const j = ({
12
+ skeletonCls: h,
13
13
  ...s
14
- }) => /* @__PURE__ */ l.jsxs(f, { type: "text", ...s, children: [
15
- /* @__PURE__ */ l.jsx("span", { children: s.children }),
16
- /* @__PURE__ */ l.jsx(
17
- P,
14
+ }) => /* @__PURE__ */ n.jsxs(x, { type: "text", ...s, children: [
15
+ /* @__PURE__ */ n.jsx("span", { children: s.children }),
16
+ /* @__PURE__ */ n.jsx(
17
+ L,
18
18
  {
19
19
  active: !0,
20
20
  title: !1,
21
- className: p,
21
+ className: h,
22
22
  paragraph: {
23
23
  rows: 1,
24
24
  width: "100%"
25
25
  }
26
26
  }
27
27
  )
28
- ] }), _ = L(
29
- ({ loading: p, actionGroup: s, customActions: r }, u) => {
30
- const { loading: C, fullscreen: y } = M(W), o = g(() => p ?? C, [p, C]), {
31
- primaryBtnClassName: c,
32
- dangerBtnClassName: n,
33
- secondaryBtnClassName: m,
34
- maskClassName: j,
35
- skeletonBtnClassName: k,
36
- skeletonClassName: x
37
- } = F(), B = g(() => {
38
- const a = s.length >= 4 ? 2 : s.length, d = s.slice(0, a), t = [];
39
- if (d != null && d.length && d.forEach((e, i) => {
28
+ ] }), K = F(
29
+ ({ loading: h, useMaxWidth: s, actionGroup: a, customActions: r }, N) => {
30
+ const { loading: f, fullscreen: b } = H(J), o = k(() => h ?? f, [h, f]), {
31
+ primaryBtnClassName: l,
32
+ dangerBtnClassName: c,
33
+ secondaryBtnClassName: C,
34
+ maskClassName: z,
35
+ skeletonBtnClassName: d,
36
+ skeletonClassName: p
37
+ } = _(), [g] = M([
38
+ /* @__PURE__ */ n.jsx(
39
+ j,
40
+ {
41
+ className: d,
42
+ skeletonCls: p,
43
+ children: "占位"
44
+ },
45
+ 1
46
+ ),
47
+ /* @__PURE__ */ n.jsx(
48
+ j,
49
+ {
50
+ className: d,
51
+ skeletonCls: p,
52
+ children: "占位"
53
+ },
54
+ 2
55
+ )
56
+ ]), y = k(() => {
57
+ if (o && s)
58
+ return g;
59
+ const m = a.length >= 4 ? 2 : a.length, i = a.slice(0, m), t = [];
60
+ if (i != null && i.length && i.forEach((e, u) => {
40
61
  t.push(
41
- o ? /* @__PURE__ */ l.jsx(
42
- b,
62
+ o ? /* @__PURE__ */ n.jsx(
63
+ j,
43
64
  {
44
- className: k,
45
- skeletonCls: x,
65
+ className: d,
66
+ skeletonCls: p,
46
67
  children: e == null ? void 0 : e.label
47
68
  },
48
- i
49
- ) : e.children ? /* @__PURE__ */ l.jsx(z, { menu: { items: e.children }, children: /* @__PURE__ */ l.jsx(
50
- f,
69
+ u
70
+ ) : e.children ? /* @__PURE__ */ n.jsx(T, { menu: { items: e.children }, children: /* @__PURE__ */ n.jsx(
71
+ x,
51
72
  {
52
73
  type: "text",
53
- className: e.danger ? n : c,
74
+ className: e.danger ? c : l,
54
75
  children: e == null ? void 0 : e.label
55
76
  }
56
- ) }, i) : /* @__PURE__ */ l.jsx(
57
- f,
77
+ ) }, u) : /* @__PURE__ */ n.jsx(
78
+ x,
58
79
  {
59
80
  type: "text",
60
- className: e.danger ? n : c,
81
+ className: e.danger ? c : l,
61
82
  onClick: e == null ? void 0 : e.onClick,
62
83
  children: e == null ? void 0 : e.label
63
84
  },
64
- i
85
+ u
65
86
  )
66
87
  );
67
- }), a === 2 && s.length >= 4) {
68
- const e = s.slice(2, s.length);
88
+ }), m === 2 && a.length >= 4) {
89
+ const e = a.slice(2, a.length);
69
90
  t.push(
70
- o ? /* @__PURE__ */ l.jsx(
71
- b,
91
+ o ? /* @__PURE__ */ n.jsx(
92
+ j,
72
93
  {
73
- className: k,
74
- skeletonCls: x,
94
+ className: d,
95
+ skeletonCls: p,
75
96
  children: "更多"
76
97
  },
77
98
  5
78
- ) : /* @__PURE__ */ l.jsx(z, { menu: { items: e }, children: /* @__PURE__ */ l.jsx(f, { type: "text", className: m, children: "更多" }) }, 5)
99
+ ) : /* @__PURE__ */ n.jsx(T, { menu: { items: e }, children: /* @__PURE__ */ n.jsx(x, { type: "text", className: C, children: "更多" }) }, 5)
79
100
  );
80
101
  }
81
102
  return t;
82
- }, [o, s]), N = g(() => {
103
+ }, [o, s, a]), B = k(() => {
83
104
  if (!(r != null && r.length))
84
105
  return;
85
- const a = r.map((t, e) => /* @__PURE__ */ l.jsx(
86
- b,
106
+ if (o && s)
107
+ return g;
108
+ const m = r.map((t, e) => /* @__PURE__ */ n.jsx(
109
+ j,
87
110
  {
88
- className: k,
89
- skeletonCls: x,
111
+ className: d,
112
+ skeletonCls: p,
90
113
  children: t == null ? void 0 : t.label
91
114
  },
92
115
  e
93
- )), d = r.map((t, e) => {
94
- let i = /* @__PURE__ */ l.jsx(
95
- f,
116
+ )), i = r.map((t, e) => {
117
+ let u = /* @__PURE__ */ n.jsx(
118
+ x,
96
119
  {
97
120
  type: "text",
98
- className: t.danger ? n : c,
121
+ className: t.danger ? c : l,
99
122
  onClick: t.onClick,
100
123
  children: t == null ? void 0 : t.label
101
124
  },
102
125
  e
103
126
  );
104
- t.type === "secondary" && (i = /* @__PURE__ */ l.jsx(
105
- f,
127
+ t.type === "secondary" && (u = /* @__PURE__ */ n.jsx(
128
+ x,
106
129
  {
107
130
  type: "text",
108
- className: m,
131
+ className: C,
109
132
  onClick: t.onClick,
110
133
  children: t == null ? void 0 : t.label
111
134
  },
112
135
  e
113
136
  ));
114
- const h = t.render ?? ((S, T) => /* @__PURE__ */ l.jsx(D, { children: S }, T));
115
- return h == null ? void 0 : h(i, e);
137
+ const w = t.render ?? ((I, R) => /* @__PURE__ */ n.jsx(O, { children: I }, R));
138
+ return w == null ? void 0 : w(u, e);
116
139
  });
117
- return o ? a : d;
118
- }, [o, r]);
119
- return /* @__PURE__ */ l.jsxs("div", { onClick: (a) => a.stopPropagation(), style: { overflow: "hidden" }, children: [
120
- /* @__PURE__ */ l.jsx(R, { size: H, ref: u, className: "actionGroup", children: N ?? B }),
121
- /* @__PURE__ */ l.jsx("div", { className: j })
140
+ return o ? m : i;
141
+ }, [o, s, r]);
142
+ return /* @__PURE__ */ n.jsxs("div", { onClick: (m) => m.stopPropagation(), style: { overflow: "hidden" }, children: [
143
+ /* @__PURE__ */ n.jsx(E, { size: q, ref: N, className: "actionGroup", children: B ?? y }),
144
+ /* @__PURE__ */ n.jsx("div", { className: z })
122
145
  ] });
123
146
  }
124
147
  );
125
- function $(p) {
126
- var x;
127
- const { actionGroup: s, loading: r, customActions: u, defaultWidth: C, ...y } = p, o = ((x = E.useToken().token.Table) == null ? void 0 : x.cellPaddingInline) ?? O, c = w(null), n = I(c), m = w(0), j = g(() => (n != null && n.width && !m.current && (m.current = n == null ? void 0 : n.width), !(n != null && n.width) && m.current ? m.current + o * 2 + 1 : n != null && n.width ? n.width + o * 2 + 1 : C ?? 141), [n, o, C]);
128
- return g(() => ({
129
- width: Math.floor(j),
148
+ function ee(h) {
149
+ var d;
150
+ const { actionGroup: s, loading: a, customActions: r, defaultWidth: N, ...f } = h, b = ((d = D.useToken().token.Table) == null ? void 0 : d.cellPaddingInline) ?? G, o = S(null), l = P(o), c = S(0), C = k(() => (l != null && l.width && !c.current && (c.current = l == null ? void 0 : l.width), !(l != null && l.width) && c.current ? c.current + b * 2 + 1 : l != null && l.width ? l.width + b * 2 + 1 : N ?? 141), [l, b, N]);
151
+ return k(() => ({
152
+ width: Math.floor(C),
130
153
  mobileHide: !0,
131
154
  isOperationCol: !0,
132
155
  title: "操作",
@@ -135,23 +158,24 @@ function $(p) {
135
158
  dataIndex: "operationCol",
136
159
  className: "operationCol",
137
160
  disabled: !0,
138
- render: (B, N, a) => {
139
- var e, i;
140
- const d = ((e = u == null ? void 0 : u(N, a)) == null ? void 0 : e.filter((h) => h.type != "detail")) ?? [], t = ((i = s == null ? void 0 : s(N, a)) == null ? void 0 : i.filter((h) => h.type != "detail")) ?? [];
141
- return /* @__PURE__ */ l.jsx(
142
- _,
161
+ render: (p, g, y) => {
162
+ var i, t;
163
+ const B = ((i = r == null ? void 0 : r(g, y)) == null ? void 0 : i.filter((e) => e.type != "detail")) ?? [], m = ((t = s == null ? void 0 : s(g, y)) == null ? void 0 : t.filter((e) => e.type != "detail")) ?? [];
164
+ return /* @__PURE__ */ n.jsx(
165
+ K,
143
166
  {
144
- actionGroup: t,
145
- customActions: d,
146
- loading: r,
147
- ref: c
167
+ actionGroup: m,
168
+ customActions: B,
169
+ loading: a,
170
+ useMaxWidth: f.useMaxWidth,
171
+ ref: o
148
172
  }
149
173
  );
150
174
  },
151
- ...y
152
- }), [j, c.current, r, s, u]);
175
+ ...f
176
+ }), [C, o.current, a, s, r]);
153
177
  }
154
178
  export {
155
- _ as BitzTableAction,
156
- $ as default
179
+ K as BitzTableAction,
180
+ ee as default
157
181
  };