bitz-react-admin-ui 2.4.8 → 2.5.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.
- package/dist/components/BitzTable/ActionCol/index.mjs +12 -12
- package/dist/components/BitzTable/Store/index.d.ts +2 -0
- package/dist/components/BitzTable/Store/index.mjs +48 -42
- package/dist/components/BitzTable/Store/utils/index.d.ts +1 -5
- package/dist/components/BitzTable/Store/utils/index.mjs +31 -32
- package/dist/components/BitzTable/Table/ResizableTitle copy.mjs +50 -41
- package/dist/components/BitzTable/Table/index.d.ts +2 -0
- package/dist/components/BitzTable/Table/index.mjs +387 -404
- package/dist/components/BitzTable/TextOverflow/index.mjs +1 -1
- package/dist/components/BitzTable/index.d.ts +2 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -27,9 +27,9 @@ const b = ({
|
|
|
27
27
|
)
|
|
28
28
|
] }), _ = E(
|
|
29
29
|
({ loading: m, actionGroup: l, customActions: r }, p) => {
|
|
30
|
-
const { loading: f, fullscreen: y } = L(W),
|
|
30
|
+
const { loading: f, fullscreen: y } = L(W), a = C(() => m ?? f, [m, f]), {
|
|
31
31
|
primaryBtnClassName: d,
|
|
32
|
-
dangerBtnClassName:
|
|
32
|
+
dangerBtnClassName: o,
|
|
33
33
|
secondaryBtnClassName: u,
|
|
34
34
|
maskClassName: B,
|
|
35
35
|
skeletonBtnClassName: h,
|
|
@@ -38,7 +38,7 @@ const b = ({
|
|
|
38
38
|
const i = l.length >= 4 ? 2 : l.length, c = l.slice(0, i), t = [];
|
|
39
39
|
if (c != null && c.length && c.forEach((e, s) => {
|
|
40
40
|
t.push(
|
|
41
|
-
|
|
41
|
+
a ? /* @__PURE__ */ n.jsx(
|
|
42
42
|
b,
|
|
43
43
|
{
|
|
44
44
|
className: h,
|
|
@@ -50,14 +50,14 @@ const b = ({
|
|
|
50
50
|
x,
|
|
51
51
|
{
|
|
52
52
|
type: "text",
|
|
53
|
-
className: e.danger ?
|
|
53
|
+
className: e.danger ? o : d,
|
|
54
54
|
children: e == null ? void 0 : e.label
|
|
55
55
|
}
|
|
56
56
|
) }, s) : /* @__PURE__ */ n.jsx(
|
|
57
57
|
x,
|
|
58
58
|
{
|
|
59
59
|
type: "text",
|
|
60
|
-
className: e.danger ?
|
|
60
|
+
className: e.danger ? o : d,
|
|
61
61
|
onClick: e == null ? void 0 : e.onClick,
|
|
62
62
|
children: e == null ? void 0 : e.label
|
|
63
63
|
},
|
|
@@ -67,7 +67,7 @@ const b = ({
|
|
|
67
67
|
}), i === 2 && l.length >= 4) {
|
|
68
68
|
const e = l.slice(2, l.length);
|
|
69
69
|
t.push(
|
|
70
|
-
|
|
70
|
+
a ? /* @__PURE__ */ n.jsx(
|
|
71
71
|
b,
|
|
72
72
|
{
|
|
73
73
|
className: h,
|
|
@@ -79,7 +79,7 @@ const b = ({
|
|
|
79
79
|
);
|
|
80
80
|
}
|
|
81
81
|
return t;
|
|
82
|
-
}, [
|
|
82
|
+
}, [a, l]), k = C(() => {
|
|
83
83
|
if (!(r != null && r.length))
|
|
84
84
|
return;
|
|
85
85
|
const i = r.map((t, e) => /* @__PURE__ */ n.jsx(
|
|
@@ -95,7 +95,7 @@ const b = ({
|
|
|
95
95
|
x,
|
|
96
96
|
{
|
|
97
97
|
type: "text",
|
|
98
|
-
className: t.danger ?
|
|
98
|
+
className: t.danger ? o : d,
|
|
99
99
|
onClick: t.onClick,
|
|
100
100
|
children: t == null ? void 0 : t.label
|
|
101
101
|
},
|
|
@@ -114,9 +114,9 @@ const b = ({
|
|
|
114
114
|
const N = t.render ?? ((z, S) => /* @__PURE__ */ n.jsx(M, { children: z }, S));
|
|
115
115
|
return N == null ? void 0 : N(s, e);
|
|
116
116
|
});
|
|
117
|
-
return
|
|
118
|
-
}, [
|
|
119
|
-
return /* @__PURE__ */ n.jsxs("div", { onClick: (i) => i.stopPropagation(), children: [
|
|
117
|
+
return a ? i : c;
|
|
118
|
+
}, [a, r]);
|
|
119
|
+
return /* @__PURE__ */ n.jsxs("div", { onClick: (i) => i.stopPropagation(), style: { overflow: "hidden" }, children: [
|
|
120
120
|
/* @__PURE__ */ n.jsx(I, { size: H, ref: p, className: "actionGroup", children: k ?? j }),
|
|
121
121
|
/* @__PURE__ */ n.jsx("div", { className: B })
|
|
122
122
|
] });
|
|
@@ -124,7 +124,7 @@ const b = ({
|
|
|
124
124
|
);
|
|
125
125
|
function $(m) {
|
|
126
126
|
var h;
|
|
127
|
-
const { actionGroup: l, loading: r, customActions: p, defaultWidth: f, ...y } = m,
|
|
127
|
+
const { actionGroup: l, loading: r, customActions: p, defaultWidth: f, ...y } = m, a = ((h = P.useToken().token.Table) == null ? void 0 : h.cellPaddingInline) ?? O, d = D(null), o = T(d), u = C(() => o != null && o.width ? o.width + a * 2 + 1 : f ?? 141, [o, a, f]);
|
|
128
128
|
return C(() => ({
|
|
129
129
|
width: Math.floor(u),
|
|
130
130
|
mobileHide: !0,
|
|
@@ -108,6 +108,7 @@ declare function useContainer(props: UseContainerProps): {
|
|
|
108
108
|
persistenceType: "online" | "localStorage" | "sessionStorage" | undefined;
|
|
109
109
|
persistenceKey: any;
|
|
110
110
|
onlineChange: ((key: any, ColumnsState: Record<string, ColumnsConfigProps>) => void) | undefined;
|
|
111
|
+
finish: boolean;
|
|
111
112
|
columnsMap: Record<string, ColumnsConfigProps>;
|
|
112
113
|
setColumnsMap: (updater: Record<string, ColumnsConfigProps> | ((origin: Record<string, ColumnsConfigProps>) => Record<string, ColumnsConfigProps>), ignoreDestroy?: boolean | undefined) => void;
|
|
113
114
|
defaultColumnKeyMap: Record<string, ColumnsConfigProps>;
|
|
@@ -147,6 +148,7 @@ declare const BitzTableContext: import("react").Context<{
|
|
|
147
148
|
persistenceType: "online" | "localStorage" | "sessionStorage" | undefined;
|
|
148
149
|
persistenceKey: any;
|
|
149
150
|
onlineChange: ((key: any, ColumnsState: Record<string, ColumnsConfigProps>) => void) | undefined;
|
|
151
|
+
finish: boolean;
|
|
150
152
|
columnsMap: Record<string, ColumnsConfigProps>;
|
|
151
153
|
setColumnsMap: (updater: Record<string, ColumnsConfigProps> | ((origin: Record<string, ColumnsConfigProps>) => Record<string, ColumnsConfigProps>), ignoreDestroy?: boolean | undefined) => void;
|
|
152
154
|
defaultColumnKeyMap: Record<string, ColumnsConfigProps>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { j as
|
|
1
|
+
import { j as Ve } from "../../../node_modules/.store/react@18.3.1/node_modules/react/jsx-runtime.mjs";
|
|
2
2
|
import { Table as le } from "antd";
|
|
3
|
-
import
|
|
4
|
-
import { createContext as
|
|
3
|
+
import v from "../../../hooks/useMergedState.mjs";
|
|
4
|
+
import { createContext as ve, useRef as ze, useState as K, useContext as Ne, useEffect as d, useMemo as g, useCallback as z } from "react";
|
|
5
5
|
import { genColumnKey as N } from "./utils/index.mjs";
|
|
6
|
-
import { getUuid as
|
|
7
|
-
import { BitzConfigContext as
|
|
6
|
+
import { getUuid as Ee } from "../../../utils/uuid.mjs";
|
|
7
|
+
import { BitzConfigContext as Ie } from "../../BitzConfigProvider/context.mjs";
|
|
8
8
|
import m from "../../../node_modules/.store/lodash-es@4.17.21/node_modules/lodash-es/merge.mjs";
|
|
9
|
-
const
|
|
9
|
+
const Je = {
|
|
10
10
|
fixed: "left",
|
|
11
11
|
className: "sorterCol",
|
|
12
12
|
isDragSorterCol: !0,
|
|
@@ -16,18 +16,18 @@ const Ee = {
|
|
|
16
16
|
onCell: () => ({
|
|
17
17
|
"data-column-name": "dragSorterCell"
|
|
18
18
|
})
|
|
19
|
-
},
|
|
20
|
-
|
|
19
|
+
}, Be = [
|
|
20
|
+
Je,
|
|
21
21
|
le.SELECTION_COLUMN,
|
|
22
22
|
le.EXPAND_COLUMN
|
|
23
23
|
];
|
|
24
|
-
function
|
|
25
|
-
var k, H, R, L, P, U, D, _, G, W, Z, A,
|
|
26
|
-
const T =
|
|
24
|
+
function je(e) {
|
|
25
|
+
var k, H, R, L, P, U, D, _, F, G, W, Z, A, X, q, Q, Y, $, p, ee, te, ne, ie, ae, oe;
|
|
26
|
+
const T = ze(Ee()), [fe, re] = K(!1), [se, ue] = K(!1), [de, ye] = K(0), s = Ne(Ie).Table, Se = s == null ? void 0 : s.defaultSize, E = e.size ?? e.defaultSize ?? Se ?? "lg", Ce = e.zebra ?? e.defaultZebra ?? (s == null ? void 0 : s.zebra) ?? !0, ge = e.bordered ?? e.defaultBordered ?? (s == null ? void 0 : s.bordered) ?? "row-column", O = e.defaultStylesConfig || {
|
|
27
27
|
size: E,
|
|
28
28
|
zebra: Ce,
|
|
29
29
|
bordered: ge
|
|
30
|
-
}, [y, I] =
|
|
30
|
+
}, [y, I] = v(
|
|
31
31
|
() => {
|
|
32
32
|
var n, c, l, a;
|
|
33
33
|
const { persistenceType: t, persistenceKey: i, onlineGet: o } = e.stylesConfigState || {};
|
|
@@ -44,7 +44,7 @@ function Je(e) {
|
|
|
44
44
|
console.warn(r);
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
return e.stylesConfig || ((l = e.stylesConfigState) == null ? void 0 : l.value) || ((a = e.stylesConfigState) == null ? void 0 : a.defaultValue) ||
|
|
47
|
+
return e.stylesConfig || ((l = e.stylesConfigState) == null ? void 0 : l.value) || ((a = e.stylesConfigState) == null ? void 0 : a.defaultValue) || O;
|
|
48
48
|
},
|
|
49
49
|
{
|
|
50
50
|
value: ((k = e.stylesConfigState) == null ? void 0 : k.value) || e.stylesConfig,
|
|
@@ -81,7 +81,7 @@ function Je(e) {
|
|
|
81
81
|
var f;
|
|
82
82
|
const a = m(l ?? {}, (f = e == null ? void 0 : e.stylesConfigState) == null ? void 0 : f.value);
|
|
83
83
|
I(
|
|
84
|
-
Object.keys(a).length ? a :
|
|
84
|
+
Object.keys(a).length ? a : O
|
|
85
85
|
);
|
|
86
86
|
});
|
|
87
87
|
} catch (l) {
|
|
@@ -89,7 +89,7 @@ function Je(e) {
|
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
}, []);
|
|
92
|
-
const u = g(() => (e.columns ?? []).filter((t) => !
|
|
92
|
+
const u = g(() => (e.columns ?? []).filter((t) => !Be.includes(t)), [e.columns]), x = g(() => {
|
|
93
93
|
var i;
|
|
94
94
|
if ((i = e == null ? void 0 : e.exportConfigState) != null && i.defaultValue)
|
|
95
95
|
return e.exportConfigState.defaultValue;
|
|
@@ -108,7 +108,7 @@ function Je(e) {
|
|
|
108
108
|
show: !0
|
|
109
109
|
});
|
|
110
110
|
}), t;
|
|
111
|
-
}, [u]), [
|
|
111
|
+
}, [u]), [V, h] = v(
|
|
112
112
|
() => {
|
|
113
113
|
var n, c, l, a;
|
|
114
114
|
const { persistenceType: t, persistenceKey: i, onlineGet: o } = e.exportConfigState || {};
|
|
@@ -165,15 +165,15 @@ function Je(e) {
|
|
|
165
165
|
if (t !== "online") {
|
|
166
166
|
const c = window[t];
|
|
167
167
|
try {
|
|
168
|
-
c == null || c.setItem(i, JSON.stringify(
|
|
168
|
+
c == null || c.setItem(i, JSON.stringify(V));
|
|
169
169
|
} catch (l) {
|
|
170
170
|
console.warn(l), j();
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
173
|
}, [
|
|
174
|
-
(
|
|
175
|
-
|
|
176
|
-
(
|
|
174
|
+
(F = e.exportConfigState) == null ? void 0 : F.persistenceKey,
|
|
175
|
+
V,
|
|
176
|
+
(G = e.exportConfigState) == null ? void 0 : G.persistenceType
|
|
177
177
|
]), d(() => {
|
|
178
178
|
var t, i, o;
|
|
179
179
|
if ((t = e.exportConfigState) != null && t.persistenceKey && ((i = e.exportConfigState) == null ? void 0 : i.persistenceType) === "online") {
|
|
@@ -197,15 +197,20 @@ function Je(e) {
|
|
|
197
197
|
return e.columnsState.defaultValue;
|
|
198
198
|
const t = u.filter((a) => a.fixed === "left").map((a, f) => ({ ...a, order: f })), i = u.filter((a) => a.fixed === "right").map((a, f) => ({ ...a, order: f })), o = u.filter((a) => !["left", "right"].includes(a.fixed)).map((a, f) => ({ ...a, order: f })), n = [...t, ...o, ...i], c = {};
|
|
199
199
|
return n.forEach((a, f) => {
|
|
200
|
-
const {
|
|
200
|
+
const {
|
|
201
|
+
order: r,
|
|
202
|
+
/*width,*/
|
|
203
|
+
fixed: Ke,
|
|
204
|
+
disabled: Oe
|
|
205
|
+
} = a, ce = N(a, f);
|
|
201
206
|
ce && (c[ce] = {
|
|
202
207
|
show: !0,
|
|
203
208
|
order: r,
|
|
204
|
-
fixed:
|
|
205
|
-
disabled:
|
|
209
|
+
fixed: Ke,
|
|
210
|
+
disabled: Oe
|
|
206
211
|
});
|
|
207
212
|
}), c;
|
|
208
|
-
}, [u]), [C, w] =
|
|
213
|
+
}, [u]), [me, we] = K(!1), [C, w] = v(
|
|
209
214
|
() => {
|
|
210
215
|
var n, c, l, a;
|
|
211
216
|
const { persistenceType: t, persistenceKey: i, onlineGet: o } = e.columnsState || {};
|
|
@@ -225,8 +230,8 @@ function Je(e) {
|
|
|
225
230
|
return e.columnsStateMap || ((l = e.columnsState) == null ? void 0 : l.value) || ((a = e.columnsState) == null ? void 0 : a.defaultValue) || {};
|
|
226
231
|
},
|
|
227
232
|
{
|
|
228
|
-
value: ((
|
|
229
|
-
onChange: ((
|
|
233
|
+
value: ((W = e.columnsState) == null ? void 0 : W.value) || e.columnsStateMap,
|
|
234
|
+
onChange: ((Z = e.columnsState) == null ? void 0 : Z.onChange) || e.onColumnsStateChange
|
|
230
235
|
}
|
|
231
236
|
);
|
|
232
237
|
d(() => {
|
|
@@ -247,7 +252,7 @@ function Je(e) {
|
|
|
247
252
|
}
|
|
248
253
|
}
|
|
249
254
|
}, [
|
|
250
|
-
(
|
|
255
|
+
(A = e.columnsState) == null ? void 0 : A.persistenceKey,
|
|
251
256
|
(X = e.columnsState) == null ? void 0 : X.persistenceType,
|
|
252
257
|
S
|
|
253
258
|
]);
|
|
@@ -311,7 +316,7 @@ function Je(e) {
|
|
|
311
316
|
(o = n == null ? void 0 : n(c)) == null || o.then((l) => {
|
|
312
317
|
var f;
|
|
313
318
|
const a = m(l ?? {}, (f = e == null ? void 0 : e.columnsState) == null ? void 0 : f.value);
|
|
314
|
-
w(a);
|
|
319
|
+
w(a), we(!0);
|
|
315
320
|
});
|
|
316
321
|
} catch (l) {
|
|
317
322
|
console.warn(l);
|
|
@@ -325,7 +330,7 @@ function Je(e) {
|
|
|
325
330
|
!(((i = C == null ? void 0 : C[c]) == null ? void 0 : i.fixed) === ((o = S == null ? void 0 : S[c]) == null ? void 0 : o.fixed)) && Object.keys(C ?? {}).length === 0 && w(S);
|
|
326
331
|
}
|
|
327
332
|
}, [S, C]);
|
|
328
|
-
const
|
|
333
|
+
const xe = g(() => (e == null ? void 0 : e.rowHoverable) ?? (s == null ? void 0 : s.rowHoverable) ?? !0, [e == null ? void 0 : e.rowHoverable, s == null ? void 0 : s.rowHoverable]), he = g(() => e.zebra ?? y.zebra, [e.zebra, y.zebra]), b = g(() => e.bordered ?? y.bordered, [e.bordered, y.bordered]), Te = g(() => ["column", "row-column"].includes(b), [b]), be = g(() => {
|
|
329
334
|
let t = !1;
|
|
330
335
|
return ["hide", "column"].includes(b) && (t = !0), t;
|
|
331
336
|
}, [b]), M = {
|
|
@@ -342,6 +347,7 @@ function Je(e) {
|
|
|
342
347
|
persistenceType: (Y = e.columnsState) == null ? void 0 : Y.persistenceType,
|
|
343
348
|
persistenceKey: ($ = e.columnsState) == null ? void 0 : $.persistenceKey,
|
|
344
349
|
onlineChange: (p = e.columnsState) == null ? void 0 : p.onlineChange,
|
|
350
|
+
finish: me,
|
|
345
351
|
columnsMap: C,
|
|
346
352
|
setColumnsMap: w,
|
|
347
353
|
defaultColumnKeyMap: S,
|
|
@@ -354,30 +360,30 @@ function Je(e) {
|
|
|
354
360
|
stylesStorageKey: (te = e.stylesConfigState) == null ? void 0 : te.persistenceKey,
|
|
355
361
|
onlineStylesConfigChange: (ne = e.stylesConfigState) == null ? void 0 : ne.onlineChange,
|
|
356
362
|
clearStylesConfigCache: B,
|
|
357
|
-
defaultTableStylesConfig:
|
|
358
|
-
exportConfig:
|
|
363
|
+
defaultTableStylesConfig: O,
|
|
364
|
+
exportConfig: V,
|
|
359
365
|
setTableExportConfig: h,
|
|
360
366
|
defaultTableExportConfig: x,
|
|
361
367
|
exportStorageType: (ie = e.exportConfigState) == null ? void 0 : ie.persistenceType,
|
|
362
368
|
exportStorageKey: (ae = e.exportConfigState) == null ? void 0 : ae.persistenceKey,
|
|
363
369
|
onlineExportConfigChange: (oe = e.exportConfigState) == null ? void 0 : oe.onlineChange,
|
|
364
370
|
clearExportConfigCache: j,
|
|
365
|
-
zebra:
|
|
366
|
-
rowHoverable:
|
|
367
|
-
showColumnBorder:
|
|
368
|
-
hideRowBorder:
|
|
371
|
+
zebra: he,
|
|
372
|
+
rowHoverable: xe,
|
|
373
|
+
showColumnBorder: Te,
|
|
374
|
+
hideRowBorder: be
|
|
369
375
|
};
|
|
370
376
|
return Object.defineProperty(M, "uuid", {
|
|
371
377
|
get: () => T.current
|
|
372
378
|
}), M;
|
|
373
379
|
}
|
|
374
|
-
const
|
|
375
|
-
const T =
|
|
376
|
-
return /* @__PURE__ */
|
|
380
|
+
const Me = ve({}), Fe = (e) => {
|
|
381
|
+
const T = je(e.initValue);
|
|
382
|
+
return /* @__PURE__ */ Ve.jsx(Me.Provider, { value: T, children: e.children });
|
|
377
383
|
};
|
|
378
384
|
export {
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
385
|
+
Me as BitzTableContext,
|
|
386
|
+
Je as SORTER_COLUMN,
|
|
387
|
+
Fe as default,
|
|
388
|
+
Be as toolCols
|
|
383
389
|
};
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import { ColumnsConfigProps } from '../../';
|
|
2
2
|
/** 删掉不应该显示的 */
|
|
3
|
-
export declare const loopFilter: (columns: any[], columnsMap: any) =>
|
|
4
|
-
filterColumns: any[];
|
|
5
|
-
hiddenTotalWidth: number;
|
|
6
|
-
autoWidthColLength: number;
|
|
7
|
-
};
|
|
3
|
+
export declare const loopFilter: (columns: any[], columnsMap: any, finish: boolean) => any[];
|
|
8
4
|
/**
|
|
9
5
|
* 生成列唯一key
|
|
10
6
|
*
|
|
@@ -1,42 +1,41 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
return {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
autoWidthColLength: r
|
|
1
|
+
const l = (e, i, x) => ((f, d) => f.map((t) => {
|
|
2
|
+
const s = u(t, t.index), o = d[s];
|
|
3
|
+
return o && o.show === !1 ? !1 : {
|
|
4
|
+
...t,
|
|
5
|
+
...o
|
|
6
|
+
// ...(item?.isOperationCol && !finish) && {
|
|
7
|
+
// width: item?.width,
|
|
8
|
+
// },
|
|
10
9
|
};
|
|
11
|
-
},
|
|
12
|
-
var
|
|
13
|
-
const { fixed:
|
|
14
|
-
if (
|
|
10
|
+
}))(e, i).filter(Boolean), u = (e, i) => "key" in e && e.key !== void 0 && e.key !== null ? e.key : e.dataIndex ? Array.isArray(e.dataIndex) ? e.dataIndex.join("-") : e.dataIndex : `${i}`, k = (e) => (i, x) => {
|
|
11
|
+
var r, y, a, c;
|
|
12
|
+
const { fixed: n, index: f } = i, { fixed: d, index: t } = x;
|
|
13
|
+
if (n === "left" && d !== "left" || d === "right" && n !== "right")
|
|
15
14
|
return -2;
|
|
16
|
-
if (
|
|
15
|
+
if (d === "left" && n !== "left" || n === "right" && d !== "right")
|
|
17
16
|
return 2;
|
|
18
|
-
const
|
|
19
|
-
return (
|
|
17
|
+
const s = i.key || `${f}`, o = x.key || `${t}`;
|
|
18
|
+
return (r = e[s]) != null && r.order || (y = e[o]) != null && y.order ? (((a = e[s]) == null ? void 0 : a.order) || 0) - (((c = e[o]) == null ? void 0 : c.order) || 0) : (i.index || 0) - (x.index || 0);
|
|
20
19
|
};
|
|
21
|
-
function
|
|
22
|
-
const
|
|
23
|
-
let
|
|
24
|
-
const
|
|
25
|
-
for (const
|
|
26
|
-
if (
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
...
|
|
30
|
-
[
|
|
20
|
+
function h(e, i, x) {
|
|
21
|
+
const n = {};
|
|
22
|
+
let f = "";
|
|
23
|
+
const d = (t, s, o) => {
|
|
24
|
+
for (const r in t)
|
|
25
|
+
if (t.hasOwnProperty(r) && (typeof t[r] == "object" && t[r] !== null && (f = r, n[r] = { ...t[r] }, d(t[r], s, o)), r === s)) {
|
|
26
|
+
const y = n[f];
|
|
27
|
+
n[f] = {
|
|
28
|
+
...y,
|
|
29
|
+
[s]: o
|
|
31
30
|
// [prop]: current.disabled || current.fixed ? true : val,
|
|
32
|
-
},
|
|
31
|
+
}, f = "";
|
|
33
32
|
}
|
|
34
33
|
};
|
|
35
|
-
return
|
|
34
|
+
return d(e, i, x), n;
|
|
36
35
|
}
|
|
37
36
|
export {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
k as columnSort,
|
|
38
|
+
u as genColumnKey,
|
|
39
|
+
l as loopFilter,
|
|
40
|
+
h as updateNestedObject
|
|
42
41
|
};
|
|
@@ -1,67 +1,76 @@
|
|
|
1
1
|
import { j as o } from "../../../node_modules/.store/react@18.3.1/node_modules/react/jsx-runtime.mjs";
|
|
2
|
-
import { Resizable as
|
|
3
|
-
import { useState as
|
|
4
|
-
import
|
|
5
|
-
const
|
|
6
|
-
const { hasScrollBar:
|
|
7
|
-
var t,
|
|
8
|
-
const e = { ...
|
|
9
|
-
return ((t = e.className) == null ? void 0 : t.includes("ant-table-cell-fix-right")) && !
|
|
10
|
-
}, [
|
|
11
|
-
if (!
|
|
2
|
+
import { Resizable as v } from "../../../node_modules/.store/react-resizable@3.0.5/node_modules/react-resizable/index.mjs";
|
|
3
|
+
import { useState as E, useMemo as R, useRef as i } from "react";
|
|
4
|
+
import O from "../../../node_modules/.store/classnames@2.5.1/node_modules/classnames/index.mjs";
|
|
5
|
+
const h = 56, H = (d) => {
|
|
6
|
+
const { hasScrollBar: b, scrollbarSize: x, onResize: y, width: n, datagridref: g, stretchref: a, ...S } = d, [P, p] = E(!1), m = R(() => {
|
|
7
|
+
var t, z;
|
|
8
|
+
const e = { ...S };
|
|
9
|
+
return ((t = e.className) == null ? void 0 : t.includes("ant-table-cell-fix-right")) && !b && ((z = e.style) != null && z.right) && (e.style = { ...e.style ?? {} }, e.style.right = Number(e.style.right ?? 0) - (x || 0)), e;
|
|
10
|
+
}, [d]), c = i(0), u = i(0), s = i(0), l = i(!1), f = R(() => c.current - n + h, [c.current, n]);
|
|
11
|
+
if (!n)
|
|
12
12
|
return /* @__PURE__ */ o.jsx("th", { ...m });
|
|
13
13
|
const j = (e) => {
|
|
14
|
-
let
|
|
14
|
+
let r = e.offsetLeft, t = e.offsetParent;
|
|
15
15
|
for (; t !== null; )
|
|
16
|
-
|
|
17
|
-
return { x:
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
u.current = !0;
|
|
16
|
+
r += t.offsetLeft, t = t.offsetParent;
|
|
17
|
+
return { x: r };
|
|
18
|
+
}, L = (e) => {
|
|
19
|
+
if (s.current = e.clientX - u.current, n + s.current - c.current <= h || s.current < f) {
|
|
20
|
+
l.current = !0;
|
|
22
21
|
return;
|
|
23
22
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
23
|
+
s.current >= f && l.current && (s.current = f, l.current = !1);
|
|
24
|
+
const t = a.current;
|
|
25
|
+
t.style.left = `${s.current}px`;
|
|
26
|
+
}, w = (e) => {
|
|
27
|
+
p(!0), s.current = 0;
|
|
28
|
+
const r = a.current;
|
|
29
|
+
r.style.opacity = 1, r.style.pointerEvents = "auto", u.current = j(g.current).x;
|
|
30
|
+
const t = e.clientX - u.current;
|
|
31
|
+
r.style.left = `${t}px`, c.current = t, s.current = t;
|
|
32
|
+
}, D = (e, r) => {
|
|
33
|
+
l.current = !1, p(!1);
|
|
34
|
+
const t = a.current;
|
|
35
|
+
t.style.opacity = 0, t.style.pointerEvents = "none", setTimeout(() => {
|
|
36
|
+
t.style.left = "0px";
|
|
37
|
+
}, 200), y(
|
|
38
|
+
e,
|
|
39
|
+
{
|
|
40
|
+
...r,
|
|
41
|
+
minWidth: h,
|
|
42
|
+
size: {
|
|
43
|
+
...r.size,
|
|
44
|
+
width: n + s.current - c.current
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
}, N = /* @__PURE__ */ o.jsx(
|
|
39
49
|
"span",
|
|
40
50
|
{
|
|
41
51
|
className: "bitzResizableHandle",
|
|
42
|
-
style: { transform: `translateX(${x}px)` },
|
|
43
52
|
onClick: (e) => {
|
|
44
53
|
e.stopPropagation(), e.preventDefault();
|
|
45
54
|
}
|
|
46
55
|
}
|
|
47
56
|
);
|
|
48
57
|
return /* @__PURE__ */ o.jsx(
|
|
49
|
-
|
|
58
|
+
v,
|
|
50
59
|
{
|
|
51
|
-
width:
|
|
60
|
+
width: n,
|
|
52
61
|
height: 0,
|
|
53
|
-
handle:
|
|
54
|
-
className:
|
|
62
|
+
handle: N,
|
|
63
|
+
className: O("bitzResizable", {
|
|
55
64
|
disabledUserSelect: P
|
|
56
65
|
}),
|
|
57
|
-
onResize:
|
|
58
|
-
onResizeStart:
|
|
59
|
-
onResizeStop:
|
|
66
|
+
onResize: L,
|
|
67
|
+
onResizeStart: w,
|
|
68
|
+
onResizeStop: D,
|
|
60
69
|
draggableOpts: { enableUserSelectHack: !1 },
|
|
61
70
|
children: /* @__PURE__ */ o.jsx("th", { ...m })
|
|
62
71
|
}
|
|
63
72
|
);
|
|
64
73
|
};
|
|
65
74
|
export {
|
|
66
|
-
|
|
75
|
+
H as default
|
|
67
76
|
};
|
|
@@ -62,6 +62,8 @@ export interface BitzTableProps<RecordType = any> extends Omit<TableProps<Record
|
|
|
62
62
|
enabledRowDragSort?: boolean;
|
|
63
63
|
/** PC端:拖拽结束 */
|
|
64
64
|
onRowDragEnd?: (newCols: RecordType[]) => void;
|
|
65
|
+
/** PC端:是否启用列宽拖拽 */
|
|
66
|
+
resizableColumns?: boolean;
|
|
65
67
|
/** 移动端:操作按钮 */
|
|
66
68
|
operationFilter?: ActionsFunType<RecordType>;
|
|
67
69
|
/** 移动端:加载更多返回函数 */
|