bitz-react-admin-ui 1.9.3 → 1.9.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/BitzConfigProvider/context.d.ts +5 -2
- package/dist/components/BitzTable/Store/index.d.ts +2 -0
- package/dist/components/BitzTable/Store/index.mjs +101 -99
- package/dist/components/BitzTable/Store/utils/index.d.ts +2 -0
- package/dist/components/BitzTable/Store/utils/index.mjs +15 -8
- package/dist/components/BitzTable/Table/index.d.ts +1 -1
- package/dist/components/BitzTable/Table/index.mjs +257 -227
- package/dist/components/BitzTable/Table/style.d.ts +3 -2
- package/dist/components/BitzTable/Table/style.mjs +13 -12
- package/dist/components/BitzTable/Table/utils.d.ts +3 -0
- package/dist/components/BitzTable/Table/utils.mjs +18 -0
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/ColumnSettingModal.mjs +16 -15
- package/dist/components/BitzTable/ToolBar/DensityIcon/index.mjs +37 -30
- package/dist/components/BitzTable/ToolBar/FullscreenIcon/index.mjs +33 -43
- package/dist/components/BitzTable/ToolBar/Wrapper/index.mjs +42 -38
- package/dist/components/BitzTable/ToolBar/index.d.ts +3 -1
- package/dist/style.css +1 -1
- package/dist/utils/findNode.d.ts +8 -0
- package/dist/utils/findNode.mjs +14 -0
- package/package.json +1 -1
- package/dist/components/BitzTable/TableSkeleton/index.d.ts +0 -9
- package/dist/components/BitzTable/TableSkeleton/index.mjs +0 -99
|
@@ -1,38 +1,39 @@
|
|
|
1
1
|
const u = ({
|
|
2
2
|
height: v,
|
|
3
3
|
evenRowBgColor: w,
|
|
4
|
-
colorBgContainer:
|
|
4
|
+
colorBgContainer: e,
|
|
5
5
|
table: o,
|
|
6
|
-
gap: I
|
|
6
|
+
gap: I,
|
|
7
|
+
borderColor: R
|
|
7
8
|
}) => {
|
|
8
|
-
var h, i, g,
|
|
9
|
+
var h, i, g, x, r, n, T, p, s, d, $, H, m, S, C, k, f, z, B, c;
|
|
9
10
|
return {
|
|
10
11
|
height: v,
|
|
11
12
|
"--toolbar-bgColor": o == null ? void 0 : o.toolbarBgColor,
|
|
12
13
|
"--thead-bgColor": o == null ? void 0 : o.headerBg,
|
|
13
14
|
"--thead-hoverBgColor": o == null ? void 0 : o.headerSortHoverBg,
|
|
14
15
|
"--evenRow-BgColor": w,
|
|
15
|
-
"--oddRow-BgColor":
|
|
16
|
+
"--oddRow-BgColor": e,
|
|
16
17
|
"--radioCheckbox-borderColor": o == null ? void 0 : o.radioCheckboxBorderColor,
|
|
17
18
|
"--expandIcon-borderColor": o == null ? void 0 : o.expandIconBorderColor,
|
|
18
19
|
"--rowHover-bgColor": o == null ? void 0 : o.rowHoverBg,
|
|
19
|
-
"--
|
|
20
|
+
"--borderColor": R,
|
|
20
21
|
"--container-gap": `${I}px`,
|
|
21
22
|
"--xlTable-fontSize": `${(h = o == null ? void 0 : o.xlTable) == null ? void 0 : h.fontSize}px`,
|
|
22
23
|
"--lgTable-fontSize": `${(i = o == null ? void 0 : o.lgTable) == null ? void 0 : i.fontSize}px`,
|
|
23
24
|
"--mdTable-fontSize": `${(g = o == null ? void 0 : o.mdTable) == null ? void 0 : g.fontSize}px`,
|
|
24
|
-
"--smTable-fontSize": `${(
|
|
25
|
-
"--xsTable-fontSize": `${(
|
|
25
|
+
"--smTable-fontSize": `${(x = o == null ? void 0 : o.smTable) == null ? void 0 : x.fontSize}px`,
|
|
26
|
+
"--xsTable-fontSize": `${(r = o == null ? void 0 : o.xsTable) == null ? void 0 : r.fontSize}px`,
|
|
26
27
|
"--xlTable-height": `${(n = o == null ? void 0 : o.xlTable) == null ? void 0 : n.height}px`,
|
|
27
28
|
"--lgTable-height": `${(T = o == null ? void 0 : o.lgTable) == null ? void 0 : T.height}px`,
|
|
28
|
-
"--mdTable-height": `${(
|
|
29
|
-
"--smTable-height": `${(
|
|
30
|
-
"--xsTable-height": `${(
|
|
29
|
+
"--mdTable-height": `${(p = o == null ? void 0 : o.mdTable) == null ? void 0 : p.height}px`,
|
|
30
|
+
"--smTable-height": `${(s = o == null ? void 0 : o.smTable) == null ? void 0 : s.height}px`,
|
|
31
|
+
"--xsTable-height": `${(d = o == null ? void 0 : o.xsTable) == null ? void 0 : d.height}px`,
|
|
31
32
|
"--xlTable-lineHeight": `${($ = o == null ? void 0 : o.xlTable) == null ? void 0 : $.lineHeight}px`,
|
|
32
33
|
"--lgTable-lineHeight": `${(H = o == null ? void 0 : o.lgTable) == null ? void 0 : H.lineHeight}px`,
|
|
33
34
|
"--mdTable-lineHeight": `${(m = o == null ? void 0 : o.mdTable) == null ? void 0 : m.lineHeight}px`,
|
|
34
|
-
"--smTable-lineHeight": `${(
|
|
35
|
-
"--xsTable-lineHeight": `${(
|
|
35
|
+
"--smTable-lineHeight": `${(S = o == null ? void 0 : o.smTable) == null ? void 0 : S.lineHeight}px`,
|
|
36
|
+
"--xsTable-lineHeight": `${(C = o == null ? void 0 : o.xsTable) == null ? void 0 : C.lineHeight}px`,
|
|
36
37
|
"--xlSkeleton-height": `${(k = o == null ? void 0 : o.xlTable) == null ? void 0 : k.skeletonHeight}px`,
|
|
37
38
|
"--lgSkeleton-height": `${(f = o == null ? void 0 : o.lgTable) == null ? void 0 : f.skeletonHeight}px`,
|
|
38
39
|
"--mdSkeleton-height": `${(z = o == null ? void 0 : o.mdTable) == null ? void 0 : z.skeletonHeight}px`,
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Table as e } from "antd";
|
|
2
|
+
const l = 0, t = 1;
|
|
3
|
+
function I(d, o, f, i) {
|
|
4
|
+
let x = l;
|
|
5
|
+
if (f) {
|
|
6
|
+
const n = d.indexOf(e.SELECTION_COLUMN);
|
|
7
|
+
n >= 0 && (x = n), o.splice(x, 0, e.SELECTION_COLUMN);
|
|
8
|
+
}
|
|
9
|
+
if (i) {
|
|
10
|
+
let n = 0;
|
|
11
|
+
const C = d.indexOf(e.EXPAND_COLUMN);
|
|
12
|
+
C >= 0 && (n = C), f && x === 0 && C === -1 && (n = t), o.splice(n, 0, e.EXPAND_COLUMN);
|
|
13
|
+
}
|
|
14
|
+
return o;
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
I as getColumnsWithTool
|
|
18
|
+
};
|
|
@@ -7,8 +7,8 @@ import { TableContext as me } from "../../Store/index.mjs";
|
|
|
7
7
|
import { genColumnKey as F, columnSort as de } from "../../Store/utils/index.mjs";
|
|
8
8
|
import p from "../../../../node_modules/.store/classnames@2.5.1/node_modules/classnames/index.mjs";
|
|
9
9
|
import { DndContext as ue } from "../../../../node_modules/.store/@dnd-kit_core@6.1.0/node_modules/@dnd-kit/core/dist/core.esm.mjs";
|
|
10
|
-
import { SortableContext as pe, verticalListSortingStrategy as
|
|
11
|
-
import
|
|
10
|
+
import { SortableContext as pe, verticalListSortingStrategy as fe, arrayMove as he } from "../../../../node_modules/.store/@dnd-kit_sortable@7.0.2/node_modules/@dnd-kit/sortable/dist/sortable.esm.mjs";
|
|
11
|
+
import xe from "./DndItem.mjs";
|
|
12
12
|
import { restrictToVerticalAxis as be, restrictToWindowEdges as ye } from "../../../../node_modules/.store/@dnd-kit_modifiers@6.0.1/node_modules/@dnd-kit/modifiers/dist/modifiers.esm.mjs";
|
|
13
13
|
import P from "../../../BitzButton/index.mjs";
|
|
14
14
|
import { useImmer as Ce } from "../../../../node_modules/.store/use-immer@0.9.0/node_modules/use-immer/dist/use-immer.module.mjs";
|
|
@@ -18,7 +18,7 @@ import "./index.less.mjs";
|
|
|
18
18
|
import W from "../../../../node_modules/.store/lodash-es@4.17.21/node_modules/lodash-es/omit.mjs";
|
|
19
19
|
import ke from "../../../../node_modules/.store/@ant-design_icons@5.3.5/node_modules/@ant-design/icons/es/icons/CheckCircleOutlined.mjs";
|
|
20
20
|
import ge from "../../../../node_modules/.store/@ant-design_icons@5.3.5/node_modules/@ant-design/icons/es/icons/RedoOutlined.mjs";
|
|
21
|
-
const $e = oe(({ onChange:
|
|
21
|
+
const $e = oe(({ onChange: x }) => {
|
|
22
22
|
var _, E, z, H;
|
|
23
23
|
const { token: i } = je.useToken(), b = se(), [j, k] = N(null), [$, K] = N(!1), [q, w] = N(!1), [a, y] = Ce({
|
|
24
24
|
columnsMap: {},
|
|
@@ -43,7 +43,7 @@ const $e = oe(({ onChange: f }) => {
|
|
|
43
43
|
y((e) => {
|
|
44
44
|
e.columnsMap = { ...l.defaultColumnKeyMap };
|
|
45
45
|
});
|
|
46
|
-
}, []),
|
|
46
|
+
}, []), f = M(() => {
|
|
47
47
|
var s, n;
|
|
48
48
|
const e = [];
|
|
49
49
|
return (s = l == null ? void 0 : l.columns) != null && s.length && ((n = l == null ? void 0 : l.columns) == null || n.map(({ key: u, dataIndex: t, ...m }) => {
|
|
@@ -95,7 +95,7 @@ const $e = oe(({ onChange: f }) => {
|
|
|
95
95
|
t.columnsMap = { ...n };
|
|
96
96
|
});
|
|
97
97
|
}, Z = (e, s) => {
|
|
98
|
-
const n = { ...a.columnsMap }, u =
|
|
98
|
+
const n = { ...a.columnsMap }, u = he(a.sortKeyColumns, e, s);
|
|
99
99
|
u.forEach((t, m) => {
|
|
100
100
|
n[t] = { ...n[t] || {}, order: m };
|
|
101
101
|
}), w(!0), y((t) => {
|
|
@@ -103,27 +103,28 @@ const $e = oe(({ onChange: f }) => {
|
|
|
103
103
|
});
|
|
104
104
|
}, ee = () => {
|
|
105
105
|
var e;
|
|
106
|
-
L(a.columnsMap), U(a.sortKeyColumns), G === "online" && B && (g == null || g(B, a.columnsMap)),
|
|
106
|
+
L(a.columnsMap), U(a.sortKeyColumns), G === "online" && B && (g == null || g(B, a.columnsMap)), x ? (K(!0), (e = x == null ? void 0 : x(a.columnsMap)) == null || e.finally(() => {
|
|
107
107
|
K(!1), b.hide();
|
|
108
108
|
})) : b.hide();
|
|
109
109
|
}, I = () => {
|
|
110
110
|
b.hide();
|
|
111
|
-
},
|
|
111
|
+
}, h = M(() => i.mode === "dark", [i.mode]);
|
|
112
112
|
return /* @__PURE__ */ o.jsxs(
|
|
113
113
|
le,
|
|
114
114
|
{
|
|
115
115
|
className: "tableColumnSettingModal",
|
|
116
116
|
title: /* @__PURE__ */ o.jsx(ne.Title, { style: { fontSize: 16, margin: 0 }, children: "列设置" }),
|
|
117
|
+
getContainer: !1,
|
|
117
118
|
...te(b),
|
|
118
119
|
style: {
|
|
119
120
|
"--modalContent-bgColor": (_ = i.Modal) == null ? void 0 : _.contentBg,
|
|
120
121
|
"--header-bgColor": (E = i.Modal) == null ? void 0 : E.headerBg,
|
|
121
122
|
"--footer-bgColor": (z = i.Modal) == null ? void 0 : z.footerBg,
|
|
122
|
-
"--blockTitle-colorBg":
|
|
123
|
-
"--leftBody-bgColor":
|
|
124
|
-
"--rightBody-bgColor":
|
|
125
|
-
"--checked":
|
|
126
|
-
"--block-bgColor":
|
|
123
|
+
"--blockTitle-colorBg": h ? "#333" : "#fff",
|
|
124
|
+
"--leftBody-bgColor": h ? "#262626" : "#e0e0e0",
|
|
125
|
+
"--rightBody-bgColor": h ? "#262626" : "#fff",
|
|
126
|
+
"--checked": h ? "#303030" : "#eee",
|
|
127
|
+
"--block-bgColor": h ? "#222" : "#fff",
|
|
127
128
|
"--colorText": i.colorText,
|
|
128
129
|
"--colorText-desc": i.colorTextDescription,
|
|
129
130
|
"--colorBorder": i.colorBorder
|
|
@@ -228,9 +229,9 @@ const $e = oe(({ onChange: f }) => {
|
|
|
228
229
|
children: /* @__PURE__ */ o.jsx(
|
|
229
230
|
pe,
|
|
230
231
|
{
|
|
231
|
-
items:
|
|
232
|
-
strategy:
|
|
233
|
-
children: /* @__PURE__ */ o.jsx("ul", { className: r.content, children:
|
|
232
|
+
items: f == null ? void 0 : f.map((e) => e.key),
|
|
233
|
+
strategy: fe,
|
|
234
|
+
children: /* @__PURE__ */ o.jsx("ul", { className: r.content, children: f == null ? void 0 : f.map((e) => /* @__PURE__ */ o.jsx(xe, { item: e }, e.key)) })
|
|
234
235
|
}
|
|
235
236
|
)
|
|
236
237
|
}
|
|
@@ -1,25 +1,24 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { memo as
|
|
3
|
-
import { Tooltip as
|
|
4
|
-
import { TableContext as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
},
|
|
1
|
+
import { j as l } from "../../../../node_modules/.store/react@18.2.0/node_modules/react/jsx-runtime.mjs";
|
|
2
|
+
import { memo as k, useContext as g } from "react";
|
|
3
|
+
import { Tooltip as h } from "antd";
|
|
4
|
+
import { TableContext as j } from "../../Store/index.mjs";
|
|
5
|
+
import z from "../style.mjs";
|
|
6
|
+
import C from "../../../BitzButton/index.mjs";
|
|
7
|
+
import S from "../../Dropdown/index.mjs";
|
|
8
|
+
import D from "../../../../node_modules/.store/@ant-design_icons@5.3.5/node_modules/@ant-design/icons/es/icons/ColumnHeightOutlined.mjs";
|
|
9
|
+
const I = ({ defaultSize: e, items: n }) => n.map((t) => t.key === e ? {
|
|
10
|
+
...t,
|
|
11
|
+
label: `${t.label}(默认)`
|
|
12
|
+
} : t), w = (e) => {
|
|
13
|
+
const { order: n, show: t = !0, icon: c = /* @__PURE__ */ l.jsx(D, {}) } = e, {
|
|
14
|
+
sizeStorageType: u,
|
|
15
|
+
sizeStorageKey: m,
|
|
16
|
+
onlineSizeChange: i,
|
|
17
|
+
defaultTableSize: f,
|
|
18
|
+
tableSize: s,
|
|
19
|
+
setTableSize: r
|
|
20
|
+
} = g(j), { toolbarItemClassName: y } = z(), d = I({
|
|
21
|
+
defaultSize: f,
|
|
23
22
|
items: [
|
|
24
23
|
{
|
|
25
24
|
key: "xl",
|
|
@@ -27,7 +26,7 @@ const z = (e) => {
|
|
|
27
26
|
},
|
|
28
27
|
{
|
|
29
28
|
key: "lg",
|
|
30
|
-
label: "
|
|
29
|
+
label: "宽松"
|
|
31
30
|
},
|
|
32
31
|
{
|
|
33
32
|
key: "md",
|
|
@@ -42,18 +41,26 @@ const z = (e) => {
|
|
|
42
41
|
label: "特紧凑"
|
|
43
42
|
}
|
|
44
43
|
]
|
|
44
|
+
}), x = {
|
|
45
|
+
selectedKeys: [s],
|
|
46
|
+
onClick: (b) => {
|
|
47
|
+
var a;
|
|
48
|
+
const { key: o } = b;
|
|
49
|
+
o !== s && (r == null || r(o), u === "online" && m && (i == null || i(m, o)), (a = e == null ? void 0 : e.onChange) == null || a.call(e, o));
|
|
50
|
+
},
|
|
51
|
+
items: d
|
|
45
52
|
};
|
|
46
|
-
return
|
|
47
|
-
|
|
53
|
+
return t ? /* @__PURE__ */ l.jsx(S, { menu: x, trigger: ["click"], children: /* @__PURE__ */ l.jsx(h, { title: "表格密度", open: !1, children: /* @__PURE__ */ l.jsx(
|
|
54
|
+
C,
|
|
48
55
|
{
|
|
49
|
-
style: { order:
|
|
56
|
+
style: { order: n },
|
|
50
57
|
type: "text",
|
|
51
|
-
className:
|
|
52
|
-
icon:
|
|
58
|
+
className: y,
|
|
59
|
+
icon: c,
|
|
53
60
|
children: "表格密度"
|
|
54
61
|
}
|
|
55
62
|
) }) }) : null;
|
|
56
|
-
},
|
|
63
|
+
}, O = k(w);
|
|
57
64
|
export {
|
|
58
|
-
|
|
65
|
+
O as default
|
|
59
66
|
};
|
|
@@ -1,56 +1,46 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { memo as
|
|
3
|
-
import { Tooltip as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import z from "../../../../node_modules/.store/@ant-design_icons@5.3.5/node_modules/@ant-design/icons/es/icons/
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
if (r) {
|
|
15
|
-
var e = m(r, n);
|
|
16
|
-
if (e)
|
|
17
|
-
return e;
|
|
18
|
-
}
|
|
19
|
-
return null;
|
|
20
|
-
}
|
|
21
|
-
const L = ({
|
|
22
|
-
order: t,
|
|
23
|
-
show: n = !0
|
|
1
|
+
import { j as t } from "../../../../node_modules/.store/react@18.2.0/node_modules/react/jsx-runtime.mjs";
|
|
2
|
+
import { memo as d, useState as p, useMemo as x, useEffect as b } from "react";
|
|
3
|
+
import { Tooltip as E } from "antd";
|
|
4
|
+
import B from "../style.mjs";
|
|
5
|
+
import F from "../../../BitzButton/index.mjs";
|
|
6
|
+
import r from "../../../../node_modules/.store/screenfull@6.0.2/node_modules/screenfull/index.mjs";
|
|
7
|
+
import j from "../../../BitzToast/index.mjs";
|
|
8
|
+
import { findParentFirstNodeByClass as h } from "../../../../utils/findNode.mjs";
|
|
9
|
+
import z from "../../../../node_modules/.store/@ant-design_icons@5.3.5/node_modules/@ant-design/icons/es/icons/FullscreenExitOutlined.mjs";
|
|
10
|
+
import T from "../../../../node_modules/.store/@ant-design_icons@5.3.5/node_modules/@ant-design/icons/es/icons/FullscreenOutlined.mjs";
|
|
11
|
+
const g = ({
|
|
12
|
+
order: m,
|
|
13
|
+
show: u = !0
|
|
24
14
|
}) => {
|
|
25
|
-
const { toolbarItemClassName:
|
|
15
|
+
const { toolbarItemClassName: a } = B(), [l, s] = p(!1), n = x(() => l ? {
|
|
26
16
|
title: "退出全屏",
|
|
27
|
-
icon: /* @__PURE__ */
|
|
17
|
+
icon: /* @__PURE__ */ t.jsx(z, {})
|
|
28
18
|
} : {
|
|
29
19
|
title: "全屏",
|
|
30
|
-
icon: /* @__PURE__ */
|
|
31
|
-
}, [
|
|
32
|
-
|
|
33
|
-
var
|
|
34
|
-
(
|
|
20
|
+
icon: /* @__PURE__ */ t.jsx(T, {})
|
|
21
|
+
}, [l]);
|
|
22
|
+
b(() => (document == null || document.addEventListener("fullscreenchange", (o) => {
|
|
23
|
+
var e, i, c;
|
|
24
|
+
(e = o.target) != null && e.classList.contains("bitzTableBlock") && (s(!!document.fullscreenElement), (c = (i = document.fullscreenElement) == null ? void 0 : i.classList) != null && c.contains("bitzTableBlock") || s(!1));
|
|
35
25
|
}), document == null ? void 0 : document.removeEventListener("fullscreenchange", () => {
|
|
36
26
|
})), []);
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
const
|
|
40
|
-
|
|
27
|
+
const f = (o) => {
|
|
28
|
+
r.isEnabled || j.error("您的浏览器不支持全屏");
|
|
29
|
+
const e = h(o.target, "bitzTableBlock");
|
|
30
|
+
l ? r.exit() : r.request(e);
|
|
41
31
|
};
|
|
42
|
-
return
|
|
43
|
-
|
|
32
|
+
return u ? /* @__PURE__ */ t.jsx(E, { title: n.title, open: !1, children: /* @__PURE__ */ t.jsx(
|
|
33
|
+
F,
|
|
44
34
|
{
|
|
45
35
|
type: "text",
|
|
46
|
-
className:
|
|
47
|
-
onClick:
|
|
48
|
-
icon:
|
|
49
|
-
style: { order:
|
|
50
|
-
children:
|
|
36
|
+
className: a,
|
|
37
|
+
onClick: f,
|
|
38
|
+
icon: n.icon,
|
|
39
|
+
style: { order: m },
|
|
40
|
+
children: n.title
|
|
51
41
|
}
|
|
52
42
|
) }) : null;
|
|
53
|
-
},
|
|
43
|
+
}, G = d(g);
|
|
54
44
|
export {
|
|
55
|
-
|
|
45
|
+
G as default
|
|
56
46
|
};
|
|
@@ -1,75 +1,79 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { memo as
|
|
3
|
-
import { Space as
|
|
1
|
+
import { j as s } from "../../../../node_modules/.store/react@18.2.0/node_modules/react/jsx-runtime.mjs";
|
|
2
|
+
import { memo as a, useContext as C, useMemo as h } from "react";
|
|
3
|
+
import { Space as g } from "antd";
|
|
4
4
|
import u from "../RefreshIcon/index.mjs";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { BitzConfigContext as
|
|
10
|
-
const
|
|
5
|
+
import x from "../ColConfigIcon/index.mjs";
|
|
6
|
+
import j from "../DensityIcon/index.mjs";
|
|
7
|
+
import z from "../FullscreenIcon/index.mjs";
|
|
8
|
+
import I from "../ExportIcon/index.mjs";
|
|
9
|
+
import { BitzConfigContext as B } from "../../../BitzConfigProvider/context.mjs";
|
|
10
|
+
const E = [
|
|
11
11
|
"export",
|
|
12
12
|
"refresh",
|
|
13
13
|
"size",
|
|
14
14
|
"fullscreen",
|
|
15
15
|
"colConfig"
|
|
16
|
-
],
|
|
16
|
+
], T = ({
|
|
17
17
|
size: k,
|
|
18
|
-
tools:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
tools: l,
|
|
19
|
+
exclude: t,
|
|
20
|
+
loading: i,
|
|
21
|
+
onExport: m,
|
|
22
|
+
onRefresh: c,
|
|
23
|
+
onSizeChange: p,
|
|
23
24
|
onColumnChange: d
|
|
24
25
|
}) => {
|
|
25
|
-
const { Table: r } =
|
|
26
|
-
const
|
|
26
|
+
const { Table: r } = C(B), f = h(() => {
|
|
27
|
+
const e = l || (r == null ? void 0 : r.toolbar) || E;
|
|
28
|
+
return t != null && t.length ? e.filter((n) => !t.includes(n)) : e;
|
|
29
|
+
}, [r == null ? void 0 : r.toolbar, t]), o = h(() => {
|
|
30
|
+
const e = {
|
|
27
31
|
export: { order: 1, show: !1 },
|
|
28
32
|
refresh: { order: 2, show: !1 },
|
|
29
33
|
size: { order: 3, show: !1 },
|
|
30
34
|
fullscreen: { order: 4, show: !1 },
|
|
31
35
|
colConfig: { order: 5, show: !1 }
|
|
32
36
|
};
|
|
33
|
-
return
|
|
34
|
-
|
|
35
|
-
}),
|
|
36
|
-
}, [
|
|
37
|
-
return /* @__PURE__ */
|
|
38
|
-
/* @__PURE__ */
|
|
39
|
-
|
|
37
|
+
return f.forEach((n, w) => {
|
|
38
|
+
e[n].order = w + 1, e[n].show = f.includes(n);
|
|
39
|
+
}), e;
|
|
40
|
+
}, [f]);
|
|
41
|
+
return /* @__PURE__ */ s.jsxs(g.Compact, { style: { height: "100%" }, children: [
|
|
42
|
+
/* @__PURE__ */ s.jsx(
|
|
43
|
+
I,
|
|
40
44
|
{
|
|
41
45
|
order: o.export.order,
|
|
42
46
|
show: o.export.show,
|
|
43
|
-
loading:
|
|
44
|
-
onClick:
|
|
47
|
+
loading: i,
|
|
48
|
+
onClick: m
|
|
45
49
|
}
|
|
46
50
|
),
|
|
47
|
-
/* @__PURE__ */
|
|
51
|
+
/* @__PURE__ */ s.jsx(
|
|
48
52
|
u,
|
|
49
53
|
{
|
|
50
54
|
order: o.refresh.order,
|
|
51
55
|
show: o.refresh.show,
|
|
52
|
-
loading:
|
|
53
|
-
onClick:
|
|
56
|
+
loading: i,
|
|
57
|
+
onClick: c
|
|
54
58
|
}
|
|
55
59
|
),
|
|
56
|
-
/* @__PURE__ */
|
|
57
|
-
|
|
60
|
+
/* @__PURE__ */ s.jsx(
|
|
61
|
+
j,
|
|
58
62
|
{
|
|
59
63
|
order: o.size.order,
|
|
60
64
|
show: o.size.show,
|
|
61
|
-
onChange:
|
|
65
|
+
onChange: p
|
|
62
66
|
}
|
|
63
67
|
),
|
|
64
|
-
/* @__PURE__ */
|
|
65
|
-
|
|
68
|
+
/* @__PURE__ */ s.jsx(
|
|
69
|
+
z,
|
|
66
70
|
{
|
|
67
71
|
order: o.fullscreen.order,
|
|
68
72
|
show: o.fullscreen.show
|
|
69
73
|
}
|
|
70
74
|
),
|
|
71
|
-
/* @__PURE__ */
|
|
72
|
-
|
|
75
|
+
/* @__PURE__ */ s.jsx(
|
|
76
|
+
x,
|
|
73
77
|
{
|
|
74
78
|
order: o.colConfig.order,
|
|
75
79
|
show: o.colConfig.show,
|
|
@@ -77,7 +81,7 @@ const B = [
|
|
|
77
81
|
}
|
|
78
82
|
)
|
|
79
83
|
] });
|
|
80
|
-
},
|
|
84
|
+
}, G = a(T);
|
|
81
85
|
export {
|
|
82
|
-
|
|
86
|
+
G as default
|
|
83
87
|
};
|
|
@@ -5,7 +5,7 @@ import ColConfigIcon from './ColConfigIcon';
|
|
|
5
5
|
import { DensitySize } from '../Store';
|
|
6
6
|
import { MouseEventHandler } from 'react';
|
|
7
7
|
import FullscreenIcon from './FullscreenIcon';
|
|
8
|
-
import { ToolEnum } from '
|
|
8
|
+
import { ToolEnum } from '../../../components/BitzConfigProvider/context';
|
|
9
9
|
import { ColumnsConfigProps } from '..';
|
|
10
10
|
export type MenuKeysType = 'excel';
|
|
11
11
|
export type ExportEvent = (key: MenuKeysType) => void;
|
|
@@ -13,6 +13,8 @@ export interface BitzTableToolBarProps {
|
|
|
13
13
|
size?: DensitySize;
|
|
14
14
|
/** 控制tool按钮的排序和显隐,根据索引排序,不在tools数组中的不显示 */
|
|
15
15
|
tools?: ToolEnum[];
|
|
16
|
+
/** 需要隐藏的tool按钮 */
|
|
17
|
+
exclude?: ToolEnum[];
|
|
16
18
|
loading?: boolean;
|
|
17
19
|
/**
|
|
18
20
|
* 导出按钮下拉菜单的点击事件,通过key值判断是导出为excel或其他格式的文件
|