bitz-react-admin-ui 2.1.7 → 2.1.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.
@@ -1,97 +1,78 @@
1
1
  import { j as e } from "../../../../node_modules/.store/react@18.2.0/node_modules/react/jsx-runtime.mjs";
2
- import { css as s } from "../../../../node_modules/.store/@emotion_css@11.11.2/node_modules/@emotion/css/dist/emotion-css.esm.mjs";
3
- import { Tooltip as g, Flex as b, Typography as l, InputNumber as S, Select as j } from "antd";
4
- import { useState as a } from "react";
5
- import y from "../../Select/index.mjs";
6
- const { Option: p } = j, E = ({
7
- onClick: u,
2
+ import { Tooltip as h, Flex as y, Typography as i, InputNumber as S, Select as g } from "antd";
3
+ import { useState as s } from "react";
4
+ import j from "../../Select/index.mjs";
5
+ import { selectStyles as b, inputNumberStyles as T } from "./styles.mjs";
6
+ const { Option: r } = g, V = ({
7
+ onClick: p,
8
8
  onClose: c
9
9
  }) => {
10
- const [m, o] = a(!1), [d, i] = a(!1), [r, f] = a("page"), [t, h] = a(1), x = () => {
11
- if (!d) {
10
+ const [u, a] = s(!1), [f, l] = s(!1), [o, m] = s("page"), [t, d] = s(1), x = () => {
11
+ if (!f) {
12
12
  if (!t && typeof t != "number" || t <= 0) {
13
- i(!0), o(!0), setTimeout(() => {
14
- o(!1), i(!1);
13
+ l(!0), a(!0), setTimeout(() => {
14
+ a(!1), l(!1);
15
15
  }, 2e3);
16
16
  return;
17
17
  }
18
- i(!0), u("any", { value: t, type: r }), c();
18
+ l(!0), p("any", { value: t, type: o }), c();
19
19
  }
20
20
  };
21
21
  return /* @__PURE__ */ e.jsx(
22
- g,
22
+ h,
23
23
  {
24
- open: m,
24
+ open: u,
25
25
  title: "数字必须大于等于1",
26
26
  getTooltipContainer: (n) => n.parentElement.parentElement.parentElement,
27
- children: /* @__PURE__ */ e.jsxs(b, { align: "center", gap: 8, onClick: (n) => n.stopPropagation(), children: [
28
- /* @__PURE__ */ e.jsx(l.Text, { style: { fontSize: "var(--fontSize)" }, children: "导出" }),
29
- /* @__PURE__ */ e.jsx(
30
- S,
31
- {
32
- controls: !1,
33
- min: 1,
34
- value: t,
35
- onChange: (n) => h(n),
36
- style: { width: 100 },
37
- size: "small",
38
- addonAfter: /* @__PURE__ */ e.jsxs(
39
- y,
27
+ children: /* @__PURE__ */ e.jsxs(
28
+ y,
29
+ {
30
+ align: "center",
31
+ gap: 8,
32
+ onClick: (n) => n.stopPropagation(),
33
+ style: { padding: "5px 12px" },
34
+ children: [
35
+ /* @__PURE__ */ e.jsx(i.Text, { style: { fontSize: "var(--fontSize)" }, children: "导出" }),
36
+ /* @__PURE__ */ e.jsx(
37
+ S,
40
38
  {
41
- value: r,
42
- onChange: f,
43
- className: s`
44
- width: auto;
45
- height: calc(var(--fontSize) + 12px);
46
-
47
- .ant-select-selection-item {
48
- padding-right: 0 !important;
49
- }
50
-
51
- .ant-select-selector {
52
- width: auto !important;
53
- padding-inline: 8px !important;
54
- }
55
- `,
56
- popupMatchSelectWidth: !1,
57
- suffixIcon: !1,
58
- children: [
59
- /* @__PURE__ */ e.jsx(p, { value: "page", children: "页" }),
60
- /* @__PURE__ */ e.jsx(p, { value: "pieces", children: "条" })
61
- ]
39
+ controls: !1,
40
+ min: 1,
41
+ value: t,
42
+ onChange: (n) => d(n),
43
+ style: { width: 100 },
44
+ size: "small",
45
+ addonAfter: /* @__PURE__ */ e.jsxs(
46
+ j,
47
+ {
48
+ value: o,
49
+ onChange: m,
50
+ className: b,
51
+ popupMatchSelectWidth: !1,
52
+ suffixIcon: !1,
53
+ children: [
54
+ /* @__PURE__ */ e.jsx(r, { value: "page", children: "页" }),
55
+ /* @__PURE__ */ e.jsx(r, { value: "pieces", children: "条" })
56
+ ]
57
+ }
58
+ ),
59
+ className: T
62
60
  }
63
61
  ),
64
- className: s`
65
- .ant-input-number-group-wrapper {
66
- height: calc(var(--fontSize) + 12px);
67
- }
68
- .ant-input-number-wrapper,
69
- .ant-input-number,
70
- .ant-input-number-input-wrap,
71
- .ant-input-number-input {
72
- height: 100% !important;
73
- }
74
- .ant-input-number {
75
- box-shadow: none;
76
- }
77
- .ant-input-number-group-addon {
78
- width: auto;
79
- }
80
- `
81
- }
82
- ),
83
- /* @__PURE__ */ e.jsx(
84
- l.Link,
85
- {
86
- style: { userSelect: "none", fontSize: "var(--fontSize)" },
87
- onClick: x,
88
- children: "下载"
89
- }
90
- )
91
- ] })
62
+ /* @__PURE__ */ e.jsx(
63
+ i.Link,
64
+ {
65
+ style: { userSelect: "none", fontSize: "var(--fontSize)" },
66
+ onClick: x,
67
+ children: "下载"
68
+ }
69
+ )
70
+ ]
71
+ }
72
+ )
92
73
  }
93
74
  );
94
75
  };
95
76
  export {
96
- E as default
77
+ V as default
97
78
  };
@@ -1,76 +1,62 @@
1
1
  import { j as o } from "../../../../node_modules/.store/react@18.2.0/node_modules/react/jsx-runtime.mjs";
2
- import { memo as d, useState as u } from "react";
3
- import f from "../style.mjs";
4
- import x from "../../../BitzButton/index.mjs";
5
- import y from "../../Dropdown/index.mjs";
6
- import c from "./AnyDataTotalLabel.mjs";
7
- import { css as b } from "../../../../node_modules/.store/@emotion_css@11.11.2/node_modules/@emotion/css/dist/emotion-css.esm.mjs";
8
- import g from "../../../../node_modules/.store/@ant-design_icons@5.3.6/node_modules/@ant-design/icons/es/icons/DownloadOutlined.mjs";
9
- const j = ({
10
- show: a = !0,
11
- order: n,
2
+ import { memo as x, useState as y, useContext as d } from "react";
3
+ import c from "../style.mjs";
4
+ import b from "../../../BitzButton/index.mjs";
5
+ import g from "../../Dropdown/index.mjs";
6
+ import j from "./AnyDataTotalLabel.mjs";
7
+ import { BitzTableContext as E } from "../../Store/index.mjs";
8
+ import { overlayStyles as N } from "./styles.mjs";
9
+ import O from "../../../../node_modules/.store/@ant-design_icons@5.3.6/node_modules/@ant-design/icons/es/icons/DownloadOutlined.mjs";
10
+ const h = ({
11
+ show: n = !0,
12
+ order: s,
12
13
  loading: m,
13
14
  onClick: e,
14
- icon: l = /* @__PURE__ */ o.jsx(g, {})
15
+ icon: l = /* @__PURE__ */ o.jsx(O, {})
15
16
  }) => {
16
- const { toolbarItemClassName: s } = f(), [p, r] = u(!1);
17
- return a ? /* @__PURE__ */ o.jsx(
18
- y,
17
+ const { toolbarItemClassName: p } = c(), [i, r] = y(!1), a = d(E).exportConfig, u = [
18
+ { key: "current", label: "仅导出当前页" },
19
+ { key: "all", label: "导出全部数据" },
20
+ { type: "divider" },
19
21
  {
20
- open: p,
21
- onOpenChange: r,
22
- menu: {
23
- items: [
24
- { key: "current", label: "仅导出当前页" },
25
- { key: "all", label: "导出全部数据" },
26
- { type: "divider" },
27
- {
28
- key: "any",
29
- label: /* @__PURE__ */ o.jsx(
30
- c,
31
- {
32
- onClick: (t, i) => e == null ? void 0 : e(t, i),
33
- onClose: () => r(!1)
34
- }
35
- ),
36
- className: "anyTotal"
37
- }
38
- ],
39
- onClick: ({ key: t }) => e == null ? void 0 : e(t)
40
- },
41
- overlayClassName: b`
42
- .ant-dropdown-menu.ant-dropdown-menu-root {
43
- display: flex;
44
- flex-direction: column;
45
-
46
- .anyTotal {
47
- cursor: default !important;
48
- margin: 5px 12px;
49
- padding: 0;
50
-
51
- &:hover {
52
- background-color: inherit !important;
53
- }
54
- }
22
+ key: "any",
23
+ label: /* @__PURE__ */ o.jsx(
24
+ j,
25
+ {
26
+ onClick: (t, f) => e == null ? void 0 : e(t, a, f),
27
+ onClose: () => r(!1)
55
28
  }
56
- `,
29
+ ),
30
+ className: "anyTotal"
31
+ }
32
+ ];
33
+ return n ? /* @__PURE__ */ o.jsx(
34
+ g,
35
+ {
36
+ open: i,
37
+ onOpenChange: r,
38
+ overlayClassName: N,
57
39
  trigger: ["click"],
58
40
  disabled: m,
59
41
  destroyPopupOnHide: !0,
60
42
  getPopupContainer: (t) => t.parentElement.parentElement.parentElement,
43
+ menu: {
44
+ items: u,
45
+ onClick: ({ key: t }) => e == null ? void 0 : e(t, a)
46
+ },
61
47
  children: /* @__PURE__ */ o.jsx(
62
- x,
48
+ b,
63
49
  {
64
50
  type: "text",
65
- className: s,
51
+ className: p,
66
52
  icon: l,
67
- style: { order: n },
53
+ style: { order: s },
68
54
  children: "下载"
69
55
  }
70
56
  )
71
57
  }
72
58
  ) : null;
73
- }, T = d(j);
59
+ }, P = x(h);
74
60
  export {
75
- T as default
61
+ P as default
76
62
  };
@@ -0,0 +1,3 @@
1
+ export declare const overlayStyles: string;
2
+ export declare const selectStyles: string;
3
+ export declare const inputNumberStyles: string;
@@ -0,0 +1,47 @@
1
+ import { css as t } from "../../../../node_modules/.store/@emotion_css@11.11.2/node_modules/@emotion/css/dist/emotion-css.esm.mjs";
2
+ const a = t`
3
+ .anyTotal {
4
+ cursor: default !important;
5
+ padding: 0 !important;
6
+
7
+ &:hover {
8
+ background-color: inherit !important;
9
+ }
10
+ }
11
+ `, e = t`
12
+ width: auto;
13
+ height: calc(var(--fontSize) + 12px);
14
+
15
+ .ant-select-selection-item {
16
+ padding-right: 0 !important;
17
+ }
18
+
19
+ .ant-select-selector {
20
+ width: auto !important;
21
+ padding-inline: 8px !important;
22
+ }
23
+ `, i = t`
24
+ .ant-input-number-group-wrapper {
25
+ height: calc(var(--fontSize) + 12px);
26
+ }
27
+
28
+ .ant-input-number-wrapper,
29
+ .ant-input-number,
30
+ .ant-input-number-input-wrap,
31
+ .ant-input-number-input {
32
+ height: 100% !important;
33
+ }
34
+
35
+ .ant-input-number {
36
+ box-shadow: none;
37
+ }
38
+
39
+ .ant-input-number-group-addon {
40
+ width: auto;
41
+ }
42
+ `;
43
+ export {
44
+ i as inputNumberStyles,
45
+ a as overlayStyles,
46
+ e as selectStyles
47
+ };
@@ -3,7 +3,7 @@ import { MouseEventHandler } from 'react';
3
3
  import { ToolEnum } from '../../../components/BitzConfigProvider/context';
4
4
  import { ColumnsConfigProps } from '..';
5
5
  export type MenuKeysType = 'current' | 'all' | 'any';
6
- export type ExportEvent = (key: MenuKeysType, info?: {
6
+ export type ExportEvent = (key: MenuKeysType, exportConfig: ExportConfigProps[], info?: {
7
7
  value: number;
8
8
  type: 'page' | 'pieces';
9
9
  }) => void;
@@ -1,5 +1,6 @@
1
1
  import { BitzTableProps } from './Table';
2
2
  import BitzTableProvider, { BitzTableContext, DensitySize as BitzTableSizeType, StylesStateType, ColumnStateType, ExportColumnStateType } from './Store';
3
+ import SubTable from './SubTable';
3
4
  import ActionBar from './ActionBar';
4
5
  import ToolBar from './ToolBar/Wrapper';
5
6
  import ActionCol from './ActionCol';
@@ -60,6 +61,7 @@ interface BitzTableColumnGroupType<RecordType> extends Omit<BitzTableColumnType<
60
61
  }
61
62
  type BitzTableColumnsType<RecordType> = (BitzTableColumnType<RecordType> | BitzTableColumnGroupType<RecordType>)[];
62
63
  type CompoundedComponent = React.ForwardRefExoticComponent<BitzTableProps> & {
64
+ SubTable: typeof SubTable;
63
65
  ActionBar: typeof ActionBar;
64
66
  ToolBar: typeof ToolBar;
65
67
  SelectionBar: typeof SelectionBar;
@@ -1,17 +1,19 @@
1
1
  import t from "./Table/index.mjs";
2
- import { BitzTableContext as f, default as b } from "./Store/index.mjs";
3
- import r from "./ActionBar/index.mjs";
4
- import i from "./ToolBar/Wrapper/index.mjs";
5
- import e from "./ActionCol/index.mjs";
6
- import a from "./SelectionBar/index.mjs";
2
+ import { BitzTableContext as z, default as d } from "./Store/index.mjs";
3
+ import r from "./SubTable/index.mjs";
4
+ import i from "./ActionBar/index.mjs";
5
+ import e from "./ToolBar/Wrapper/index.mjs";
6
+ import a from "./ActionCol/index.mjs";
7
+ import l from "./SelectionBar/index.mjs";
7
8
  const o = t;
8
9
  process.env.NODE_ENV !== "production" && (o.displayName = "BitzTable");
9
- o.ActionBar = r;
10
- o.ToolBar = i;
11
- o.SelectionBar = a;
12
- o.ActionCol = e;
10
+ o.SubTable = r;
11
+ o.ActionBar = i;
12
+ o.ToolBar = e;
13
+ o.SelectionBar = l;
14
+ o.ActionCol = a;
13
15
  export {
14
- f as BitzTableContext,
15
- b as BitzTableProvider,
16
+ z as BitzTableContext,
17
+ d as BitzTableProvider,
16
18
  o as default
17
19
  };
@@ -2,12 +2,13 @@ import { j as i } from "../../../node_modules/.store/react@18.2.0/node_modules/r
2
2
  import p from "../../BitzDescriptions/index.mjs";
3
3
  import m from "../TableCell/index.mjs";
4
4
  import u from "../TextBlock/index.mjs";
5
- const b = (o, n, e) => {
6
- const l = o.map((r) => (typeof r.title == "string" && (r.title = /* @__PURE__ */ i.jsx(u, { value: r.title, bold: 600 })), {
5
+ import { defaultValue as a } from "../index.mjs";
6
+ const w = (n, o, e) => {
7
+ const l = n.map((r) => (typeof r.title == "string" && (r.title = /* @__PURE__ */ i.jsx(u, { value: r.title, bold: 600 })), {
7
8
  ...r,
8
9
  width: "auto",
9
10
  render: (t, c, g) => {
10
- const f = (n == null ? void 0 : n.length) === 1 ? !1 : g + 1 > ((n == null ? void 0 : n.length) || 0) / 2;
11
+ const f = (o == null ? void 0 : o.length) === 1 ? !1 : g + 1 > ((o == null ? void 0 : o.length) || 0) / 2;
11
12
  if (r != null && r.render) {
12
13
  const s = r.render(t, c, g);
13
14
  if (typeof s == "object")
@@ -17,7 +18,7 @@ const b = (o, n, e) => {
17
18
  ))
18
19
  return /* @__PURE__ */ i.jsx(m, { value: `${s}`, isLatterHalf: f });
19
20
  }
20
- return !t && !["boolean", "number", "bigint"].includes(typeof t) ? /* @__PURE__ */ i.jsx(u, { value: "-" }) : /* @__PURE__ */ i.jsx(m, { value: t, isLatterHalf: f });
21
+ return !t && !["boolean", "number", "bigint"].includes(typeof t) ? /* @__PURE__ */ i.jsx(u, { value: a }) : /* @__PURE__ */ i.jsx(m, { value: t, isLatterHalf: f });
21
22
  }
22
23
  }));
23
24
  return [
@@ -30,15 +31,15 @@ const b = (o, n, e) => {
30
31
  },
31
32
  ...l
32
33
  ];
33
- }, j = (o, n) => o ? {
34
+ }, R = (n, o) => n ? {
34
35
  expandable: {
35
36
  rowExpandable: (e) => {
36
37
  var l;
37
- return n ? !0 : (l = e[o]) == null ? void 0 : l.length;
38
+ return o ? !0 : (l = e[n]) == null ? void 0 : l.length;
38
39
  },
39
40
  expandedRowRender: (e) => {
40
41
  var r;
41
- const l = (r = e[o]) == null ? void 0 : r.map((t) => (typeof t.label == "string" && (t.label = /* @__PURE__ */ i.jsx(u, { minRows: 1, maxRows: 5, value: t.label })), typeof t.children == "string" && (t.children = /* @__PURE__ */ i.jsx(u, { minRows: 1, maxRows: 5, value: t.children })), t));
42
+ const l = (r = e[n]) == null ? void 0 : r.map((t) => (typeof t.label == "string" && (t.label = /* @__PURE__ */ i.jsx(u, { minRows: 1, maxRows: 5, value: t.label })), typeof t.children == "string" && (t.children = /* @__PURE__ */ i.jsx(u, { minRows: 1, maxRows: 5, value: t.children })), t));
42
43
  return /* @__PURE__ */ i.jsx(
43
44
  p,
44
45
  {
@@ -50,8 +51,8 @@ const b = (o, n, e) => {
50
51
  );
51
52
  }
52
53
  }
53
- } : null, w = (o, n) => {
54
- if (o) {
54
+ } : null, S = (n, o) => {
55
+ if (n) {
55
56
  const e = {
56
57
  gutter: 20,
57
58
  left: {
@@ -66,7 +67,7 @@ const b = (o, n, e) => {
66
67
  button: 4
67
68
  }
68
69
  };
69
- return n || (e.right.search = 11, e.right.operation = 13, e.right.toolTagSelect = 0, e.right.totalSelect = 11, e.right.button = void 0), e;
70
+ return o || (e.right.search = 11, e.right.operation = 13, e.right.toolTagSelect = 0, e.right.totalSelect = 11, e.right.button = void 0), e;
70
71
  } else {
71
72
  const e = {
72
73
  gutter: 0,
@@ -82,11 +83,11 @@ const b = (o, n, e) => {
82
83
  button: void 0
83
84
  }
84
85
  };
85
- return n || (e.right.search = 11, e.right.operation = 13, e.right.toolTagSelect = 0, e.right.totalSelect = 11), e;
86
+ return o || (e.right.search = 11, e.right.operation = 13, e.right.toolTagSelect = 0, e.right.totalSelect = 11), e;
86
87
  }
87
88
  };
88
89
  export {
89
- b as getColumns,
90
- j as getExpandable,
91
- w as getLayoutConfig
90
+ w as getColumns,
91
+ R as getExpandable,
92
+ S as getLayoutConfig
92
93
  };