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