bitz-react-admin-ui 1.9.5 → 1.9.7

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.
@@ -0,0 +1,5 @@
1
+ import { BitzTableColumnsType } from '..';
2
+ /** build skeleton */
3
+ export declare function loopBuildSkeleton<T>(columns: BitzTableColumnsType<T>, toolCols: any): BitzTableColumnsType<T>;
4
+ /** 设置复选框列、展开列的位置 */
5
+ export declare function getColumnsWithTool<T>(sortCols: any, cols: any, rowSelection: any, expandable: any): BitzTableColumnsType<T>;
@@ -0,0 +1,40 @@
1
+ import { j as f } from "../../../node_modules/.store/react@18.2.0/node_modules/react/jsx-runtime.mjs";
2
+ import { Skeleton as x, Table as d } from "antd";
3
+ function a(o, t) {
4
+ return o == null ? void 0 : o.map((e) => {
5
+ const n = { ...e };
6
+ return e != null && e.isOperationCol || e != null && e.isToolCol || t.includes(e) ? e : (n != null && n.children && (n.children = a(n == null ? void 0 : n.children, t)), {
7
+ ...n,
8
+ sorter: !1,
9
+ render: (l, i, r) => /* @__PURE__ */ f.jsx(
10
+ x,
11
+ {
12
+ active: !0,
13
+ title: !1,
14
+ paragraph: {
15
+ rows: 1,
16
+ width: (r + 1) % 2 === 0 ? "100%" : "60%"
17
+ }
18
+ }
19
+ )
20
+ });
21
+ });
22
+ }
23
+ const C = 0, c = 1;
24
+ function s(o, t, e, n) {
25
+ let l = C;
26
+ if (e) {
27
+ const i = o.indexOf(d.SELECTION_COLUMN);
28
+ i >= 0 && (l = i), t.splice(l, 0, d.SELECTION_COLUMN);
29
+ }
30
+ if (n) {
31
+ let i = 0;
32
+ const r = o.indexOf(d.EXPAND_COLUMN);
33
+ r >= 0 && (i = r), e && l === 0 && r === -1 && (i = c), t.splice(i, 0, d.EXPAND_COLUMN);
34
+ }
35
+ return t;
36
+ }
37
+ export {
38
+ s as getColumnsWithTool,
39
+ a as loopBuildSkeleton
40
+ };
@@ -7,8 +7,8 @@ import { TableContext as me } from "../../Store/index.mjs";
7
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
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";
10
+ import { SortableContext as pe, verticalListSortingStrategy as fe, arrayMove as he } from "../../../../node_modules/.store/@dnd-kit_sortable@7.0.2/node_modules/@dnd-kit/sortable/dist/sortable.esm.mjs";
11
+ import xe from "./DndItem.mjs";
12
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
13
  import P from "../../../BitzButton/index.mjs";
14
14
  import { useImmer as Ce } from "../../../../node_modules/.store/use-immer@0.9.0/node_modules/use-immer/dist/use-immer.module.mjs";
@@ -18,7 +18,7 @@ import "./index.less.mjs";
18
18
  import W from "../../../../node_modules/.store/lodash-es@4.17.21/node_modules/lodash-es/omit.mjs";
19
19
  import ke from "../../../../node_modules/.store/@ant-design_icons@5.3.5/node_modules/@ant-design/icons/es/icons/CheckCircleOutlined.mjs";
20
20
  import ge from "../../../../node_modules/.store/@ant-design_icons@5.3.5/node_modules/@ant-design/icons/es/icons/RedoOutlined.mjs";
21
- const $e = oe(({ onChange: f }) => {
21
+ const $e = oe(({ onChange: x }) => {
22
22
  var _, E, z, H;
23
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: {},
@@ -43,7 +43,7 @@ const $e = oe(({ onChange: f }) => {
43
43
  y((e) => {
44
44
  e.columnsMap = { ...l.defaultColumnKeyMap };
45
45
  });
46
- }, []), h = M(() => {
46
+ }, []), f = 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 }) => {
@@ -95,7 +95,7 @@ const $e = oe(({ onChange: f }) => {
95
95
  t.columnsMap = { ...n };
96
96
  });
97
97
  }, Z = (e, s) => {
98
- const n = { ...a.columnsMap }, u = xe(a.sortKeyColumns, e, s);
98
+ const n = { ...a.columnsMap }, u = he(a.sortKeyColumns, e, s);
99
99
  u.forEach((t, m) => {
100
100
  n[t] = { ...n[t] || {}, order: m };
101
101
  }), w(!0), y((t) => {
@@ -103,27 +103,28 @@ const $e = oe(({ onChange: f }) => {
103
103
  });
104
104
  }, ee = () => {
105
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(() => {
106
+ L(a.columnsMap), U(a.sortKeyColumns), G === "online" && B && (g == null || g(B, a.columnsMap)), x ? (K(!0), (e = x == null ? void 0 : x(a.columnsMap)) == null || e.finally(() => {
107
107
  K(!1), b.hide();
108
108
  })) : b.hide();
109
109
  }, I = () => {
110
110
  b.hide();
111
- }, x = M(() => i.mode === "dark", [i.mode]);
111
+ }, h = M(() => i.mode === "dark", [i.mode]);
112
112
  return /* @__PURE__ */ o.jsxs(
113
113
  le,
114
114
  {
115
115
  className: "tableColumnSettingModal",
116
116
  title: /* @__PURE__ */ o.jsx(ne.Title, { style: { fontSize: 16, margin: 0 }, children: "列设置" }),
117
+ getContainer: !1,
117
118
  ...te(b),
118
119
  style: {
119
120
  "--modalContent-bgColor": (_ = i.Modal) == null ? void 0 : _.contentBg,
120
121
  "--header-bgColor": (E = i.Modal) == null ? void 0 : E.headerBg,
121
122
  "--footer-bgColor": (z = i.Modal) == null ? void 0 : z.footerBg,
122
- "--blockTitle-colorBg": x ? "#333" : "#fff",
123
- "--leftBody-bgColor": x ? "#262626" : "#e0e0e0",
124
- "--rightBody-bgColor": x ? "#262626" : "#fff",
125
- "--checked": x ? "#303030" : "#eee",
126
- "--block-bgColor": x ? "#222" : "#fff",
123
+ "--blockTitle-colorBg": h ? "#333" : "#fff",
124
+ "--leftBody-bgColor": h ? "#262626" : "#e0e0e0",
125
+ "--rightBody-bgColor": h ? "#262626" : "#fff",
126
+ "--checked": h ? "#303030" : "#eee",
127
+ "--block-bgColor": h ? "#222" : "#fff",
127
128
  "--colorText": i.colorText,
128
129
  "--colorText-desc": i.colorTextDescription,
129
130
  "--colorBorder": i.colorBorder
@@ -228,9 +229,9 @@ const $e = oe(({ onChange: f }) => {
228
229
  children: /* @__PURE__ */ o.jsx(
229
230
  pe,
230
231
  {
231
- items: h == null ? void 0 : h.map((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)) })
232
+ items: f == null ? void 0 : f.map((e) => e.key),
233
+ strategy: fe,
234
+ children: /* @__PURE__ */ o.jsx("ul", { className: r.content, children: f == null ? void 0 : f.map((e) => /* @__PURE__ */ o.jsx(xe, { item: e }, e.key)) })
234
235
  }
235
236
  )
236
237
  }
@@ -1,25 +1,24 @@
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 k } from "react";
3
- import { Tooltip as b } from "antd";
4
- import { TableContext as g } from "../../Store/index.mjs";
5
- import j from "../style.mjs";
6
- import h from "../../../BitzButton/index.mjs";
7
- import C from "../../Dropdown/index.mjs";
8
- import w from "../../../../node_modules/.store/@ant-design_icons@5.3.5/node_modules/@ant-design/icons/es/icons/ColumnHeightOutlined.mjs";
9
- const z = (e) => {
10
- const { order: s, show: c = !0, icon: a = /* @__PURE__ */ o.jsx(w, {}) } = e, {
11
- sizeStorageType: y,
12
- sizeStorageKey: i,
13
- onlineSizeChange: l,
14
- tableSize: m,
15
- setTableSize: n
16
- } = k(g), { toolbarItemClassName: f } = j(), u = {
17
- selectedKeys: [m],
18
- onClick: (x) => {
19
- var r;
20
- const { key: t } = x;
21
- t !== m && (n == null || n(t), y === "online" && i && (l == null || l(i, t)), (r = e == null ? void 0 : e.onChange) == null || r.call(e, t));
22
- },
1
+ import { j as l } from "../../../../node_modules/.store/react@18.2.0/node_modules/react/jsx-runtime.mjs";
2
+ import { memo as k, useContext as g } from "react";
3
+ import { Tooltip as h } from "antd";
4
+ import { TableContext as j } from "../../Store/index.mjs";
5
+ import z from "../style.mjs";
6
+ import C from "../../../BitzButton/index.mjs";
7
+ import S from "../../Dropdown/index.mjs";
8
+ import D from "../../../../node_modules/.store/@ant-design_icons@5.3.5/node_modules/@ant-design/icons/es/icons/ColumnHeightOutlined.mjs";
9
+ const I = ({ defaultSize: e, items: n }) => n.map((t) => t.key === e ? {
10
+ ...t,
11
+ label: `${t.label}(默认)`
12
+ } : t), w = (e) => {
13
+ const { order: n, show: t = !0, icon: c = /* @__PURE__ */ l.jsx(D, {}) } = e, {
14
+ sizeStorageType: u,
15
+ sizeStorageKey: m,
16
+ onlineSizeChange: i,
17
+ defaultTableSize: f,
18
+ tableSize: s,
19
+ setTableSize: r
20
+ } = g(j), { toolbarItemClassName: y } = z(), d = I({
21
+ defaultSize: f,
23
22
  items: [
24
23
  {
25
24
  key: "xl",
@@ -27,7 +26,7 @@ const z = (e) => {
27
26
  },
28
27
  {
29
28
  key: "lg",
30
- label: "宽松(默认)"
29
+ label: "宽松"
31
30
  },
32
31
  {
33
32
  key: "md",
@@ -42,18 +41,26 @@ const z = (e) => {
42
41
  label: "特紧凑"
43
42
  }
44
43
  ]
44
+ }), x = {
45
+ selectedKeys: [s],
46
+ onClick: (b) => {
47
+ var a;
48
+ const { key: o } = b;
49
+ o !== s && (r == null || r(o), u === "online" && m && (i == null || i(m, o)), (a = e == null ? void 0 : e.onChange) == null || a.call(e, o));
50
+ },
51
+ items: d
45
52
  };
46
- return c ? /* @__PURE__ */ o.jsx(C, { menu: u, trigger: ["click"], children: /* @__PURE__ */ o.jsx(b, { title: "表格密度", open: !1, children: /* @__PURE__ */ o.jsx(
47
- h,
53
+ return t ? /* @__PURE__ */ l.jsx(S, { menu: x, trigger: ["click"], children: /* @__PURE__ */ l.jsx(h, { title: "表格密度", open: !1, children: /* @__PURE__ */ l.jsx(
54
+ C,
48
55
  {
49
- style: { order: s },
56
+ style: { order: n },
50
57
  type: "text",
51
- className: f,
52
- icon: a,
58
+ className: y,
59
+ icon: c,
53
60
  children: "表格密度"
54
61
  }
55
62
  ) }) }) : null;
56
- }, G = d(z);
63
+ }, O = k(w);
57
64
  export {
58
- G as default
65
+ O as default
59
66
  };
@@ -1,56 +1,46 @@
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
- import c from "../../../../node_modules/.store/screenfull@6.0.2/node_modules/screenfull/index.mjs";
7
- import h from "../../../BitzToast/index.mjs";
8
- import v from "../../../../node_modules/.store/@ant-design_icons@5.3.5/node_modules/@ant-design/icons/es/icons/FullscreenExitOutlined.mjs";
9
- import z from "../../../../node_modules/.store/@ant-design_icons@5.3.5/node_modules/@ant-design/icons/es/icons/FullscreenOutlined.mjs";
10
- function m(t, n) {
11
- if (t.classList.contains(n))
12
- return t;
13
- var r = t.parentNode;
14
- if (r) {
15
- var e = m(r, n);
16
- if (e)
17
- return e;
18
- }
19
- return null;
20
- }
21
- const L = ({
22
- order: t,
23
- show: n = !0
1
+ import { j as t } 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";
6
+ import r from "../../../../node_modules/.store/screenfull@6.0.2/node_modules/screenfull/index.mjs";
7
+ import j from "../../../BitzToast/index.mjs";
8
+ import { findParentFirstNodeByClass as h } from "../../../../utils/findNode.mjs";
9
+ import z from "../../../../node_modules/.store/@ant-design_icons@5.3.5/node_modules/@ant-design/icons/es/icons/FullscreenExitOutlined.mjs";
10
+ import T from "../../../../node_modules/.store/@ant-design_icons@5.3.5/node_modules/@ant-design/icons/es/icons/FullscreenOutlined.mjs";
11
+ const g = ({
12
+ order: m,
13
+ show: u = !0
24
14
  }) => {
25
- const { toolbarItemClassName: r } = F(), [e, u] = x(!1), s = b(() => e ? {
15
+ const { toolbarItemClassName: a } = B(), [l, s] = p(!1), n = x(() => l ? {
26
16
  title: "退出全屏",
27
- icon: /* @__PURE__ */ o.jsx(v, {})
17
+ icon: /* @__PURE__ */ t.jsx(z, {})
28
18
  } : {
29
19
  title: "全屏",
30
- icon: /* @__PURE__ */ o.jsx(z, {})
31
- }, [e]);
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));
20
+ icon: /* @__PURE__ */ t.jsx(T, {})
21
+ }, [l]);
22
+ b(() => (document == null || document.addEventListener("fullscreenchange", (o) => {
23
+ var e, i, c;
24
+ (e = o.target) != null && e.classList.contains("bitzTableBlock") && (s(!!document.fullscreenElement), (c = (i = document.fullscreenElement) == null ? void 0 : i.classList) != null && c.contains("bitzTableBlock") || s(!1));
35
25
  }), document == null ? void 0 : document.removeEventListener("fullscreenchange", () => {
36
26
  })), []);
37
- const d = (i) => {
38
- c.isEnabled || h.error("您的浏览器不支持全屏");
39
- const l = m(i.target, "bitzTableBlock");
40
- e ? c.exit() : c.request(l);
27
+ const f = (o) => {
28
+ r.isEnabled || j.error("您的浏览器不支持全屏");
29
+ const e = h(o.target, "bitzTableBlock");
30
+ l ? r.exit() : r.request(e);
41
31
  };
42
- return n ? /* @__PURE__ */ o.jsx(B, { title: s.title, open: !1, children: /* @__PURE__ */ o.jsx(
43
- j,
32
+ return u ? /* @__PURE__ */ t.jsx(E, { title: n.title, open: !1, children: /* @__PURE__ */ t.jsx(
33
+ F,
44
34
  {
45
35
  type: "text",
46
- className: r,
47
- onClick: d,
48
- icon: s.icon,
49
- style: { order: t },
50
- children: s.title
36
+ className: a,
37
+ onClick: f,
38
+ icon: n.icon,
39
+ style: { order: m },
40
+ children: n.title
51
41
  }
52
42
  ) }) : null;
53
- }, q = p(L);
43
+ }, G = d(g);
54
44
  export {
55
- q as default
45
+ G as default
56
46
  };
@@ -5,7 +5,7 @@ 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
+ import { ToolEnum } from '../../../components/BitzConfigProvider/context';
9
9
  import { ColumnsConfigProps } from '..';
10
10
  export type MenuKeysType = 'excel';
11
11
  export type ExportEvent = (key: MenuKeysType) => void;
@@ -47,10 +47,16 @@ interface BitzTableColumnType<RecordType = any> extends ColumnsConfigProps, Tabl
47
47
  mobileHideLabel?: boolean;
48
48
  /** 是否为操作列 */
49
49
  isOperationCol?: boolean;
50
+ /** 是否为复选框/展开列 */
51
+ isToolCol?: boolean;
50
52
  /** 列宽根据内容宽度最大的设置(只应用在操作列上) */
51
53
  useMaxWidth?: boolean;
52
54
  }
53
- type BitzTableColumnsType<DataType> = BitzTableColumnType<DataType>[];
55
+ /** 表头分组 */
56
+ interface BitzTableColumnGroupType<RecordType> extends Omit<BitzTableColumnType<RecordType>, 'dataIndex'> {
57
+ children: BitzTableColumnsType<RecordType>;
58
+ }
59
+ type BitzTableColumnsType<RecordType> = (BitzTableColumnType<RecordType> | BitzTableColumnGroupType<RecordType>)[];
54
60
  type CompoundedComponent = React.ForwardRefExoticComponent<BitzTableProps> & {
55
61
  ActionBar: typeof ActionBar;
56
62
  ToolBar: typeof ToolBar;
@@ -58,6 +64,6 @@ type CompoundedComponent = React.ForwardRefExoticComponent<BitzTableProps> & {
58
64
  ActionCol: typeof ActionCol;
59
65
  };
60
66
  declare const BitzTable: CompoundedComponent;
61
- export type { BitzTableProps, BitzTableSizeType, ColumnsConfigProps, SizeStateType, ColumnStateType, BitzTableColumnType, BitzTableColumnsType, ActionsFunType, Action, BitzTableActionProps, BitzTableActionColProps, };
67
+ export type { BitzTableProps, BitzTableSizeType, ColumnsConfigProps, SizeStateType, ColumnStateType, BitzTableColumnType, BitzTableColumnGroupType, BitzTableColumnsType, ActionsFunType, Action, BitzTableActionProps, BitzTableActionColProps, };
62
68
  export { BitzTableProvider, BitzTableContext };
63
69
  export default BitzTable;
@@ -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
@@ -1,5 +1,5 @@
1
1
  import { getDefaultExportFromCjs as e } from "../../../../../_virtual/_commonjsHelpers.mjs";
2
- import { __module as r } from "../../../../../_virtual/index.mjs";
2
+ import { __module as r } from "../../../../../_virtual/index2.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";