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.
- package/dist/components/BitzTable/ActionCol/index.mjs +108 -84
- package/dist/components/BitzTable/Table/index.mjs +276 -278
- package/dist/components/BitzTable/index.d.ts +1 -0
- package/dist/components/BitzTooltip/index.mjs +67 -55
- package/dist/components/BitzTooltip/style.d.ts +1 -0
- package/dist/components/BitzTooltip/style.mjs +25 -14
- package/dist/node_modules/.store/react-is@18.3.1/node_modules/react-is/index.mjs +1 -1
- package/dist/node_modules/.store/react-resizable@3.0.5/node_modules/react-resizable/index.mjs +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,132 +1,155 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import
|
|
3
|
-
import { Space as
|
|
4
|
-
import { forwardRef as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
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
|
|
9
|
-
import { tablePaddingInline as
|
|
10
|
-
import { BitzTableContext as
|
|
11
|
-
const
|
|
12
|
-
skeletonCls:
|
|
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__ */
|
|
15
|
-
/* @__PURE__ */
|
|
16
|
-
/* @__PURE__ */
|
|
17
|
-
|
|
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:
|
|
21
|
+
className: h,
|
|
22
22
|
paragraph: {
|
|
23
23
|
rows: 1,
|
|
24
24
|
width: "100%"
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
)
|
|
28
|
-
] }),
|
|
29
|
-
({ loading:
|
|
30
|
-
const { loading:
|
|
31
|
-
primaryBtnClassName:
|
|
32
|
-
dangerBtnClassName:
|
|
33
|
-
secondaryBtnClassName:
|
|
34
|
-
maskClassName:
|
|
35
|
-
skeletonBtnClassName:
|
|
36
|
-
skeletonClassName:
|
|
37
|
-
} =
|
|
38
|
-
|
|
39
|
-
|
|
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__ */
|
|
42
|
-
|
|
62
|
+
o ? /* @__PURE__ */ n.jsx(
|
|
63
|
+
j,
|
|
43
64
|
{
|
|
44
|
-
className:
|
|
45
|
-
skeletonCls:
|
|
65
|
+
className: d,
|
|
66
|
+
skeletonCls: p,
|
|
46
67
|
children: e == null ? void 0 : e.label
|
|
47
68
|
},
|
|
48
|
-
|
|
49
|
-
) : e.children ? /* @__PURE__ */
|
|
50
|
-
|
|
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 ?
|
|
74
|
+
className: e.danger ? c : l,
|
|
54
75
|
children: e == null ? void 0 : e.label
|
|
55
76
|
}
|
|
56
|
-
) },
|
|
57
|
-
|
|
77
|
+
) }, u) : /* @__PURE__ */ n.jsx(
|
|
78
|
+
x,
|
|
58
79
|
{
|
|
59
80
|
type: "text",
|
|
60
|
-
className: e.danger ?
|
|
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
|
-
|
|
85
|
+
u
|
|
65
86
|
)
|
|
66
87
|
);
|
|
67
|
-
}),
|
|
68
|
-
const e =
|
|
88
|
+
}), m === 2 && a.length >= 4) {
|
|
89
|
+
const e = a.slice(2, a.length);
|
|
69
90
|
t.push(
|
|
70
|
-
o ? /* @__PURE__ */
|
|
71
|
-
|
|
91
|
+
o ? /* @__PURE__ */ n.jsx(
|
|
92
|
+
j,
|
|
72
93
|
{
|
|
73
|
-
className:
|
|
74
|
-
skeletonCls:
|
|
94
|
+
className: d,
|
|
95
|
+
skeletonCls: p,
|
|
75
96
|
children: "更多"
|
|
76
97
|
},
|
|
77
98
|
5
|
|
78
|
-
) : /* @__PURE__ */
|
|
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]),
|
|
103
|
+
}, [o, s, a]), B = k(() => {
|
|
83
104
|
if (!(r != null && r.length))
|
|
84
105
|
return;
|
|
85
|
-
|
|
86
|
-
|
|
106
|
+
if (o && s)
|
|
107
|
+
return g;
|
|
108
|
+
const m = r.map((t, e) => /* @__PURE__ */ n.jsx(
|
|
109
|
+
j,
|
|
87
110
|
{
|
|
88
|
-
className:
|
|
89
|
-
skeletonCls:
|
|
111
|
+
className: d,
|
|
112
|
+
skeletonCls: p,
|
|
90
113
|
children: t == null ? void 0 : t.label
|
|
91
114
|
},
|
|
92
115
|
e
|
|
93
|
-
)),
|
|
94
|
-
let
|
|
95
|
-
|
|
116
|
+
)), i = r.map((t, e) => {
|
|
117
|
+
let u = /* @__PURE__ */ n.jsx(
|
|
118
|
+
x,
|
|
96
119
|
{
|
|
97
120
|
type: "text",
|
|
98
|
-
className: t.danger ?
|
|
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" && (
|
|
105
|
-
|
|
127
|
+
t.type === "secondary" && (u = /* @__PURE__ */ n.jsx(
|
|
128
|
+
x,
|
|
106
129
|
{
|
|
107
130
|
type: "text",
|
|
108
|
-
className:
|
|
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
|
|
115
|
-
return
|
|
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 ?
|
|
118
|
-
}, [o, r]);
|
|
119
|
-
return /* @__PURE__ */
|
|
120
|
-
/* @__PURE__ */
|
|
121
|
-
/* @__PURE__ */
|
|
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
|
|
126
|
-
var
|
|
127
|
-
const { actionGroup: s, loading:
|
|
128
|
-
return
|
|
129
|
-
width: Math.floor(
|
|
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: (
|
|
139
|
-
var
|
|
140
|
-
const
|
|
141
|
-
return /* @__PURE__ */
|
|
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:
|
|
145
|
-
customActions:
|
|
146
|
-
loading:
|
|
147
|
-
|
|
167
|
+
actionGroup: m,
|
|
168
|
+
customActions: B,
|
|
169
|
+
loading: a,
|
|
170
|
+
useMaxWidth: f.useMaxWidth,
|
|
171
|
+
ref: o
|
|
148
172
|
}
|
|
149
173
|
);
|
|
150
174
|
},
|
|
151
|
-
...
|
|
152
|
-
}), [
|
|
175
|
+
...f
|
|
176
|
+
}), [C, o.current, a, s, r]);
|
|
153
177
|
}
|
|
154
178
|
export {
|
|
155
|
-
|
|
156
|
-
|
|
179
|
+
K as BitzTableAction,
|
|
180
|
+
ee as default
|
|
157
181
|
};
|