bitz-react-admin-ui 1.7.6 → 1.7.8

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.
Files changed (32) hide show
  1. package/dist/_virtual/dayjs.min.mjs +5 -2
  2. package/dist/_virtual/dayjs.min2.mjs +4 -0
  3. package/dist/_virtual/index.mjs +2 -2
  4. package/dist/_virtual/index2.mjs +2 -2
  5. package/dist/components/BitzCalendar/index.mjs +1 -1
  6. package/dist/components/BitzConfigProvider/context.d.ts +1 -0
  7. package/dist/components/BitzConfigProvider/index.d.ts +10 -0
  8. package/dist/components/BitzDayJs/index.mjs +1 -1
  9. package/dist/components/BitzFuiCalendar/BitzFuiCalendarStore.mjs +1 -1
  10. package/dist/components/BitzFuiCalendar/CalendarAgendum.mjs +1 -1
  11. package/dist/components/BitzFuiCalendar/CalendarAgendumItem.mjs +1 -1
  12. package/dist/components/BitzFuiCalendar/CalendarHeadItem.mjs +1 -1
  13. package/dist/components/BitzFuiCalendar/CalendarToolbar.mjs +1 -1
  14. package/dist/components/BitzFuiCalendar/ColumnData.mjs +1 -1
  15. package/dist/components/BitzMeetingTime/BitzMeetingTimeItem.mjs +1 -1
  16. package/dist/components/BitzMeetingTime/index.mjs +1 -1
  17. package/dist/components/BitzTable/Store/index.d.ts +12 -0
  18. package/dist/components/BitzTable/Store/index.mjs +150 -99
  19. package/dist/components/BitzTable/Table/index.mjs +191 -185
  20. package/dist/components/BitzTable/ToolBar/ColConfigIcon/ColumnSettingModal.d.ts +5 -3
  21. package/dist/components/BitzTable/ToolBar/ColConfigIcon/ColumnSettingModal.mjs +93 -89
  22. package/dist/components/BitzTable/ToolBar/ColConfigIcon/index.d.ts +2 -1
  23. package/dist/components/BitzTable/ToolBar/ColConfigIcon/index.mjs +21 -17
  24. package/dist/components/BitzTable/ToolBar/DensityIcon/index.mjs +26 -20
  25. package/dist/components/BitzTable/ToolBar/index.d.ts +2 -1
  26. package/dist/node_modules/.store/classnames@2.5.1/node_modules/classnames/index.mjs +1 -1
  27. package/dist/node_modules/.store/dayjs@1.11.10/node_modules/dayjs/dayjs.min.mjs +292 -292
  28. package/dist/node_modules/.store/dayjs@1.11.10/node_modules/dayjs/locale/zh-cn.mjs +13 -13
  29. package/dist/node_modules/.store/prop-types@15.8.1/node_modules/prop-types/index.mjs +1 -1
  30. package/dist/style.css +1 -1
  31. package/dist/utils/time.mjs +1 -1
  32. package/package.json +1 -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 Z, useModal as L, antdModalV5 as ee } from "@ebay/nice-modal-react";
3
- import { Modal as oe, Typography as se, Checkbox as te, Button as le } from "antd";
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 R, useContext as ne, useEffect as re, useCallback as A, useMemo as C } from "react";
6
- import { TableContext as ae } from "../../Store/index.mjs";
7
- import { genColumnKey as O, columnSort as ce } from "../../Store/utils/index.mjs";
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 ie } from "../../../../node_modules/.store/@dnd-kit_core@6.1.0/node_modules/@dnd-kit/core/dist/core.esm.mjs";
10
- import { SortableContext as me, verticalListSortingStrategy as de, arrayMove as ue } from "../../../../node_modules/.store/@dnd-kit_sortable@7.0.2/node_modules/@dnd-kit/sortable/dist/sortable.esm.mjs";
11
- import pe from "./DndItem.mjs";
12
- import { restrictToVerticalAxis as he, restrictToWindowEdges as xe } from "../../../../node_modules/.store/@dnd-kit_modifiers@6.0.1/node_modules/@dnd-kit/modifiers/dist/modifiers.esm.mjs";
13
- import V from "../../../BitzButton/index.mjs";
14
- import { useImmer as be } from "../../../../node_modules/.store/use-immer@0.9.0/node_modules/use-immer/dist/use-immer.module.mjs";
15
- import { css as ye } from "../../../../node_modules/.store/@emotion_css@11.11.2/node_modules/@emotion/css/dist/emotion-css.esm.mjs";
16
- import fe from "../../../BitzTheme/index.mjs";
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 F from "../../../../node_modules/.store/lodash-es@4.17.21/node_modules/lodash-es/omit.mjs";
19
- import Ce from "../../../../node_modules/.store/@ant-design_icons@5.3.3/node_modules/@ant-design/icons/es/icons/CheckCircleOutlined.mjs";
20
- import Me from "../../../../node_modules/.store/@ant-design_icons@5.3.3/node_modules/@ant-design/icons/es/icons/RedoOutlined.mjs";
21
- const Fe = Z(() => {
22
- var T, D, I, _;
23
- const { token: i } = fe.useToken(), b = L(), [M, j] = R(null), [P, S] = R(!1), [a, y] = be({
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: W,
28
- persistenceKey: N,
27
+ persistenceType: G,
28
+ persistenceKey: B,
29
29
  onlineChange: g,
30
- columnsMap: $,
31
- setColumnsMap: q,
32
- sortKeyColumns: G,
33
- setSortKeyColumns: J,
30
+ columnsMap: J,
31
+ setColumnsMap: L,
32
+ sortKeyColumns: Q,
33
+ setSortKeyColumns: U,
34
34
  // clearPersistenceStorage,
35
35
  ...l
36
- } = ne(ae);
37
- re(() => {
36
+ } = ce(me);
37
+ ie(() => {
38
38
  y((e) => {
39
- e.columnsMap = { ...$ }, e.sortKeyColumns = [...G];
39
+ e.columnsMap = { ...J }, e.sortKeyColumns = [...Q];
40
40
  });
41
41
  }, []);
42
- const Q = A(() => {
42
+ const X = V(() => {
43
43
  y((e) => {
44
44
  e.columnsMap = { ...l.defaultColumnKeyMap };
45
45
  });
46
- }, []), h = C(() => {
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 f = O(
50
+ const C = F(
51
51
  u || t,
52
52
  [u || t].filter(Boolean).join("-")
53
- ), d = a.columnsMap[f || "null"];
53
+ ), d = a.columnsMap[C || "null"];
54
54
  return (d == null ? void 0 : d.show) !== !1 && e.push({
55
- key: f,
56
- ...F(m, ["className"]),
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(ce(a.columnsMap));
61
- }, [a.columnsMap, l == null ? void 0 : l.columns]), k = A(
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
- ), K = C(
68
- () => M ? k(M) : -1,
69
- [M, k]
70
- ), w = C(() => {
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: f, children: d, ...E }) => {
73
- var z;
74
- const v = O(
75
- m || f,
76
- [t == null ? void 0 : t.columnKey, E.index].filter(Boolean).join("-")
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 H = {
79
+ const A = {
80
80
  key: v,
81
- ...F(E, ["className"]),
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 : (z = c == null ? void 0 : c.disable) == null ? void 0 : z.checkbox,
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, H), H;
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]), U = (e, s) => {
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), S(!0), y((t) => {
94
+ })(s.key), w(!0), y((t) => {
95
95
  t.columnsMap = { ...n };
96
96
  });
97
- }, X = (e, s) => {
98
- const n = { ...a.columnsMap }, u = ue(a.sortKeyColumns, e, s);
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
- }), S(!0), y((t) => {
101
+ }), w(!0), y((t) => {
102
102
  t.columnsMap = { ...n }, t.sortKeyColumns = u;
103
103
  });
104
- }, Y = () => {
105
- q(a.columnsMap), J(a.sortKeyColumns), W === "online" && N && (g == null || g(N, a.columnsMap)), b.resolve({ ...a.columnsMap }), b.hide();
106
- }, B = () => {
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 = C(() => i.mode === "dark", [i.mode]);
111
+ }, x = M(() => i.mode === "dark", [i.mode]);
109
112
  return /* @__PURE__ */ o.jsxs(
110
- oe,
113
+ le,
111
114
  {
112
115
  className: "tableColumnSettingModal",
113
- title: /* @__PURE__ */ o.jsx(se.Title, { level: 4, style: { margin: 0 }, children: "自定义列" }),
114
- ...ee(b),
116
+ title: /* @__PURE__ */ o.jsx(ne.Title, { style: { fontSize: 16, margin: 0 }, children: "列设置" }),
117
+ ...te(b),
115
118
  style: {
116
- "--modalContent-bgColor": (T = i.Modal) == null ? void 0 : T.contentBg,
117
- "--header-bgColor": (D = i.Modal) == null ? void 0 : D.headerBg,
118
- "--footer-bgColor": (I = i.Modal) == null ? void 0 : I.footerBg,
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: B,
133
+ onCancel: I,
131
134
  footer: /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
132
135
  /* @__PURE__ */ o.jsx(
133
- V,
136
+ P,
134
137
  {
135
138
  type: "primary",
136
- icon: /* @__PURE__ */ o.jsx(Ce, {}),
137
- onClick: Y,
138
- disabled: !P,
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(V, { onClick: B, children: "取消" })
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: (_ = w.list) == null ? void 0 : _.map((e) => {
158
- const s = w.keys.includes(e.key);
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 && U(s, e),
170
+ onClick: () => !e.disabled && Y(s, e),
167
171
  children: [
168
- /* @__PURE__ */ o.jsx(te, { checked: s, disabled: e.disabled }),
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
- le,
196
+ ae,
193
197
  {
194
198
  type: "link",
195
- icon: /* @__PURE__ */ o.jsx(Me, {}),
199
+ icon: /* @__PURE__ */ o.jsx(ge, {}),
196
200
  size: "small",
197
- onClick: Q,
198
- className: ye`
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
- ie,
212
+ ue,
209
213
  {
210
- modifiers: [he, xe],
214
+ modifiers: [be, ye],
211
215
  onDragStart: (e) => {
212
216
  const { active: s } = e;
213
- s && j(s == null ? void 0 : s.id);
217
+ s && k(s == null ? void 0 : s.id);
214
218
  },
215
- onDragCancel: () => j(null),
219
+ onDragCancel: () => k(null),
216
220
  onDragEnd: (e) => {
217
- j(null);
221
+ k(null);
218
222
  const { over: s } = e;
219
223
  if (s) {
220
- const n = k(s.id);
221
- K !== n && X(K, n);
224
+ const n = S(s.id);
225
+ T !== n && Z(T, n);
222
226
  }
223
227
  },
224
228
  children: /* @__PURE__ */ o.jsx(
225
- me,
229
+ pe,
226
230
  {
227
231
  items: h == null ? void 0 : h.map((e) => e.key),
228
- strategy: de,
229
- children: /* @__PURE__ */ o.jsx("ul", { className: r.content, children: h == null ? void 0 : h.map((e) => /* @__PURE__ */ o.jsx(pe, { item: e }, e.key)) })
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
- Fe as default
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?: (columns: any) => void;
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 u, { useContext as c } from "react";
3
- import { Tooltip as d } from "antd";
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 x from "../style.mjs";
7
- import h from "../../../BitzButton/index.mjs";
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 j from "../../../../node_modules/.store/@ant-design_icons@5.3.3/node_modules/@ant-design/icons/es/icons/SettingOutlined.mjs";
10
- const S = (o) => {
11
- const { order: m, show: i = !0, icon: l = /* @__PURE__ */ t.jsx(j, {}) } = o, { toolbarItemClassName: r } = x(), { uuid: e } = c(g), s = () => {
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(C, { id: `ColumnSettingModal-${e}` }),
19
- /* @__PURE__ */ t.jsx(d, { title: "列设置", open: !1, children: /* @__PURE__ */ t.jsx(
20
- h,
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: s,
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 = u.memo(S);
35
+ }, N = a.memo(j);
32
36
  export {
33
37
  N as default
34
38
  };
@@ -1,17 +1,23 @@
1
- import { j as o } from "../../../../node_modules/.store/react@18.2.0/node_modules/react/jsx-runtime.mjs";
2
- import { memo as d, useContext as y } from "react";
3
- import { Dropdown as u, Tooltip as b } from "antd";
4
- import { TableContext as f } from "../../Store/index.mjs";
5
- import k from "../style.mjs";
6
- import h from "../../../BitzButton/index.mjs";
7
- import j from "../../../../node_modules/.store/@ant-design_icons@5.3.3/node_modules/@ant-design/icons/es/icons/ColumnHeightOutlined.mjs";
8
- const C = (e) => {
9
- const { order: m, show: s = !0, icon: r = /* @__PURE__ */ o.jsx(j, {}) } = e, t = y(f), { toolbarItemClassName: a } = k(), c = {
10
- selectedKeys: [t.tableSize],
11
- onClick: ({ key: x }) => {
12
- var n, i;
13
- const l = x;
14
- (n = t.setTableSize) == null || n.call(t, l), (i = e == null ? void 0 : e.onChange) == null || i.call(e, l);
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 b } from "react";
3
+ import { Dropdown as k, Tooltip as j } from "antd";
4
+ import { TableContext as h } from "../../Store/index.mjs";
5
+ import C from "../style.mjs";
6
+ import g 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 D = (e) => {
9
+ const { order: m, show: r = !0, icon: c = /* @__PURE__ */ t.jsx(w, {}) } = e, {
10
+ persistenceType: a,
11
+ persistenceKey: s,
12
+ onlineSizeChange: o,
13
+ tableSize: y,
14
+ setTableSize: l
15
+ } = b(h), { toolbarItemClassName: x } = C(), d = {
16
+ selectedKeys: [y],
17
+ onClick: ({ key: u }) => {
18
+ var i;
19
+ const n = u;
20
+ l == null || l(n), a === "online" && s && (o == null || o(s, n)), (i = e == null ? void 0 : e.onChange) == null || i.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 s ? /* @__PURE__ */ o.jsx(u, { menu: c, trigger: ["click"], children: /* @__PURE__ */ o.jsx(b, { title: "表格密度", open: !1, children: /* @__PURE__ */ o.jsx(
40
- h,
45
+ return r ? /* @__PURE__ */ t.jsx(k, { menu: d, trigger: ["click"], children: /* @__PURE__ */ t.jsx(j, { title: "表格密度", open: !1, children: /* @__PURE__ */ t.jsx(
46
+ g,
41
47
  {
42
48
  style: { order: m },
43
49
  type: "text",
44
- className: a,
45
- icon: r,
50
+ className: x,
51
+ icon: c,
46
52
  children: "表格密度"
47
53
  }
48
54
  ) }) }) : null;
49
- }, B = d(C);
55
+ }, G = f(D);
50
56
  export {
51
- B as default
57
+ G 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: any) => void;
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 { getDefaultExportFromCjs as u } from "../../../../../_virtual/_commonjsHelpers.mjs";
2
- import { __module as i } from "../../../../../_virtual/index2.mjs";
2
+ import { __module as i } from "../../../../../_virtual/index.mjs";
3
3
  /*!
4
4
  Copyright (c) 2018 Jed Watson.
5
5
  Licensed under the MIT License (MIT), see