bitz-react-admin-ui 1.7.4 → 1.7.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.
Files changed (25) hide show
  1. package/dist/components/BitzConfigProvider/context.d.ts +1 -1
  2. package/dist/components/BitzConfigProvider/index.d.ts +3 -0
  3. package/dist/components/BitzConfirmModal/index.d.ts +6 -5
  4. package/dist/components/BitzConfirmModal/index.mjs +33 -65
  5. package/dist/components/BitzFullScreen/index.d.ts +6 -1
  6. package/dist/components/BitzFullScreen/index.mjs +22 -14
  7. package/dist/components/BitzTable/Store/index.d.ts +20 -29
  8. package/dist/components/BitzTable/Store/utils/index.d.ts +2 -2
  9. package/dist/components/BitzTable/Table/index.mjs +255 -238
  10. package/dist/components/BitzTable/TableSkeleton/index.mjs +20 -19
  11. package/dist/components/BitzTable/ToolBar/ColConfigIcon/index.d.ts +3 -2
  12. package/dist/components/BitzTable/ToolBar/ColConfigIcon/index.mjs +21 -21
  13. package/dist/components/BitzTable/ToolBar/ColConfigIcon/index.module.less.mjs +29 -29
  14. package/dist/components/BitzTable/ToolBar/DensityIcon/index.d.ts +3 -2
  15. package/dist/components/BitzTable/ToolBar/DensityIcon/index.mjs +14 -14
  16. package/dist/components/BitzTable/ToolBar/ExportIcon/index.d.ts +1 -1
  17. package/dist/components/BitzTable/ToolBar/FullscreenIcon/index.d.ts +2 -1
  18. package/dist/components/BitzTable/ToolBar/FullscreenIcon/index.mjs +37 -34
  19. package/dist/components/BitzTable/ToolBar/RefreshIcon/index.d.ts +3 -2
  20. package/dist/components/BitzTable/ToolBar/RefreshIcon/index.mjs +19 -13
  21. package/dist/components/BitzTable/ToolBar/Wrapper/index.mjs +67 -43
  22. package/dist/components/BitzTable/ToolBar/index.d.ts +1 -1
  23. package/dist/components/BitzTable/index.d.ts +12 -3
  24. package/dist/style.css +1 -1
  25. package/package.json +1 -1
@@ -1,48 +1,49 @@
1
1
  import { j as i } from "../../../node_modules/.store/react@18.2.0/node_modules/react/jsx-runtime.mjs";
2
- import { theme as g, Skeleton as L, Table as f } from "antd";
2
+ import { theme as _, Skeleton as L, Table as f } from "antd";
3
3
  import O from "../../../node_modules/.store/antd@5.15.3/node_modules/antd/es/table/ExpandIcon.mjs";
4
- import { useContext as R, useMemo as a, useRef as T, useEffect as h } from "react";
4
+ import { useContext as R, useMemo as a, useRef as T, useEffect as w } from "react";
5
5
  import "../../../node_modules/.store/antd@5.15.3/node_modules/antd/es/config-provider/index.mjs";
6
- import w from "../../../node_modules/.store/antd@5.15.3/node_modules/antd/locale/en_US.mjs";
7
- import { ConfigContext as N } from "../../../node_modules/.store/antd@5.15.3/node_modules/antd/es/config-provider/context.mjs";
8
- const U = ({
6
+ import N from "../../../node_modules/.store/antd@5.15.3/node_modules/antd/locale/en_US.mjs";
7
+ import { ConfigContext as S } from "../../../node_modules/.store/antd@5.15.3/node_modules/antd/es/config-provider/context.mjs";
8
+ const q = ({
9
9
  columns: s,
10
10
  dataLength: c,
11
11
  rowSelection: l,
12
12
  expandable: o,
13
13
  loading: r,
14
+ showTableTool: y,
14
15
  ...u
15
16
  }) => {
16
17
  var x;
17
- const { token: m } = g.useToken(), { table: p, locale: y = w } = R(N), C = { ...y.Table }, b = ((x = p == null ? void 0 : p.expandable) == null ? void 0 : x.expandIcon) || (o == null ? void 0 : o.expandIcon) || O(C), k = a(() => {
18
+ const { token: m } = _.useToken(), { table: p, locale: C = N } = R(S), b = { ...C.Table }, k = ((x = p == null ? void 0 : p.expandable) == null ? void 0 : x.expandIcon) || (o == null ? void 0 : o.expandIcon) || O(b), I = a(() => {
18
19
  if (!r)
19
20
  return [];
20
21
  const t = c > 4 ? c >= 20 ? 20 : c : 4;
21
22
  return Array.from({ length: t }).map((e, n) => ({ index: n }));
22
- }, [r, c]), I = a(() => {
23
+ }, [r, c]), E = a(() => {
23
24
  var t;
24
25
  return (t = s == null ? void 0 : s.filter((e) => Object.keys(e).length !== 0)) == null ? void 0 : t.map((e) => e != null && e.isOperationCol ? e : {
25
26
  ...e,
26
27
  sorter: !1,
27
- render: (n, S, _) => /* @__PURE__ */ i.jsx(
28
+ render: (n, B, j) => /* @__PURE__ */ i.jsx(
28
29
  L,
29
30
  {
30
31
  active: !0,
31
32
  title: !1,
32
33
  paragraph: {
33
34
  rows: 1,
34
- width: (_ + 1) % 2 === 0 ? "100%" : "60%"
35
+ width: (j + 1) % 2 === 0 ? "100%" : "60%"
35
36
  }
36
37
  }
37
38
  )
38
39
  });
39
- }, [s]), E = a(() => {
40
+ }, [s]), g = a(() => {
40
41
  if (o)
41
42
  return {
42
43
  ...o,
43
44
  expandedRowRender: () => /* @__PURE__ */ i.jsx(i.Fragment, {}),
44
45
  expandIcon: (t) => {
45
- const e = b(t);
46
+ const e = k(t);
46
47
  return {
47
48
  ...e,
48
49
  props: {
@@ -56,7 +57,7 @@ const U = ({
56
57
  };
57
58
  }
58
59
  };
59
- }, [o]), j = a(() => {
60
+ }, [o]), h = a(() => {
60
61
  if (l)
61
62
  return {
62
63
  ...l,
@@ -64,7 +65,7 @@ const U = ({
64
65
  getCheckboxProps: () => ({ disabled: !0 })
65
66
  };
66
67
  }, [l]), d = T();
67
- return h(() => {
68
+ return w(() => {
68
69
  var e, n;
69
70
  const t = (n = (e = d.current) == null ? void 0 : e.nativeElement) == null ? void 0 : n.querySelector(".ant-table-body");
70
71
  t && (t.scrollLeft = 0);
@@ -73,18 +74,18 @@ const U = ({
73
74
  {
74
75
  ...u,
75
76
  ref: d,
76
- expandable: E,
77
- rowSelection: j,
77
+ expandable: g,
78
+ rowSelection: h,
78
79
  pagination: !1,
79
- columns: [f.SELECTION_COLUMN, f.EXPAND_COLUMN, ...I],
80
+ columns: [f.SELECTION_COLUMN, f.EXPAND_COLUMN, ...E],
80
81
  rowKey: "index",
81
- dataSource: k,
82
+ dataSource: I,
82
83
  loading: !1,
83
84
  style: {
84
85
  ...u.style,
85
86
  position: "absolute",
86
87
  inset: 0,
87
- top: 40,
88
+ top: y ? "var(--toolbar-height)" : 0,
88
89
  zIndex: r ? 100 : -1,
89
90
  /** 保险起见,使用了zIndex也要用opacity控制显隐 */
90
91
  opacity: r ? 1 : 0,
@@ -94,5 +95,5 @@ const U = ({
94
95
  );
95
96
  };
96
97
  export {
97
- U as default
98
+ q as default
98
99
  };
@@ -1,8 +1,9 @@
1
1
  import React from 'react';
2
2
  interface ColumnSettingProps {
3
+ order?: number;
4
+ show?: boolean;
3
5
  icon?: React.ReactNode;
4
6
  onChange?: (columns: any) => void;
5
- order: number;
6
7
  }
7
- declare const _default: React.MemoExoticComponent<(props: ColumnSettingProps) => import("react/jsx-runtime").JSX.Element>;
8
+ declare const _default: React.MemoExoticComponent<(props: ColumnSettingProps) => import("react/jsx-runtime").JSX.Element | null>;
8
9
  export default _default;
@@ -1,34 +1,34 @@
1
1
  import { j as t } from "../../../../node_modules/.store/react@18.2.0/node_modules/react/jsx-runtime.mjs";
2
- import a, { useContext as c } from "react";
3
- import { Tooltip as u } from "antd";
4
- import { show as d } from "@ebay/nice-modal-react";
5
- import f from "./ColumnSettingModal.mjs";
6
- import C from "../style.mjs";
7
- import x from "../../../BitzButton/index.mjs";
2
+ import u, { useContext as c } from "react";
3
+ import { Tooltip as d } from "antd";
4
+ import { show as f } from "@ebay/nice-modal-react";
5
+ import C from "./ColumnSettingModal.mjs";
6
+ import x from "../style.mjs";
7
+ import h from "../../../BitzButton/index.mjs";
8
8
  import { TableContext as g } from "../../Store/index.mjs";
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, icon: i = /* @__PURE__ */ t.jsx(h, {}) } = o, { toolbarItemClassName: l } = C(), { uuid: e } = c(g), r = () => {
12
- d(`ColumnSettingModal-${e}`).then((s) => {
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
13
  var n;
14
- (n = o.onChange) == null || n.call(o, s);
14
+ (n = o.onChange) == null || n.call(o, a);
15
15
  });
16
16
  };
17
- return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
18
- /* @__PURE__ */ t.jsx(f, { id: `ColumnSettingModal-${e}` }),
19
- /* @__PURE__ */ t.jsx(u, { title: "列设置", open: !1, children: /* @__PURE__ */ t.jsx(
20
- x,
17
+ 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,
21
21
  {
22
22
  type: "text",
23
- className: l,
24
- onClick: r,
25
- icon: i,
23
+ className: r,
24
+ onClick: s,
25
+ icon: l,
26
26
  style: { order: m },
27
27
  children: "列设置"
28
28
  }
29
29
  ) })
30
- ] });
31
- }, R = a.memo(j);
30
+ ] }) : null;
31
+ }, N = u.memo(S);
32
32
  export {
33
- R as default
33
+ N as default
34
34
  };
@@ -1,34 +1,34 @@
1
- const t = "_introduce_lbjuo_1", e = "_block_lbjuo_8", o = "_body_lbjuo_13", _ = "_container_lbjuo_16", n = "_header_lbjuo_23", c = "_title_lbjuo_32", l = "_content_lbjuo_47", b = "_item_lbjuo_54", i = "_checked_lbjuo_63", s = "_moveItem_lbjuo_75", d = "_isDragging_lbjuo_89", m = "_disabled_lbjuo_92", u = "_moveItemShanchu_lbjuo_103", a = {
2
- introduce: t,
3
- block: e,
4
- body: o,
5
- container: _,
6
- header: n,
1
+ const e = "_introduce_e5ppq_1", t = "_block_e5ppq_8", _ = "_body_e5ppq_13", n = "_container_e5ppq_16", o = "_header_e5ppq_23", c = "_title_e5ppq_32", p = "_content_e5ppq_47", i = "_item_e5ppq_53", s = "_checked_e5ppq_62", d = "_moveItem_e5ppq_74", m = "_isDragging_e5ppq_88", a = "_disabled_e5ppq_91", q = "_moveItemShanchu_e5ppq_102", l = {
2
+ introduce: e,
3
+ block: t,
4
+ body: _,
5
+ container: n,
6
+ header: o,
7
7
  title: c,
8
- content: l,
9
- item: b,
10
- checked: i,
11
- "content-item-text": "_content-item-text_lbjuo_66",
12
- "content-item-text-disabled": "_content-item-text-disabled_lbjuo_72",
13
- moveItem: s,
14
- isDragging: d,
15
- disabled: m,
16
- "moveItem-text": "_moveItem-text_lbjuo_96",
17
- moveItemShanchu: u
8
+ content: p,
9
+ item: i,
10
+ checked: s,
11
+ "content-item-text": "_content-item-text_e5ppq_65",
12
+ "content-item-text-disabled": "_content-item-text-disabled_e5ppq_71",
13
+ moveItem: d,
14
+ isDragging: m,
15
+ disabled: a,
16
+ "moveItem-text": "_moveItem-text_e5ppq_95",
17
+ moveItemShanchu: q
18
18
  };
19
19
  export {
20
- e as block,
21
- o as body,
22
- i as checked,
23
- _ as container,
24
- l as content,
25
- a as default,
26
- m as disabled,
27
- n as header,
28
- t as introduce,
29
- d as isDragging,
30
- b as item,
31
- s as moveItem,
32
- u as moveItemShanchu,
20
+ t as block,
21
+ _ as body,
22
+ s as checked,
23
+ n as container,
24
+ p as content,
25
+ l as default,
26
+ a as disabled,
27
+ o as header,
28
+ e as introduce,
29
+ m as isDragging,
30
+ i as item,
31
+ d as moveItem,
32
+ q as moveItemShanchu,
33
33
  c as title
34
34
  };
@@ -1,9 +1,10 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { DensitySize } from '../../Store';
3
3
  interface DensityIconProps {
4
- order: number;
4
+ order?: number;
5
+ show?: boolean;
5
6
  icon?: ReactNode;
6
7
  onChange?: (size: DensitySize) => void;
7
8
  }
8
- declare const _default: import("react").MemoExoticComponent<(props: DensityIconProps) => import("react/jsx-runtime").JSX.Element>;
9
+ declare const _default: import("react").MemoExoticComponent<(props: DensityIconProps) => import("react/jsx-runtime").JSX.Element | null>;
9
10
  export default _default;
@@ -1,16 +1,16 @@
1
1
  import { j as o } from "../../../../node_modules/.store/react@18.2.0/node_modules/react/jsx-runtime.mjs";
2
- import { memo as x, useContext as d } from "react";
3
- import { Dropdown as y, Tooltip as b } from "antd";
2
+ import { memo as d, useContext as y } from "react";
3
+ import { Dropdown as u, Tooltip as b } from "antd";
4
4
  import { TableContext as f } from "../../Store/index.mjs";
5
- import u from "../style.mjs";
6
- import k from "../../../BitzButton/index.mjs";
5
+ import k from "../style.mjs";
6
+ import h from "../../../BitzButton/index.mjs";
7
7
  import j from "../../../../node_modules/.store/@ant-design_icons@5.3.3/node_modules/@ant-design/icons/es/icons/ColumnHeightOutlined.mjs";
8
8
  const C = (e) => {
9
- const { order: m, icon: s = /* @__PURE__ */ o.jsx(j, {}) } = e, t = d(f), { toolbarItemClassName: r } = u(), a = {
9
+ const { order: m, show: s = !0, icon: r = /* @__PURE__ */ o.jsx(j, {}) } = e, t = y(f), { toolbarItemClassName: a } = k(), c = {
10
10
  selectedKeys: [t.tableSize],
11
- onClick: ({ key: c }) => {
11
+ onClick: ({ key: x }) => {
12
12
  var n, i;
13
- const l = c;
13
+ const l = x;
14
14
  (n = t.setTableSize) == null || n.call(t, l), (i = e == null ? void 0 : e.onChange) == null || i.call(e, l);
15
15
  },
16
16
  items: [
@@ -36,17 +36,17 @@ const C = (e) => {
36
36
  }
37
37
  ]
38
38
  };
39
- return /* @__PURE__ */ o.jsx(y, { menu: a, trigger: ["click"], children: /* @__PURE__ */ o.jsx(b, { title: "表格密度", open: !1, children: /* @__PURE__ */ o.jsx(
40
- k,
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,
41
41
  {
42
42
  style: { order: m },
43
43
  type: "text",
44
- className: r,
45
- icon: s,
44
+ className: a,
45
+ icon: r,
46
46
  children: "表格密度"
47
47
  }
48
- ) }) });
49
- }, w = x(C);
48
+ ) }) }) : null;
49
+ }, B = d(C);
50
50
  export {
51
- w as default
51
+ B as default
52
52
  };
@@ -2,7 +2,7 @@ import { ReactNode } from 'react';
2
2
  import { BitzDropdownToButtonProps } from '@/components/BitzConvert';
3
3
  import { ExportEvent } from '..';
4
4
  interface ExportIconProps extends Pick<BitzDropdownToButtonProps, 'menu' | 'tipText'> {
5
- order: number;
5
+ order?: number;
6
6
  icon?: ReactNode;
7
7
  loading?: boolean;
8
8
  /** 是否显示导出icon */
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  declare const _default: import("react").NamedExoticComponent<{
3
- order: number;
3
+ order?: number | undefined;
4
+ show?: boolean | undefined;
4
5
  }>;
5
6
  export default _default;
@@ -1,53 +1,56 @@
1
- import { j as s } 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";
1
+ import { j as o } from "../../../../node_modules/.store/react@18.2.0/node_modules/react/jsx-runtime.mjs";
2
+ import { memo as p, useState as x, useMemo as b, useEffect as E } from "react";
3
+ import { Tooltip as B } from "antd";
4
+ import F from "../style.mjs";
5
+ import j from "../../../BitzButton/index.mjs";
6
6
  import c from "../../../../node_modules/.store/screenfull@6.0.2/node_modules/screenfull/index.mjs";
7
- import j from "../../../BitzToast/index.mjs";
8
- import h from "../../../../node_modules/.store/@ant-design_icons@5.3.3/node_modules/@ant-design/icons/es/icons/FullscreenExitOutlined.mjs";
9
- import v from "../../../../node_modules/.store/@ant-design_icons@5.3.3/node_modules/@ant-design/icons/es/icons/FullscreenOutlined.mjs";
10
- function f(t, r) {
11
- if (t.classList.contains(r))
7
+ import h from "../../../BitzToast/index.mjs";
8
+ import v from "../../../../node_modules/.store/@ant-design_icons@5.3.3/node_modules/@ant-design/icons/es/icons/FullscreenExitOutlined.mjs";
9
+ import z from "../../../../node_modules/.store/@ant-design_icons@5.3.3/node_modules/@ant-design/icons/es/icons/FullscreenOutlined.mjs";
10
+ function m(t, n) {
11
+ if (t.classList.contains(n))
12
12
  return t;
13
- var e = t.parentNode;
14
- if (e) {
15
- var n = f(e, r);
16
- if (n)
17
- return n;
13
+ var r = t.parentNode;
14
+ if (r) {
15
+ var e = m(r, n);
16
+ if (e)
17
+ return e;
18
18
  }
19
19
  return null;
20
20
  }
21
- const z = ({ order: t }) => {
22
- const { toolbarItemClassName: r } = B(), [e, n] = p(!1), l = x(() => e ? {
21
+ const L = ({
22
+ order: t,
23
+ show: n = !0
24
+ }) => {
25
+ const { toolbarItemClassName: r } = F(), [e, u] = x(!1), s = b(() => e ? {
23
26
  title: "退出全屏",
24
- icon: /* @__PURE__ */ s.jsx(h, {})
27
+ icon: /* @__PURE__ */ o.jsx(v, {})
25
28
  } : {
26
29
  title: "全屏",
27
- icon: /* @__PURE__ */ s.jsx(v, {})
30
+ icon: /* @__PURE__ */ o.jsx(z, {})
28
31
  }, [e]);
29
- b(() => (document == null || document.addEventListener("fullscreenchange", (i) => {
30
- var o, a, u;
31
- (o = i.target) != null && o.classList.contains("bitzTableBlock") && (n(!!document.fullscreenElement), (u = (a = document.fullscreenElement) == null ? void 0 : a.classList) != null && u.contains("bitzTableBlock") || n(!1));
32
+ E(() => (document == null || document.addEventListener("fullscreenchange", (i) => {
33
+ var l, a, f;
34
+ (l = i.target) != null && l.classList.contains("bitzTableBlock") && (u(!!document.fullscreenElement), (f = (a = document.fullscreenElement) == null ? void 0 : a.classList) != null && f.contains("bitzTableBlock") || u(!1));
32
35
  }), document == null ? void 0 : document.removeEventListener("fullscreenchange", () => {
33
36
  })), []);
34
- const m = (i) => {
35
- c.isEnabled || j.error("您的浏览器不支持全屏");
36
- const o = f(i.target, "bitzTableBlock");
37
- e ? c.exit() : c.request(o);
37
+ const d = (i) => {
38
+ c.isEnabled || h.error("您的浏览器不支持全屏");
39
+ const l = m(i.target, "bitzTableBlock");
40
+ e ? c.exit() : c.request(l);
38
41
  };
39
- return /* @__PURE__ */ s.jsx(E, { title: l.title, open: !1, children: /* @__PURE__ */ s.jsx(
40
- F,
42
+ return n ? /* @__PURE__ */ o.jsx(B, { title: s.title, open: !1, children: /* @__PURE__ */ o.jsx(
43
+ j,
41
44
  {
42
45
  type: "text",
43
46
  className: r,
44
- onClick: m,
45
- icon: l.icon,
47
+ onClick: d,
48
+ icon: s.icon,
46
49
  style: { order: t },
47
- children: l.title
50
+ children: s.title
48
51
  }
49
- ) });
50
- }, O = d(z);
52
+ ) }) : null;
53
+ }, q = p(L);
51
54
  export {
52
- O as default
55
+ q as default
53
56
  };
@@ -1,9 +1,10 @@
1
1
  import { MouseEventHandler, ReactNode } from 'react';
2
2
  interface RefreshIconProps {
3
- order: number;
3
+ order?: number;
4
+ show?: boolean;
4
5
  icon?: ReactNode;
5
6
  loading?: boolean;
6
7
  onClick?: MouseEventHandler;
7
8
  }
8
- declare const _default: import("react").MemoExoticComponent<(props: RefreshIconProps) => import("react/jsx-runtime").JSX.Element>;
9
+ declare const _default: import("react").MemoExoticComponent<(props: RefreshIconProps) => import("react/jsx-runtime").JSX.Element | null>;
9
10
  export default _default;
@@ -1,24 +1,30 @@
1
1
  import { j as o } from "../../../../node_modules/.store/react@18.2.0/node_modules/react/jsx-runtime.mjs";
2
- import { memo as n } from "react";
3
- import { Tooltip as l } from "antd";
4
- import a from "../style.mjs";
5
- import c from "../../../BitzButton/index.mjs";
6
- import p from "../../../../node_modules/.store/@ant-design_icons@5.3.3/node_modules/@ant-design/icons/es/icons/ReloadOutlined.mjs";
7
- const f = (t) => {
8
- const { loading: e, onClick: r, order: s, icon: m = /* @__PURE__ */ o.jsx(p, {}) } = t, { toolbarItemClassName: i } = a();
9
- return /* @__PURE__ */ o.jsx(l, { title: "刷新", open: !1, children: /* @__PURE__ */ o.jsx(
10
- c,
2
+ import { memo as i } from "react";
3
+ import { Tooltip as a } from "antd";
4
+ import c from "../style.mjs";
5
+ import p from "../../../BitzButton/index.mjs";
6
+ import f from "../../../../node_modules/.store/@ant-design_icons@5.3.3/node_modules/@ant-design/icons/es/icons/ReloadOutlined.mjs";
7
+ const d = (t) => {
8
+ const {
9
+ loading: e,
10
+ onClick: r,
11
+ order: s,
12
+ show: l = !0,
13
+ icon: m = /* @__PURE__ */ o.jsx(f, {})
14
+ } = t, { toolbarItemClassName: n } = c();
15
+ return l ? /* @__PURE__ */ o.jsx(a, { title: "刷新", open: !1, children: /* @__PURE__ */ o.jsx(
16
+ p,
11
17
  {
12
18
  type: "text",
13
- className: i,
19
+ className: n,
14
20
  disabled: e,
15
21
  onClick: r,
16
22
  icon: m,
17
23
  style: { order: s },
18
24
  children: "刷新"
19
25
  }
20
- ) });
21
- }, y = n(f);
26
+ ) }) : null;
27
+ }, I = i(d);
22
28
  export {
23
- y as default
29
+ I as default
24
30
  };
@@ -1,59 +1,83 @@
1
- import { j as r } from "../../../../node_modules/.store/react@18.2.0/node_modules/react/jsx-runtime.mjs";
2
- import { memo as u, useContext as a, useMemo as c } from "react";
3
- import { Space as h } from "antd";
4
- import d from "../RefreshIcon/index.mjs";
5
- import g 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 = ["export", "refresh", "size", "fullscreen", "colConfig"], k = ({
11
- size: y,
12
- tools: i,
13
- loading: t,
14
- onExport: m,
15
- onRefresh: f,
16
- onSizeChange: l,
17
- onColumnChange: p
1
+ import { j as e } from "../../../../node_modules/.store/react@18.2.0/node_modules/react/jsx-runtime.mjs";
2
+ import { memo as w, useContext as x, useMemo as l } from "react";
3
+ import { Space as a } from "antd";
4
+ import u from "../RefreshIcon/index.mjs";
5
+ import C from "../ColConfigIcon/index.mjs";
6
+ import g from "../DensityIcon/index.mjs";
7
+ import j from "../FullscreenIcon/index.mjs";
8
+ import z from "../ExportIcon/index.mjs";
9
+ import { BitzConfigContext as I } from "../../../BitzConfigProvider/context.mjs";
10
+ const B = [
11
+ "export",
12
+ "refresh",
13
+ "size",
14
+ "fullscreen",
15
+ "colConfig"
16
+ ], E = ({
17
+ size: k,
18
+ tools: c,
19
+ loading: f,
20
+ onExport: i,
21
+ onRefresh: h,
22
+ onSizeChange: m,
23
+ onColumnChange: d
18
24
  }) => {
19
- const { Table: o } = a(B), s = c(() => i || (o == null ? void 0 : o.toolbar) || E, [o == null ? void 0 : o.toolbar]), e = c(() => {
20
- const n = {
21
- export: 1,
22
- refresh: 2,
23
- size: 3,
24
- fullscreen: 4,
25
- colConfig: 5
25
+ const { Table: r } = x(I), s = l(() => c || (r == null ? void 0 : r.toolbar) || B, [r == null ? void 0 : r.toolbar]), o = l(() => {
26
+ const t = {
27
+ export: { order: 1, show: !1 },
28
+ refresh: { order: 2, show: !1 },
29
+ size: { order: 3, show: !1 },
30
+ fullscreen: { order: 4, show: !1 },
31
+ colConfig: { order: 5, show: !1 }
26
32
  };
27
- return s.forEach((x, C) => n[x] = C + 1), n;
33
+ return s.forEach((n, p) => {
34
+ t[n].order = p + 1, t[n].show = s.includes(n);
35
+ }), t;
28
36
  }, [s]);
29
- return /* @__PURE__ */ r.jsxs(h.Compact, { style: { height: "100%" }, children: [
30
- /* @__PURE__ */ r.jsx(
31
- I,
37
+ return /* @__PURE__ */ e.jsxs(a.Compact, { style: { height: "100%" }, children: [
38
+ /* @__PURE__ */ e.jsx(
39
+ z,
32
40
  {
33
- order: e.export,
34
- loading: t,
35
- onClick: m
41
+ order: o.export.order,
42
+ show: o.export.show,
43
+ loading: f,
44
+ onClick: i
36
45
  }
37
46
  ),
38
- /* @__PURE__ */ r.jsx(
39
- d,
47
+ /* @__PURE__ */ e.jsx(
48
+ u,
40
49
  {
41
- order: e.refresh,
42
- loading: t,
43
- onClick: f
50
+ order: o.refresh.order,
51
+ show: o.refresh.show,
52
+ loading: f,
53
+ onClick: h
44
54
  }
45
55
  ),
46
- /* @__PURE__ */ r.jsx(j, { order: e.size, onChange: l }),
47
- /* @__PURE__ */ r.jsx(z, { order: e.fullscreen }),
48
- /* @__PURE__ */ r.jsx(
56
+ /* @__PURE__ */ e.jsx(
49
57
  g,
50
58
  {
51
- order: e.colConfig,
52
- onChange: p
59
+ order: o.size.order,
60
+ show: o.size.show,
61
+ onChange: m
62
+ }
63
+ ),
64
+ /* @__PURE__ */ e.jsx(
65
+ j,
66
+ {
67
+ order: o.fullscreen.order,
68
+ show: o.fullscreen.show
69
+ }
70
+ ),
71
+ /* @__PURE__ */ e.jsx(
72
+ C,
73
+ {
74
+ order: o.colConfig.order,
75
+ show: o.colConfig.show,
76
+ onChange: d
53
77
  }
54
78
  )
55
79
  ] });
56
- }, v = u(k);
80
+ }, A = w(E);
57
81
  export {
58
- v as default
82
+ A as default
59
83
  };
@@ -5,9 +5,9 @@ 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 '@/components/BitzConfigProvider/context';
8
9
  export type MenuKeysType = 'excel';
9
10
  export type ExportEvent = (key: MenuKeysType) => void;
10
- export type ToolEnum = 'export' | 'refresh' | 'size' | 'fullscreen' | 'colConfig';
11
11
  export interface BitzTableToolBarProps {
12
12
  size?: DensitySize;
13
13
  /** 控制tool按钮的排序和显隐,根据索引排序,不在tools数组中的不显示 */