bitz-react-admin-ui 2.1.8 → 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,7 +1,4 @@
1
- import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.mjs";
2
- import { __require as o } from "../node_modules/.store/dayjs@1.11.10/node_modules/dayjs/dayjs.min.mjs";
3
- var t = o();
4
- const s = /* @__PURE__ */ r(t);
1
+ var a = { exports: {} };
5
2
  export {
6
- s as default
3
+ a as __module
7
4
  };
@@ -1,7 +1,7 @@
1
1
  import { j as n } from "../../node_modules/.store/react@18.2.0/node_modules/react/jsx-runtime.mjs";
2
2
  import { useRef as O, useEffect as R } from "react";
3
3
  import { Calendar as k, Select as a, Row as w, Col as y } from "antd";
4
- import N from "../../_virtual/dayjs.min.mjs";
4
+ import N from "../../node_modules/.store/dayjs@1.11.10/node_modules/dayjs/dayjs.min.mjs";
5
5
  import B from "../../node_modules/.store/dayjs@1.11.10/node_modules/dayjs/plugin/weekOfYear.mjs";
6
6
  import "../../node_modules/.store/dayjs@1.11.10/node_modules/dayjs/locale/zh-cn.mjs";
7
7
  N.extend(B);
@@ -1,4 +1,4 @@
1
- import t from "../../_virtual/dayjs.min.mjs";
1
+ import t from "../../node_modules/.store/dayjs@1.11.10/node_modules/dayjs/dayjs.min.mjs";
2
2
  import "../../node_modules/.store/dayjs@1.11.10/node_modules/dayjs/locale/zh-cn.mjs";
3
3
  const m = {
4
4
  dayjs() {
@@ -1,5 +1,5 @@
1
1
  import { create as a } from "../../node_modules/.store/zustand@4.5.2/node_modules/zustand/esm/index.mjs";
2
- import o from "../../_virtual/dayjs.min.mjs";
2
+ import o from "../../node_modules/.store/dayjs@1.11.10/node_modules/dayjs/dayjs.min.mjs";
3
3
  var d = /* @__PURE__ */ ((e) => (e.day = "day", e.workWeek = "workWeek", e.week = "week", e.agendum = "agendum", e))(d || {});
4
4
  const i = a((e, k) => ({
5
5
  colHeight: 0,
@@ -1,7 +1,7 @@
1
1
  import { j as d } from "../../node_modules/.store/react@18.2.0/node_modules/react/jsx-runtime.mjs";
2
2
  import { useState as y, useEffect as j, useMemo as D } from "react";
3
3
  import M from "../../node_modules/.store/dayjs@1.11.10/node_modules/dayjs/plugin/isToday.mjs";
4
- import n from "../../_virtual/dayjs.min.mjs";
4
+ import n from "../../node_modules/.store/dayjs@1.11.10/node_modules/dayjs/dayjs.min.mjs";
5
5
  import { useBitzFuiCalendarStore as S, CalendarTypeEnum as C } from "./BitzFuiCalendarStore.mjs";
6
6
  import N from "./CalendarAgendumItem.mjs";
7
7
  import x from "./CalendarAgendum.module.less.mjs";
@@ -1,7 +1,7 @@
1
1
  import { j as i } from "../../node_modules/.store/react@18.2.0/node_modules/react/jsx-runtime.mjs";
2
2
  import { useMemo as a } from "react";
3
3
  import e from "./CalendarAgendum.module.less.mjs";
4
- import l from "../../_virtual/dayjs.min.mjs";
4
+ import l from "../../node_modules/.store/dayjs@1.11.10/node_modules/dayjs/dayjs.min.mjs";
5
5
  import { Button as c } from "antd";
6
6
  const d = (_, s) => {
7
7
  let t = s.diff(_, "minute"), m;
@@ -1,6 +1,6 @@
1
1
  import { j as a } from "../../node_modules/.store/react@18.2.0/node_modules/react/jsx-runtime.mjs";
2
2
  import { memo as m, useMemo as r } from "react";
3
- import d from "../../_virtual/dayjs.min.mjs";
3
+ import d from "../../node_modules/.store/dayjs@1.11.10/node_modules/dayjs/dayjs.min.mjs";
4
4
  import i from "../../node_modules/.store/classnames@2.5.1/node_modules/classnames/index.mjs";
5
5
  const n = (t) => {
6
6
  const { time: e } = t, s = r(() => e.isSame(d(), "day"), [e]);
@@ -2,7 +2,7 @@ import { j as e } from "../../node_modules/.store/react@18.2.0/node_modules/reac
2
2
  import { memo as C, useMemo as i } from "react";
3
3
  import { Space as c, Button as o, DatePicker as b, Dropdown as h } from "antd";
4
4
  import { useBitzFuiCalendarStore as w, CalendarTypeEnum as a } from "./BitzFuiCalendarStore.mjs";
5
- import g from "../../_virtual/dayjs.min.mjs";
5
+ import g from "../../node_modules/.store/dayjs@1.11.10/node_modules/dayjs/dayjs.min.mjs";
6
6
  import T from "../../node_modules/.store/@ant-design_icons@5.3.6/node_modules/@ant-design/icons/es/icons/AppstoreOutlined.mjs";
7
7
  import v from "../../node_modules/.store/@ant-design_icons@5.3.6/node_modules/@ant-design/icons/es/icons/LeftOutlined.mjs";
8
8
  import _ from "../../node_modules/.store/@ant-design_icons@5.3.6/node_modules/@ant-design/icons/es/icons/RightOutlined.mjs";
@@ -4,7 +4,7 @@ import E from "./FuiCalendarItem.mjs";
4
4
  import b from "../../node_modules/.store/dayjs@1.11.10/node_modules/dayjs/plugin/isSameOrAfter.mjs";
5
5
  import F from "../../node_modules/.store/dayjs@1.11.10/node_modules/dayjs/plugin/isSameOrBefore.mjs";
6
6
  import M from "../../node_modules/.store/dayjs@1.11.10/node_modules/dayjs/plugin/utc.mjs";
7
- import r from "../../_virtual/dayjs.min.mjs";
7
+ import r from "../../node_modules/.store/dayjs@1.11.10/node_modules/dayjs/dayjs.min.mjs";
8
8
  import { useBitzFuiCalendarStore as z } from "./BitzFuiCalendarStore.mjs";
9
9
  r.extend(M);
10
10
  r.extend(F);
@@ -3,7 +3,7 @@ import { useState as w, useMemo as x, useEffect as E } from "react";
3
3
  import A from "../../node_modules/.store/dayjs@1.11.10/node_modules/dayjs/plugin/objectSupport.mjs";
4
4
  import H from "../../node_modules/.store/dayjs@1.11.10/node_modules/dayjs/plugin/isSameOrAfter.mjs";
5
5
  import D from "../../node_modules/.store/dayjs@1.11.10/node_modules/dayjs/plugin/utc.mjs";
6
- import e from "../../_virtual/dayjs.min.mjs";
6
+ import e from "../../node_modules/.store/dayjs@1.11.10/node_modules/dayjs/dayjs.min.mjs";
7
7
  import "./index.less.mjs";
8
8
  e.extend(A);
9
9
  e.extend(H);
@@ -2,7 +2,7 @@ import { j as e } from "../../node_modules/.store/react@18.2.0/node_modules/reac
2
2
  import { useMemo as d } from "react";
3
3
  import p from "../../node_modules/.store/dayjs@1.11.10/node_modules/dayjs/plugin/objectSupport.mjs";
4
4
  import T from "./BitzMeetingTimeItem.mjs";
5
- import m from "../../_virtual/dayjs.min.mjs";
5
+ import m from "../../node_modules/.store/dayjs@1.11.10/node_modules/dayjs/dayjs.min.mjs";
6
6
  import "./index.less.mjs";
7
7
  m.extend(p);
8
8
  const x = (a) => {
@@ -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,165 @@
1
+ import { j as S } from "../../../node_modules/.store/react@18.2.0/node_modules/react/jsx-runtime.mjs";
2
+ import { useContext as q, useRef as it, useMemo as r, useCallback as $ } from "react";
3
+ import { Table as z } from "antd";
4
+ import lt from "../../../node_modules/.store/classnames@2.5.1/node_modules/classnames/index.mjs";
5
+ import { BitzTableContext as ct } from "../Store/index.mjs";
6
+ import ut from "../../../node_modules/.store/ahooks@3.7.11/node_modules/ahooks/es/useSize/index.mjs";
7
+ import mt from "../ActionCol/style.mjs";
8
+ import ht from "../../BitzTheme/index.mjs";
9
+ import dt 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 ft from "../../../node_modules/.store/antd@5.16.2/node_modules/antd/locale/en_US.mjs";
12
+ import { getColumnsWithTool as bt, loopBuildSkeleton as yt } from "../Table/utils.mjs";
13
+ import { ConfigContext as Ct } from "../../../node_modules/.store/antd@5.16.2/node_modules/antd/es/config-provider/context.mjs";
14
+ const O = [z.SELECTION_COLUMN, z.EXPAND_COLUMN];
15
+ function Nt({
16
+ dataSource: f = [],
17
+ columns: E,
18
+ loading: i = !1,
19
+ scroll: s,
20
+ components: y,
21
+ expandable: l,
22
+ rowSelection: h,
23
+ ...a
24
+ }) {
25
+ var A, D;
26
+ const { token: _ } = ht.useToken(), { gap: G } = mt(), { showColumnBorder: U, rowHoverable: V } = q(ct), d = it(null), R = ut((A = d.current) == null ? void 0 : A.nativeElement), C = r(() => {
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]), X = () => {
30
+ var n, o;
31
+ const t = (o = (n = d.current) == null ? void 0 : n.nativeElement) == null ? void 0 : o.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((c) => {
35
+ var u;
36
+ e.push(
37
+ ((u = c.querySelector("& > .operationCol .actionGroup")) == null ? void 0 : u.clientWidth) || 0
38
+ );
39
+ }), e.length)
40
+ return Math.ceil(Math.max(...e)) + G * 2;
41
+ }, I = () => {
42
+ var u, b, g, x, p;
43
+ const t = (b = (u = d.current) == null ? void 0 : u.nativeElement) == null ? void 0 : b.querySelector(
44
+ ".ant-table-body"
45
+ ), e = t == null ? void 0 : t.clientWidth, o = ((t == null ? void 0 : t.offsetWidth) || 0) - e > 0, c = (p = (x = (g = d.current) == null ? void 0 : g.nativeElement) == null ? void 0 : x.querySelector(
46
+ ".ant-table-cell-scrollbar"
47
+ )) == null ? void 0 : p.offsetWidth;
48
+ return { tbodyWidth: e, scrollbarSize: c, hasScrollBar: o };
49
+ }, F = (t) => {
50
+ var j, K;
51
+ const e = t.length, n = t.filter((m) => m.width), c = n.map((m) => m.width).reduce((m, k) => m + k, 0);
52
+ let u = 0;
53
+ if ((j = d.current) != null && j.nativeElement) {
54
+ const m = window.getComputedStyle((K = d.current) == null ? void 0 : K.nativeElement), k = parseInt(
55
+ m.getPropertyValue("--toolCell-paddingInline")
56
+ );
57
+ u = parseInt(m.getPropertyValue("--fontSize")) + 4 + 2 * k;
58
+ }
59
+ let b = 0;
60
+ h && (b += u), l && (b += u);
61
+ const { tbodyWidth: g } = I(), x = parseInt(`${C == null ? void 0 : C.x}`) || 0, p = Math.max(x, g), P = (parseInt(`${p}`) || 0) - c - b;
62
+ return P >= 0 ? P / (e - n.length) : void 0;
63
+ }, { hasScrollBar: B, scrollbarSize: T } = r(() => {
64
+ const { hasScrollBar: t, scrollbarSize: e } = I();
65
+ return {
66
+ hasScrollBar: t,
67
+ scrollbarSize: e
68
+ };
69
+ }, [R == null ? void 0 : R.height]), w = r(() => {
70
+ const t = E ?? [], e = t.filter((o) => !O.includes(o));
71
+ F(e);
72
+ const n = e.map((o) => ({
73
+ ...o,
74
+ width: o.useMaxWidth ? X() ?? o.width : o.width
75
+ }));
76
+ return bt(t, n, h, l);
77
+ }, [E]), v = r(() => yt(w, O), [w]), H = r(() => i ? v : w, [i, w, v]), N = r(() => {
78
+ const t = f == null ? void 0 : f.length, e = t > 10 ? t >= 20 ? 20 : t : 10;
79
+ return Array.from({ length: e }).map((o, c) => ({
80
+ key: `${Date.now()}${c}`
81
+ }));
82
+ }, [f]), J = r(() => i ? N : f, [i, f, N]), { table: W, locale: Q = ft } = q(Ct), Y = { ...Q.Table }, Z = ((D = W == null ? void 0 : W.expandable) == null ? void 0 : D.expandIcon) || (l == null ? void 0 : l.expandIcon) || dt(Y), L = r(() => {
83
+ if (l)
84
+ return {
85
+ ...l,
86
+ expandedRowRender: () => /* @__PURE__ */ S.jsx(S.Fragment, {}),
87
+ expandIcon: (t) => {
88
+ const e = Z(t);
89
+ return {
90
+ ...e,
91
+ props: {
92
+ ...e.props,
93
+ disabled: !0,
94
+ style: {
95
+ ...e.props.style,
96
+ backgroundColor: _.colorBgContainerDisabled
97
+ }
98
+ }
99
+ };
100
+ }
101
+ };
102
+ }, [l]), tt = r(() => i ? L : l, [i, l, L]), M = r(() => {
103
+ if (h)
104
+ return {
105
+ ...h,
106
+ selectedRowKeys: [],
107
+ getCheckboxProps: () => ({ disabled: !0 })
108
+ };
109
+ }, [h]), et = r(() => i ? M : h, [i, h, M]), nt = r(() => i ? void 0 : a.rowKey, [i, a.rowKey]), ot = $(
110
+ (t, e) => {
111
+ var o;
112
+ if (!a.onRow)
113
+ return {};
114
+ const n = (o = a.onRow) == null ? void 0 : o.call(a, t, e);
115
+ return n.onClick && (n.className = "rowPointerCursor"), n;
116
+ },
117
+ [a.onRow]
118
+ ), rt = $(
119
+ (t, e, n) => {
120
+ const o = e % 2 === 0 ? "oddRow" : "evenRow";
121
+ if (a.rowClassName) {
122
+ const c = a.rowClassName(t, e, n);
123
+ return lt(o, c);
124
+ }
125
+ return o;
126
+ },
127
+ [a.rowClassName]
128
+ ), st = (t) => {
129
+ var n;
130
+ const e = { ...t };
131
+ return e.className.includes("ant-table-cell-fix-right") && !B && ((n = e.style) != null && n.right) && (e.style = {
132
+ ...e.style,
133
+ right: e.style.right - (T || 0)
134
+ }), /* @__PURE__ */ S.jsx("th", { ...e });
135
+ }, at = r(() => ({
136
+ ...y,
137
+ header: {
138
+ ...y == null ? void 0 : y.header,
139
+ cell: st
140
+ }
141
+ }), [y, B, T]);
142
+ return /* @__PURE__ */ S.jsx(
143
+ z,
144
+ {
145
+ ...a,
146
+ bordered: U,
147
+ columns: H,
148
+ dataSource: J,
149
+ loading: !1,
150
+ pagination: !1,
151
+ scroll: C,
152
+ expandable: tt,
153
+ rowSelection: et,
154
+ onRow: ot,
155
+ rowClassName: rt,
156
+ components: at,
157
+ rowKey: nt,
158
+ rowHoverable: V,
159
+ ref: d
160
+ }
161
+ );
162
+ }
163
+ export {
164
+ Nt as default
165
+ };