bitz-react-admin-ui 2.2.5 → 2.2.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.
Files changed (30) hide show
  1. package/dist/_virtual/index.mjs +2 -2
  2. package/dist/_virtual/index2.mjs +2 -2
  3. package/dist/_virtual/isoWeek.mjs +4 -0
  4. package/dist/components/BitzFuiCalendar/CalendarAgendum.mjs +25 -25
  5. package/dist/components/BitzFuiCalendar/CalendarAgendumItem.mjs +10 -9
  6. package/dist/components/BitzFuiCalendar/CalendarBody.mjs +16 -13
  7. package/dist/components/BitzFuiCalendar/CalendarHead.mjs +22 -18
  8. package/dist/components/BitzFuiCalendar/CalendarToolbar.mjs +8 -8
  9. package/dist/components/BitzFuiCalendar/ColumnData.mjs +43 -44
  10. package/dist/components/BitzTable/Store/index.d.ts +5 -1
  11. package/dist/components/BitzTable/Store/index.mjs +159 -137
  12. package/dist/components/BitzTable/SubTable/index.mjs +86 -87
  13. package/dist/components/BitzTable/Table/SortableRow.mjs +2 -2
  14. package/dist/components/BitzTable/Table/index.d.ts +4 -10
  15. package/dist/components/BitzTable/Table/index.mjs +281 -282
  16. package/dist/components/BitzTable/Table/utils.d.ts +2 -2
  17. package/dist/components/BitzTable/Table/utils.mjs +29 -23
  18. package/dist/components/BitzTable/ToolBar/ColConfigIcon/ColumnsSort/index.mjs +107 -107
  19. package/dist/components/BitzTable/ToolBar/Wrapper/index.mjs +5 -5
  20. package/dist/components/BitzTable/index.d.ts +9 -4
  21. package/dist/components/BitzTable/index.mjs +17 -15
  22. package/dist/components/BitzTable2/index.d.ts +2 -0
  23. package/dist/components/BitzTable2/index.mjs +4 -0
  24. package/dist/index.d.ts +1 -0
  25. package/dist/index.mjs +34 -32
  26. package/dist/node_modules/.store/classnames@2.5.1/node_modules/classnames/index.mjs +1 -1
  27. package/dist/node_modules/.store/dayjs@1.11.10/node_modules/dayjs/plugin/isoWeek.mjs +34 -0
  28. package/dist/node_modules/.store/prop-types@15.8.1/node_modules/prop-types/index.mjs +1 -1
  29. package/dist/style.css +1 -1
  30. package/package.json +1 -1
@@ -1,20 +1,19 @@
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";
1
+ import { j as y } from "../../../node_modules/.store/react@18.2.0/node_modules/react/jsx-runtime.mjs";
2
+ import { useContext as D, useRef as Z, useMemo as o, useCallback as I } from "react";
3
+ import { Table as ee } from "antd";
4
+ import te from "../../../node_modules/.store/classnames@2.5.1/node_modules/classnames/index.mjs";
5
+ import { BitzTableContext as re, toolCols as ne } from "../Store/index.mjs";
6
+ import oe from "../../../node_modules/.store/ahooks@3.7.11/node_modules/ahooks/es/useSize/index.mjs";
7
+ import se from "../ActionCol/style.mjs";
8
+ import ae from "../../BitzTheme/index.mjs";
9
+ import le from "../../../node_modules/.store/antd@5.16.2/node_modules/antd/es/table/ExpandIcon.mjs";
10
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({
11
+ import ce from "../../../node_modules/.store/antd@5.16.2/node_modules/antd/locale/en_US.mjs";
12
+ import { getColumnsWithTool as ie, loopBuildSkeleton as ue } from "../Table/utils.mjs";
13
+ import { ConfigContext as me } from "../../../node_modules/.store/antd@5.16.2/node_modules/antd/es/config-provider/context.mjs";
14
+ function Be({
16
15
  dataSource: u = [],
17
- columns: x,
16
+ columns: g,
18
17
  loading: l = !1,
19
18
  scroll: s,
20
19
  components: f,
@@ -22,128 +21,128 @@ function Bt({
22
21
  rowSelection: m,
23
22
  ...a
24
23
  }) {
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(
24
+ var T, p;
25
+ const { token: L } = ae.useToken(), { gap: j } = se(), { showColumnBorder: K, rowHoverable: M } = D(re), h = Z(null), C = oe((T = h.current) == null ? void 0 : T.nativeElement), q = o(() => {
26
+ let e = (s == null ? void 0 : s.x) ?? 1e3;
27
+ return s != null && s.x ? { x: e, y: s.y || 400 } : s != null && s.y ? { x: e, y: s.y } : { x: e, y: 400 };
28
+ }, [s]), P = () => {
29
+ var n, r;
30
+ const e = (r = (n = h.current) == null ? void 0 : n.nativeElement) == null ? void 0 : r.querySelectorAll(
32
31
  "& > .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) => {
32
+ ), t = [];
33
+ if (e == null || e.forEach((i) => {
35
34
  var b;
36
- e.push(
35
+ t.push(
37
36
  ((b = i.querySelector("& > .operationCol .actionGroup")) == null ? void 0 : b.clientWidth) || 0
38
37
  );
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(
38
+ }), t.length)
39
+ return Math.ceil(Math.max(...t)) + j * 2;
40
+ }, A = () => {
41
+ var b, W, E, v, N;
42
+ const e = (W = (b = h.current) == null ? void 0 : b.nativeElement) == null ? void 0 : W.querySelector(
44
43
  ".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(
44
+ ), t = e == null ? void 0 : e.clientWidth, r = ((e == null ? void 0 : e.offsetWidth) || 0) - t > 0, i = (N = (v = (E = h.current) == null ? void 0 : E.nativeElement) == null ? void 0 : v.querySelector(
46
45
  ".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 } = _();
46
+ )) == null ? void 0 : N.offsetWidth;
47
+ return { tbodyWidth: t, scrollbarSize: i, hasScrollBar: r };
48
+ }, { hasScrollBar: x, scrollbarSize: R } = o(() => {
49
+ const { hasScrollBar: e, scrollbarSize: t } = A();
51
50
  return {
52
- hasScrollBar: t,
53
- scrollbarSize: e
51
+ hasScrollBar: e,
52
+ scrollbarSize: t
54
53
  };
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
54
+ }, [C == null ? void 0 : C.height]), d = o(() => {
55
+ const e = g ?? [], n = e.filter((r) => !ne.includes(r)).map((r) => ({
56
+ ...r,
57
+ width: r.useMaxWidth ? P() ?? r.width : r.width
59
58
  }));
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) => ({
59
+ return ie(e, n, !1, !!m, !!c);
60
+ }, [g]), k = o(() => ue(d), [d]), G = o(() => l ? k : d, [l, d, k]), S = o(() => {
61
+ const e = u == null ? void 0 : u.length, t = e > 4 ? e >= 8 ? 8 : e : 4;
62
+ return Array.from({ length: t }).map((r, i) => ({
64
63
  key: `${Date.now()}${i}`
65
64
  }));
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(() => {
65
+ }, [u]), $ = o(() => l ? S : u, [l, u, S]), { table: w, locale: F = ce } = D(me), H = { ...F.Table }, _ = ((p = w == null ? void 0 : w.expandable) == null ? void 0 : p.expandIcon) || (c == null ? void 0 : c.expandIcon) || le(H), z = o(() => {
67
66
  if (c)
68
67
  return {
69
68
  ...c,
70
- expandedRowRender: () => /* @__PURE__ */ C.jsx(C.Fragment, {}),
71
- expandIcon: (t) => {
72
- const e = H(t);
69
+ expandedRowRender: () => /* @__PURE__ */ y.jsx(y.Fragment, {}),
70
+ expandIcon: (e) => {
71
+ const t = _(e);
73
72
  return {
74
- ...e,
73
+ ...t,
75
74
  props: {
76
- ...e.props,
75
+ ...t.props,
77
76
  disabled: !0,
78
77
  style: {
79
- ...e.props.style,
80
- backgroundColor: j.colorBgContainerDisabled
78
+ ...t.props.style,
79
+ backgroundColor: L.colorBgContainerDisabled
81
80
  }
82
81
  }
83
82
  };
84
83
  }
85
84
  };
86
- }, [c]), X = o(() => l ? B : c, [l, c, B]), E = o(() => {
85
+ }, [c]), J = o(() => l ? z : c, [l, c, z]), B = o(() => {
87
86
  if (m)
88
87
  return {
89
88
  ...m,
90
89
  selectedRowKeys: [],
91
90
  getCheckboxProps: () => ({ disabled: !0 })
92
91
  };
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;
92
+ }, [m]), O = o(() => l ? B : m, [l, m, B]), Q = o(() => l ? void 0 : a.rowKey, [l, a.rowKey]), U = I(
93
+ (e, t) => {
94
+ var r;
96
95
  if (!a.onRow)
97
96
  return {};
98
- const r = (n = a.onRow) == null ? void 0 : n.call(a, t, e);
99
- return r.onClick && (r.className = "rowPointerCursor"), r;
97
+ const n = (r = a.onRow) == null ? void 0 : r.call(a, e, t);
98
+ return n.onClick && (n.className = "rowPointerCursor"), n;
100
99
  },
101
100
  [a.onRow]
102
- ), Y = I(
103
- (t, e, r) => {
104
- const n = e % 2 === 0 ? "oddRow" : "evenRow";
101
+ ), V = I(
102
+ (e, t, n) => {
103
+ const r = t % 2 === 0 ? "oddRow" : "evenRow";
105
104
  if (a.rowClassName) {
106
- const i = a.rowClassName(t, e, r);
107
- return nt(n, i);
105
+ const i = a.rowClassName(e, t, n);
106
+ return te(r, i);
108
107
  }
109
- return n;
108
+ return r;
110
109
  },
111
110
  [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(() => ({
111
+ ), X = (e) => {
112
+ var n;
113
+ const t = { ...e };
114
+ return t.className.includes("ant-table-cell-fix-right") && !x && ((n = t.style) != null && n.right) && (t.style = {
115
+ ...t.style,
116
+ right: t.style.right - (R || 0)
117
+ }), /* @__PURE__ */ y.jsx("th", { ...t });
118
+ }, Y = o(() => ({
120
119
  ...f,
121
120
  header: {
122
121
  ...f == null ? void 0 : f.header,
123
- cell: Z
122
+ cell: X
124
123
  }
125
- }), [f, R, S]);
126
- return /* @__PURE__ */ C.jsx(
127
- g,
124
+ }), [f, x, R]);
125
+ return /* @__PURE__ */ y.jsx(
126
+ ee,
128
127
  {
129
128
  ...a,
130
- bordered: q,
129
+ bordered: K,
131
130
  columns: G,
132
- dataSource: U,
131
+ dataSource: $,
133
132
  loading: !1,
134
133
  pagination: !1,
135
- scroll: A,
136
- expandable: X,
137
- rowSelection: J,
138
- onRow: V,
139
- rowClassName: Y,
140
- components: tt,
134
+ scroll: q,
135
+ expandable: J,
136
+ rowSelection: O,
137
+ onRow: U,
138
+ rowClassName: V,
139
+ components: Y,
141
140
  rowKey: Q,
142
- rowHoverable: P,
141
+ rowHoverable: M,
143
142
  ref: h
144
143
  }
145
144
  );
146
145
  }
147
146
  export {
148
- Bt as default
147
+ Be as default
149
148
  };
@@ -30,7 +30,7 @@ const T = ({ children: m, loading: t, ...e }) => {
30
30
  },
31
31
  children: a.Children.map(m, (r) => {
32
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, {
33
+ return ((s = (n = r.props) == null ? void 0 : n.additionalProps) == null ? void 0 : s["data-column-name"]) === "dragSorterCell" ? a.cloneElement(r, {
34
34
  children: /* @__PURE__ */ i.jsx(
35
35
  j,
36
36
  {
@@ -38,7 +38,7 @@ const T = ({ children: m, loading: t, ...e }) => {
38
38
  style: {
39
39
  touchAction: "none",
40
40
  cursor: t === "true" ? "default" : "move",
41
- fontSize: "calc(var(--fontSize) + 3px)",
41
+ fontSize: "calc(var(--fontSize) + 2px)",
42
42
  color: t === "true" ? l.colorTextDisabled : "inherit"
43
43
  },
44
44
  ...u
@@ -4,15 +4,11 @@ import { SkeletonParagraphProps } from 'antd/es/skeleton/Paragraph';
4
4
  import { AnyObject } from 'antd/es/_util/type';
5
5
  import type { RowClassName } from 'rc-table/es/interface';
6
6
  import { ColumnStateType, DensitySize, StylesStateType, ExportColumnStateType } from '../Store';
7
- import { ActionsFunType, BitzTableColumnsType } from '..';
7
+ import { ActionsFunType, BitzTableColumnsType, SelelctionAlertProps } from '..';
8
8
  import { BitzTableBorderedType } from '@/components/BitzConfigProvider/context';
9
- import { TableRowSelection } from 'antd/es/table/interface';
10
9
  import { DragEndEvent } from '@dnd-kit/core';
11
10
  import './index.less';
12
- export interface BitzTableRowSelectionProps<RecordType> extends TableRowSelection<RecordType> {
13
- onClear?: () => void;
14
- }
15
- export interface BitzTableProps<RecordType = any> extends Omit<TableProps<RecordType>, 'size' | 'pagination' | 'bordered' | 'rowSelection'> {
11
+ export interface BitzTableProps<RecordType = any> extends Omit<TableProps<RecordType>, 'size' | 'pagination' | 'bordered'> {
16
12
  /** 是否开启rowHover样式 */
17
13
  rowHoverable?: boolean;
18
14
  /** 是否开启斑马纹样式 */
@@ -21,8 +17,6 @@ export interface BitzTableProps<RecordType = any> extends Omit<TableProps<Record
21
17
  bordered?: BitzTableBorderedType;
22
18
  /** PC端:是否显示分页 */
23
19
  showPagination?: boolean;
24
- /** PC端:是否显示分页选中条数据 */
25
- showSelected?: boolean;
26
20
  /** PC端:BitzTable组件的整体高度,由外部通过视口高度减去其他元素高度和间隙的结果 */
27
21
  height?: number;
28
22
  /** table可滚动区域的最大宽高的值 */
@@ -40,8 +34,6 @@ export interface BitzTableProps<RecordType = any> extends Omit<TableProps<Record
40
34
  operationFilter?: ActionsFunType<RecordType>;
41
35
  /** PC&移动端:请求加载状态 */
42
36
  loading?: boolean;
43
- /** 多选/单选 */
44
- rowSelection?: BitzTableRowSelectionProps<RecordType>;
45
37
  /** 骨架屏列表个数 */
46
38
  skeletonNum?: {
47
39
  pc?: number;
@@ -57,6 +49,8 @@ export interface BitzTableProps<RecordType = any> extends Omit<TableProps<Record
57
49
  size?: DensitySize;
58
50
  /** 是否启用分页组件的受控属性 */
59
51
  enableControlPage?: boolean;
52
+ /** 多选/单选操作 */
53
+ selelctionAlert?: SelelctionAlertProps;
60
54
  /** 分页控件的分页属性 */
61
55
  pagination?: {
62
56
  page: number;