bitz-react-admin-ui 1.7.7 → 1.7.9
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 +1 -0
- package/dist/components/BitzConfigProvider/index.d.ts +10 -0
- package/dist/components/BitzConfirmModal/index.d.ts +5 -0
- package/dist/components/BitzConvert/DropdownToButton/index.d.ts +6 -6
- package/dist/components/BitzTable/Store/index.d.ts +25 -13
- package/dist/components/BitzTable/Store/index.mjs +168 -117
- package/dist/components/BitzTable/Table/index.d.ts +6 -1
- package/dist/components/BitzTable/Table/index.mjs +190 -185
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/ColumnSettingModal.d.ts +5 -3
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/ColumnSettingModal.mjs +93 -89
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/index.d.ts +2 -1
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/index.mjs +21 -17
- package/dist/components/BitzTable/ToolBar/DensityIcon/index.mjs +27 -21
- package/dist/components/BitzTable/ToolBar/index.d.ts +2 -1
- package/dist/components/BitzTable/index.d.ts +2 -2
- package/dist/style.css +1 -1
- package/package.json +5 -1
|
@@ -1,121 +1,124 @@
|
|
|
1
1
|
import { j as o } from "../../../../node_modules/.store/react@18.2.0/node_modules/react/jsx-runtime.mjs";
|
|
2
|
-
import { create as
|
|
3
|
-
import { Modal as
|
|
2
|
+
import { create as oe, useModal as se, antdModalV5 as te } from "@ebay/nice-modal-react";
|
|
3
|
+
import { Modal as le, Typography as ne, Checkbox as re, Button as ae } from "antd";
|
|
4
4
|
import r from "./index.module.less.mjs";
|
|
5
|
-
import { useState as
|
|
6
|
-
import { TableContext as
|
|
7
|
-
import { genColumnKey as
|
|
5
|
+
import { useState as N, useContext as ce, useEffect as ie, useCallback as V, useMemo as M } from "react";
|
|
6
|
+
import { TableContext as me } from "../../Store/index.mjs";
|
|
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
|
-
import { DndContext as
|
|
10
|
-
import { SortableContext as
|
|
11
|
-
import
|
|
12
|
-
import { restrictToVerticalAxis as
|
|
13
|
-
import
|
|
14
|
-
import { useImmer as
|
|
15
|
-
import { css as
|
|
16
|
-
import
|
|
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 he, arrayMove as xe } from "../../../../node_modules/.store/@dnd-kit_sortable@7.0.2/node_modules/@dnd-kit/sortable/dist/sortable.esm.mjs";
|
|
11
|
+
import fe from "./DndItem.mjs";
|
|
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
|
+
import P from "../../../BitzButton/index.mjs";
|
|
14
|
+
import { useImmer as Ce } from "../../../../node_modules/.store/use-immer@0.9.0/node_modules/use-immer/dist/use-immer.module.mjs";
|
|
15
|
+
import { css as Me } from "../../../../node_modules/.store/@emotion_css@11.11.2/node_modules/@emotion/css/dist/emotion-css.esm.mjs";
|
|
16
|
+
import je from "../../../BitzTheme/index.mjs";
|
|
17
17
|
import "./index.less.mjs";
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
const
|
|
22
|
-
var
|
|
23
|
-
const { token: i } =
|
|
18
|
+
import W from "../../../../node_modules/.store/lodash-es@4.17.21/node_modules/lodash-es/omit.mjs";
|
|
19
|
+
import ke from "../../../../node_modules/.store/@ant-design_icons@5.3.3/node_modules/@ant-design/icons/es/icons/CheckCircleOutlined.mjs";
|
|
20
|
+
import ge from "../../../../node_modules/.store/@ant-design_icons@5.3.3/node_modules/@ant-design/icons/es/icons/RedoOutlined.mjs";
|
|
21
|
+
const $e = oe(({ onChange: f }) => {
|
|
22
|
+
var _, E, z, H;
|
|
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: {},
|
|
25
25
|
sortKeyColumns: []
|
|
26
26
|
}), {
|
|
27
|
-
persistenceType:
|
|
28
|
-
persistenceKey:
|
|
27
|
+
persistenceType: G,
|
|
28
|
+
persistenceKey: B,
|
|
29
29
|
onlineChange: g,
|
|
30
|
-
columnsMap:
|
|
31
|
-
setColumnsMap:
|
|
32
|
-
sortKeyColumns:
|
|
33
|
-
setSortKeyColumns:
|
|
30
|
+
columnsMap: J,
|
|
31
|
+
setColumnsMap: L,
|
|
32
|
+
sortKeyColumns: Q,
|
|
33
|
+
setSortKeyColumns: U,
|
|
34
34
|
// clearPersistenceStorage,
|
|
35
35
|
...l
|
|
36
|
-
} =
|
|
37
|
-
|
|
36
|
+
} = ce(me);
|
|
37
|
+
ie(() => {
|
|
38
38
|
y((e) => {
|
|
39
|
-
e.columnsMap = {
|
|
39
|
+
e.columnsMap = { ...J }, e.sortKeyColumns = [...Q];
|
|
40
40
|
});
|
|
41
41
|
}, []);
|
|
42
|
-
const
|
|
42
|
+
const X = V(() => {
|
|
43
43
|
y((e) => {
|
|
44
44
|
e.columnsMap = { ...l.defaultColumnKeyMap };
|
|
45
45
|
});
|
|
46
|
-
}, []), h =
|
|
46
|
+
}, []), h = 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 }) => {
|
|
50
|
-
const
|
|
50
|
+
const C = F(
|
|
51
51
|
u || t,
|
|
52
52
|
[u || t].filter(Boolean).join("-")
|
|
53
|
-
), d = a.columnsMap[
|
|
53
|
+
), d = a.columnsMap[C || "null"];
|
|
54
54
|
return (d == null ? void 0 : d.show) !== !1 && e.push({
|
|
55
|
-
key:
|
|
56
|
-
...
|
|
55
|
+
key: C,
|
|
56
|
+
...W(m, ["className"]),
|
|
57
57
|
selectable: !1,
|
|
58
58
|
disabled: (d == null ? void 0 : d.disable) === !0
|
|
59
59
|
}), d;
|
|
60
|
-
})), e.sort(
|
|
61
|
-
}, [a.columnsMap, l == null ? void 0 : l.columns]),
|
|
60
|
+
})), e.sort(de(a.columnsMap));
|
|
61
|
+
}, [a.columnsMap, l == null ? void 0 : l.columns]), S = V(
|
|
62
62
|
(e) => {
|
|
63
63
|
var s;
|
|
64
64
|
return (s = a.sortKeyColumns) == null ? void 0 : s.findIndex((n) => n === e);
|
|
65
65
|
},
|
|
66
66
|
[a.sortKeyColumns]
|
|
67
|
-
),
|
|
68
|
-
() =>
|
|
69
|
-
[
|
|
70
|
-
),
|
|
67
|
+
), T = M(
|
|
68
|
+
() => j ? S(j) : -1,
|
|
69
|
+
[j, S]
|
|
70
|
+
), D = M(() => {
|
|
71
71
|
const e = [], s = /* @__PURE__ */ new Map();
|
|
72
|
-
return { list: ((u, t) => u.map(({ key: m, dataIndex:
|
|
73
|
-
var
|
|
74
|
-
const v =
|
|
75
|
-
m ||
|
|
76
|
-
[t == null ? void 0 : t.columnKey,
|
|
72
|
+
return { list: ((u, t) => u.map(({ key: m, dataIndex: C, children: d, ...R }) => {
|
|
73
|
+
var O;
|
|
74
|
+
const v = F(
|
|
75
|
+
m || C,
|
|
76
|
+
[t == null ? void 0 : t.columnKey, R.index].filter(Boolean).join("-")
|
|
77
77
|
), c = a.columnsMap[v || "null"] || { show: !0 };
|
|
78
78
|
(c == null ? void 0 : c.show) !== !1 && !d && e.push(v);
|
|
79
|
-
const
|
|
79
|
+
const A = {
|
|
80
80
|
key: v,
|
|
81
|
-
...
|
|
81
|
+
...W(R, ["className"]),
|
|
82
82
|
selectable: !1,
|
|
83
83
|
disabled: c.disable === !0,
|
|
84
|
-
disableCheckbox: typeof c.disable == "boolean" ? c == null ? void 0 : c.disable : (
|
|
84
|
+
disableCheckbox: typeof c.disable == "boolean" ? c == null ? void 0 : c.disable : (O = c == null ? void 0 : c.disable) == null ? void 0 : O.checkbox,
|
|
85
85
|
isLeaf: t ? !0 : void 0
|
|
86
86
|
};
|
|
87
|
-
return s.set(m,
|
|
87
|
+
return s.set(m, A), A;
|
|
88
88
|
}))(l == null ? void 0 : l.columns), keys: e, map: s };
|
|
89
|
-
}, [a.columnsMap, l == null ? void 0 : l.columns]),
|
|
89
|
+
}, [a.columnsMap, l == null ? void 0 : l.columns]), Y = (e, s) => {
|
|
90
90
|
const n = { ...a.columnsMap };
|
|
91
91
|
((t) => {
|
|
92
92
|
const m = { ...n[t] };
|
|
93
93
|
m.show = !e, n[t] = m;
|
|
94
|
-
})(s.key),
|
|
94
|
+
})(s.key), w(!0), y((t) => {
|
|
95
95
|
t.columnsMap = { ...n };
|
|
96
96
|
});
|
|
97
|
-
},
|
|
98
|
-
const n = { ...a.columnsMap }, u =
|
|
97
|
+
}, Z = (e, s) => {
|
|
98
|
+
const n = { ...a.columnsMap }, u = xe(a.sortKeyColumns, e, s);
|
|
99
99
|
u.forEach((t, m) => {
|
|
100
100
|
n[t] = { ...n[t] || {}, order: m };
|
|
101
|
-
}),
|
|
101
|
+
}), w(!0), y((t) => {
|
|
102
102
|
t.columnsMap = { ...n }, t.sortKeyColumns = u;
|
|
103
103
|
});
|
|
104
|
-
},
|
|
105
|
-
|
|
106
|
-
|
|
104
|
+
}, ee = () => {
|
|
105
|
+
var e;
|
|
106
|
+
L(a.columnsMap), U(a.sortKeyColumns), G === "online" && B && (g == null || g(B, a.columnsMap)), f ? (K(!0), (e = f == null ? void 0 : f(a.columnsMap)) == null || e.finally(() => {
|
|
107
|
+
K(!1), b.hide();
|
|
108
|
+
})) : b.hide();
|
|
109
|
+
}, I = () => {
|
|
107
110
|
b.hide();
|
|
108
|
-
}, x =
|
|
111
|
+
}, x = M(() => i.mode === "dark", [i.mode]);
|
|
109
112
|
return /* @__PURE__ */ o.jsxs(
|
|
110
|
-
|
|
113
|
+
le,
|
|
111
114
|
{
|
|
112
115
|
className: "tableColumnSettingModal",
|
|
113
|
-
title: /* @__PURE__ */ o.jsx(
|
|
114
|
-
...
|
|
116
|
+
title: /* @__PURE__ */ o.jsx(ne.Title, { style: { fontSize: 16, margin: 0 }, children: "列设置" }),
|
|
117
|
+
...te(b),
|
|
115
118
|
style: {
|
|
116
|
-
"--modalContent-bgColor": (
|
|
117
|
-
"--header-bgColor": (
|
|
118
|
-
"--footer-bgColor": (
|
|
119
|
+
"--modalContent-bgColor": (_ = i.Modal) == null ? void 0 : _.contentBg,
|
|
120
|
+
"--header-bgColor": (E = i.Modal) == null ? void 0 : E.headerBg,
|
|
121
|
+
"--footer-bgColor": (z = i.Modal) == null ? void 0 : z.footerBg,
|
|
119
122
|
"--blockTitle-colorBg": x ? "#333" : "#fff",
|
|
120
123
|
"--leftBody-bgColor": x ? "#262626" : "#e0e0e0",
|
|
121
124
|
"--rightBody-bgColor": x ? "#262626" : "#fff",
|
|
@@ -127,19 +130,20 @@ const Fe = Z(() => {
|
|
|
127
130
|
},
|
|
128
131
|
styles: { body: { maxHeight: window.innerHeight - 300 } },
|
|
129
132
|
width: 600,
|
|
130
|
-
onCancel:
|
|
133
|
+
onCancel: I,
|
|
131
134
|
footer: /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
|
|
132
135
|
/* @__PURE__ */ o.jsx(
|
|
133
|
-
|
|
136
|
+
P,
|
|
134
137
|
{
|
|
135
138
|
type: "primary",
|
|
136
|
-
icon: /* @__PURE__ */ o.jsx(
|
|
137
|
-
onClick:
|
|
138
|
-
disabled: !
|
|
139
|
+
icon: /* @__PURE__ */ o.jsx(ke, {}),
|
|
140
|
+
onClick: ee,
|
|
141
|
+
disabled: !q,
|
|
142
|
+
loading: $,
|
|
139
143
|
children: "保存"
|
|
140
144
|
}
|
|
141
145
|
),
|
|
142
|
-
/* @__PURE__ */ o.jsx(
|
|
146
|
+
/* @__PURE__ */ o.jsx(P, { onClick: I, children: "取消" })
|
|
143
147
|
] }),
|
|
144
148
|
children: [
|
|
145
149
|
/* @__PURE__ */ o.jsx("div", { className: p(r.introduce, "tableColumnSetting_introduce"), children: "选择要在表中显示的可用列。拖动选定的列以对其重新排序。" }),
|
|
@@ -154,8 +158,8 @@ const Fe = Z(() => {
|
|
|
154
158
|
/* @__PURE__ */ o.jsx("div", { className: p(r.title, "tableColumnSetting_title"), children: "可用列" }),
|
|
155
159
|
/* @__PURE__ */ o.jsx("div", {})
|
|
156
160
|
] }),
|
|
157
|
-
/* @__PURE__ */ o.jsx("div", { className: p(r.body, "tableColumnSetting_body"), children: /* @__PURE__ */ o.jsx("ul", { className: r.content, children: (
|
|
158
|
-
const s =
|
|
161
|
+
/* @__PURE__ */ o.jsx("div", { className: p(r.body, "tableColumnSetting_body"), children: /* @__PURE__ */ o.jsx("ul", { className: r.content, children: (H = D.list) == null ? void 0 : H.map((e) => {
|
|
162
|
+
const s = D.keys.includes(e.key);
|
|
159
163
|
return /* @__PURE__ */ o.jsxs(
|
|
160
164
|
"li",
|
|
161
165
|
{
|
|
@@ -163,9 +167,9 @@ const Fe = Z(() => {
|
|
|
163
167
|
[r.checked]: !s,
|
|
164
168
|
tableColumnSetting_checked: !s
|
|
165
169
|
}),
|
|
166
|
-
onClick: () => !e.disabled &&
|
|
170
|
+
onClick: () => !e.disabled && Y(s, e),
|
|
167
171
|
children: [
|
|
168
|
-
/* @__PURE__ */ o.jsx(
|
|
172
|
+
/* @__PURE__ */ o.jsx(re, { checked: s, disabled: e.disabled }),
|
|
169
173
|
/* @__PURE__ */ o.jsx(
|
|
170
174
|
"span",
|
|
171
175
|
{
|
|
@@ -189,13 +193,13 @@ const Fe = Z(() => {
|
|
|
189
193
|
/* @__PURE__ */ o.jsxs("div", { className: r.header, children: [
|
|
190
194
|
/* @__PURE__ */ o.jsx("div", { className: r.title, children: "选定列" }),
|
|
191
195
|
/* @__PURE__ */ o.jsx(
|
|
192
|
-
|
|
196
|
+
ae,
|
|
193
197
|
{
|
|
194
198
|
type: "link",
|
|
195
|
-
icon: /* @__PURE__ */ o.jsx(
|
|
199
|
+
icon: /* @__PURE__ */ o.jsx(ge, {}),
|
|
196
200
|
size: "small",
|
|
197
|
-
onClick:
|
|
198
|
-
className:
|
|
201
|
+
onClick: X,
|
|
202
|
+
className: Me`
|
|
199
203
|
&:hover {
|
|
200
204
|
color: ${i.colorPrimary} !important;
|
|
201
205
|
}
|
|
@@ -205,28 +209,28 @@ const Fe = Z(() => {
|
|
|
205
209
|
)
|
|
206
210
|
] }),
|
|
207
211
|
/* @__PURE__ */ o.jsx("div", { className: p(r.body, "tableColumnSetting_body-order"), children: /* @__PURE__ */ o.jsx(
|
|
208
|
-
|
|
212
|
+
ue,
|
|
209
213
|
{
|
|
210
|
-
modifiers: [
|
|
214
|
+
modifiers: [be, ye],
|
|
211
215
|
onDragStart: (e) => {
|
|
212
216
|
const { active: s } = e;
|
|
213
|
-
s &&
|
|
217
|
+
s && k(s == null ? void 0 : s.id);
|
|
214
218
|
},
|
|
215
|
-
onDragCancel: () =>
|
|
219
|
+
onDragCancel: () => k(null),
|
|
216
220
|
onDragEnd: (e) => {
|
|
217
|
-
|
|
221
|
+
k(null);
|
|
218
222
|
const { over: s } = e;
|
|
219
223
|
if (s) {
|
|
220
|
-
const n =
|
|
221
|
-
|
|
224
|
+
const n = S(s.id);
|
|
225
|
+
T !== n && Z(T, n);
|
|
222
226
|
}
|
|
223
227
|
},
|
|
224
228
|
children: /* @__PURE__ */ o.jsx(
|
|
225
|
-
|
|
229
|
+
pe,
|
|
226
230
|
{
|
|
227
231
|
items: h == null ? void 0 : h.map((e) => e.key),
|
|
228
|
-
strategy:
|
|
229
|
-
children: /* @__PURE__ */ o.jsx("ul", { className: r.content, children: h == null ? void 0 : h.map((e) => /* @__PURE__ */ o.jsx(
|
|
232
|
+
strategy: he,
|
|
233
|
+
children: /* @__PURE__ */ o.jsx("ul", { className: r.content, children: h == null ? void 0 : h.map((e) => /* @__PURE__ */ o.jsx(fe, { item: e }, e.key)) })
|
|
230
234
|
}
|
|
231
235
|
)
|
|
232
236
|
}
|
|
@@ -240,5 +244,5 @@ const Fe = Z(() => {
|
|
|
240
244
|
);
|
|
241
245
|
});
|
|
242
246
|
export {
|
|
243
|
-
|
|
247
|
+
$e as default
|
|
244
248
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { BitzTableToolBarProps } from '..';
|
|
2
3
|
interface ColumnSettingProps {
|
|
3
4
|
order?: number;
|
|
4
5
|
show?: boolean;
|
|
5
6
|
icon?: React.ReactNode;
|
|
6
|
-
onChange?:
|
|
7
|
+
onChange?: BitzTableToolBarProps['onColumnChange'];
|
|
7
8
|
}
|
|
8
9
|
declare const _default: React.MemoExoticComponent<(props: ColumnSettingProps) => import("react/jsx-runtime").JSX.Element | null>;
|
|
9
10
|
export default _default;
|
|
@@ -1,34 +1,38 @@
|
|
|
1
1
|
import { j as t } from "../../../../node_modules/.store/react@18.2.0/node_modules/react/jsx-runtime.mjs";
|
|
2
|
-
import
|
|
3
|
-
import { Tooltip as
|
|
2
|
+
import a, { useContext as u } from "react";
|
|
3
|
+
import { Tooltip as c } from "antd";
|
|
4
4
|
import { show as f } from "@ebay/nice-modal-react";
|
|
5
5
|
import C from "./ColumnSettingModal.mjs";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
6
|
+
import d from "../style.mjs";
|
|
7
|
+
import x from "../../../BitzButton/index.mjs";
|
|
8
8
|
import { TableContext as g } from "../../Store/index.mjs";
|
|
9
|
-
import
|
|
10
|
-
const
|
|
11
|
-
const { order: m, show: i = !0, icon: l = /* @__PURE__ */ t.jsx(
|
|
12
|
-
f(`ColumnSettingModal-${e}`).then((a) => {
|
|
13
|
-
var n;
|
|
14
|
-
(n = o.onChange) == null || n.call(o, a);
|
|
15
|
-
});
|
|
16
|
-
};
|
|
9
|
+
import h from "../../../../node_modules/.store/@ant-design_icons@5.3.3/node_modules/@ant-design/icons/es/icons/SettingOutlined.mjs";
|
|
10
|
+
const j = (o) => {
|
|
11
|
+
const { order: m, show: i = !0, icon: l = /* @__PURE__ */ t.jsx(h, {}) } = o, { toolbarItemClassName: r } = d(), { uuid: e } = u(g);
|
|
17
12
|
return i ? /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
18
|
-
/* @__PURE__ */ t.jsx(
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
/* @__PURE__ */ t.jsx(
|
|
14
|
+
C,
|
|
15
|
+
{
|
|
16
|
+
id: `ColumnSettingModal-${e}`,
|
|
17
|
+
onChange: async (s) => {
|
|
18
|
+
var n;
|
|
19
|
+
return (n = o.onChange) == null ? void 0 : n.call(o, s);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
),
|
|
23
|
+
/* @__PURE__ */ t.jsx(c, { title: "列设置", open: !1, children: /* @__PURE__ */ t.jsx(
|
|
24
|
+
x,
|
|
21
25
|
{
|
|
22
26
|
type: "text",
|
|
23
27
|
className: r,
|
|
24
|
-
onClick:
|
|
28
|
+
onClick: () => f(`ColumnSettingModal-${e}`),
|
|
25
29
|
icon: l,
|
|
26
30
|
style: { order: m },
|
|
27
31
|
children: "列设置"
|
|
28
32
|
}
|
|
29
33
|
) })
|
|
30
34
|
] }) : null;
|
|
31
|
-
}, N =
|
|
35
|
+
}, N = a.memo(j);
|
|
32
36
|
export {
|
|
33
37
|
N as default
|
|
34
38
|
};
|
|
@@ -1,17 +1,23 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { memo as
|
|
3
|
-
import { Dropdown as
|
|
4
|
-
import { TableContext as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
const
|
|
9
|
-
const { order:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { j as t } from "../../../../node_modules/.store/react@18.2.0/node_modules/react/jsx-runtime.mjs";
|
|
2
|
+
import { memo as f, useContext as k } from "react";
|
|
3
|
+
import { Dropdown as b, Tooltip as g } from "antd";
|
|
4
|
+
import { TableContext as j } from "../../Store/index.mjs";
|
|
5
|
+
import h from "../style.mjs";
|
|
6
|
+
import C from "../../../BitzButton/index.mjs";
|
|
7
|
+
import w from "../../../../node_modules/.store/@ant-design_icons@5.3.3/node_modules/@ant-design/icons/es/icons/ColumnHeightOutlined.mjs";
|
|
8
|
+
const z = (e) => {
|
|
9
|
+
const { order: s, show: r = !0, icon: c = /* @__PURE__ */ t.jsx(w, {}) } = e, {
|
|
10
|
+
sizeStorageType: a,
|
|
11
|
+
sizeStorageKey: i,
|
|
12
|
+
onlineSizeChange: o,
|
|
13
|
+
tableSize: y,
|
|
14
|
+
setTableSize: l
|
|
15
|
+
} = k(j), { toolbarItemClassName: x } = h(), d = {
|
|
16
|
+
selectedKeys: [y],
|
|
17
|
+
onClick: (u) => {
|
|
18
|
+
var m;
|
|
19
|
+
const { key: n } = u;
|
|
20
|
+
l == null || l(n), a === "online" && i && (o == null || o(i, n)), (m = e == null ? void 0 : e.onChange) == null || m.call(e, n);
|
|
15
21
|
},
|
|
16
22
|
items: [
|
|
17
23
|
{
|
|
@@ -36,17 +42,17 @@ const C = (e) => {
|
|
|
36
42
|
}
|
|
37
43
|
]
|
|
38
44
|
};
|
|
39
|
-
return
|
|
40
|
-
|
|
45
|
+
return r ? /* @__PURE__ */ t.jsx(b, { menu: d, trigger: ["click"], children: /* @__PURE__ */ t.jsx(g, { title: "表格密度", open: !1, children: /* @__PURE__ */ t.jsx(
|
|
46
|
+
C,
|
|
41
47
|
{
|
|
42
|
-
style: { order:
|
|
48
|
+
style: { order: s },
|
|
43
49
|
type: "text",
|
|
44
|
-
className:
|
|
45
|
-
icon:
|
|
50
|
+
className: x,
|
|
51
|
+
icon: c,
|
|
46
52
|
children: "表格密度"
|
|
47
53
|
}
|
|
48
54
|
) }) }) : null;
|
|
49
|
-
},
|
|
55
|
+
}, E = f(z);
|
|
50
56
|
export {
|
|
51
|
-
|
|
57
|
+
E as default
|
|
52
58
|
};
|
|
@@ -6,6 +6,7 @@ import { DensitySize } from '../Store';
|
|
|
6
6
|
import { MouseEventHandler } from 'react';
|
|
7
7
|
import FullscreenIcon from './FullscreenIcon';
|
|
8
8
|
import { ToolEnum } from '@/components/BitzConfigProvider/context';
|
|
9
|
+
import { ColumnsConfigProps } from '..';
|
|
9
10
|
export type MenuKeysType = 'excel';
|
|
10
11
|
export type ExportEvent = (key: MenuKeysType) => void;
|
|
11
12
|
export interface BitzTableToolBarProps {
|
|
@@ -23,7 +24,7 @@ export interface BitzTableToolBarProps {
|
|
|
23
24
|
/** 表格布局更改 */
|
|
24
25
|
onSizeChange?: (size: DensitySize) => void;
|
|
25
26
|
/** 列配置更改 */
|
|
26
|
-
onColumnChange?: (columns:
|
|
27
|
+
onColumnChange?: (columns: Record<string, ColumnsConfigProps>) => Promise<void>;
|
|
27
28
|
}
|
|
28
29
|
type CompoundedComponent = React.ForwardRefExoticComponent<BitzTableToolBarProps> & {
|
|
29
30
|
ExportIcon: typeof ExportIcon;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BitzTableProps } from './Table';
|
|
2
|
-
import BitzTableProvider, { TableContext as BitzTableContext, DensitySize as BitzTableSizeType } from './Store';
|
|
2
|
+
import BitzTableProvider, { TableContext as BitzTableContext, DensitySize as BitzTableSizeType, SizeStateType, ColumnStateType } from './Store';
|
|
3
3
|
import ActionBar from './ActionBar';
|
|
4
4
|
import ToolBar from './ToolBar';
|
|
5
5
|
import ActionCol from './ActionCol';
|
|
@@ -57,6 +57,6 @@ type CompoundedComponent = React.ForwardRefExoticComponent<BitzTableProps> & {
|
|
|
57
57
|
ActionCol: typeof ActionCol;
|
|
58
58
|
};
|
|
59
59
|
declare const BitzTable: CompoundedComponent;
|
|
60
|
-
export type { BitzTableProps, BitzTableSizeType, ColumnsConfigProps, BitzTableColumnType, BitzTableColumnsType, ActionsFunType, Action, BitzTableActionProps, BitzTableActionColProps, };
|
|
60
|
+
export type { BitzTableProps, BitzTableSizeType, ColumnsConfigProps, SizeStateType, ColumnStateType, BitzTableColumnType, BitzTableColumnsType, ActionsFunType, Action, BitzTableActionProps, BitzTableActionColProps, };
|
|
61
61
|
export { BitzTableProvider, BitzTableContext };
|
|
62
62
|
export default BitzTable;
|