bitz-react-admin-ui 2.2.0 → 2.2.1

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,5 +1,6 @@
1
- export declare const getCssVar: ({ height, evenRowBgColor, colorBgContainer, table, gap, borderColor, scrollbarWidth, other, }: {
1
+ export declare const getCssVar: ({ height, fontFamily, evenRowBgColor, colorBgContainer, table, gap, borderColor, scrollbarWidth, other, }: {
2
2
  height: any;
3
+ fontFamily: any;
3
4
  evenRowBgColor: any;
4
5
  colorBgContainer: any;
5
6
  table: any;
@@ -1,29 +1,31 @@
1
1
  const j = ({
2
2
  height: v,
3
- evenRowBgColor: w,
4
- colorBgContainer: e,
3
+ fontFamily: w,
4
+ evenRowBgColor: e,
5
+ colorBgContainer: I,
5
6
  table: o,
6
- gap: I,
7
- borderColor: R,
8
- scrollbarWidth: u,
7
+ gap: R,
8
+ borderColor: u,
9
+ scrollbarWidth: y,
9
10
  other: V
10
11
  }) => {
11
- var h, i, g, x, r, n, T, p, s, d, $, H, m, S, C, k, f, z, B, c;
12
+ var i, h, g, x, r, n, T, p, s, d, $, H, m, S, C, f, k, z, B, c;
12
13
  return {
13
14
  height: v,
15
+ "--font-family": w,
14
16
  "--toolbar-bgColor": o == null ? void 0 : o.toolbarBgColor,
15
17
  "--thead-bgColor": o == null ? void 0 : o.headerBg,
16
18
  "--thead-hoverBgColor": o == null ? void 0 : o.headerSortHoverBg,
17
- "--evenRow-BgColor": w,
18
- "--oddRow-BgColor": e,
19
+ "--evenRow-BgColor": e,
20
+ "--oddRow-BgColor": I,
19
21
  "--radioCheckbox-borderColor": o == null ? void 0 : o.radioCheckboxBorderColor,
20
22
  "--expandIcon-borderColor": o == null ? void 0 : o.expandIconBorderColor,
21
23
  "--rowHover-bgColor": o == null ? void 0 : o.rowHoverBg,
22
- "--borderColor": R,
23
- "--container-gap": `${I}px`,
24
- "--scrollbar-width": `${u || 0}px`,
25
- "--xlTable-fontSize": `${(h = o == null ? void 0 : o.xlTable) == null ? void 0 : h.fontSize}px`,
26
- "--lgTable-fontSize": `${(i = o == null ? void 0 : o.lgTable) == null ? void 0 : i.fontSize}px`,
24
+ "--borderColor": u,
25
+ "--container-gap": `${R}px`,
26
+ "--scrollbar-width": `${y || 0}px`,
27
+ "--xlTable-fontSize": `${(i = o == null ? void 0 : o.xlTable) == null ? void 0 : i.fontSize}px`,
28
+ "--lgTable-fontSize": `${(h = o == null ? void 0 : o.lgTable) == null ? void 0 : h.fontSize}px`,
27
29
  "--mdTable-fontSize": `${(g = o == null ? void 0 : o.mdTable) == null ? void 0 : g.fontSize}px`,
28
30
  "--smTable-fontSize": `${(x = o == null ? void 0 : o.smTable) == null ? void 0 : x.fontSize}px`,
29
31
  "--xsTable-fontSize": `${(r = o == null ? void 0 : o.xsTable) == null ? void 0 : r.fontSize}px`,
@@ -37,8 +39,8 @@ const j = ({
37
39
  "--mdTable-lineHeight": `${(m = o == null ? void 0 : o.mdTable) == null ? void 0 : m.lineHeight}px`,
38
40
  "--smTable-lineHeight": `${(S = o == null ? void 0 : o.smTable) == null ? void 0 : S.lineHeight}px`,
39
41
  "--xsTable-lineHeight": `${(C = o == null ? void 0 : o.xsTable) == null ? void 0 : C.lineHeight}px`,
40
- "--xlSkeleton-height": `${(k = o == null ? void 0 : o.xlTable) == null ? void 0 : k.skeletonHeight}px`,
41
- "--lgSkeleton-height": `${(f = o == null ? void 0 : o.lgTable) == null ? void 0 : f.skeletonHeight}px`,
42
+ "--xlSkeleton-height": `${(f = o == null ? void 0 : o.xlTable) == null ? void 0 : f.skeletonHeight}px`,
43
+ "--lgSkeleton-height": `${(k = o == null ? void 0 : o.lgTable) == null ? void 0 : k.skeletonHeight}px`,
42
44
  "--mdSkeleton-height": `${(z = o == null ? void 0 : o.mdTable) == null ? void 0 : z.skeletonHeight}px`,
43
45
  "--smSkeleton-height": `${(B = o == null ? void 0 : o.smTable) == null ? void 0 : B.skeletonHeight}px`,
44
46
  "--xsSkeleton-height": `${(c = o == null ? void 0 : o.xsTable) == null ? void 0 : c.skeletonHeight}px`,
@@ -1,41 +1,45 @@
1
1
  import { j as t } from "../../../../node_modules/.store/react@18.2.0/node_modules/react/jsx-runtime.mjs";
2
- import { memo as u, useContext as f, useMemo as a } from "react";
3
- import { Tooltip as p } from "antd";
4
- import x from "../style.mjs";
5
- import d from "../../../BitzButton/index.mjs";
2
+ import { memo as d, useContext as p, useMemo as x, useEffect as b } from "react";
3
+ import { Tooltip as B } from "antd";
4
+ import E from "../style.mjs";
5
+ import F from "../../../BitzButton/index.mjs";
6
6
  import r from "../../../../node_modules/.store/screenfull@6.0.2/node_modules/screenfull/index.mjs";
7
- import b from "../../../BitzToast/index.mjs";
8
- import { findParentFirstNodeByClass as j } from "../../../../utils/findNode.mjs";
9
- import { BitzTableContext as B } from "../../Store/index.mjs";
10
- import F from "../../../../node_modules/.store/@ant-design_icons@5.3.6/node_modules/@ant-design/icons/es/icons/FullscreenExitOutlined.mjs";
7
+ import j from "../../../BitzToast/index.mjs";
8
+ import { findParentFirstNodeByClass as z } from "../../../../utils/findNode.mjs";
9
+ import { BitzTableContext as T } from "../../Store/index.mjs";
10
+ import h from "../../../../node_modules/.store/@ant-design_icons@5.3.6/node_modules/@ant-design/icons/es/icons/FullscreenExitOutlined.mjs";
11
11
  import C from "../../../../node_modules/.store/@ant-design_icons@5.3.6/node_modules/@ant-design/icons/es/icons/FullscreenOutlined.mjs";
12
- const y = ({
13
- order: l,
14
- show: n = !0
12
+ const g = ({
13
+ order: m,
14
+ show: u = !0
15
15
  }) => {
16
- const { toolbarItemClassName: i } = x(), { fullscreen: e } = f(B), o = a(() => e ? {
16
+ const { toolbarItemClassName: a } = E(), { fullscreen: n, setFullscreen: s } = p(T), o = x(() => n ? {
17
17
  title: "退出全屏",
18
- icon: /* @__PURE__ */ t.jsx(F, {})
18
+ icon: /* @__PURE__ */ t.jsx(h, {})
19
19
  } : {
20
20
  title: "全屏",
21
21
  icon: /* @__PURE__ */ t.jsx(C, {})
22
- }, [e]), s = (m) => {
23
- r.isEnabled || b.error("您的浏览器不支持全屏");
24
- const c = j(m.target, "bitzTableBlock");
25
- e ? r.exit() : r.request(c);
22
+ }, [n]), f = (l) => {
23
+ r.isEnabled || j.error("您的浏览器不支持全屏");
24
+ const e = z(l.target, "bitzTableBlock");
25
+ n ? r.exit() : r.request(e);
26
26
  };
27
- return n ? /* @__PURE__ */ t.jsx(p, { title: o.title, open: !1, children: /* @__PURE__ */ t.jsx(
28
- d,
27
+ return b(() => (document == null || document.addEventListener("fullscreenchange", (l) => {
28
+ var e, i, c;
29
+ (e = l.target) != null && e.classList.contains("bitzTableBlock") && (s(!!document.fullscreenElement), (c = (i = document.fullscreenElement) == null ? void 0 : i.classList) != null && c.contains("bitzTableBlock") || s(!1));
30
+ }), document == null ? void 0 : document.removeEventListener("fullscreenchange", () => {
31
+ })), []), u ? /* @__PURE__ */ t.jsx(B, { title: o.title, open: !1, children: /* @__PURE__ */ t.jsx(
32
+ F,
29
33
  {
30
34
  type: "text",
31
- className: i,
32
- onClick: s,
35
+ className: a,
36
+ onClick: f,
33
37
  icon: o.icon,
34
- style: { order: l },
38
+ style: { order: m },
35
39
  children: o.title
36
40
  }
37
41
  ) }) : null;
38
- }, G = u(y);
42
+ }, P = d(g);
39
43
  export {
40
- G as default
44
+ P as default
41
45
  };
@@ -1,30 +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 l, useContext as a } from "react";
3
- import { Tooltip as c } from "antd";
4
- import p from "../style.mjs";
5
- import f from "../../../BitzButton/index.mjs";
6
- import { BitzTableContext as d } from "../../Store/index.mjs";
7
- import u from "../../../../node_modules/.store/@ant-design_icons@5.3.6/node_modules/@ant-design/icons/es/icons/ReloadOutlined.mjs";
8
- const x = (t) => {
2
+ import { memo as a, useContext as c } from "react";
3
+ import { Tooltip as p } from "antd";
4
+ import f from "../style.mjs";
5
+ import d from "../../../BitzButton/index.mjs";
6
+ import { BitzTableContext as u } from "../../Store/index.mjs";
7
+ import x from "../../../../node_modules/.store/@ant-design_icons@5.3.6/node_modules/@ant-design/icons/es/icons/ReloadOutlined.mjs";
8
+ const h = (t) => {
9
9
  const {
10
10
  onClick: e,
11
11
  order: r,
12
12
  show: s = !0,
13
- icon: n = /* @__PURE__ */ o.jsx(u, {})
14
- } = t, { loading: m } = a(d), { toolbarItemClassName: i } = p();
15
- return s ? /* @__PURE__ */ o.jsx(c, { title: "刷新", open: !1, children: /* @__PURE__ */ o.jsx(
16
- f,
13
+ icon: n = /* @__PURE__ */ o.jsx(x, {})
14
+ } = t, { loading: l, selected: m } = c(u), { toolbarItemClassName: i } = f();
15
+ return s ? /* @__PURE__ */ o.jsx(p, { title: "刷新", open: !1, children: /* @__PURE__ */ o.jsx(
16
+ d,
17
17
  {
18
18
  type: "text",
19
19
  className: i,
20
- disabled: m,
20
+ disabled: l || m,
21
21
  onClick: e,
22
22
  icon: n,
23
23
  style: { order: r },
24
24
  children: "刷新"
25
25
  }
26
26
  ) }) : null;
27
- }, I = l(x);
27
+ }, z = a(h);
28
28
  export {
29
- I as default
29
+ z as default
30
30
  };
@@ -1,52 +1,50 @@
1
1
  import { j as s } from "../../../../node_modules/.store/react@18.2.0/node_modules/react/jsx-runtime.mjs";
2
- import { useContext as w, useMemo as h } from "react";
3
- import { Space as u } from "antd";
4
- import x from "../RefreshIcon/index.mjs";
2
+ import { useContext as i, useMemo as l } from "react";
3
+ import { Space as x } from "antd";
4
+ import u from "../RefreshIcon/index.mjs";
5
5
  import g from "../ColConfigIcon/index.mjs";
6
6
  import C from "../FullscreenIcon/index.mjs";
7
7
  import j from "../ExportIcon/index.mjs";
8
- import { BitzConfigContext as B } from "../../../BitzConfigProvider/context.mjs";
9
- import { BitzToolBarContext as z } from "./context.mjs";
10
- const E = ["export", "refresh", "fullscreen", "config"], q = ({
11
- size: I,
12
- tools: l,
13
- toolsConfig: m,
8
+ import { BitzConfigContext as z } from "../../../BitzConfigProvider/context.mjs";
9
+ import { BitzToolBarContext as B } from "./context.mjs";
10
+ import { BitzTableContext as I } from "../../Store/index.mjs";
11
+ const T = ["export", "refresh", "fullscreen", "config"], A = ({
12
+ size: E,
13
+ tools: m,
14
+ toolsConfig: c,
14
15
  exclude: t,
15
- loading: i,
16
- onExport: c,
16
+ onExport: h,
17
17
  onRefresh: p,
18
18
  onColumnChange: d
19
19
  }) => {
20
- const { Table: r } = w(B), f = h(() => {
21
- const e = l || (r == null ? void 0 : r.toolbar) || E;
20
+ const { Table: r } = i(z), { selected: a } = i(I), f = l(() => {
21
+ const e = m || (r == null ? void 0 : r.toolbar) || T;
22
22
  return t != null && t.length ? e.filter((n) => !t.includes(n)) : e;
23
- }, [r == null ? void 0 : r.toolbar, t]), o = h(() => {
23
+ }, [r == null ? void 0 : r.toolbar, t]), o = l(() => {
24
24
  const e = {
25
25
  export: { order: 1, show: !1 },
26
26
  refresh: { order: 2, show: !1 },
27
27
  fullscreen: { order: 3, show: !1 },
28
28
  config: { order: 4, show: !1 }
29
29
  };
30
- return f.forEach((n, a) => {
31
- e[n].order = a + 1, e[n].show = f.includes(n);
30
+ return f.forEach((n, w) => {
31
+ e[n].order = w + 1, e[n].show = f.includes(n);
32
32
  }), e;
33
33
  }, [f]);
34
- return /* @__PURE__ */ s.jsx(z.Provider, { value: m ?? {}, children: /* @__PURE__ */ s.jsxs(u.Compact, { style: { height: "100%" }, children: [
34
+ return /* @__PURE__ */ s.jsx(B.Provider, { value: c ?? {}, children: /* @__PURE__ */ s.jsxs(x.Compact, { style: { height: "100%", ...a && { zIndex: 10 } }, children: [
35
35
  /* @__PURE__ */ s.jsx(
36
36
  j,
37
37
  {
38
38
  order: o.export.order,
39
39
  show: o.export.show,
40
- loading: i,
41
- onClick: c
40
+ onClick: h
42
41
  }
43
42
  ),
44
43
  /* @__PURE__ */ s.jsx(
45
- x,
44
+ u,
46
45
  {
47
46
  order: o.refresh.order,
48
47
  show: o.refresh.show,
49
- loading: i,
50
48
  onClick: p
51
49
  }
52
50
  ),
@@ -68,5 +66,5 @@ const E = ["export", "refresh", "fullscreen", "config"], q = ({
68
66
  ] }) });
69
67
  };
70
68
  export {
71
- q as default
69
+ A as default
72
70
  };
@@ -1,7 +1,7 @@
1
- import { BitzTableContext as $ } from "../Store/index.mjs";
1
+ import { BitzTableContext as h } from "../Store/index.mjs";
2
2
  import "../../../node_modules/.store/@ant-design_cssinjs@1.19.1/node_modules/@ant-design/cssinjs/es/extractStyle.mjs";
3
3
  import "../../../node_modules/.store/@ant-design_cssinjs@1.19.1/node_modules/@ant-design/cssinjs/es/hooks/useCacheToken.mjs";
4
- import { useContext as f, useMemo as g } from "react";
4
+ import { useContext as u, useMemo as x } from "react";
5
5
  import "../../../node_modules/.store/@ant-design_cssinjs@1.19.1/node_modules/@ant-design/cssinjs/es/StyleContext.mjs";
6
6
  import "../../../node_modules/.store/@ant-design_cssinjs@1.19.1/node_modules/@ant-design/cssinjs/es/theme/createTheme.mjs";
7
7
  import "../../../node_modules/.store/rc-util@5.39.1/node_modules/rc-util/es/warning.mjs";
@@ -9,75 +9,70 @@ import "../../../node_modules/.store/@ant-design_cssinjs@1.19.1/node_modules/@an
9
9
  import "../../../node_modules/.store/@ant-design_cssinjs@1.19.1/node_modules/@ant-design/cssinjs/es/hooks/useCompatibleInsertionEffect.mjs";
10
10
  import "../../../node_modules/.store/@ant-design_cssinjs@1.19.1/node_modules/@ant-design/cssinjs/es/hooks/useEffectCleanupRegister.mjs";
11
11
  import "../../../node_modules/.store/@ant-design_cssinjs@1.19.1/node_modules/@ant-design/cssinjs/es/hooks/useHMR.mjs";
12
- import h from "../../../node_modules/.store/@ant-design_cssinjs@1.19.1/node_modules/@ant-design/cssinjs/es/hooks/useStyleRegister.mjs";
12
+ import y from "../../../node_modules/.store/@ant-design_cssinjs@1.19.1/node_modules/@ant-design/cssinjs/es/hooks/useStyleRegister.mjs";
13
13
  import "../../../node_modules/.store/@ant-design_cssinjs@1.19.1/node_modules/@ant-design/cssinjs/es/transformers/legacyLogicalProperties.mjs";
14
- import u from "../../../node_modules/.store/classnames@2.5.1/node_modules/classnames/index.mjs";
15
- import x from "../../BitzTheme/index.mjs";
16
- const J = () => {
17
- const { theme: T, token: i, hashId: n } = x.useToken(), { tableSize: a } = f($), d = g(() => a ?? "lg", [a]), r = "toolbarItem", m = "ToolbarItemBtn", z = (o, t, e) => {
18
- var l, s, p, b, c;
14
+ import B from "../../../node_modules/.store/classnames@2.5.1/node_modules/classnames/index.mjs";
15
+ import N from "../../BitzTheme/index.mjs";
16
+ const O = () => {
17
+ const { theme: S, token: i, hashId: n } = N.useToken(), { tableSize: a, selected: T } = u(h), $ = x(() => a ?? "lg", [a]), r = "toolbarItem", l = "rowSelecting", m = "ToolbarItemBtn", f = (e, g, t, o) => {
18
+ var s, c, p, b, d;
19
19
  return [
20
20
  {
21
- [`.${o}`]: {
21
+ [`.${e}`]: {
22
22
  height: "100%",
23
23
  paddingBlock: 0,
24
24
  borderRadius: 0,
25
25
  borderColor: "transparent",
26
26
  display: "block",
27
27
  "&:not(&:disabled):hover": {
28
- color: e.colorText
28
+ color: o.colorText
29
29
  },
30
30
  "&:not(&:disabled):focus": {
31
- color: e.colorText
31
+ color: o.colorText
32
32
  },
33
33
  ".ant-btn-icon": {
34
34
  marginInlineEnd: "6px !important"
35
35
  }
36
36
  }
37
37
  },
38
- [
39
- {
40
- [`.${o}.xl${t}`]: {
41
- fontSize: (l = e.Table.xlTable) == null ? void 0 : l.fontSize
42
- }
38
+ {
39
+ [`.${e}.${g}`]: {
40
+ color: "#fff !important"
43
41
  }
44
- ],
45
- [
46
- {
47
- [`.${o}.lg${t}`]: {
48
- fontSize: (s = e.Table.lgTable) == null ? void 0 : s.fontSize
49
- }
42
+ },
43
+ {
44
+ [`.${e}.xl${t}`]: {
45
+ fontSize: (s = o.Table.xlTable) == null ? void 0 : s.fontSize
50
46
  }
51
- ],
52
- [
53
- {
54
- [`.${o}.md${t}`]: {
55
- fontSize: (p = e.Table.mdTable) == null ? void 0 : p.fontSize
56
- }
47
+ },
48
+ {
49
+ [`.${e}.lg${t}`]: {
50
+ fontSize: (c = o.Table.lgTable) == null ? void 0 : c.fontSize
57
51
  }
58
- ],
59
- [
60
- {
61
- [`.${o}.sm${t}`]: {
62
- fontSize: (b = e.Table.smTable) == null ? void 0 : b.fontSize
63
- }
52
+ },
53
+ {
54
+ [`.${e}.md${t}`]: {
55
+ fontSize: (p = o.Table.mdTable) == null ? void 0 : p.fontSize
64
56
  }
65
- ],
66
- [
67
- {
68
- [`.${o}.xs${t}`]: {
69
- fontSize: (c = e.Table.xsTable) == null ? void 0 : c.fontSize
70
- }
57
+ },
58
+ {
59
+ [`.${e}.sm${t}`]: {
60
+ fontSize: (b = o.Table.smTable) == null ? void 0 : b.fontSize
61
+ }
62
+ },
63
+ {
64
+ [`.${e}.xs${t}`]: {
65
+ fontSize: (d = o.Table.xsTable) == null ? void 0 : d.fontSize
71
66
  }
72
- ]
67
+ }
73
68
  ];
74
69
  };
75
- h({ theme: T, token: i, hashId: n, path: [r] }, () => [
76
- z(r, m, i)
70
+ y({ theme: S, token: i, hashId: n, path: [r] }, () => [
71
+ f(r, l, m, i)
77
72
  ]);
78
- const S = `${d}${m}`;
79
- return { toolbarItemClassName: u(r, S, n) };
73
+ const z = `${$}${m}`;
74
+ return { toolbarItemClassName: B(r, { [`${l}`]: T }, z, n) };
80
75
  };
81
76
  export {
82
- J as default
77
+ O as default
83
78
  };
@@ -1,4 +1,4 @@
1
- import { BitzTableProps } from './Table';
1
+ import { BitzTableProps, BitzTableRowSelectionProps } from './Table';
2
2
  import BitzTableProvider, { BitzTableContext, DensitySize as BitzTableSizeType, StylesStateType, ColumnStateType, ExportColumnStateType } from './Store';
3
3
  import SubTable from './SubTable';
4
4
  import ActionBar from './ActionBar';
@@ -70,6 +70,6 @@ type CompoundedComponent = React.ForwardRefExoticComponent<BitzTableProps> & {
70
70
  ActionCol: typeof ActionCol;
71
71
  };
72
72
  declare const BitzTable: CompoundedComponent;
73
- export type { BitzTableProps, BitzTableSizeType, ColumnsConfigProps, StylesStateType, ColumnStateType, ExportColumnStateType, BitzTableColumnType, BitzTableColumnGroupType, BitzTableColumnsType, ActionsFunType, Action, BitzTableActionProps, BitzTableActionColProps, };
73
+ export type { BitzTableProps, BitzTableRowSelectionProps, BitzTableSizeType, ColumnsConfigProps, StylesStateType, ColumnStateType, ExportColumnStateType, BitzTableColumnType, BitzTableColumnGroupType, BitzTableColumnsType, ActionsFunType, Action, BitzTableActionProps, BitzTableActionColProps, };
74
74
  export { BitzTableProvider, BitzTableContext };
75
75
  export default BitzTable;
@@ -1,5 +1,5 @@
1
1
  import { getDefaultExportFromCjs as u } from "../../../../../_virtual/_commonjsHelpers.mjs";
2
- import { __module as i } from "../../../../../_virtual/index.mjs";
2
+ import { __module as i } from "../../../../../_virtual/index2.mjs";
3
3
  /*!
4
4
  Copyright (c) 2018 Jed Watson.
5
5
  Licensed under the MIT License (MIT), see
@@ -1,5 +1,5 @@
1
1
  import { getDefaultExportFromCjs as e } from "../../../../../_virtual/_commonjsHelpers.mjs";
2
- import { __module as r } from "../../../../../_virtual/index2.mjs";
2
+ import { __module as r } from "../../../../../_virtual/index.mjs";
3
3
  import { __require as o } from "../../../react-is@16.13.1/node_modules/react-is/index.mjs";
4
4
  import { __require as t } from "./factoryWithTypeCheckers.mjs";
5
5
  import { __require as p } from "./factoryWithThrowingShims.mjs";