bitz-react-admin-ui 2.1.8 → 2.2.0

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 (79) hide show
  1. package/dist/_virtual/dayjs.min.mjs +2 -5
  2. package/dist/_virtual/index.mjs +2 -2
  3. package/dist/_virtual/index2.mjs +2 -2
  4. package/dist/components/BitzCalendar/index.mjs +1 -1
  5. package/dist/components/BitzDayJs/index.mjs +1 -1
  6. package/dist/components/BitzFuiCalendar/BitzFuiCalendarStore.mjs +1 -1
  7. package/dist/components/BitzFuiCalendar/CalendarAgendum.mjs +1 -1
  8. package/dist/components/BitzFuiCalendar/CalendarAgendumItem.mjs +1 -1
  9. package/dist/components/BitzFuiCalendar/CalendarHeadItem.mjs +1 -1
  10. package/dist/components/BitzFuiCalendar/CalendarToolbar.mjs +1 -1
  11. package/dist/components/BitzFuiCalendar/ColumnData.mjs +1 -1
  12. package/dist/components/BitzMeetingTime/BitzMeetingTimeItem.mjs +1 -1
  13. package/dist/components/BitzMeetingTime/index.mjs +1 -1
  14. package/dist/components/BitzTable/ActionBar/ActionBar.mjs +26 -22
  15. package/dist/components/BitzTable/ActionCol/index.d.ts +1 -1
  16. package/dist/components/BitzTable/ActionCol/index.mjs +61 -61
  17. package/dist/components/BitzTable/SelectionBar/Button.d.ts +2 -3
  18. package/dist/components/BitzTable/SelectionBar/Button.mjs +19 -25
  19. package/dist/components/BitzTable/SelectionBar/SelectionBar.mjs +24 -21
  20. package/dist/components/BitzTable/Store/index.d.ts +43 -22
  21. package/dist/components/BitzTable/Store/index.mjs +128 -125
  22. package/dist/components/BitzTable/Store/utils/index.d.ts +4 -5
  23. package/dist/components/BitzTable/Store/utils/index.mjs +31 -31
  24. package/dist/components/BitzTable/SubTable/index.d.ts +21 -0
  25. package/dist/components/BitzTable/SubTable/index.mjs +149 -0
  26. package/dist/components/BitzTable/Table/SortTableContext.d.ts +12 -0
  27. package/dist/components/BitzTable/Table/SortTableContext.mjs +25 -0
  28. package/dist/components/BitzTable/Table/SortableRow.d.ts +7 -0
  29. package/dist/components/BitzTable/Table/SortableRow.mjs +54 -0
  30. package/dist/components/BitzTable/Table/index.d.ts +5 -0
  31. package/dist/components/BitzTable/Table/index.mjs +277 -255
  32. package/dist/components/BitzTable/Table/utils.mjs +17 -16
  33. package/dist/components/BitzTable/ToolBar/ColConfigIcon/ColumnConfigModal.d.ts +1 -0
  34. package/dist/components/BitzTable/ToolBar/ColConfigIcon/ColumnConfigModal.mjs +84 -97
  35. package/dist/components/BitzTable/ToolBar/ColConfigIcon/ColumnsSort/DndItem.d.ts +5 -4
  36. package/dist/components/BitzTable/ToolBar/ColConfigIcon/ColumnsSort/DndItem.mjs +66 -60
  37. package/dist/components/BitzTable/ToolBar/ColConfigIcon/ColumnsSort/DndList.mjs +78 -72
  38. package/dist/components/BitzTable/ToolBar/ColConfigIcon/ColumnsSort/index.d.ts +1 -3
  39. package/dist/components/BitzTable/ToolBar/ColConfigIcon/ColumnsSort/index.mjs +190 -189
  40. package/dist/components/BitzTable/ToolBar/ColConfigIcon/ExportConfig/DndItem.d.ts +8 -0
  41. package/dist/components/BitzTable/ToolBar/ColConfigIcon/ExportConfig/DndItem.mjs +94 -0
  42. package/dist/components/BitzTable/ToolBar/ColConfigIcon/ExportConfig/DndList.d.ts +10 -0
  43. package/dist/components/BitzTable/ToolBar/ColConfigIcon/ExportConfig/DndList.mjs +58 -0
  44. package/dist/components/BitzTable/ToolBar/ColConfigIcon/ExportConfig/index.d.ts +13 -7
  45. package/dist/components/BitzTable/ToolBar/ColConfigIcon/ExportConfig/index.mjs +119 -80
  46. package/dist/components/BitzTable/ToolBar/ColConfigIcon/StylesConfig/index.d.ts +2 -2
  47. package/dist/components/BitzTable/ToolBar/ColConfigIcon/index.mjs +26 -29
  48. package/dist/components/BitzTable/ToolBar/ColConfigIcon/style.d.ts +3 -1
  49. package/dist/components/BitzTable/ToolBar/ColConfigIcon/style.mjs +53 -77
  50. package/dist/components/BitzTable/ToolBar/ExportIcon/AnyDataTotalLabel.d.ts +2 -2
  51. package/dist/components/BitzTable/ToolBar/ExportIcon/ExportModal.d.ts +12 -0
  52. package/dist/components/BitzTable/ToolBar/ExportIcon/ExportModal.mjs +61 -0
  53. package/dist/components/BitzTable/ToolBar/ExportIcon/index.mjs +50 -59
  54. package/dist/components/BitzTable/ToolBar/FullscreenIcon/index.mjs +27 -32
  55. package/dist/components/BitzTable/ToolBar/Modal/index.d.ts +18 -0
  56. package/dist/components/BitzTable/ToolBar/Modal/index.mjs +50 -0
  57. package/dist/components/BitzTable/ToolBar/Modal/style.d.ts +2 -0
  58. package/dist/components/BitzTable/ToolBar/Modal/style.mjs +58 -0
  59. package/dist/components/BitzTable/ToolBar/RefreshIcon/index.mjs +20 -20
  60. package/dist/components/BitzTable/ToolBar/index.d.ts +12 -11
  61. package/dist/components/BitzTable/index.d.ts +4 -0
  62. package/dist/components/BitzTable/index.mjs +13 -11
  63. package/dist/node_modules/.store/@ant-design_icons-svg@4.4.2/node_modules/@ant-design/icons-svg/es/asn/MenuOutlined.mjs +5 -0
  64. package/dist/node_modules/.store/@ant-design_icons@5.3.6/node_modules/@ant-design/icons/es/icons/MenuOutlined.mjs +15 -0
  65. package/dist/node_modules/.store/@dnd-kit_core@6.1.0/node_modules/@dnd-kit/core/dist/core.esm.mjs +1098 -753
  66. package/dist/node_modules/.store/classnames@2.5.1/node_modules/classnames/index.mjs +1 -1
  67. package/dist/node_modules/.store/dayjs@1.11.10/node_modules/dayjs/dayjs.min.mjs +292 -292
  68. package/dist/node_modules/.store/dayjs@1.11.10/node_modules/dayjs/locale/zh-cn.mjs +13 -13
  69. package/dist/node_modules/.store/prop-types@15.8.1/node_modules/prop-types/index.mjs +1 -1
  70. package/dist/style.css +1 -1
  71. package/dist/utils/WithFluent.mjs +16 -12
  72. package/dist/utils/findNode.d.ts +2 -2
  73. package/dist/utils/time.mjs +1 -1
  74. package/package.json +1 -1
  75. package/dist/_virtual/dayjs.min2.mjs +0 -4
  76. package/dist/components/BitzTable/Select/index.mjs +0 -11
  77. package/dist/components/BitzTable/Select/style.mjs +0 -66
  78. package/dist/components/BitzTable/ToolBar/ExportIcon/AnyDataTotalLabel.mjs +0 -78
  79. package/dist/components/BitzTable/ToolBar/ExportIcon/styles.mjs +0 -47
@@ -0,0 +1,21 @@
1
+ import { TableProps } from 'antd';
2
+ import { AnyObject } from 'antd/es/_util/type';
3
+ import type { RowClassName } from 'rc-table/es/interface';
4
+ import { BitzTableColumnsType } from '..';
5
+ export interface BitzSubTableProps<RecordType = any> extends Omit<TableProps<RecordType>, 'size' | 'pagination' | 'bordered'> {
6
+ /** table可滚动区域的最大宽高的值 */
7
+ scroll?: {
8
+ x?: number;
9
+ y?: number;
10
+ };
11
+ /** PC端 & 移动端:后端返回的数组数据 */
12
+ dataSource?: RecordType[];
13
+ /** PC端&移动端:自定义的列表参数 */
14
+ columns?: BitzTableColumnsType<RecordType>;
15
+ /** PC&移动端:请求加载状态 */
16
+ loading?: boolean;
17
+ /** 自定义行类名 */
18
+ rowClassName?: RowClassName<RecordType>;
19
+ }
20
+ declare function SubTable<T extends AnyObject>({ dataSource, columns: tableColumns, loading, scroll, components, expandable, rowSelection, ...props }: BitzSubTableProps<T>): import("react/jsx-runtime").JSX.Element;
21
+ export default SubTable;
@@ -0,0 +1,149 @@
1
+ import { j as C } from "../../../node_modules/.store/react@18.2.0/node_modules/react/jsx-runtime.mjs";
2
+ import { useContext as D, useRef as et, useMemo as o, useCallback as I } from "react";
3
+ import { Table as g } from "antd";
4
+ import nt from "../../../node_modules/.store/classnames@2.5.1/node_modules/classnames/index.mjs";
5
+ import { BitzTableContext as rt } from "../Store/index.mjs";
6
+ import ot from "../../../node_modules/.store/ahooks@3.7.11/node_modules/ahooks/es/useSize/index.mjs";
7
+ import st from "../ActionCol/style.mjs";
8
+ import at from "../../BitzTheme/index.mjs";
9
+ import lt from "../../../node_modules/.store/antd@5.16.2/node_modules/antd/es/table/ExpandIcon.mjs";
10
+ import "../../../node_modules/.store/antd@5.16.2/node_modules/antd/es/config-provider/index.mjs";
11
+ import ct from "../../../node_modules/.store/antd@5.16.2/node_modules/antd/locale/en_US.mjs";
12
+ import { getColumnsWithTool as it, loopBuildSkeleton as ut } from "../Table/utils.mjs";
13
+ import { ConfigContext as mt } from "../../../node_modules/.store/antd@5.16.2/node_modules/antd/es/config-provider/context.mjs";
14
+ const M = [g.SELECTION_COLUMN, g.EXPAND_COLUMN];
15
+ function Bt({
16
+ dataSource: u = [],
17
+ columns: x,
18
+ loading: l = !1,
19
+ scroll: s,
20
+ components: f,
21
+ expandable: c,
22
+ rowSelection: m,
23
+ ...a
24
+ }) {
25
+ var T, N;
26
+ const { token: j } = at.useToken(), { gap: K } = st(), { showColumnBorder: q, rowHoverable: P } = D(rt), h = et(null), y = ot((T = h.current) == null ? void 0 : T.nativeElement), A = o(() => {
27
+ let t = (s == null ? void 0 : s.x) ?? 1e3;
28
+ return s != null && s.x ? { x: t, y: s.y || 400 } : s != null && s.y ? { x: t, y: s.y } : { x: t, y: 400 };
29
+ }, [s]), O = () => {
30
+ var r, n;
31
+ const t = (n = (r = h.current) == null ? void 0 : r.nativeElement) == null ? void 0 : n.querySelectorAll(
32
+ "& > .bitzTableContainerBody > .ant-table-wrapper.bitzTable > .ant-spin-nested-loading > .ant-spin-container > .ant-table > .ant-table-container > .ant-table-body > table > .ant-table-tbody > tr:not(.ant-table-measure-row, .ant-table-expanded-row)"
33
+ ), e = [];
34
+ if (t == null || t.forEach((i) => {
35
+ var b;
36
+ e.push(
37
+ ((b = i.querySelector("& > .operationCol .actionGroup")) == null ? void 0 : b.clientWidth) || 0
38
+ );
39
+ }), e.length)
40
+ return Math.ceil(Math.max(...e)) + K * 2;
41
+ }, _ = () => {
42
+ var b, p, W, L, v;
43
+ const t = (p = (b = h.current) == null ? void 0 : b.nativeElement) == null ? void 0 : p.querySelector(
44
+ ".ant-table-body"
45
+ ), e = t == null ? void 0 : t.clientWidth, n = ((t == null ? void 0 : t.offsetWidth) || 0) - e > 0, i = (v = (L = (W = h.current) == null ? void 0 : W.nativeElement) == null ? void 0 : L.querySelector(
46
+ ".ant-table-cell-scrollbar"
47
+ )) == null ? void 0 : v.offsetWidth;
48
+ return { tbodyWidth: e, scrollbarSize: i, hasScrollBar: n };
49
+ }, { hasScrollBar: R, scrollbarSize: S } = o(() => {
50
+ const { hasScrollBar: t, scrollbarSize: e } = _();
51
+ return {
52
+ hasScrollBar: t,
53
+ scrollbarSize: e
54
+ };
55
+ }, [y == null ? void 0 : y.height]), d = o(() => {
56
+ const t = x ?? [], r = t.filter((n) => !M.includes(n)).map((n) => ({
57
+ ...n,
58
+ width: n.useMaxWidth ? O() ?? n.width : n.width
59
+ }));
60
+ return it(t, r, m, c);
61
+ }, [x]), k = o(() => ut(d, M), [d]), G = o(() => l ? k : d, [l, d, k]), z = o(() => {
62
+ const t = u == null ? void 0 : u.length, e = t > 4 ? t >= 8 ? 8 : t : 4;
63
+ return Array.from({ length: e }).map((n, i) => ({
64
+ key: `${Date.now()}${i}`
65
+ }));
66
+ }, [u]), U = o(() => l ? z : u, [l, u, z]), { table: w, locale: $ = ct } = D(mt), F = { ...$.Table }, H = ((N = w == null ? void 0 : w.expandable) == null ? void 0 : N.expandIcon) || (c == null ? void 0 : c.expandIcon) || lt(F), B = o(() => {
67
+ if (c)
68
+ return {
69
+ ...c,
70
+ expandedRowRender: () => /* @__PURE__ */ C.jsx(C.Fragment, {}),
71
+ expandIcon: (t) => {
72
+ const e = H(t);
73
+ return {
74
+ ...e,
75
+ props: {
76
+ ...e.props,
77
+ disabled: !0,
78
+ style: {
79
+ ...e.props.style,
80
+ backgroundColor: j.colorBgContainerDisabled
81
+ }
82
+ }
83
+ };
84
+ }
85
+ };
86
+ }, [c]), X = o(() => l ? B : c, [l, c, B]), E = o(() => {
87
+ if (m)
88
+ return {
89
+ ...m,
90
+ selectedRowKeys: [],
91
+ getCheckboxProps: () => ({ disabled: !0 })
92
+ };
93
+ }, [m]), J = o(() => l ? E : m, [l, m, E]), Q = o(() => l ? void 0 : a.rowKey, [l, a.rowKey]), V = I(
94
+ (t, e) => {
95
+ var n;
96
+ if (!a.onRow)
97
+ return {};
98
+ const r = (n = a.onRow) == null ? void 0 : n.call(a, t, e);
99
+ return r.onClick && (r.className = "rowPointerCursor"), r;
100
+ },
101
+ [a.onRow]
102
+ ), Y = I(
103
+ (t, e, r) => {
104
+ const n = e % 2 === 0 ? "oddRow" : "evenRow";
105
+ if (a.rowClassName) {
106
+ const i = a.rowClassName(t, e, r);
107
+ return nt(n, i);
108
+ }
109
+ return n;
110
+ },
111
+ [a.rowClassName]
112
+ ), Z = (t) => {
113
+ var r;
114
+ const e = { ...t };
115
+ return e.className.includes("ant-table-cell-fix-right") && !R && ((r = e.style) != null && r.right) && (e.style = {
116
+ ...e.style,
117
+ right: e.style.right - (S || 0)
118
+ }), /* @__PURE__ */ C.jsx("th", { ...e });
119
+ }, tt = o(() => ({
120
+ ...f,
121
+ header: {
122
+ ...f == null ? void 0 : f.header,
123
+ cell: Z
124
+ }
125
+ }), [f, R, S]);
126
+ return /* @__PURE__ */ C.jsx(
127
+ g,
128
+ {
129
+ ...a,
130
+ bordered: q,
131
+ columns: G,
132
+ dataSource: U,
133
+ loading: !1,
134
+ pagination: !1,
135
+ scroll: A,
136
+ expandable: X,
137
+ rowSelection: J,
138
+ onRow: V,
139
+ rowClassName: Y,
140
+ components: tt,
141
+ rowKey: Q,
142
+ rowHoverable: P,
143
+ ref: h
144
+ }
145
+ );
146
+ }
147
+ export {
148
+ Bt as default
149
+ };
@@ -0,0 +1,12 @@
1
+ import { DragEndEvent } from "@dnd-kit/core";
2
+ import { ReactNode } from "react";
3
+ interface SortTableContextProps {
4
+ children?: ReactNode;
5
+ enabledRowDragSort?: boolean;
6
+ dataSource: any[];
7
+ mergeRowKey: string;
8
+ onDragEnd: (event: DragEndEvent) => void;
9
+ }
10
+ declare function SortTableContext({ children, enabledRowDragSort, dataSource, mergeRowKey, onDragEnd, }: SortTableContextProps): import("react/jsx-runtime").JSX.Element;
11
+ declare const _default: import("react").MemoExoticComponent<typeof SortTableContext>;
12
+ export default _default;
@@ -0,0 +1,25 @@
1
+ import { j as t } from "../../../node_modules/.store/react@18.2.0/node_modules/react/jsx-runtime.mjs";
2
+ import { DndContext as a } from "../../../node_modules/.store/@dnd-kit_core@6.1.0/node_modules/@dnd-kit/core/dist/core.esm.mjs";
3
+ import { restrictToVerticalAxis as n } from "../../../node_modules/.store/@dnd-kit_modifiers@6.0.1/node_modules/@dnd-kit/modifiers/dist/modifiers.esm.mjs";
4
+ import { SortableContext as x, verticalListSortingStrategy as f } from "../../../node_modules/.store/@dnd-kit_sortable@7.0.2/node_modules/@dnd-kit/sortable/dist/sortable.esm.mjs";
5
+ import { memo as p } from "react";
6
+ function l({
7
+ children: r,
8
+ enabledRowDragSort: o,
9
+ dataSource: e,
10
+ mergeRowKey: m,
11
+ onDragEnd: i
12
+ }) {
13
+ return o ? /* @__PURE__ */ t.jsx(a, { modifiers: [n], onDragEnd: i, children: /* @__PURE__ */ t.jsx(
14
+ x,
15
+ {
16
+ items: e.map((s) => s[m]),
17
+ strategy: f,
18
+ children: r
19
+ }
20
+ ) }) : /* @__PURE__ */ t.jsx(t.Fragment, { children: r });
21
+ }
22
+ const C = p(l);
23
+ export {
24
+ C as default
25
+ };
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ interface RowProps extends React.HTMLAttributes<HTMLTableRowElement> {
3
+ 'data-row-key': string;
4
+ loading: 'true' | 'false';
5
+ }
6
+ declare const SortableRow: ({ children, loading, ...props }: RowProps) => import("react/jsx-runtime").JSX.Element;
7
+ export default SortableRow;
@@ -0,0 +1,54 @@
1
+ import { j as i } from "../../../node_modules/.store/react@18.2.0/node_modules/react/jsx-runtime.mjs";
2
+ import { useSortable as R } from "../../../node_modules/.store/@dnd-kit_sortable@7.0.2/node_modules/@dnd-kit/sortable/dist/sortable.esm.mjs";
3
+ import { CSS as b } from "../../../node_modules/.store/@dnd-kit_utilities@3.2.2/node_modules/@dnd-kit/utilities/dist/utilities.esm.mjs";
4
+ import { theme as h } from "antd";
5
+ import a from "react";
6
+ import j from "../../../node_modules/.store/@ant-design_icons@5.3.6/node_modules/@ant-design/icons/es/icons/MenuOutlined.mjs";
7
+ const T = ({ children: m, loading: t, ...e }) => {
8
+ const { token: l } = h.useToken(), {
9
+ attributes: f,
10
+ listeners: u,
11
+ setNodeRef: c,
12
+ setActivatorNodeRef: d,
13
+ transform: o,
14
+ transition: p,
15
+ isDragging: x
16
+ } = R({ id: e["data-row-key"] }), S = {
17
+ ...e.style,
18
+ transform: b.Transform.toString(o && { ...o, scaleY: 1 }),
19
+ transition: p,
20
+ ...x ? { position: "relative", zIndex: 9999 } : {}
21
+ };
22
+ return /* @__PURE__ */ i.jsx(
23
+ "tr",
24
+ {
25
+ ...e,
26
+ style: S,
27
+ ...f,
28
+ ...t === "true" ? {} : {
29
+ ref: c
30
+ },
31
+ children: a.Children.map(m, (r) => {
32
+ var n, s;
33
+ return ((s = (n = r.props) == null ? void 0 : n.additionalProps) == null ? void 0 : s["data-column-name"]) === "dragSortCell" ? a.cloneElement(r, {
34
+ children: /* @__PURE__ */ i.jsx(
35
+ j,
36
+ {
37
+ ref: d,
38
+ style: {
39
+ touchAction: "none",
40
+ cursor: t === "true" ? "default" : "move",
41
+ fontSize: "calc(var(--fontSize) + 3px)",
42
+ color: t === "true" ? l.colorTextDisabled : "inherit"
43
+ },
44
+ ...u
45
+ }
46
+ )
47
+ }) : r;
48
+ })
49
+ }
50
+ );
51
+ };
52
+ export {
53
+ T as default
54
+ };
@@ -6,6 +6,7 @@ import type { RowClassName } from 'rc-table/es/interface';
6
6
  import { ColumnStateType, DensitySize, StylesStateType, ExportColumnStateType } from '../Store';
7
7
  import { ActionsFunType, BitzTableColumnsType } from '..';
8
8
  import { BitzTableBorderedType } from '@/components/BitzConfigProvider/context';
9
+ import { DragEndEvent } from '@dnd-kit/core';
9
10
  import './index.less';
10
11
  export interface BitzTableProps<RecordType = any> extends Omit<TableProps<RecordType>, 'size' | 'pagination' | 'bordered'> {
11
12
  /** 是否开启rowHover样式 */
@@ -55,6 +56,10 @@ export interface BitzTableProps<RecordType = any> extends Omit<TableProps<Record
55
56
  };
56
57
  /** PC端:给父组件传值 page当前第几页 pageSize每页有多少 */
57
58
  paginationEmit?: (page: number, pageSize: number) => void;
59
+ /** 是否启用拖拽 */
60
+ enabledRowDragSort?: boolean;
61
+ /** 拖拽结束 */
62
+ onRowDragEnd?: (event: DragEndEvent) => void;
58
63
  /** 移动端:加载更多返回函数 */
59
64
  /** 移动端:下拉刷新 */
60
65
  mobileRefreshEmit?: () => Promise<unknown> | void;