bitz-react-admin-ui 2.6.1 → 2.6.3
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 +2 -5
- package/dist/components/BitzCalendar/index.mjs +1 -1
- package/dist/components/BitzConfigProvider/context.d.ts +7 -1
- 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/CalendarBody.mjs +1 -1
- package/dist/components/BitzFuiCalendar/CalendarHead.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/ActionCol/index.mjs +73 -73
- package/dist/components/BitzTable/Store/index.d.ts +30 -0
- package/dist/components/BitzTable/Store/index.mjs +246 -217
- package/dist/components/BitzTable/Store/utils/index.d.ts +1 -1
- package/dist/components/BitzTable/Store/utils/index.mjs +12 -12
- package/dist/components/BitzTable/Table/index.d.ts +9 -1
- package/dist/components/BitzTable/Table/index.mjs +425 -403
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/ColumnConfigModal.mjs +103 -95
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/ColumnsSort/index.d.ts +2 -1
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/ColumnsSort/index.mjs +243 -197
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/ExportConfig/index.mjs +141 -105
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/StylesConfig/ScopeSwitch.d.ts +8 -0
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/StylesConfig/ScopeSwitch.mjs +23 -0
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/StylesConfig/index.mjs +127 -74
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/index.mjs +76 -25
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/style.mjs +151 -96
- package/dist/components/BitzTable/ToolBar/ExportIcon/ExportModal.mjs +29 -27
- package/dist/components/BitzTable/ToolBar/Modal/index.mjs +19 -9
- package/dist/components/BitzTable/ToolBar/Modal/style.d.ts +4 -0
- package/dist/components/BitzTable/ToolBar/Modal/style.mjs +42 -14
- package/dist/components/BitzTable/index.d.ts +2 -0
- package/dist/node_modules/.store/dayjs@1.11.11/node_modules/dayjs/dayjs.min.mjs +292 -292
- package/dist/node_modules/.store/dayjs@1.11.11/node_modules/dayjs/locale/zh-cn.mjs +13 -13
- package/dist/node_modules/.store/lodash@4.17.21/node_modules/lodash/debounce.mjs +34 -37
- package/dist/style.css +1 -1
- package/dist/utils/time.mjs +1 -1
- package/package.json +1 -1
- package/dist/_virtual/dayjs.min2.mjs +0 -4
- package/dist/node_modules/.store/ahooks@3.8.0/node_modules/ahooks/es/useDebounceFn/index.mjs +0 -29
- package/dist/node_modules/.store/ahooks@3.8.0/node_modules/ahooks/es/utils/lodash-polyfill.mjs +0 -7
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { Table as
|
|
3
|
-
import
|
|
4
|
-
import { createContext as
|
|
5
|
-
import { flattenColumns as
|
|
6
|
-
import { getUuid as
|
|
7
|
-
import { BitzConfigContext as
|
|
8
|
-
import
|
|
9
|
-
const
|
|
1
|
+
import { j as ke } from "../../../node_modules/.store/react@18.3.1/node_modules/react/jsx-runtime.mjs";
|
|
2
|
+
import { Table as fe } from "antd";
|
|
3
|
+
import N from "../../../hooks/useMergedState.mjs";
|
|
4
|
+
import { createContext as Re, useRef as De, useState as h, useContext as Le, useMemo as d, useEffect as g, useCallback as P } from "react";
|
|
5
|
+
import { flattenColumns as Ue, genColumnKey as B } from "./utils/index.mjs";
|
|
6
|
+
import { getUuid as Ae } from "../../../utils/uuid.mjs";
|
|
7
|
+
import { BitzConfigContext as Ge } from "../../BitzConfigProvider/context.mjs";
|
|
8
|
+
import y from "../../../node_modules/.store/lodash-es@4.17.21/node_modules/lodash-es/merge.mjs";
|
|
9
|
+
const _e = {
|
|
10
10
|
fixed: "left",
|
|
11
11
|
className: "sorterCol",
|
|
12
12
|
isDragSorterCol: !0,
|
|
@@ -16,78 +16,89 @@ const Be = {
|
|
|
16
16
|
onCell: () => ({
|
|
17
17
|
"data-column-name": "dragSorterCell"
|
|
18
18
|
})
|
|
19
|
-
},
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
];
|
|
24
|
-
function
|
|
25
|
-
var k,
|
|
26
|
-
const
|
|
19
|
+
}, Fe = [
|
|
20
|
+
_e,
|
|
21
|
+
fe.SELECTION_COLUMN,
|
|
22
|
+
fe.EXPAND_COLUMN
|
|
23
|
+
], se = 5;
|
|
24
|
+
function We(e) {
|
|
25
|
+
var k, R, D, L, U, A, G, _, F, W, Z, X, q, Q, Y, $, p, ee, te, ne, ie, ae, oe, ce, le;
|
|
26
|
+
const K = De(Ae()), [ue, de] = h(!1), [ye, Se] = h(!1), [ge, Ce] = h(0), f = Le(Ge).Table, me = f == null ? void 0 : f.defaultSize, E = e.defaultSize ?? me ?? "lg", we = e.defaultZebra ?? (f == null ? void 0 : f.zebra) ?? !0, he = e.defaultOperationPlacement ?? (f == null ? void 0 : f.operationPlacement) ?? "right", xe = e.defaultPageSize ?? (f == null ? void 0 : f.pageSize) ?? 10, Te = e.defaultOrderBy ?? (f == null ? void 0 : f.orderBy) ?? "desc", Ke = e.defaultBordered ?? (f == null ? void 0 : f.bordered) ?? "row-column", z = d(() => {
|
|
27
27
|
var t;
|
|
28
|
-
return
|
|
28
|
+
return y(
|
|
29
29
|
{
|
|
30
30
|
size: e.size ?? E,
|
|
31
|
-
zebra: e.zebra ??
|
|
32
|
-
bordered: e.bordered ??
|
|
31
|
+
zebra: e.zebra ?? we,
|
|
32
|
+
bordered: e.bordered ?? Ke,
|
|
33
|
+
operationPlacement: e.operationPlacement ?? he,
|
|
34
|
+
pageSize: e.pageSize ?? xe,
|
|
35
|
+
orderBy: e.orderBy ?? Te
|
|
33
36
|
},
|
|
34
37
|
(t = e.stylesConfigState) == null ? void 0 : t.defaultValue
|
|
35
38
|
);
|
|
36
|
-
}, [
|
|
39
|
+
}, [
|
|
40
|
+
e.size,
|
|
41
|
+
e.zebra,
|
|
42
|
+
e.bordered,
|
|
43
|
+
e.operationPlacement,
|
|
44
|
+
e.pageSize,
|
|
45
|
+
e.orderBy,
|
|
46
|
+
e.defaultStylesConfig
|
|
47
|
+
]), [s, I] = N(
|
|
37
48
|
() => {
|
|
38
|
-
var n,
|
|
39
|
-
const { persistenceType: t, persistenceKey:
|
|
40
|
-
if (
|
|
41
|
-
const
|
|
49
|
+
var n, a, l;
|
|
50
|
+
const { persistenceType: t, persistenceKey: i, onlineGet: c } = e.stylesConfigState || {};
|
|
51
|
+
if (i && t && typeof window < "u" && t !== "online") {
|
|
52
|
+
const o = window[t];
|
|
42
53
|
try {
|
|
43
|
-
const
|
|
44
|
-
if (
|
|
45
|
-
return (n = e == null ? void 0 : e.stylesConfigState) != null && n.defaultValue ?
|
|
46
|
-
JSON.parse(
|
|
47
|
-
(
|
|
48
|
-
) : JSON.parse(
|
|
49
|
-
} catch (
|
|
50
|
-
console.warn(
|
|
54
|
+
const r = o == null ? void 0 : o.getItem(i);
|
|
55
|
+
if (r)
|
|
56
|
+
return (n = e == null ? void 0 : e.stylesConfigState) != null && n.defaultValue ? y(
|
|
57
|
+
JSON.parse(r),
|
|
58
|
+
(a = e == null ? void 0 : e.stylesConfigState) == null ? void 0 : a.defaultValue
|
|
59
|
+
) : JSON.parse(r);
|
|
60
|
+
} catch (r) {
|
|
61
|
+
console.warn(r);
|
|
51
62
|
}
|
|
52
63
|
}
|
|
53
|
-
return e.stylesConfig || ((l = e.stylesConfigState) == null ? void 0 : l.value) ||
|
|
64
|
+
return e.stylesConfig || ((l = e.stylesConfigState) == null ? void 0 : l.value) || z;
|
|
54
65
|
},
|
|
55
66
|
{
|
|
56
67
|
value: ((k = e.stylesConfigState) == null ? void 0 : k.value) || e.stylesConfig,
|
|
57
|
-
onChange: ((
|
|
68
|
+
onChange: ((R = e.stylesConfigState) == null ? void 0 : R.onChange) || e.onStylesConfigChange
|
|
58
69
|
}
|
|
59
70
|
);
|
|
60
|
-
|
|
71
|
+
g(() => {
|
|
61
72
|
var c, n;
|
|
62
73
|
if (!((c = e.stylesConfigState) != null && c.persistenceKey) || !((n = e.stylesConfigState) != null && n.persistenceType) || typeof window > "u")
|
|
63
74
|
return;
|
|
64
75
|
const {
|
|
65
76
|
persistenceType: t,
|
|
66
|
-
persistenceKey:
|
|
77
|
+
persistenceKey: i
|
|
67
78
|
// onlineChange
|
|
68
79
|
} = e.stylesConfigState;
|
|
69
80
|
if (t !== "online") {
|
|
70
|
-
const
|
|
81
|
+
const a = window[t];
|
|
71
82
|
try {
|
|
72
|
-
|
|
83
|
+
a == null || a.setItem(i, JSON.stringify(s));
|
|
73
84
|
} catch (l) {
|
|
74
|
-
console.warn(l),
|
|
85
|
+
console.warn(l), M();
|
|
75
86
|
}
|
|
76
87
|
}
|
|
77
88
|
}, [
|
|
78
|
-
(
|
|
79
|
-
|
|
89
|
+
(D = e.stylesConfigState) == null ? void 0 : D.persistenceKey,
|
|
90
|
+
s,
|
|
80
91
|
(L = e.stylesConfigState) == null ? void 0 : L.persistenceType
|
|
81
|
-
]),
|
|
82
|
-
var t,
|
|
83
|
-
if ((t = e.stylesConfigState) != null && t.persistenceKey && ((
|
|
84
|
-
const { onlineGet: n, persistenceKey:
|
|
92
|
+
]), g(() => {
|
|
93
|
+
var t, i, c;
|
|
94
|
+
if ((t = e.stylesConfigState) != null && t.persistenceKey && ((i = e.stylesConfigState) == null ? void 0 : i.persistenceType) === "online") {
|
|
95
|
+
const { onlineGet: n, persistenceKey: a } = e.stylesConfigState;
|
|
85
96
|
try {
|
|
86
|
-
(c = n == null ? void 0 : n(
|
|
87
|
-
var
|
|
88
|
-
const
|
|
97
|
+
(c = n == null ? void 0 : n(a)) == null || c.then((l) => {
|
|
98
|
+
var r;
|
|
99
|
+
const o = y(l ?? {}, (r = e == null ? void 0 : e.stylesConfigState) == null ? void 0 : r.value);
|
|
89
100
|
I(
|
|
90
|
-
Object.keys(
|
|
101
|
+
Object.keys(o).length ? o : z
|
|
91
102
|
);
|
|
92
103
|
});
|
|
93
104
|
} catch (l) {
|
|
@@ -95,9 +106,9 @@ function Me(e) {
|
|
|
95
106
|
}
|
|
96
107
|
}
|
|
97
108
|
}, []);
|
|
98
|
-
const
|
|
99
|
-
(t) => !
|
|
100
|
-
), [e.columns]),
|
|
109
|
+
const u = d(() => (e.columns ?? []).filter(
|
|
110
|
+
(t) => !Fe.includes(t) && t.title
|
|
111
|
+
), [e.columns]), x = d(() => {
|
|
101
112
|
var n;
|
|
102
113
|
const t = {
|
|
103
114
|
fields: [],
|
|
@@ -105,100 +116,100 @@ function Me(e) {
|
|
|
105
116
|
key: "current",
|
|
106
117
|
info: void 0
|
|
107
118
|
}
|
|
108
|
-
},
|
|
119
|
+
}, i = u.find((a) => {
|
|
109
120
|
var l;
|
|
110
|
-
return (l =
|
|
111
|
-
}), c =
|
|
112
|
-
if (
|
|
113
|
-
t.fields =
|
|
121
|
+
return (l = a == null ? void 0 : a.children) == null ? void 0 : l.length;
|
|
122
|
+
}), c = u.filter((a) => !a.isOperationCol);
|
|
123
|
+
if (i)
|
|
124
|
+
t.fields = Ue(c);
|
|
114
125
|
else {
|
|
115
|
-
const
|
|
116
|
-
c.forEach((l,
|
|
117
|
-
const
|
|
118
|
-
|
|
119
|
-
field:
|
|
126
|
+
const a = [];
|
|
127
|
+
c.forEach((l, o) => {
|
|
128
|
+
const r = B(l, o);
|
|
129
|
+
r && !l.exportHidden && a.push({
|
|
130
|
+
field: r,
|
|
120
131
|
title: l.title,
|
|
121
132
|
show: !0
|
|
122
133
|
});
|
|
123
|
-
}), t.fields =
|
|
134
|
+
}), t.fields = a;
|
|
124
135
|
}
|
|
125
|
-
return (n = e == null ? void 0 : e.exportConfigState) != null && n.defaultValue ?
|
|
126
|
-
}, [
|
|
136
|
+
return (n = e == null ? void 0 : e.exportConfigState) != null && n.defaultValue ? y(t, e.exportConfigState.defaultValue) : t;
|
|
137
|
+
}, [u]), [V, T] = N(
|
|
127
138
|
() => {
|
|
128
|
-
var n,
|
|
129
|
-
const { persistenceType: t, persistenceKey:
|
|
130
|
-
if (
|
|
131
|
-
const
|
|
139
|
+
var n, a, l;
|
|
140
|
+
const { persistenceType: t, persistenceKey: i, onlineGet: c } = e.exportConfigState || {};
|
|
141
|
+
if (i && t && typeof window < "u" && t !== "online") {
|
|
142
|
+
const o = window[t];
|
|
132
143
|
try {
|
|
133
|
-
const
|
|
134
|
-
if (
|
|
135
|
-
return (n = e == null ? void 0 : e.exportConfigState) != null && n.defaultValue ?
|
|
136
|
-
JSON.parse(
|
|
137
|
-
(
|
|
138
|
-
) : JSON.parse(
|
|
139
|
-
} catch (
|
|
140
|
-
console.warn(
|
|
144
|
+
const r = o == null ? void 0 : o.getItem(i);
|
|
145
|
+
if (r)
|
|
146
|
+
return (n = e == null ? void 0 : e.exportConfigState) != null && n.defaultValue ? y(
|
|
147
|
+
JSON.parse(r),
|
|
148
|
+
(a = e == null ? void 0 : e.exportConfigState) == null ? void 0 : a.defaultValue
|
|
149
|
+
) : JSON.parse(r);
|
|
150
|
+
} catch (r) {
|
|
151
|
+
console.warn(r);
|
|
141
152
|
}
|
|
142
153
|
}
|
|
143
|
-
return e.exportConfig || ((l = e.exportConfigState) == null ? void 0 : l.value) ||
|
|
154
|
+
return e.exportConfig || ((l = e.exportConfigState) == null ? void 0 : l.value) || x;
|
|
144
155
|
},
|
|
145
156
|
{
|
|
146
|
-
value: ((
|
|
147
|
-
onChange: ((
|
|
157
|
+
value: ((U = e.exportConfigState) == null ? void 0 : U.value) || e.exportConfig,
|
|
158
|
+
onChange: ((A = e.exportConfigState) == null ? void 0 : A.onChange) || e.onExportConfigChange
|
|
148
159
|
}
|
|
149
160
|
);
|
|
150
|
-
|
|
151
|
-
var n,
|
|
152
|
-
const { persistenceType: t, persistenceKey:
|
|
153
|
-
if (
|
|
161
|
+
g(() => {
|
|
162
|
+
var n, a;
|
|
163
|
+
const { persistenceType: t, persistenceKey: i, onlineGet: c } = e.exportConfigState || {};
|
|
164
|
+
if (i && t && typeof window < "u" && t !== "online") {
|
|
154
165
|
const l = window[t];
|
|
155
166
|
try {
|
|
156
|
-
const
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
JSON.parse(
|
|
160
|
-
(
|
|
167
|
+
const o = l == null ? void 0 : l.getItem(i);
|
|
168
|
+
o ? (n = e == null ? void 0 : e.exportConfigState) != null && n.defaultValue ? T(
|
|
169
|
+
y(
|
|
170
|
+
JSON.parse(o),
|
|
171
|
+
(a = e == null ? void 0 : e.exportConfigState) == null ? void 0 : a.defaultValue
|
|
161
172
|
)
|
|
162
|
-
) :
|
|
163
|
-
} catch (
|
|
164
|
-
console.warn(
|
|
173
|
+
) : T(JSON.parse(o)) : T(x);
|
|
174
|
+
} catch (o) {
|
|
175
|
+
console.warn(o);
|
|
165
176
|
}
|
|
166
177
|
}
|
|
167
178
|
}, [
|
|
168
|
-
(
|
|
169
|
-
(
|
|
170
|
-
|
|
171
|
-
]),
|
|
179
|
+
(G = e.exportConfigState) == null ? void 0 : G.persistenceKey,
|
|
180
|
+
(_ = e.exportConfigState) == null ? void 0 : _.persistenceType,
|
|
181
|
+
x
|
|
182
|
+
]), g(() => {
|
|
172
183
|
var c, n;
|
|
173
184
|
if (!((c = e.exportConfigState) != null && c.persistenceKey) || !((n = e.exportConfigState) != null && n.persistenceType) || typeof window > "u")
|
|
174
185
|
return;
|
|
175
186
|
const {
|
|
176
187
|
persistenceType: t,
|
|
177
|
-
persistenceKey:
|
|
188
|
+
persistenceKey: i
|
|
178
189
|
// onlineChange
|
|
179
190
|
} = e.exportConfigState;
|
|
180
191
|
if (t !== "online") {
|
|
181
|
-
const
|
|
192
|
+
const a = window[t];
|
|
182
193
|
try {
|
|
183
|
-
|
|
194
|
+
a == null || a.setItem(i, JSON.stringify(V));
|
|
184
195
|
} catch (l) {
|
|
185
196
|
console.warn(l), j();
|
|
186
197
|
}
|
|
187
198
|
}
|
|
188
199
|
}, [
|
|
189
|
-
(
|
|
200
|
+
(F = e.exportConfigState) == null ? void 0 : F.persistenceKey,
|
|
190
201
|
V,
|
|
191
|
-
(
|
|
192
|
-
]),
|
|
193
|
-
var t,
|
|
194
|
-
if ((t = e.exportConfigState) != null && t.persistenceKey && ((
|
|
195
|
-
const { onlineGet: n, persistenceKey:
|
|
202
|
+
(W = e.exportConfigState) == null ? void 0 : W.persistenceType
|
|
203
|
+
]), g(() => {
|
|
204
|
+
var t, i, c;
|
|
205
|
+
if ((t = e.exportConfigState) != null && t.persistenceKey && ((i = e.exportConfigState) == null ? void 0 : i.persistenceType) === "online") {
|
|
206
|
+
const { onlineGet: n, persistenceKey: a } = e.exportConfigState;
|
|
196
207
|
try {
|
|
197
|
-
(c = n == null ? void 0 : n(
|
|
198
|
-
var
|
|
199
|
-
const
|
|
200
|
-
|
|
201
|
-
Object.keys(
|
|
208
|
+
(c = n == null ? void 0 : n(a)) == null || c.then((l) => {
|
|
209
|
+
var r;
|
|
210
|
+
const o = y(l ?? {}, (r = e == null ? void 0 : e.exportConfigState) == null ? void 0 : r.value);
|
|
211
|
+
T(
|
|
212
|
+
Object.keys(o).length ? o : x
|
|
202
213
|
);
|
|
203
214
|
});
|
|
204
215
|
} catch (l) {
|
|
@@ -210,193 +221,211 @@ function Me(e) {
|
|
|
210
221
|
var l;
|
|
211
222
|
if ((l = e == null ? void 0 : e.columnsState) != null && l.defaultValue)
|
|
212
223
|
return e.columnsState.defaultValue;
|
|
213
|
-
const t =
|
|
214
|
-
return n.forEach((
|
|
215
|
-
const { order: m, width:
|
|
216
|
-
|
|
224
|
+
const t = u.filter((o) => o.fixed === "left").map((o, r) => ({ ...o, order: r })), i = u.filter((o) => o.fixed === "right").map((o, r) => ({ ...o, order: r })), c = u.filter((o) => !["left", "right"].includes(o.fixed)).map((o, r) => ({ ...o, order: r })), n = [...t, ...c, ...i], a = {};
|
|
225
|
+
return n.forEach((o, r) => {
|
|
226
|
+
const { order: m, width: Xe, fixed: je, disabled: He } = o, re = B(o, r);
|
|
227
|
+
re && (a[re] = {
|
|
217
228
|
show: !0,
|
|
218
229
|
order: m,
|
|
219
|
-
fixed:
|
|
220
|
-
disabled:
|
|
230
|
+
fixed: je,
|
|
231
|
+
disabled: He
|
|
221
232
|
});
|
|
222
|
-
}),
|
|
223
|
-
}, [
|
|
233
|
+
}), a;
|
|
234
|
+
}, [u]), [be, Oe] = h(!1), [S, w] = N(
|
|
224
235
|
() => {
|
|
225
|
-
var n,
|
|
226
|
-
const { persistenceType: t, persistenceKey:
|
|
227
|
-
if (
|
|
228
|
-
const
|
|
236
|
+
var n, a, l, o;
|
|
237
|
+
const { persistenceType: t, persistenceKey: i, onlineGet: c } = e.columnsState || {};
|
|
238
|
+
if (i && t && typeof window < "u" && t !== "online") {
|
|
239
|
+
const r = window[t];
|
|
229
240
|
try {
|
|
230
|
-
const m =
|
|
241
|
+
const m = r == null ? void 0 : r.getItem(i);
|
|
231
242
|
if (m)
|
|
232
|
-
return (n = e == null ? void 0 : e.columnsState) != null && n.defaultValue ?
|
|
243
|
+
return (n = e == null ? void 0 : e.columnsState) != null && n.defaultValue ? y(
|
|
233
244
|
JSON.parse(m),
|
|
234
|
-
(
|
|
245
|
+
(a = e == null ? void 0 : e.columnsState) == null ? void 0 : a.defaultValue
|
|
235
246
|
) : JSON.parse(m);
|
|
236
247
|
} catch (m) {
|
|
237
248
|
console.warn(m);
|
|
238
249
|
}
|
|
239
250
|
}
|
|
240
|
-
return e.columnsStateMap || ((l = e.columnsState) == null ? void 0 : l.value) || ((
|
|
251
|
+
return e.columnsStateMap || ((l = e.columnsState) == null ? void 0 : l.value) || ((o = e.columnsState) == null ? void 0 : o.defaultValue) || {};
|
|
241
252
|
},
|
|
242
253
|
{
|
|
243
|
-
value: ((
|
|
244
|
-
onChange: ((
|
|
254
|
+
value: ((Z = e.columnsState) == null ? void 0 : Z.value) || e.columnsStateMap,
|
|
255
|
+
onChange: ((X = e.columnsState) == null ? void 0 : X.onChange) || e.onColumnsStateChange
|
|
245
256
|
}
|
|
246
257
|
);
|
|
247
|
-
|
|
248
|
-
var n,
|
|
249
|
-
const { persistenceType: t, persistenceKey:
|
|
250
|
-
if (
|
|
258
|
+
g(() => {
|
|
259
|
+
var n, a;
|
|
260
|
+
const { persistenceType: t, persistenceKey: i, onlineGet: c } = e.columnsState || {};
|
|
261
|
+
if (i && t && typeof window < "u" && t !== "online") {
|
|
251
262
|
const l = window[t];
|
|
252
263
|
try {
|
|
253
|
-
const
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
JSON.parse(
|
|
257
|
-
(
|
|
264
|
+
const o = l == null ? void 0 : l.getItem(i);
|
|
265
|
+
o ? (n = e == null ? void 0 : e.columnsState) != null && n.defaultValue ? w(
|
|
266
|
+
y(
|
|
267
|
+
JSON.parse(o),
|
|
268
|
+
(a = e == null ? void 0 : e.columnsState) == null ? void 0 : a.defaultValue
|
|
258
269
|
)
|
|
259
|
-
) : w(JSON.parse(
|
|
260
|
-
} catch (
|
|
261
|
-
console.warn(
|
|
270
|
+
) : w(JSON.parse(o)) : w(C);
|
|
271
|
+
} catch (o) {
|
|
272
|
+
console.warn(o);
|
|
262
273
|
}
|
|
263
274
|
}
|
|
264
275
|
}, [
|
|
265
|
-
(
|
|
266
|
-
(
|
|
276
|
+
(q = e.columnsState) == null ? void 0 : q.persistenceKey,
|
|
277
|
+
(Q = e.columnsState) == null ? void 0 : Q.persistenceType,
|
|
267
278
|
C
|
|
268
279
|
]);
|
|
269
|
-
const J =
|
|
270
|
-
const { persistenceType: t, persistenceKey:
|
|
271
|
-
if (!
|
|
280
|
+
const J = P(() => {
|
|
281
|
+
const { persistenceType: t, persistenceKey: i } = e.columnsState || {};
|
|
282
|
+
if (!i || !t || typeof window > "u")
|
|
272
283
|
return;
|
|
273
284
|
const c = window[t];
|
|
274
285
|
try {
|
|
275
|
-
c == null || c.removeItem(
|
|
286
|
+
c == null || c.removeItem(i);
|
|
276
287
|
} catch (n) {
|
|
277
288
|
console.warn(n);
|
|
278
289
|
}
|
|
279
|
-
}, [e.columnsState]),
|
|
280
|
-
const { persistenceType: t, persistenceKey:
|
|
281
|
-
if (!
|
|
290
|
+
}, [e.columnsState]), M = P(() => {
|
|
291
|
+
const { persistenceType: t, persistenceKey: i } = e.stylesConfigState || {};
|
|
292
|
+
if (!i || !t || typeof window > "u")
|
|
282
293
|
return;
|
|
283
294
|
const c = window[t];
|
|
284
295
|
try {
|
|
285
|
-
c == null || c.removeItem(
|
|
296
|
+
c == null || c.removeItem(i);
|
|
286
297
|
} catch (n) {
|
|
287
298
|
console.warn(n);
|
|
288
299
|
}
|
|
289
|
-
}, [e.stylesConfigState]), j =
|
|
290
|
-
const { persistenceType: t, persistenceKey:
|
|
291
|
-
if (!
|
|
300
|
+
}, [e.stylesConfigState]), j = P(() => {
|
|
301
|
+
const { persistenceType: t, persistenceKey: i } = e.exportConfigState || {};
|
|
302
|
+
if (!i || !t || typeof window > "u")
|
|
292
303
|
return;
|
|
293
304
|
const c = window[t];
|
|
294
305
|
try {
|
|
295
|
-
c == null || c.removeItem(
|
|
306
|
+
c == null || c.removeItem(i);
|
|
296
307
|
} catch (n) {
|
|
297
308
|
console.warn(n);
|
|
298
309
|
}
|
|
299
310
|
}, [e.exportConfigState]);
|
|
300
|
-
|
|
311
|
+
g(() => {
|
|
301
312
|
var c, n;
|
|
302
313
|
if (!((c = e.columnsState) != null && c.persistenceKey) || !((n = e.columnsState) != null && n.persistenceType) || typeof window > "u")
|
|
303
314
|
return;
|
|
304
315
|
const {
|
|
305
316
|
persistenceType: t,
|
|
306
|
-
persistenceKey:
|
|
317
|
+
persistenceKey: i
|
|
307
318
|
// onlineChange
|
|
308
319
|
} = e.columnsState;
|
|
309
320
|
if (t !== "online") {
|
|
310
|
-
const
|
|
321
|
+
const a = window[t];
|
|
311
322
|
try {
|
|
312
|
-
|
|
323
|
+
a == null || a.setItem(i, JSON.stringify(S));
|
|
313
324
|
} catch (l) {
|
|
314
325
|
console.warn(l), J();
|
|
315
326
|
}
|
|
316
327
|
}
|
|
317
328
|
}, [
|
|
318
|
-
(
|
|
319
|
-
|
|
320
|
-
(
|
|
321
|
-
]),
|
|
322
|
-
var t,
|
|
323
|
-
if ((t = e.columnsState) != null && t.persistenceKey && ((
|
|
324
|
-
const { onlineGet: n, persistenceKey:
|
|
329
|
+
(Y = e.columnsState) == null ? void 0 : Y.persistenceKey,
|
|
330
|
+
S,
|
|
331
|
+
($ = e.columnsState) == null ? void 0 : $.persistenceType
|
|
332
|
+
]), g(() => {
|
|
333
|
+
var t, i, c;
|
|
334
|
+
if ((t = e.columnsState) != null && t.persistenceKey && ((i = e.columnsState) == null ? void 0 : i.persistenceType) === "online") {
|
|
335
|
+
const { onlineGet: n, persistenceKey: a } = e.columnsState;
|
|
325
336
|
try {
|
|
326
|
-
(c = n == null ? void 0 : n(
|
|
327
|
-
var
|
|
328
|
-
const
|
|
329
|
-
w(
|
|
337
|
+
(c = n == null ? void 0 : n(a)) == null || c.then((l) => {
|
|
338
|
+
var r;
|
|
339
|
+
const o = y(l ?? {}, (r = e == null ? void 0 : e.columnsState) == null ? void 0 : r.value);
|
|
340
|
+
w(o), Oe(!0);
|
|
330
341
|
});
|
|
331
342
|
} catch (l) {
|
|
332
343
|
console.warn(l);
|
|
333
344
|
}
|
|
334
345
|
}
|
|
335
|
-
}, []),
|
|
336
|
-
var
|
|
337
|
-
const t =
|
|
346
|
+
}, []), g(() => {
|
|
347
|
+
var i, c;
|
|
348
|
+
const t = u.findIndex((n) => n == null ? void 0 : n.isOperationCol);
|
|
338
349
|
if (t >= 0) {
|
|
339
|
-
const n =
|
|
340
|
-
!(((
|
|
350
|
+
const n = u[t], a = B(n, t);
|
|
351
|
+
!(((i = S == null ? void 0 : S[a]) == null ? void 0 : i.fixed) === ((c = C == null ? void 0 : C[a]) == null ? void 0 : c.fixed)) && Object.keys(S ?? {}).length === 0 && w(C);
|
|
341
352
|
}
|
|
342
|
-
}, [C,
|
|
343
|
-
const
|
|
353
|
+
}, [C, S]);
|
|
354
|
+
const ze = d(() => (e == null ? void 0 : e.rowHoverable) ?? (f == null ? void 0 : f.rowHoverable) ?? !0, [e == null ? void 0 : e.rowHoverable, f == null ? void 0 : f.rowHoverable]), Ve = d(() => e.zebra ?? s.zebra, [e.zebra, s.zebra]), b = d(() => e.bordered ?? s.bordered, [e.bordered, s.bordered]), ve = d(() => ["column", "row-column"].includes(b), [b]), Ne = d(() => {
|
|
344
355
|
let t = !1;
|
|
345
356
|
return ["hide", "column"].includes(b) && (t = !0), t;
|
|
346
|
-
}, [b]),
|
|
357
|
+
}, [b]), Pe = d(() => e.operationPlacement ?? s.operationPlacement, [e.operationPlacement, s.operationPlacement]), [Be, v] = h(!1), [Ee, O] = h(se), Ie = () => {
|
|
358
|
+
v(!0), O(se);
|
|
359
|
+
}, Je = () => {
|
|
360
|
+
v(!1), O(0);
|
|
361
|
+
}, Me = () => {
|
|
362
|
+
var t, i, c;
|
|
363
|
+
(c = (t = e.columnsState) == null ? void 0 : t.onlineChange) == null || c.call(
|
|
364
|
+
t,
|
|
365
|
+
(i = e.columnsState) == null ? void 0 : i.persistenceKey,
|
|
366
|
+
S
|
|
367
|
+
), v(!1), O(0);
|
|
368
|
+
}, H = {
|
|
347
369
|
loading: e.loading ?? !1,
|
|
348
370
|
dataSource: e.dataSource,
|
|
349
371
|
pagination: e.pagination,
|
|
350
372
|
total: e.total,
|
|
351
|
-
uuid:
|
|
352
|
-
fullscreen:
|
|
353
|
-
setFullscreen:
|
|
354
|
-
selected:
|
|
355
|
-
setSelected:
|
|
356
|
-
toolbarWidth:
|
|
357
|
-
setToolbarWidth:
|
|
373
|
+
uuid: K.current,
|
|
374
|
+
fullscreen: ue,
|
|
375
|
+
setFullscreen: de,
|
|
376
|
+
selected: ye,
|
|
377
|
+
setSelected: Se,
|
|
378
|
+
toolbarWidth: ge,
|
|
379
|
+
setToolbarWidth: Ce,
|
|
380
|
+
startAutoSaveCountdown: Ie,
|
|
381
|
+
isSaving: Be,
|
|
382
|
+
countdown: Ee,
|
|
383
|
+
cancelAutoSave: Je,
|
|
384
|
+
immediateSave: Me,
|
|
385
|
+
setCountdown: O,
|
|
358
386
|
columns: e.columns,
|
|
359
|
-
baseColumns:
|
|
360
|
-
persistenceType: (
|
|
361
|
-
persistenceKey: (
|
|
362
|
-
onlineChange: (
|
|
363
|
-
finish:
|
|
364
|
-
columnsMap:
|
|
387
|
+
baseColumns: u,
|
|
388
|
+
persistenceType: (p = e.columnsState) == null ? void 0 : p.persistenceType,
|
|
389
|
+
persistenceKey: (ee = e.columnsState) == null ? void 0 : ee.persistenceKey,
|
|
390
|
+
onlineChange: (te = e.columnsState) == null ? void 0 : te.onlineChange,
|
|
391
|
+
finish: be,
|
|
392
|
+
columnsMap: S,
|
|
365
393
|
setColumnsMap: w,
|
|
366
394
|
defaultColumnKeyMap: C,
|
|
367
395
|
clearPersistenceStorage: J,
|
|
368
|
-
stylesConfig:
|
|
396
|
+
stylesConfig: s,
|
|
369
397
|
setTableStylesConfig: I,
|
|
370
398
|
defaultTableSize: E,
|
|
371
|
-
tableSize:
|
|
372
|
-
stylesStorageType: (
|
|
373
|
-
stylesStorageKey: (
|
|
374
|
-
onlineStylesConfigChange: (
|
|
375
|
-
clearStylesConfigCache:
|
|
376
|
-
defaultTableStylesConfig:
|
|
399
|
+
tableSize: s.size,
|
|
400
|
+
stylesStorageType: (ne = e.stylesConfigState) == null ? void 0 : ne.persistenceType,
|
|
401
|
+
stylesStorageKey: (ie = e.stylesConfigState) == null ? void 0 : ie.persistenceKey,
|
|
402
|
+
onlineStylesConfigChange: (ae = e.stylesConfigState) == null ? void 0 : ae.onlineChange,
|
|
403
|
+
clearStylesConfigCache: M,
|
|
404
|
+
defaultTableStylesConfig: z,
|
|
377
405
|
exportConfig: V,
|
|
378
|
-
setTableExportConfig:
|
|
379
|
-
defaultTableExportConfig:
|
|
380
|
-
exportStorageType: (
|
|
381
|
-
exportStorageKey: (
|
|
382
|
-
onlineExportConfigChange: (
|
|
406
|
+
setTableExportConfig: T,
|
|
407
|
+
defaultTableExportConfig: x,
|
|
408
|
+
exportStorageType: (oe = e.exportConfigState) == null ? void 0 : oe.persistenceType,
|
|
409
|
+
exportStorageKey: (ce = e.exportConfigState) == null ? void 0 : ce.persistenceKey,
|
|
410
|
+
onlineExportConfigChange: (le = e.exportConfigState) == null ? void 0 : le.onlineChange,
|
|
383
411
|
clearExportConfigCache: j,
|
|
384
|
-
zebra:
|
|
385
|
-
rowHoverable:
|
|
386
|
-
showColumnBorder:
|
|
387
|
-
hideRowBorder:
|
|
412
|
+
zebra: Ve,
|
|
413
|
+
rowHoverable: ze,
|
|
414
|
+
showColumnBorder: ve,
|
|
415
|
+
hideRowBorder: Ne,
|
|
416
|
+
operationPlacement: Pe
|
|
388
417
|
};
|
|
389
|
-
return Object.defineProperty(
|
|
390
|
-
get: () =>
|
|
391
|
-
}),
|
|
418
|
+
return Object.defineProperty(H, "uuid", {
|
|
419
|
+
get: () => K.current
|
|
420
|
+
}), H;
|
|
392
421
|
}
|
|
393
|
-
const
|
|
394
|
-
const
|
|
395
|
-
return /* @__PURE__ */
|
|
422
|
+
const Ze = Re({}), it = (e) => {
|
|
423
|
+
const K = We(e.initValue);
|
|
424
|
+
return /* @__PURE__ */ ke.jsx(Ze.Provider, { value: K, children: e.children });
|
|
396
425
|
};
|
|
397
426
|
export {
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
427
|
+
Ze as BitzTableContext,
|
|
428
|
+
_e as SORTER_COLUMN,
|
|
429
|
+
it as default,
|
|
430
|
+
Fe as toolCols
|
|
402
431
|
};
|