bitz-react-admin-ui 1.9.5 → 1.9.6
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.
- package/dist/_virtual/dayjs.min.mjs +5 -2
- package/dist/_virtual/dayjs.min2.mjs +4 -0
- package/dist/_virtual/index.mjs +2 -2
- package/dist/_virtual/index2.mjs +2 -2
- package/dist/components/BitzCalendar/index.mjs +1 -1
- package/dist/components/BitzConfigProvider/context.d.ts +5 -2
- package/dist/components/BitzDayJs/index.mjs +1 -1
- package/dist/components/BitzFuiCalendar/BitzFuiCalendarStore.mjs +1 -1
- package/dist/components/BitzFuiCalendar/CalendarAgendum.mjs +1 -1
- package/dist/components/BitzFuiCalendar/CalendarAgendumItem.mjs +1 -1
- package/dist/components/BitzFuiCalendar/CalendarHeadItem.mjs +1 -1
- package/dist/components/BitzFuiCalendar/CalendarToolbar.mjs +1 -1
- package/dist/components/BitzFuiCalendar/ColumnData.mjs +1 -1
- package/dist/components/BitzMeetingTime/BitzMeetingTimeItem.mjs +1 -1
- package/dist/components/BitzMeetingTime/index.mjs +1 -1
- package/dist/components/BitzTable/Store/index.d.ts +2 -0
- package/dist/components/BitzTable/Store/index.mjs +101 -99
- package/dist/components/BitzTable/Store/utils/index.d.ts +2 -0
- package/dist/components/BitzTable/Store/utils/index.mjs +15 -8
- package/dist/components/BitzTable/Table/index.d.ts +1 -1
- package/dist/components/BitzTable/Table/index.mjs +241 -255
- package/dist/components/BitzTable/Table/utils.d.ts +3 -0
- package/dist/components/BitzTable/Table/utils.mjs +18 -0
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/ColumnSettingModal.mjs +16 -15
- package/dist/components/BitzTable/ToolBar/DensityIcon/index.mjs +37 -30
- package/dist/components/BitzTable/ToolBar/FullscreenIcon/index.mjs +33 -43
- package/dist/components/BitzTable/ToolBar/index.d.ts +1 -1
- package/dist/node_modules/.store/classnames@2.5.1/node_modules/classnames/index.mjs +1 -1
- package/dist/node_modules/.store/dayjs@1.11.10/node_modules/dayjs/dayjs.min.mjs +292 -292
- package/dist/node_modules/.store/dayjs@1.11.10/node_modules/dayjs/locale/zh-cn.mjs +13 -13
- package/dist/node_modules/.store/prop-types@15.8.1/node_modules/prop-types/index.mjs +1 -1
- package/dist/style.css +1 -1
- package/dist/utils/findNode.d.ts +8 -0
- package/dist/utils/findNode.mjs +14 -0
- package/dist/utils/time.mjs +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
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);
|
|
2
5
|
export {
|
|
3
|
-
|
|
6
|
+
s as default
|
|
4
7
|
};
|
package/dist/_virtual/index.mjs
CHANGED
package/dist/_virtual/index2.mjs
CHANGED
|
@@ -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 "../../
|
|
4
|
+
import N from "../../_virtual/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,15 +1,18 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { DensitySize } from '../BitzTable/Store';
|
|
2
3
|
export type ToolEnum = 'export' | 'refresh' | 'size' | 'fullscreen' | 'colConfig';
|
|
3
4
|
/** 控制table的全局行为 */
|
|
4
5
|
export interface TableComponentContextProps {
|
|
5
|
-
/** 根据从左到右方向排序,不在数组中则不显示 */
|
|
6
|
-
toolbar?: ToolEnum[];
|
|
7
6
|
/** 是否显示外边框和列边框 */
|
|
8
7
|
bordered?: boolean;
|
|
8
|
+
/** 默认size */
|
|
9
|
+
defaultSize?: DensitySize;
|
|
9
10
|
/** 是否开启斑马纹,填充偶数行背景色 */
|
|
10
11
|
fillEvenRow?: boolean;
|
|
11
12
|
/** 是否开启rowHover样式 */
|
|
12
13
|
rowHoverable?: boolean;
|
|
14
|
+
/** 根据从左到右方向排序,不在数组中则不显示 */
|
|
15
|
+
toolbar?: ToolEnum[];
|
|
13
16
|
}
|
|
14
17
|
export interface BitzConfigProviderContextProps {
|
|
15
18
|
Table?: TableComponentContextProps;
|
|
@@ -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 "../../
|
|
2
|
+
import o from "../../_virtual/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 "../../
|
|
4
|
+
import n from "../../_virtual/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 "../../
|
|
4
|
+
import l from "../../_virtual/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 "../../
|
|
3
|
+
import d from "../../_virtual/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 "../../
|
|
5
|
+
import g from "../../_virtual/dayjs.min.mjs";
|
|
6
6
|
import T from "../../node_modules/.store/@ant-design_icons@5.3.5/node_modules/@ant-design/icons/es/icons/AppstoreOutlined.mjs";
|
|
7
7
|
import v from "../../node_modules/.store/@ant-design_icons@5.3.5/node_modules/@ant-design/icons/es/icons/LeftOutlined.mjs";
|
|
8
8
|
import _ from "../../node_modules/.store/@ant-design_icons@5.3.5/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 "../../
|
|
7
|
+
import r from "../../_virtual/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 "../../
|
|
6
|
+
import e from "../../_virtual/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 "../../
|
|
5
|
+
import m from "../../_virtual/dayjs.min.mjs";
|
|
6
6
|
import "./index.less.mjs";
|
|
7
7
|
m.extend(p);
|
|
8
8
|
const x = (a) => {
|
|
@@ -50,6 +50,7 @@ declare function useContainer(props: UseContainerProps): {
|
|
|
50
50
|
columnsMap: Record<string, ColumnsConfigProps>;
|
|
51
51
|
setColumnsMap: (updater: Record<string, ColumnsConfigProps> | ((origin: Record<string, ColumnsConfigProps>) => Record<string, ColumnsConfigProps>), ignoreDestroy?: boolean | undefined) => void;
|
|
52
52
|
setTableSize: (updater: DensitySize | ((origin: DensitySize) => DensitySize), ignoreDestroy?: boolean | undefined) => void;
|
|
53
|
+
defaultTableSize: "xl" | "lg" | "md" | "sm" | "xs";
|
|
53
54
|
tableSize: DensitySize;
|
|
54
55
|
sizeStorageType: "online" | "localStorage" | "sessionStorage" | undefined;
|
|
55
56
|
sizeStorageKey: any;
|
|
@@ -68,6 +69,7 @@ declare const TableContext: import("react").Context<{
|
|
|
68
69
|
columnsMap: Record<string, ColumnsConfigProps>;
|
|
69
70
|
setColumnsMap: (updater: Record<string, ColumnsConfigProps> | ((origin: Record<string, ColumnsConfigProps>) => Record<string, ColumnsConfigProps>), ignoreDestroy?: boolean | undefined) => void;
|
|
70
71
|
setTableSize: (updater: DensitySize | ((origin: DensitySize) => DensitySize), ignoreDestroy?: boolean | undefined) => void;
|
|
72
|
+
defaultTableSize: "xl" | "lg" | "md" | "sm" | "xs";
|
|
71
73
|
tableSize: DensitySize;
|
|
72
74
|
sizeStorageType: "online" | "localStorage" | "sessionStorage" | undefined;
|
|
73
75
|
sizeStorageKey: any;
|
|
@@ -1,209 +1,211 @@
|
|
|
1
1
|
import { j as A } from "../../../node_modules/.store/react@18.2.0/node_modules/react/jsx-runtime.mjs";
|
|
2
|
-
import
|
|
3
|
-
import { createContext as
|
|
4
|
-
import { genColumnKey as
|
|
5
|
-
import { getUuid as
|
|
2
|
+
import G from "../../../hooks/useMergedState.mjs";
|
|
3
|
+
import { createContext as F, useRef as U, useContext as H, useEffect as m, useMemo as L, useCallback as Q } from "react";
|
|
4
|
+
import { genColumnKey as W } from "./utils/index.mjs";
|
|
5
|
+
import { getUuid as X } from "../../../utils/uuid.mjs";
|
|
6
|
+
import { BitzConfigContext as Y } from "../../BitzConfigProvider/context.mjs";
|
|
6
7
|
import d from "../../../node_modules/.store/lodash-es@4.17.21/node_modules/lodash-es/merge.mjs";
|
|
7
|
-
function
|
|
8
|
-
var T, V, v, O, J, M, N,
|
|
9
|
-
const
|
|
8
|
+
function Z(e) {
|
|
9
|
+
var T, V, v, O, b, x, J, M, N, j, I, P, E, k, R, B, D;
|
|
10
|
+
const r = U(X()), w = U([]), q = (T = H(Y).Table) == null ? void 0 : T.defaultSize, z = e.defaultSize ?? q ?? "lg", [h, g] = G(
|
|
10
11
|
() => {
|
|
11
|
-
var n,
|
|
12
|
-
const { persistenceType: t, persistenceKey:
|
|
13
|
-
if (
|
|
12
|
+
var n, c, a, l;
|
|
13
|
+
const { persistenceType: t, persistenceKey: i, onlineGet: u } = e.sizeState || {};
|
|
14
|
+
if (i && t && typeof window < "u" && t !== "online") {
|
|
14
15
|
const o = window[t];
|
|
15
16
|
try {
|
|
16
|
-
const s = o == null ? void 0 : o.getItem(
|
|
17
|
+
const s = o == null ? void 0 : o.getItem(i);
|
|
17
18
|
if (s)
|
|
18
19
|
return (n = e == null ? void 0 : e.sizeState) != null && n.defaultValue ? d(
|
|
19
20
|
JSON.parse(s),
|
|
20
|
-
(
|
|
21
|
+
(c = e == null ? void 0 : e.sizeState) == null ? void 0 : c.defaultValue
|
|
21
22
|
) : JSON.parse(s);
|
|
22
23
|
} catch (s) {
|
|
23
24
|
console.warn(s);
|
|
24
25
|
}
|
|
25
26
|
}
|
|
26
|
-
return e.size || ((
|
|
27
|
+
return e.size || ((a = e.sizeState) == null ? void 0 : a.value) || ((l = e.sizeState) == null ? void 0 : l.defaultValue) || z;
|
|
27
28
|
},
|
|
28
29
|
{
|
|
29
|
-
value: ((
|
|
30
|
-
onChange: ((
|
|
30
|
+
value: ((V = e.sizeState) == null ? void 0 : V.value) || e.size,
|
|
31
|
+
onChange: ((v = e.sizeState) == null ? void 0 : v.onChange) || e.onSizeChange
|
|
31
32
|
}
|
|
32
33
|
);
|
|
33
|
-
|
|
34
|
+
m(() => {
|
|
34
35
|
var u, n;
|
|
35
36
|
if (!((u = e.sizeState) != null && u.persistenceKey) || !((n = e.sizeState) != null && n.persistenceType) || typeof window > "u")
|
|
36
37
|
return;
|
|
37
38
|
const {
|
|
38
39
|
persistenceType: t,
|
|
39
|
-
persistenceKey:
|
|
40
|
+
persistenceKey: i
|
|
40
41
|
// onlineChange
|
|
41
42
|
} = e.sizeState;
|
|
42
43
|
if (t !== "online") {
|
|
43
|
-
const
|
|
44
|
+
const c = window[t];
|
|
44
45
|
try {
|
|
45
|
-
|
|
46
|
-
} catch (
|
|
47
|
-
console.warn(
|
|
46
|
+
c == null || c.setItem(i, JSON.stringify(y));
|
|
47
|
+
} catch (a) {
|
|
48
|
+
console.warn(a), K();
|
|
48
49
|
}
|
|
49
50
|
}
|
|
50
51
|
}, [
|
|
51
|
-
(
|
|
52
|
-
|
|
53
|
-
(
|
|
54
|
-
]),
|
|
55
|
-
var t,
|
|
56
|
-
if ((t = e.sizeState) != null && t.persistenceKey && ((
|
|
57
|
-
const { onlineGet: n, persistenceKey:
|
|
52
|
+
(O = e.sizeState) == null ? void 0 : O.persistenceKey,
|
|
53
|
+
h,
|
|
54
|
+
(b = e.sizeState) == null ? void 0 : b.persistenceType
|
|
55
|
+
]), m(() => {
|
|
56
|
+
var t, i, u;
|
|
57
|
+
if ((t = e.sizeState) != null && t.persistenceKey && ((i = e.sizeState) == null ? void 0 : i.persistenceType) === "online") {
|
|
58
|
+
const { onlineGet: n, persistenceKey: c } = e.sizeState;
|
|
58
59
|
try {
|
|
59
|
-
(u = n == null ? void 0 : n(
|
|
60
|
+
(u = n == null ? void 0 : n(c)) == null || u.then((a) => {
|
|
60
61
|
var l;
|
|
61
|
-
|
|
62
|
+
g(a ?? ((l = e == null ? void 0 : e.sizeState) == null ? void 0 : l.value) ?? z);
|
|
62
63
|
});
|
|
63
|
-
} catch (
|
|
64
|
-
console.warn(
|
|
64
|
+
} catch (a) {
|
|
65
|
+
console.warn(a);
|
|
65
66
|
}
|
|
66
67
|
}
|
|
67
68
|
}, []);
|
|
68
|
-
const S =
|
|
69
|
-
var
|
|
70
|
-
if ((
|
|
69
|
+
const S = L(() => {
|
|
70
|
+
var i, u;
|
|
71
|
+
if ((i = e == null ? void 0 : e.columnsState) != null && i.defaultValue)
|
|
71
72
|
return e.columnsState.defaultValue;
|
|
72
73
|
const t = {};
|
|
73
|
-
return (u = e.columns) == null || u.forEach(({ key: n, dataIndex:
|
|
74
|
-
const s =
|
|
74
|
+
return (u = e.columns) == null || u.forEach(({ key: n, dataIndex: c, fixed: a, disable: l }, o) => {
|
|
75
|
+
const s = W(n ?? c, o);
|
|
75
76
|
s && (t[s] = {
|
|
76
77
|
show: !0,
|
|
77
|
-
fixed:
|
|
78
|
+
fixed: a,
|
|
78
79
|
disable: l
|
|
79
80
|
});
|
|
80
81
|
}), t;
|
|
81
|
-
}, [e.columns]), [y,
|
|
82
|
+
}, [e.columns]), [y, f] = G(
|
|
82
83
|
() => {
|
|
83
|
-
var n,
|
|
84
|
-
const { persistenceType: t, persistenceKey:
|
|
85
|
-
if (
|
|
84
|
+
var n, c, a, l;
|
|
85
|
+
const { persistenceType: t, persistenceKey: i, onlineGet: u } = e.columnsState || {};
|
|
86
|
+
if (i && t && typeof window < "u" && t !== "online") {
|
|
86
87
|
const o = window[t];
|
|
87
88
|
try {
|
|
88
|
-
const s = o == null ? void 0 : o.getItem(
|
|
89
|
+
const s = o == null ? void 0 : o.getItem(i);
|
|
89
90
|
if (s)
|
|
90
91
|
return (n = e == null ? void 0 : e.columnsState) != null && n.defaultValue ? d(
|
|
91
92
|
JSON.parse(s),
|
|
92
|
-
(
|
|
93
|
+
(c = e == null ? void 0 : e.columnsState) == null ? void 0 : c.defaultValue
|
|
93
94
|
) : JSON.parse(s);
|
|
94
95
|
} catch (s) {
|
|
95
96
|
console.warn(s);
|
|
96
97
|
}
|
|
97
98
|
}
|
|
98
|
-
return e.columnsStateMap || ((
|
|
99
|
+
return e.columnsStateMap || ((a = e.columnsState) == null ? void 0 : a.value) || ((l = e.columnsState) == null ? void 0 : l.defaultValue) || S;
|
|
99
100
|
},
|
|
100
101
|
{
|
|
101
|
-
value: ((
|
|
102
|
-
onChange: ((
|
|
102
|
+
value: ((x = e.columnsState) == null ? void 0 : x.value) || e.columnsStateMap,
|
|
103
|
+
onChange: ((J = e.columnsState) == null ? void 0 : J.onChange) || e.onColumnsStateChange
|
|
103
104
|
}
|
|
104
105
|
);
|
|
105
|
-
|
|
106
|
-
var n,
|
|
107
|
-
const { persistenceType: t, persistenceKey:
|
|
108
|
-
if (
|
|
109
|
-
const
|
|
106
|
+
m(() => {
|
|
107
|
+
var n, c;
|
|
108
|
+
const { persistenceType: t, persistenceKey: i, onlineGet: u } = e.columnsState || {};
|
|
109
|
+
if (i && t && typeof window < "u" && t !== "online") {
|
|
110
|
+
const a = window[t];
|
|
110
111
|
try {
|
|
111
|
-
const l =
|
|
112
|
-
l ? (n = e == null ? void 0 : e.columnsState) != null && n.defaultValue ?
|
|
112
|
+
const l = a == null ? void 0 : a.getItem(i);
|
|
113
|
+
l ? (n = e == null ? void 0 : e.columnsState) != null && n.defaultValue ? f(
|
|
113
114
|
d(
|
|
114
115
|
JSON.parse(l),
|
|
115
|
-
(
|
|
116
|
+
(c = e == null ? void 0 : e.columnsState) == null ? void 0 : c.defaultValue
|
|
116
117
|
)
|
|
117
|
-
) :
|
|
118
|
+
) : f(JSON.parse(l)) : f(S);
|
|
118
119
|
} catch (l) {
|
|
119
120
|
console.warn(l);
|
|
120
121
|
}
|
|
121
122
|
}
|
|
122
123
|
}, [
|
|
123
|
-
(
|
|
124
|
-
(
|
|
124
|
+
(M = e.columnsState) == null ? void 0 : M.persistenceKey,
|
|
125
|
+
(N = e.columnsState) == null ? void 0 : N.persistenceType,
|
|
125
126
|
S
|
|
126
127
|
]);
|
|
127
|
-
const
|
|
128
|
-
const { persistenceType: t, persistenceKey:
|
|
129
|
-
if (!
|
|
128
|
+
const K = Q(() => {
|
|
129
|
+
const { persistenceType: t, persistenceKey: i } = e.columnsState || {};
|
|
130
|
+
if (!i || !t || typeof window > "u")
|
|
130
131
|
return;
|
|
131
132
|
const u = window[t];
|
|
132
133
|
try {
|
|
133
|
-
u == null || u.removeItem(
|
|
134
|
+
u == null || u.removeItem(i);
|
|
134
135
|
} catch (n) {
|
|
135
136
|
console.warn(n);
|
|
136
137
|
}
|
|
137
138
|
}, [e.columnsState]);
|
|
138
|
-
|
|
139
|
+
m(() => {
|
|
139
140
|
var u, n;
|
|
140
141
|
if (!((u = e.columnsState) != null && u.persistenceKey) || !((n = e.columnsState) != null && n.persistenceType) || typeof window > "u")
|
|
141
142
|
return;
|
|
142
143
|
const {
|
|
143
144
|
persistenceType: t,
|
|
144
|
-
persistenceKey:
|
|
145
|
+
persistenceKey: i
|
|
145
146
|
// onlineChange
|
|
146
147
|
} = e.columnsState;
|
|
147
148
|
if (t !== "online") {
|
|
148
|
-
const
|
|
149
|
+
const c = window[t];
|
|
149
150
|
try {
|
|
150
|
-
|
|
151
|
-
} catch (
|
|
152
|
-
console.warn(
|
|
151
|
+
c == null || c.setItem(i, JSON.stringify(y));
|
|
152
|
+
} catch (a) {
|
|
153
|
+
console.warn(a), K();
|
|
153
154
|
}
|
|
154
155
|
}
|
|
155
156
|
}, [
|
|
156
157
|
(j = e.columnsState) == null ? void 0 : j.persistenceKey,
|
|
157
158
|
y,
|
|
158
|
-
(
|
|
159
|
-
]),
|
|
160
|
-
var t,
|
|
161
|
-
if ((t = e.columnsState) != null && t.persistenceKey && ((
|
|
162
|
-
const { onlineGet: n, persistenceKey:
|
|
159
|
+
(I = e.columnsState) == null ? void 0 : I.persistenceType
|
|
160
|
+
]), m(() => {
|
|
161
|
+
var t, i, u;
|
|
162
|
+
if ((t = e.columnsState) != null && t.persistenceKey && ((i = e.columnsState) == null ? void 0 : i.persistenceType) === "online") {
|
|
163
|
+
const { onlineGet: n, persistenceKey: c } = e.columnsState;
|
|
163
164
|
try {
|
|
164
|
-
(u = n == null ? void 0 : n(
|
|
165
|
+
(u = n == null ? void 0 : n(c)) == null || u.then((a) => {
|
|
165
166
|
var o, s;
|
|
166
|
-
const l = d(
|
|
167
|
-
|
|
167
|
+
const l = d(a, (o = e == null ? void 0 : e.columnsState) == null ? void 0 : o.value);
|
|
168
|
+
f(
|
|
168
169
|
(s = Object.keys(l ?? {})) != null && s.length ? l ?? {} : S
|
|
169
170
|
);
|
|
170
171
|
});
|
|
171
|
-
} catch (
|
|
172
|
-
console.warn(
|
|
172
|
+
} catch (a) {
|
|
173
|
+
console.warn(a);
|
|
173
174
|
}
|
|
174
175
|
}
|
|
175
176
|
}, []);
|
|
176
|
-
const
|
|
177
|
-
uuid:
|
|
178
|
-
persistenceType: (
|
|
179
|
-
persistenceKey: (
|
|
180
|
-
onlineChange: (
|
|
177
|
+
const C = {
|
|
178
|
+
uuid: r.current,
|
|
179
|
+
persistenceType: (P = e.columnsState) == null ? void 0 : P.persistenceType,
|
|
180
|
+
persistenceKey: (E = e.columnsState) == null ? void 0 : E.persistenceKey,
|
|
181
|
+
onlineChange: (k = e.columnsState) == null ? void 0 : k.onlineChange,
|
|
181
182
|
sortKeyColumns: w.current,
|
|
182
183
|
setSortKeyColumns: (t) => {
|
|
183
184
|
w.current = t;
|
|
184
185
|
},
|
|
185
186
|
columnsMap: y,
|
|
186
|
-
setColumnsMap:
|
|
187
|
-
setTableSize:
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
187
|
+
setColumnsMap: f,
|
|
188
|
+
setTableSize: g,
|
|
189
|
+
defaultTableSize: z,
|
|
190
|
+
tableSize: h,
|
|
191
|
+
sizeStorageType: (R = e.sizeState) == null ? void 0 : R.persistenceType,
|
|
192
|
+
sizeStorageKey: (B = e.sizeState) == null ? void 0 : B.persistenceKey,
|
|
193
|
+
onlineSizeChange: (D = e.sizeState) == null ? void 0 : D.onlineChange,
|
|
192
194
|
columns: e.columns,
|
|
193
|
-
clearPersistenceStorage:
|
|
195
|
+
clearPersistenceStorage: K,
|
|
194
196
|
defaultColumnKeyMap: S
|
|
195
197
|
};
|
|
196
|
-
return Object.defineProperty(
|
|
198
|
+
return Object.defineProperty(C, "sortKeyColumns", {
|
|
197
199
|
get: () => w.current
|
|
198
|
-
}), Object.defineProperty(
|
|
199
|
-
get: () =>
|
|
200
|
-
}),
|
|
200
|
+
}), Object.defineProperty(C, "uuid", {
|
|
201
|
+
get: () => r.current
|
|
202
|
+
}), C;
|
|
201
203
|
}
|
|
202
|
-
const
|
|
203
|
-
const
|
|
204
|
-
return /* @__PURE__ */ A.jsx(
|
|
204
|
+
const _ = F({}), ce = (e) => {
|
|
205
|
+
const r = Z(e.initValue);
|
|
206
|
+
return /* @__PURE__ */ A.jsx(_.Provider, { value: r, children: e.children });
|
|
205
207
|
};
|
|
206
208
|
export {
|
|
207
|
-
|
|
208
|
-
|
|
209
|
+
_ as TableContext,
|
|
210
|
+
ce as default
|
|
209
211
|
};
|
|
@@ -1,14 +1,21 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
const h = (n, e) => n.map((r) => {
|
|
2
|
+
const o = g((r == null ? void 0 : r.key) || (r == null ? void 0 : r.dataIndex), r.index), d = e[o];
|
|
3
|
+
return d && d.show === !1 ? !1 : r.children ? {
|
|
4
|
+
...r,
|
|
5
|
+
children: h(r.children, e)
|
|
6
|
+
} : r;
|
|
7
|
+
}).filter(Boolean), g = (n, e) => n ? Array.isArray(n) ? n.join("-") : n.toString() : `${e}`, y = (n) => (e, r) => {
|
|
8
|
+
var x, l, c, s;
|
|
9
|
+
const { fixed: o, index: d } = e, { fixed: t, index: u } = r;
|
|
10
|
+
if (o === "left" && t !== "left" || t === "right" && o !== "right")
|
|
5
11
|
return -2;
|
|
6
|
-
if (
|
|
12
|
+
if (t === "left" && o !== "left" || o === "right" && t !== "right")
|
|
7
13
|
return 2;
|
|
8
|
-
const
|
|
9
|
-
return (x =
|
|
14
|
+
const f = e.key || `${d}`, i = r.key || `${u}`;
|
|
15
|
+
return (x = n[f]) != null && x.order || (l = n[i]) != null && l.order ? (((c = n[f]) == null ? void 0 : c.order) || 0) - (((s = n[i]) == null ? void 0 : s.order) || 0) : (e.index || 0) - (r.index || 0);
|
|
10
16
|
};
|
|
11
17
|
export {
|
|
12
18
|
y as columnSort,
|
|
13
|
-
|
|
19
|
+
g as genColumnKey,
|
|
20
|
+
h as loopFilter
|
|
14
21
|
};
|