@baishuyun/ui-base 6.29.0 → 6.29.1
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/Amap/index.js +1 -1
- package/dist/Calendar/{Calendar-DHRiaiXw.js → Calendar-cXOw65UG.js} +1 -1
- package/dist/Calendar/index.js +3 -3
- package/dist/Card/index.js +1 -1
- package/dist/CheckBox/index.js +1 -1
- package/dist/ColorPicker/index.js +1 -1
- package/dist/ConfigProvider/index.js +1 -1
- package/dist/DatePicker/{DatePicker-BfyiYmTl.js → DatePicker-TimXurVT.js} +1 -1
- package/dist/DatePicker/{DatePickerPanel-D8qVQZ0a.js → DatePickerPanel-CfnP7Cpa.js} +1 -1
- package/dist/DatePicker/index.js +2 -2
- package/dist/DropDown/index.js +1 -1
- package/dist/Editor/index.js +1 -1
- package/dist/FieldCard/index.js +1 -1
- package/dist/Gantt/index.js +2 -2
- package/dist/Icon/index.js +1 -1
- package/dist/InputTag/index.js +1 -1
- package/dist/Kanban/index.js +1 -1
- package/dist/Loading/index.js +1 -1
- package/dist/Modal/index.js +1 -1
- package/dist/NotFoundContent/index.js +1 -1
- package/dist/Overlay/index.js +1 -1
- package/dist/Radio/index.js +1 -1
- package/dist/ScrollBar/index.js +1 -1
- package/dist/Segmented/index.js +1 -1
- package/dist/Select/index.js +1 -1
- package/dist/Table/{Table-BmPAWvbO.js → Table-BMqJZqBK.js} +396 -305
- package/dist/Table/index.js +2 -2
- package/dist/Tabs/index.js +1 -1
- package/dist/Tooltip/index.js +1 -1
- package/dist/Tree/index.js +1 -1
- package/dist/components/Table/components/TableBody.d.ts +1 -40
- package/dist/components/Table/hooks/useTableVirtual.d.ts +5 -1
- package/dist/components/Table/index.d.ts +1 -2
- package/dist/components/Table/interface.d.ts +39 -0
- package/dist/components/Table/utils/tableUtils.d.ts +1 -1
- package/dist/index.js +4 -4
- package/dist/style.css +1 -1
- package/dist/vendors/{version-BovtV-fV.js → version-Foao691n.js} +1 -1
- package/package.json +1 -1
|
@@ -41,28 +41,31 @@ var E = {
|
|
|
41
41
|
className: "bsy-row-height-auto",
|
|
42
42
|
height: "auto"
|
|
43
43
|
}
|
|
44
|
-
},
|
|
44
|
+
}, ee = {
|
|
45
45
|
ASC: "asc",
|
|
46
46
|
DESC: "desc",
|
|
47
47
|
NONE: null
|
|
48
|
-
},
|
|
48
|
+
}, j = {
|
|
49
49
|
wrapper: "custom-table-wrapper",
|
|
50
50
|
body: "custom-table-body"
|
|
51
|
-
},
|
|
51
|
+
}, M = (e = []) => e.flatMap((e) => e.children?.length ? e.children : [e]), N = (e, t) => t.findIndex((t) => e.isParent ? t.parentKey === e.key : t.key === e.key), P = (e, t, n, r = k.DEFAULT_WIDTH) => o(n === "left" ? t.slice(0, e) : t.slice(e + 1), (e) => e.width || r), F = (e, t, n) => n !== "left" && n !== "right" ? null : {
|
|
52
52
|
position: "sticky",
|
|
53
|
-
[n]:
|
|
53
|
+
[n]: P(e, t, n),
|
|
54
54
|
zIndex: 2
|
|
55
|
-
},
|
|
55
|
+
}, te = (e, t, n, r) => {
|
|
56
56
|
if (!t || !n) return e;
|
|
57
|
-
let i = n ===
|
|
57
|
+
let i = n === ee.DESC ? -1 : 1;
|
|
58
58
|
return [...e].sort((e, n) => {
|
|
59
59
|
let a = e[t], o = n[t];
|
|
60
60
|
return r ? r(a, o, e, n) * i : a === o ? 0 : a == null ? 1 : o == null ? -1 : typeof a == "string" && typeof o == "string" ? a.localeCompare(o) * i : (a < o ? -1 : 1) * i;
|
|
61
61
|
});
|
|
62
|
-
},
|
|
62
|
+
}, I = (e, t = "id", n) => {
|
|
63
|
+
if (!e) return n;
|
|
63
64
|
let r = e[t];
|
|
64
|
-
|
|
65
|
-
|
|
65
|
+
if (typeof r == "string" || typeof r == "number") return r;
|
|
66
|
+
let i = e.uniqueId ?? e._id ?? e.id;
|
|
67
|
+
return typeof i == "string" || typeof i == "number" ? i : n;
|
|
68
|
+
}, ne = (e) => {
|
|
66
69
|
let t = [], n = [], r = [];
|
|
67
70
|
return e.forEach((e, i) => {
|
|
68
71
|
let a = {
|
|
@@ -75,7 +78,7 @@ var E = {
|
|
|
75
78
|
normalColumns: n,
|
|
76
79
|
rightFixedColumns: r
|
|
77
80
|
};
|
|
78
|
-
},
|
|
81
|
+
}, L = (e, t = k.DEFAULT_WIDTH) => o(e, (e) => e.children?.length ? o(e.children, (e) => e.width || t) : e.width || t), re = (e, t) => {
|
|
79
82
|
if (Object.keys(t).length === 0) return e;
|
|
80
83
|
let n = (e) => {
|
|
81
84
|
let r = !1, i = e.map((e) => {
|
|
@@ -89,52 +92,60 @@ var E = {
|
|
|
89
92
|
return r ? i : e;
|
|
90
93
|
};
|
|
91
94
|
return n(e);
|
|
92
|
-
},
|
|
93
|
-
let n =
|
|
95
|
+
}, ie = (e, t) => {
|
|
96
|
+
let n = ne(e), r = L(e);
|
|
94
97
|
return {
|
|
95
98
|
...n,
|
|
96
|
-
fixedLeftWidth:
|
|
97
|
-
fixedRightWidth:
|
|
99
|
+
fixedLeftWidth: L(n.leftFixedColumns),
|
|
100
|
+
fixedRightWidth: L(n.rightFixedColumns),
|
|
98
101
|
totalColumnsWidth: r,
|
|
99
102
|
needSpacer: r < t
|
|
100
103
|
};
|
|
101
|
-
},
|
|
102
|
-
let u = _(null), d =
|
|
104
|
+
}, ae = Object.freeze({}), oe = d(({ column: e, style: t = ae, className: n = "", onResizeStart: r, isResizing: i = !1, resizable: a = !0, colSpan: o = 1, rowSpan: l = 1 }) => {
|
|
105
|
+
let u = _(null), d = _(null);
|
|
106
|
+
p(() => () => {
|
|
107
|
+
d.current?.(), d.current = null;
|
|
108
|
+
}, []);
|
|
109
|
+
let m = f((e) => {
|
|
103
110
|
u.current?.triggerClick?.(e);
|
|
104
|
-
}, []),
|
|
111
|
+
}, []), h = f((t) => {
|
|
105
112
|
if (!a || !r) return;
|
|
106
|
-
t.preventDefault(), t.stopPropagation();
|
|
107
|
-
let n = (e) => {
|
|
113
|
+
t.preventDefault(), t.stopPropagation(), d.current?.();
|
|
114
|
+
let n = null, i = (e) => {
|
|
108
115
|
e.preventDefault(), e.stopPropagation();
|
|
116
|
+
}, o = () => {
|
|
117
|
+
document.removeEventListener("click", i, !0), d.current = null, n !== null && (clearTimeout(n), n = null);
|
|
118
|
+
}, s = () => {
|
|
119
|
+
n = setTimeout(o, 0);
|
|
109
120
|
};
|
|
110
|
-
document.addEventListener("click",
|
|
111
|
-
|
|
112
|
-
},
|
|
121
|
+
document.addEventListener("click", i, !0), document.addEventListener("mouseup", s, { once: !0 }), d.current = () => {
|
|
122
|
+
document.removeEventListener("mouseup", s), o();
|
|
123
|
+
}, r(e.key, e.width || k.DEFAULT_WIDTH, t.clientX);
|
|
113
124
|
}, [
|
|
114
125
|
e.key,
|
|
115
126
|
e.width,
|
|
116
127
|
a,
|
|
117
128
|
r
|
|
118
|
-
]),
|
|
129
|
+
]), g = typeof e.header == "function" ? e.header(e, { menuRef: u }) : e.title;
|
|
119
130
|
return /* @__PURE__ */ c("th", {
|
|
120
131
|
className: `custom-table-header-cell ${n} `,
|
|
121
132
|
style: t,
|
|
122
133
|
colSpan: o > 1 ? o : void 0,
|
|
123
134
|
rowSpan: l > 1 ? l : void 0,
|
|
124
|
-
onClick:
|
|
135
|
+
onClick: m,
|
|
125
136
|
children: [/* @__PURE__ */ s("div", {
|
|
126
137
|
className: "header-cell-content",
|
|
127
|
-
children:
|
|
138
|
+
children: g
|
|
128
139
|
}), a ? /* @__PURE__ */ s("div", {
|
|
129
140
|
className: `resize-handle ${i ? "resizing" : ""}`,
|
|
130
|
-
onMouseDown:
|
|
141
|
+
onMouseDown: h
|
|
131
142
|
}) : null]
|
|
132
143
|
});
|
|
133
144
|
});
|
|
134
|
-
|
|
145
|
+
oe.displayName = "HeaderCell";
|
|
135
146
|
//#endregion
|
|
136
147
|
//#region src/components/Table/utils/flattenColumns.ts
|
|
137
|
-
var
|
|
148
|
+
var se = (e) => {
|
|
138
149
|
let t = [], n = [], r = (e, i = 0, a = null) => {
|
|
139
150
|
t[i] || (t[i] = []), e.forEach((e) => {
|
|
140
151
|
let o = e.children, s = e.fixed || a || void 0;
|
|
@@ -184,9 +195,9 @@ var ae = (e) => {
|
|
|
184
195
|
flatColumns: n,
|
|
185
196
|
headerRows: i
|
|
186
197
|
};
|
|
187
|
-
},
|
|
188
|
-
let p =
|
|
189
|
-
if (p) return
|
|
198
|
+
}, R = Object.freeze([]), ce = Object.freeze([]), z = u(({ columns: e = R, enableFixed: t = !1, height: n = E.HEADER_HEIGHT, resizingColumn: r = null, onResizeStart: i, resizable: a = !0, disabledResizeColumns: o = ce, totalColumnsWidth: l = 0, needSpacer: u = !1, headerRowSpan: d = 1 }, f) => {
|
|
199
|
+
let p = e.some((e) => !!(e.children && e.children.length > 0)), { flatColumns: m, headerRows: h } = g(() => {
|
|
200
|
+
if (p) return se(e);
|
|
190
201
|
let t = Math.max(1, d || 1);
|
|
191
202
|
if (t > 1) {
|
|
192
203
|
let n = [e.map((e) => ({
|
|
@@ -209,18 +220,51 @@ var ae = (e) => {
|
|
|
209
220
|
e,
|
|
210
221
|
p,
|
|
211
222
|
d
|
|
212
|
-
]), _ = (
|
|
213
|
-
let
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
}
|
|
217
|
-
|
|
223
|
+
]), _ = g(() => new Set(o), [o]), v = g(() => {
|
|
224
|
+
let e = /* @__PURE__ */ new Map(), t = m.length - 1, n = /* @__PURE__ */ new Map();
|
|
225
|
+
m.forEach((e, t) => {
|
|
226
|
+
n.set(e.key, t);
|
|
227
|
+
});
|
|
228
|
+
let r = /* @__PURE__ */ new Set();
|
|
229
|
+
return h.forEach((i) => {
|
|
230
|
+
i.forEach((i) => {
|
|
231
|
+
if (r.has(i.key)) return;
|
|
232
|
+
r.add(i.key);
|
|
233
|
+
let a = i.isParent ? m.findIndex((e) => e.parentKey === i.key) : n.get(i.key) ?? -1, o = i.align || "left", s = _.has(i.key), c = {
|
|
234
|
+
textAlign: o,
|
|
235
|
+
...F(a, m, i.fixed)
|
|
236
|
+
}, l = `custom-table-header-cell ${i.className || ""}`.trim();
|
|
237
|
+
i.fixed === "left" && (l += " fixed-left"), i.fixed === "right" && (l += " fixed-right"), a === 0 && (l += " first");
|
|
238
|
+
let u = a === t;
|
|
239
|
+
if (i.isParent) {
|
|
240
|
+
let e = -1;
|
|
241
|
+
for (let t = 0; t < m.length; t++) m[t].parentKey === i.key && (e = t);
|
|
242
|
+
u = e === t;
|
|
243
|
+
}
|
|
244
|
+
u && (l += " last"), e.set(i.key, {
|
|
245
|
+
style: c,
|
|
246
|
+
className: l,
|
|
247
|
+
isDisabled: s
|
|
248
|
+
});
|
|
249
|
+
});
|
|
250
|
+
}), e;
|
|
251
|
+
}, [
|
|
252
|
+
m,
|
|
253
|
+
h,
|
|
254
|
+
_
|
|
255
|
+
]), y = (e) => {
|
|
256
|
+
let t = v.get(e.key) || {
|
|
257
|
+
style: { textAlign: e.align || "left" },
|
|
258
|
+
className: `custom-table-header-cell ${e.className || ""}`.trim(),
|
|
259
|
+
isDisabled: _.has(e.key)
|
|
260
|
+
};
|
|
261
|
+
return /* @__PURE__ */ s(oe, {
|
|
218
262
|
column: e,
|
|
219
|
-
style:
|
|
220
|
-
className:
|
|
263
|
+
style: t.style,
|
|
264
|
+
className: t.className,
|
|
221
265
|
onResizeStart: i,
|
|
222
266
|
isResizing: r === e.key,
|
|
223
|
-
resizable: a && !e.children && !
|
|
267
|
+
resizable: a && !e.children && !t.isDisabled,
|
|
224
268
|
colSpan: e.colSpan,
|
|
225
269
|
rowSpan: e.rowSpan
|
|
226
270
|
}, e.key);
|
|
@@ -235,14 +279,15 @@ var ae = (e) => {
|
|
|
235
279
|
children: /* @__PURE__ */ c("table", {
|
|
236
280
|
style: {
|
|
237
281
|
tableLayout: "fixed",
|
|
238
|
-
minWidth: l
|
|
282
|
+
minWidth: l,
|
|
283
|
+
width: u ? "100%" : l
|
|
239
284
|
},
|
|
240
285
|
children: [/* @__PURE__ */ c("colgroup", { children: [m.map((e) => /* @__PURE__ */ s("col", { style: { width: e.width || k.DEFAULT_WIDTH } }, e.key)), u ? /* @__PURE__ */ s("col", {
|
|
241
286
|
className: "spacer-col",
|
|
242
287
|
style: { width: "auto" }
|
|
243
288
|
}) : null] }), /* @__PURE__ */ s("thead", { children: h.map((e, t) => e.length === 0 ? /* @__PURE__ */ s("tr", { style: { height: n } }, t) : /* @__PURE__ */ c("tr", {
|
|
244
289
|
style: { height: p || d > 1 ? n : "auto" },
|
|
245
|
-
children: [e.map((e) =>
|
|
290
|
+
children: [e.map((e) => y(e)), u && t === 0 ? /* @__PURE__ */ s("th", {
|
|
246
291
|
className: "custom-table-header-cell spacer-cell",
|
|
247
292
|
rowSpan: h.length
|
|
248
293
|
}) : null]
|
|
@@ -250,8 +295,8 @@ var ae = (e) => {
|
|
|
250
295
|
})
|
|
251
296
|
});
|
|
252
297
|
});
|
|
253
|
-
|
|
254
|
-
var
|
|
298
|
+
z.displayName = "TableHeader";
|
|
299
|
+
var le = d(z), ue = (e, t) => {
|
|
255
300
|
let n = t.name, r = t.children || [], i = 0;
|
|
256
301
|
for (let t = 0; t < e.length; t++) {
|
|
257
302
|
let a = e[t], o = Object.keys(a);
|
|
@@ -261,7 +306,7 @@ var se = d(oe), z = (e, t) => {
|
|
|
261
306
|
}) && (i = t + 1);
|
|
262
307
|
}
|
|
263
308
|
return i;
|
|
264
|
-
},
|
|
309
|
+
}, de = (e, t, n = "_id") => {
|
|
265
310
|
if (!e || e.length === 0) return [];
|
|
266
311
|
let r = t.filter((e) => !!(e.children && e.children.length > 0));
|
|
267
312
|
if (r.length === 0) return e.map((e) => ({
|
|
@@ -273,7 +318,7 @@ var se = d(oe), z = (e, t) => {
|
|
|
273
318
|
Object.entries(i).forEach(([e, t]) => {
|
|
274
319
|
let n = {};
|
|
275
320
|
r.forEach((e) => {
|
|
276
|
-
n[e.name] =
|
|
321
|
+
n[e.name] = ue(t, e);
|
|
277
322
|
}), o[e] = {
|
|
278
323
|
groupSize: t.length,
|
|
279
324
|
subformRowCounts: n
|
|
@@ -306,21 +351,22 @@ var se = d(oe), z = (e, t) => {
|
|
|
306
351
|
return t > 0 ? t : 0;
|
|
307
352
|
}
|
|
308
353
|
return 1;
|
|
309
|
-
},
|
|
310
|
-
let r =
|
|
354
|
+
}, V = (e, t) => B(e, t) > 0, H = (e, t, n) => {
|
|
355
|
+
let r = N(e, t), i = e.align || "left", a = F(r, t, n);
|
|
311
356
|
return {
|
|
312
357
|
column: e,
|
|
313
358
|
className: y("custom-table-cell", {
|
|
314
359
|
first: r === 0,
|
|
360
|
+
last: r >= 0 && r === t.length - 1,
|
|
315
361
|
fixed: !!n
|
|
316
|
-
}, e.className, e
|
|
362
|
+
}, e.className, e.type, e.colorEnable && "color-enable", e.regex === "barcode" && "bar-code", e.regex === "qrcode" && "qr-code"),
|
|
317
363
|
style: {
|
|
318
364
|
textAlign: i,
|
|
319
365
|
...a
|
|
320
366
|
}
|
|
321
367
|
};
|
|
322
|
-
},
|
|
323
|
-
let T = g(() =>
|
|
368
|
+
}, U = Object.freeze([]), fe = Object.freeze([]), pe = ({ leftFixedColumns: e = U, normalColumns: t = U, rightFixedColumns: n = U, dataSource: r = fe, rowKey: i = "id", rowHeight: a = E.ROW_HEIGHT, emptyText: o, onRowClick: l, onRow: u, onCell: d, totalColumnsWidth: p = 0, needSpacer: m = !1, rowRefCallback: h, isDynamicHeight: _ = !1, emptyRowContent: v, showEmptyRow: b = !0, startVirtualIndex: x, hideWhenEmpty: S = !1, wrapperClassName: C, forceRowHeight: w = !1 }) => {
|
|
369
|
+
let T = g(() => M(e), [e]), D = g(() => M(t), [t]), O = g(() => M(n), [n]), A = g(() => [
|
|
324
370
|
...T,
|
|
325
371
|
...D,
|
|
326
372
|
...O
|
|
@@ -328,8 +374,8 @@ var se = d(oe), z = (e, t) => {
|
|
|
328
374
|
T,
|
|
329
375
|
D,
|
|
330
376
|
O
|
|
331
|
-
]),
|
|
332
|
-
let e = T.map((e) =>
|
|
377
|
+
]), ee = g(() => {
|
|
378
|
+
let e = T.map((e) => H(e, A, "left")), t = D.map((e) => H(e, A, void 0)), n = O.map((e) => H(e, A, "right"));
|
|
333
379
|
return [
|
|
334
380
|
...e,
|
|
335
381
|
...t,
|
|
@@ -340,21 +386,25 @@ var se = d(oe), z = (e, t) => {
|
|
|
340
386
|
T,
|
|
341
387
|
D,
|
|
342
388
|
O
|
|
343
|
-
]),
|
|
389
|
+
]), j = f((e) => {
|
|
344
390
|
e && h && h(e);
|
|
345
|
-
}, [h]),
|
|
391
|
+
}, [h]), N = (e, t, n) => {
|
|
346
392
|
let { column: r, className: i, style: a } = e;
|
|
347
|
-
if (!
|
|
348
|
-
let o = B(t, r), c = r.dataIndex ? t[r.dataIndex] : void 0, l = r.render && typeof r.render == "function" ? r.render(c, t, n) : c, u =
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
style
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
393
|
+
if (!V(t, r)) return null;
|
|
394
|
+
let o = B(t, r), c = r.dataIndex ? t[r.dataIndex] : void 0, l = r.render && typeof r.render == "function" ? r.render(c, t, n) : c, u, f = i, p = a;
|
|
395
|
+
if (d && typeof d == "function") {
|
|
396
|
+
let e = d(c, t, r, n, {
|
|
397
|
+
className: i,
|
|
398
|
+
style: a
|
|
399
|
+
});
|
|
400
|
+
e && (u = e, e.className && e.className !== i && (f = `${i} ${e.className}`.trim()), e.style && e.style !== a && (p = {
|
|
401
|
+
...a,
|
|
402
|
+
...e.style
|
|
403
|
+
}));
|
|
404
|
+
}
|
|
405
|
+
return /* @__PURE__ */ s("td", {
|
|
406
|
+
className: f,
|
|
407
|
+
style: p,
|
|
358
408
|
rowSpan: o > 1 ? o : void 0,
|
|
359
409
|
...u,
|
|
360
410
|
children: /* @__PURE__ */ s("div", {
|
|
@@ -364,7 +414,7 @@ var se = d(oe), z = (e, t) => {
|
|
|
364
414
|
}, r.key);
|
|
365
415
|
};
|
|
366
416
|
if (S && r.length === 0) return null;
|
|
367
|
-
let
|
|
417
|
+
let P = () => v ?? /* @__PURE__ */ s("tr", {
|
|
368
418
|
className: "custom-table-empty-row",
|
|
369
419
|
children: /* @__PURE__ */ s("td", {
|
|
370
420
|
colSpan: A.length + (m ? 1 : 0),
|
|
@@ -375,19 +425,20 @@ var se = d(oe), z = (e, t) => {
|
|
|
375
425
|
},
|
|
376
426
|
children: o
|
|
377
427
|
})
|
|
378
|
-
}),
|
|
428
|
+
}), F = w || !_;
|
|
379
429
|
return /* @__PURE__ */ s("div", {
|
|
380
430
|
className: y("custom-table-body", C),
|
|
381
431
|
style: { minWidth: p },
|
|
382
432
|
children: /* @__PURE__ */ c("table", {
|
|
383
433
|
style: {
|
|
384
434
|
tableLayout: "fixed",
|
|
385
|
-
minWidth: p
|
|
435
|
+
minWidth: p,
|
|
436
|
+
width: m ? "100%" : p
|
|
386
437
|
},
|
|
387
438
|
children: [/* @__PURE__ */ c("colgroup", { children: [A.map((e) => /* @__PURE__ */ s("col", { style: { width: e.width || k.DEFAULT_WIDTH } }, e.key)), m ? /* @__PURE__ */ s("col", {
|
|
388
439
|
className: "spacer-col",
|
|
389
440
|
style: { width: "auto" }
|
|
390
|
-
}) : null] }), /* @__PURE__ */ s("tbody", { children: r.length === 0 ? b ?
|
|
441
|
+
}) : null] }), /* @__PURE__ */ s("tbody", { children: r.length === 0 ? b ? P() : null : r.map((e, t) => {
|
|
391
442
|
let n = {};
|
|
392
443
|
if (u && typeof u == "function") {
|
|
393
444
|
let r = u(e, t, {
|
|
@@ -402,24 +453,24 @@ var se = d(oe), z = (e, t) => {
|
|
|
402
453
|
}
|
|
403
454
|
let r = typeof x == "number" ? x + t : typeof e.dataIndex == "number" ? e.dataIndex : t;
|
|
404
455
|
return /* @__PURE__ */ c("tr", {
|
|
405
|
-
ref: _ ?
|
|
456
|
+
ref: _ ? j : void 0,
|
|
406
457
|
style: {
|
|
407
|
-
height:
|
|
458
|
+
height: F ? a : "auto",
|
|
408
459
|
...n.style
|
|
409
460
|
},
|
|
410
461
|
className: y("custom-table-row", n.className),
|
|
411
|
-
onClick: (n) => l
|
|
462
|
+
onClick: l ? (n) => l(e, t, n) : void 0,
|
|
412
463
|
"data-index": _ ? r : void 0,
|
|
413
464
|
...n,
|
|
414
|
-
children: [
|
|
415
|
-
},
|
|
465
|
+
children: [ee.map((n) => N(n, e, t)), m ? /* @__PURE__ */ s("td", { className: "spacer-cell" }) : null]
|
|
466
|
+
}, I(e, i, t));
|
|
416
467
|
}) })]
|
|
417
468
|
})
|
|
418
469
|
});
|
|
419
470
|
};
|
|
420
|
-
|
|
421
|
-
var
|
|
422
|
-
let d = g(() =>
|
|
471
|
+
pe.displayName = "TableBody";
|
|
472
|
+
var me = d(pe), he = Object.freeze([]), ge = Object.freeze({}), _e = ({ leftFixedColumns: e = he, normalColumns: t = he, rightFixedColumns: n = he, footerData: r = ge, summary: i, render: a, enableFixed: o = !0, totalColumnsWidth: l = 0, needSpacer: u = !1 }) => {
|
|
473
|
+
let d = g(() => M(e), [e]), f = g(() => M(t), [t]), p = g(() => M(n), [n]), m = g(() => [
|
|
423
474
|
...d,
|
|
424
475
|
...f,
|
|
425
476
|
...p
|
|
@@ -427,21 +478,33 @@ var de = d(ue), H = ({ leftFixedColumns: e = [], normalColumns: t = [], rightFix
|
|
|
427
478
|
d,
|
|
428
479
|
f,
|
|
429
480
|
p
|
|
430
|
-
]), h = (
|
|
431
|
-
let
|
|
432
|
-
|
|
433
|
-
let
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
481
|
+
]), h = g(() => {
|
|
482
|
+
let e = /* @__PURE__ */ new Map();
|
|
483
|
+
return m.forEach((t, n) => {
|
|
484
|
+
let r = { textAlign: t.align || "left" }, i = "custom-table-footer-cell";
|
|
485
|
+
if (o && t.fixed) {
|
|
486
|
+
let e = F(n, m, t.fixed);
|
|
487
|
+
e && (r = {
|
|
488
|
+
...r,
|
|
489
|
+
...e
|
|
490
|
+
}, i += t.fixed === "left" ? " fixed-left" : " fixed-right");
|
|
491
|
+
}
|
|
492
|
+
e.set(t.key, {
|
|
493
|
+
cellStyle: r,
|
|
494
|
+
cellClassName: i
|
|
495
|
+
});
|
|
496
|
+
}), e;
|
|
497
|
+
}, [m, o]), _ = (e) => {
|
|
498
|
+
let t = (e.dataIndex ? r?.[e.dataIndex] : void 0) ?? i?.[e.key], { renderFooter: n } = e, o = n && typeof n == "function" ? n(t, e) : a && typeof a == "function" ? a(t, e) : t, c = h.get(e.key) || {
|
|
499
|
+
cellStyle: { textAlign: e.align || "left" },
|
|
500
|
+
cellClassName: "custom-table-footer-cell"
|
|
501
|
+
};
|
|
439
502
|
return /* @__PURE__ */ s("td", {
|
|
440
|
-
className:
|
|
441
|
-
style:
|
|
503
|
+
className: c.cellClassName,
|
|
504
|
+
style: c.cellStyle,
|
|
442
505
|
children: /* @__PURE__ */ s("div", {
|
|
443
506
|
className: "cell-content",
|
|
444
|
-
children:
|
|
507
|
+
children: o
|
|
445
508
|
})
|
|
446
509
|
}, e.key);
|
|
447
510
|
};
|
|
@@ -454,51 +517,47 @@ var de = d(ue), H = ({ leftFixedColumns: e = [], normalColumns: t = [], rightFix
|
|
|
454
517
|
children: /* @__PURE__ */ c("table", {
|
|
455
518
|
style: {
|
|
456
519
|
tableLayout: "fixed",
|
|
457
|
-
minWidth: l
|
|
520
|
+
minWidth: l,
|
|
521
|
+
width: u ? "100%" : l
|
|
458
522
|
},
|
|
459
523
|
children: [/* @__PURE__ */ c("colgroup", { children: [m.map((e) => /* @__PURE__ */ s("col", { style: { width: e.width || k.DEFAULT_WIDTH } }, e.key)), u ? /* @__PURE__ */ s("col", {
|
|
460
524
|
className: "spacer-col",
|
|
461
525
|
style: { width: "auto" }
|
|
462
526
|
}) : null] }), /* @__PURE__ */ s("tfoot", { children: /* @__PURE__ */ c("tr", { children: [
|
|
463
|
-
d.map((e) =>
|
|
464
|
-
f.map((e) =>
|
|
465
|
-
p.map((e) =>
|
|
527
|
+
d.map((e) => _(e)),
|
|
528
|
+
f.map((e) => _(e)),
|
|
529
|
+
p.map((e) => _(e)),
|
|
466
530
|
u ? /* @__PURE__ */ s("td", { className: "spacer-cell" }) : null
|
|
467
531
|
] }) })]
|
|
468
532
|
})
|
|
469
533
|
});
|
|
470
534
|
};
|
|
471
|
-
|
|
472
|
-
var
|
|
473
|
-
function
|
|
535
|
+
_e.displayName = "TableFooter";
|
|
536
|
+
var ve = d(_e), W = [];
|
|
537
|
+
function ye(e, t, n) {
|
|
474
538
|
let r = x(e), a = x(t.estimateSize), o = t.rowHeight, s = t.minRowHeight || D.MIN_HEIGHT, c = t.maxRowHeight || D.MAX_HEIGHT, l = f((e) => {
|
|
475
539
|
let t = r.current ?? [], n = a.current;
|
|
476
540
|
if (typeof n == "function") return n(e, t[e]);
|
|
477
541
|
let l = t[e];
|
|
478
|
-
return l && typeof l.rowHeight == "number" ? i(l.rowHeight, s, c) :
|
|
542
|
+
return l && typeof l.rowHeight == "number" ? i(l.rowHeight, s, c) : o === "auto" ? D.MIN_HEIGHT : typeof o == "function" ? i(o(e), s, c) : typeof o == "number" ? i(o, s, c) : D.MIN_HEIGHT;
|
|
479
543
|
}, [
|
|
480
544
|
o,
|
|
481
545
|
s,
|
|
482
546
|
c,
|
|
483
547
|
a,
|
|
484
548
|
r
|
|
485
|
-
]), u =
|
|
549
|
+
]), u = t.enabled ?? e.length > O.ENABLE_AUTO_SIZE, d = t.dynamicHeight ?? o === "auto", m = _(/* @__PURE__ */ new Map()), h = _(null), v = g(() => {
|
|
486
550
|
if (e.length === 0) return null;
|
|
487
|
-
let
|
|
488
|
-
return `${String(
|
|
489
|
-
}, [e]);
|
|
551
|
+
let n = I(e[0], t.rowKey, 0), r = I(e[e.length - 1], t.rowKey, e.length - 1);
|
|
552
|
+
return `${String(n)}-${String(r)}-${e.length}`;
|
|
553
|
+
}, [e, t.rowKey]);
|
|
490
554
|
p(() => {
|
|
491
|
-
h.current !== null && h.current !== v && m.current.clear(), h.current = v;
|
|
492
|
-
}, [v]), p(() => {
|
|
493
555
|
let e = m.current;
|
|
494
556
|
return () => {
|
|
495
557
|
e.clear();
|
|
496
558
|
};
|
|
497
559
|
}, []);
|
|
498
|
-
let y = f((e) => {
|
|
499
|
-
let t = r.current ?? [];
|
|
500
|
-
return t[e]?.uniqueId || t[e]?._id || t[e]?.id || `table-row-${e}`;
|
|
501
|
-
}, [r]), b = T({
|
|
560
|
+
let y = f((e) => I((r.current ?? [])[e], t.rowKey, e), [t.rowKey, r]), b = T({
|
|
502
561
|
count: u ? e.length : 0,
|
|
503
562
|
getScrollElement: () => n.current,
|
|
504
563
|
estimateSize: l,
|
|
@@ -513,21 +572,25 @@ function pe(e, t, n) {
|
|
|
513
572
|
return n.set(t, a), a;
|
|
514
573
|
} : void 0,
|
|
515
574
|
getItemKey: y
|
|
516
|
-
})
|
|
575
|
+
});
|
|
576
|
+
p(() => {
|
|
577
|
+
h.current !== null && h.current !== v && (m.current.clear(), typeof b.measure == "function" && b.measure()), h.current = v;
|
|
578
|
+
}, [v, b]);
|
|
579
|
+
let C = u ? b.getTotalSize() : 0, w = u ? b.getVirtualItems() : W, E = u && w.length > 0 && w[0].start || 0, k = u && w.length > 0 ? C - (w[w.length - 1].end || 0) : 0, A = S(() => {
|
|
517
580
|
m.current.clear(), typeof b.measure == "function" && b.measure();
|
|
518
|
-
}),
|
|
581
|
+
}), ee = S((e) => {
|
|
519
582
|
if (e === void 0) {
|
|
520
|
-
m.current.clear();
|
|
583
|
+
m.current.clear(), typeof b.measure == "function" && b.measure();
|
|
521
584
|
return;
|
|
522
585
|
}
|
|
523
|
-
let
|
|
524
|
-
|
|
525
|
-
if (typeof e == "number")
|
|
586
|
+
let n = Array.isArray(e) ? e : [e], i = m.current, a = r.current ?? [];
|
|
587
|
+
n.forEach((e) => {
|
|
588
|
+
if (typeof e == "number") i.delete(String(e));
|
|
526
589
|
else {
|
|
527
|
-
let
|
|
528
|
-
|
|
590
|
+
let n = a.findIndex((n, r) => I(n, t.rowKey, r) === e);
|
|
591
|
+
n !== -1 && i.delete(String(n));
|
|
529
592
|
}
|
|
530
|
-
});
|
|
593
|
+
}), typeof b.measure == "function" && b.measure();
|
|
531
594
|
});
|
|
532
595
|
return {
|
|
533
596
|
enabled: u,
|
|
@@ -537,11 +600,11 @@ function pe(e, t, n) {
|
|
|
537
600
|
paddingTop: E,
|
|
538
601
|
paddingBottom: k,
|
|
539
602
|
remeasure: A,
|
|
540
|
-
clearRowHeightCache:
|
|
603
|
+
clearRowHeightCache: ee,
|
|
541
604
|
isDynamicHeight: d
|
|
542
605
|
};
|
|
543
606
|
}
|
|
544
|
-
function
|
|
607
|
+
function be(e, t, n, r) {
|
|
545
608
|
let i = n ? t.map((t) => {
|
|
546
609
|
let n = e[t.index];
|
|
547
610
|
return n && {
|
|
@@ -556,14 +619,14 @@ function me(e, t, n, r) {
|
|
|
556
619
|
}
|
|
557
620
|
//#endregion
|
|
558
621
|
//#region src/components/Table/hooks/useColumnResize.ts
|
|
559
|
-
function
|
|
622
|
+
function G(e = {}) {
|
|
560
623
|
let { minColumnWidth: t = k.MIN_WIDTH, maxColumnWidth: n = k.MAX_WIDTH, onColumnResize: r, onColumnResizeEnd: a } = e, [o, s] = v(null), c = x(o), l = x(r), u = x(a), d = S((e, t, n) => {
|
|
561
624
|
s({
|
|
562
625
|
columnKey: e,
|
|
563
626
|
startWidth: t,
|
|
564
627
|
startX: n
|
|
565
628
|
});
|
|
566
|
-
}), f = (e, r) => i(r.startWidth + e - r.startX, t, n);
|
|
629
|
+
}), f = (e, r) => Math.round(i(r.startWidth + e - r.startX, t, n));
|
|
567
630
|
return b("mousemove", (e) => {
|
|
568
631
|
let t = c.current;
|
|
569
632
|
t && l.current?.(e, t.columnKey, f(e.clientX, t));
|
|
@@ -584,11 +647,11 @@ function he(e = {}) {
|
|
|
584
647
|
}
|
|
585
648
|
//#endregion
|
|
586
649
|
//#region src/components/Table/hooks/useTableColumnWidths.ts
|
|
587
|
-
var
|
|
588
|
-
function
|
|
589
|
-
let
|
|
650
|
+
var xe = {};
|
|
651
|
+
function Se({ columns: e, scrollRef: t, minColumnWidth: n, maxColumnWidth: r, onColumnResize: i, onColumnResizeEnd: a }) {
|
|
652
|
+
let o = _(null), s = _(/* @__PURE__ */ new Map()), c = _(/* @__PURE__ */ new Map()), l = _(null), [u, d] = v(xe), f = g(() => M(e), [e]), m = g(() => re(e, u), [e, u]), h = g(() => M(m), [m]);
|
|
590
653
|
p(() => {
|
|
591
|
-
let e =
|
|
654
|
+
let e = c.current, t = /* @__PURE__ */ new Map();
|
|
592
655
|
for (let e of f) t.set(e.key, e.width || k.DEFAULT_WIDTH);
|
|
593
656
|
d((n) => {
|
|
594
657
|
let r = Object.keys(n);
|
|
@@ -606,31 +669,33 @@ function _e({ columns: e, scrollRef: t, minColumnWidth: n, maxColumnWidth: r, on
|
|
|
606
669
|
return i ? a : n;
|
|
607
670
|
});
|
|
608
671
|
for (let [n, r] of t) {
|
|
609
|
-
let t = e.get(n), i =
|
|
610
|
-
(i === void 0 || t !== void 0 && t !== r || i === r) &&
|
|
672
|
+
let t = e.get(n), i = s.current.get(n);
|
|
673
|
+
(i === void 0 || t !== void 0 && t !== r || i === r) && s.current.set(n, r);
|
|
611
674
|
}
|
|
612
|
-
|
|
675
|
+
c.current = t;
|
|
613
676
|
}, [f]);
|
|
614
|
-
let y = S((e) =>
|
|
677
|
+
let y = S((e) => s.current.get(e.key) || e.width || k.DEFAULT_WIDTH), b = S((e) => {
|
|
615
678
|
let n = h.findIndex((t) => t.key === e);
|
|
616
679
|
if (n === -1) return 0;
|
|
617
|
-
let r = h[n], i =
|
|
680
|
+
let r = h[n], i = 0;
|
|
681
|
+
for (let e = 0; e <= n; e++) i += y(h[e]);
|
|
618
682
|
return r.fixed === "left" ? i : i - (t.current?.scrollLeft || 0);
|
|
619
683
|
}), x = S((e) => {
|
|
620
|
-
|
|
684
|
+
o.current && (o.current.style.display = "block", o.current.style.left = `${e}px`);
|
|
621
685
|
}), C = S((e, t) => {
|
|
622
|
-
|
|
686
|
+
s.current.set(e, t), d((n) => n[e] === t ? n : {
|
|
623
687
|
...n,
|
|
624
688
|
[e]: t
|
|
625
689
|
});
|
|
626
|
-
}), { isResizing: w, resizingColumn: T, startResize: E } =
|
|
690
|
+
}), { isResizing: w, resizingColumn: T, startResize: E } = G({
|
|
627
691
|
minColumnWidth: n || k.MIN_WIDTH,
|
|
628
692
|
maxColumnWidth: r || k.MAX_WIDTH,
|
|
629
693
|
onColumnResizeEnd: S((e, t) => {
|
|
630
|
-
C(e, t), a?.(e, t,
|
|
694
|
+
l.current = null, C(e, t), a?.(e, t, s.current), o.current && (o.current.style.display = "none");
|
|
631
695
|
}),
|
|
632
696
|
onColumnResize: S((e, t, n) => {
|
|
633
|
-
|
|
697
|
+
let r = l.current;
|
|
698
|
+
!r || r.columnKey !== t || (x(r.left + n - r.startWidth), i?.(t, n, s.current));
|
|
634
699
|
})
|
|
635
700
|
});
|
|
636
701
|
return {
|
|
@@ -639,18 +704,30 @@ function _e({ columns: e, scrollRef: t, minColumnWidth: n, maxColumnWidth: r, on
|
|
|
639
704
|
isResizing: w,
|
|
640
705
|
resizingColumn: T,
|
|
641
706
|
handleResizeStart: S((e, t, n) => {
|
|
642
|
-
|
|
707
|
+
let r = b(e);
|
|
708
|
+
l.current = {
|
|
709
|
+
columnKey: e,
|
|
710
|
+
left: r,
|
|
711
|
+
startWidth: t
|
|
712
|
+
}, x(r), E(e, t, n);
|
|
643
713
|
}),
|
|
644
|
-
resizeHandleRef:
|
|
714
|
+
resizeHandleRef: o
|
|
645
715
|
};
|
|
646
716
|
}
|
|
647
717
|
//#endregion
|
|
648
718
|
//#region src/components/Table/hooks/useTableViewport.ts
|
|
649
|
-
|
|
650
|
-
|
|
719
|
+
var Ce = {
|
|
720
|
+
elementWidth: 0,
|
|
721
|
+
viewportClientHeight: 0,
|
|
722
|
+
scrollOffset: {
|
|
651
723
|
left: 0,
|
|
652
724
|
top: 0
|
|
653
|
-
}
|
|
725
|
+
},
|
|
726
|
+
headerHeight: E.HEADER_HEIGHT,
|
|
727
|
+
hasYScroll: !1
|
|
728
|
+
};
|
|
729
|
+
function we({ scrollRef: e, tableHeaderRef: t, bordered: n, hasFooter: r, headerRowSpan: i, dataSourceLength: a, overlayScrollbarOptions: o }) {
|
|
730
|
+
let s = C(e), c = s?.height ?? 0, [l, u] = v(Ce), [d] = w({ options: {
|
|
654
731
|
overflow: {
|
|
655
732
|
x: o?.overflowX ?? "scroll",
|
|
656
733
|
y: o?.overflowY ?? "scroll"
|
|
@@ -661,19 +738,27 @@ function ve({ scrollRef: e, tableHeaderRef: t, bordered: n, hasFooter: r, header
|
|
|
661
738
|
autoHideDelay: 400
|
|
662
739
|
}
|
|
663
740
|
} });
|
|
664
|
-
|
|
741
|
+
h(() => {
|
|
665
742
|
if (!e.current) return;
|
|
666
743
|
let t = e.current, n = t.parentElement;
|
|
667
|
-
n &&
|
|
744
|
+
n && d({
|
|
668
745
|
target: n,
|
|
669
746
|
elements: { viewport: t }
|
|
670
747
|
});
|
|
671
|
-
}, [
|
|
748
|
+
}, [d, e]), h(() => {
|
|
672
749
|
let n = e.current;
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
750
|
+
if (!n) return;
|
|
751
|
+
let r = n.clientWidth, i = n.clientHeight, a = n.offsetLeft, o = n.offsetTop, s = t.current?.clientHeight || E.HEADER_HEIGHT, c = n.scrollHeight > n.clientHeight;
|
|
752
|
+
u((e) => e.elementWidth === r && e.viewportClientHeight === i && e.scrollOffset.left === a && e.scrollOffset.top === o && e.headerHeight === s && e.hasYScroll === c ? e : {
|
|
753
|
+
elementWidth: r,
|
|
754
|
+
viewportClientHeight: i,
|
|
755
|
+
scrollOffset: {
|
|
756
|
+
left: a,
|
|
757
|
+
top: o
|
|
758
|
+
},
|
|
759
|
+
headerHeight: s,
|
|
760
|
+
hasYScroll: c
|
|
761
|
+
});
|
|
677
762
|
}, [
|
|
678
763
|
s?.width,
|
|
679
764
|
s?.height,
|
|
@@ -682,203 +767,209 @@ function ve({ scrollRef: e, tableHeaderRef: t, bordered: n, hasFooter: r, header
|
|
|
682
767
|
i,
|
|
683
768
|
e,
|
|
684
769
|
t
|
|
685
|
-
])
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
770
|
+
]);
|
|
771
|
+
let f = s?.width || l.elementWidth, p = g(() => {
|
|
772
|
+
if (!c || !l.viewportClientHeight) return;
|
|
773
|
+
let e = n ? 2 : 0, t = l.viewportClientHeight - l.headerHeight - (r ? E.HEADER_HEIGHT : 0) - e;
|
|
774
|
+
return Math.max(0, t);
|
|
775
|
+
}, [
|
|
776
|
+
c,
|
|
777
|
+
l.viewportClientHeight,
|
|
778
|
+
l.headerHeight,
|
|
779
|
+
r,
|
|
780
|
+
n
|
|
781
|
+
]);
|
|
782
|
+
return {
|
|
783
|
+
elementWidth: f,
|
|
784
|
+
hasYScroll: l.hasYScroll,
|
|
785
|
+
scrollOffset: l.scrollOffset,
|
|
786
|
+
headerHeight: l.headerHeight,
|
|
787
|
+
bodyMinHeight: p
|
|
701
788
|
};
|
|
702
789
|
}
|
|
703
790
|
//#endregion
|
|
704
791
|
//#region src/components/Table/style/resolveTableThemeVars.ts
|
|
705
|
-
var
|
|
792
|
+
var Te = (e) => {
|
|
706
793
|
if (!e) return {};
|
|
707
794
|
let t = {};
|
|
708
795
|
return n(t, "--bsy-table-color-border", e.colorBorder), n(t, "--bsy-table-color-bg-header", e.colorBgHeader), n(t, "--bsy-table-color-bg-container", e.colorBgContainer), n(t, "--bsy-table-color-text", e.colorText), n(t, "--bsy-table-color-text-heading", e.colorTextHeading), n(t, "--bsy-table-color-bg-row-hover", e.colorBgRowHover), t;
|
|
709
|
-
},
|
|
796
|
+
}, Ee = Object.freeze([]), De = Object.freeze({
|
|
710
797
|
left: !0,
|
|
711
798
|
right: !0
|
|
712
|
-
},
|
|
713
|
-
let { t:
|
|
714
|
-
scrollRef:
|
|
799
|
+
}), Oe = Object.freeze([]), ke = Object.freeze([]), Ae = u(({ columns: e = Oe, dataSource: n = ke, rowKey: r = "id", height: i, bordered: a = !0, emptyText: o, onRowClick: u, scroll: d, footerData: f, footerSummary: h, renderFooter: v, hasFooter: y = !1, onRow: b, onCell: x, rowHeightStyle: S = "low", resizable: C = !0, disabledResizeColumns: w = Ee, minColumnWidth: T, maxColumnWidth: D, onColumnResize: k, onColumnResizeEnd: ee, renderBody: j, estimateSize: M, virtualEnabled: N, dataProcessor: P, headerRowSpan: F, fixedShadowMask: te = De, onRenderEmpty: I, overlayScrollbarOptions: ne, wrapperStyle: L, theme: re }, ae) => {
|
|
800
|
+
let { t: oe } = t(), se = g(() => Te(re), [re]), R = _(null), ce = _(null), { elementWidth: z, hasYScroll: ue, scrollOffset: de, headerHeight: B, bodyMinHeight: V } = we({
|
|
801
|
+
scrollRef: R,
|
|
715
802
|
tableHeaderRef: ce,
|
|
716
803
|
bordered: a,
|
|
717
804
|
hasFooter: y,
|
|
718
|
-
headerRowSpan:
|
|
805
|
+
headerRowSpan: F,
|
|
719
806
|
dataSourceLength: n.length,
|
|
720
|
-
overlayScrollbarOptions:
|
|
721
|
-
}), { sizedColumns:
|
|
807
|
+
overlayScrollbarOptions: ne
|
|
808
|
+
}), { sizedColumns: H, flatColumns: U, isResizing: fe, resizingColumn: pe, handleResizeStart: he, resizeHandleRef: ge } = Se({
|
|
722
809
|
columns: e,
|
|
723
|
-
scrollRef:
|
|
810
|
+
scrollRef: R,
|
|
724
811
|
minColumnWidth: T,
|
|
725
812
|
maxColumnWidth: D,
|
|
726
813
|
onColumnResize: k,
|
|
727
|
-
onColumnResizeEnd:
|
|
728
|
-
}), { className:
|
|
729
|
-
rowHeight:
|
|
814
|
+
onColumnResizeEnd: ee
|
|
815
|
+
}), { className: _e, height: W } = A[S] || A.auto, { virtualRows: G, totalHeight: xe, paddingTop: Ce, paddingBottom: Ae, remeasure: K, rowRefCallback: q, isDynamicHeight: je, clearRowHeightCache: Me, enabled: Ne } = ye(n, g(() => ({
|
|
816
|
+
rowHeight: W,
|
|
817
|
+
dynamicHeight: S === "auto",
|
|
818
|
+
rowKey: r,
|
|
730
819
|
overscan: O.DEFAULT_OVERSCAN,
|
|
731
|
-
estimateSize:
|
|
732
|
-
...
|
|
820
|
+
estimateSize: M,
|
|
821
|
+
...N === void 0 ? {} : { enabled: N }
|
|
733
822
|
}), [
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
823
|
+
W,
|
|
824
|
+
S,
|
|
825
|
+
r,
|
|
826
|
+
M,
|
|
827
|
+
N
|
|
828
|
+
]), R);
|
|
829
|
+
m(ae, () => ({
|
|
830
|
+
clearRowHeightCache: Me,
|
|
831
|
+
remeasure: K
|
|
832
|
+
}), [Me, K]);
|
|
833
|
+
let Pe = o || oe(E.EMPTY_TEXT_KEY);
|
|
743
834
|
p(() => {
|
|
744
|
-
|
|
745
|
-
}, [
|
|
746
|
-
let { leftFixedColumns:
|
|
747
|
-
|
|
748
|
-
|
|
835
|
+
K?.();
|
|
836
|
+
}, [W, K]);
|
|
837
|
+
let { leftFixedColumns: J, normalColumns: Y, rightFixedColumns: X, fixedLeftWidth: Fe, fixedRightWidth: Z, totalColumnsWidth: Q, needSpacer: $ } = g(() => ie(H, z), [H, z]), Ie = g(() => be(n, G, Ne, P), [
|
|
838
|
+
Ne,
|
|
839
|
+
G,
|
|
749
840
|
n,
|
|
750
|
-
|
|
751
|
-
]),
|
|
841
|
+
P
|
|
842
|
+
]), Le = g(() => {
|
|
752
843
|
let e = {};
|
|
753
844
|
return a ? e.border = "1px solid var(--bsy-table-color-border, var(--bsy-base-border-color, #e0e0e0))" : e.border = "none", (i || d?.y) && (e.maxHeight = i || d?.y), e;
|
|
754
845
|
}, [
|
|
755
846
|
a,
|
|
756
847
|
i,
|
|
757
848
|
d
|
|
758
|
-
]),
|
|
759
|
-
if (!
|
|
760
|
-
let e =
|
|
761
|
-
l.isValidElement(e) && e.type === "tr" ?
|
|
849
|
+
]), Re = !!(i || d?.y), ze, Be, Ve = !0;
|
|
850
|
+
if (!j && n.length === 0 && typeof I == "function") {
|
|
851
|
+
let e = I();
|
|
852
|
+
l.isValidElement(e) && e.type === "tr" ? ze = e : e && (Be = e, Ve = !1);
|
|
762
853
|
}
|
|
763
854
|
return /* @__PURE__ */ c("div", {
|
|
764
|
-
className: `custom-table ${
|
|
855
|
+
className: `custom-table ${ue ? "has-y-scroll" : ""}`,
|
|
765
856
|
style: {
|
|
766
857
|
position: "relative",
|
|
767
858
|
height: "100%",
|
|
768
|
-
...
|
|
859
|
+
...se
|
|
769
860
|
},
|
|
770
861
|
"data-overlayscrollbars-initialize": "",
|
|
771
862
|
children: [
|
|
772
863
|
/* @__PURE__ */ c("div", {
|
|
773
|
-
ref:
|
|
774
|
-
className: `custom-table-wrapper ${
|
|
864
|
+
ref: R,
|
|
865
|
+
className: `custom-table-wrapper ${fe ? "resizing" : ""} ${_e} os-enabled`,
|
|
775
866
|
style: {
|
|
776
|
-
...
|
|
777
|
-
...
|
|
867
|
+
...Le,
|
|
868
|
+
...L
|
|
778
869
|
},
|
|
779
870
|
children: [
|
|
780
|
-
/* @__PURE__ */ s(
|
|
871
|
+
/* @__PURE__ */ s(le, {
|
|
781
872
|
ref: ce,
|
|
782
|
-
columns:
|
|
783
|
-
enableFixed:
|
|
873
|
+
columns: H,
|
|
874
|
+
enableFixed: Re,
|
|
784
875
|
height: E.HEADER_HEIGHT,
|
|
785
|
-
resizingColumn:
|
|
786
|
-
onResizeStart: C ?
|
|
876
|
+
resizingColumn: pe,
|
|
877
|
+
onResizeStart: C ? he : void 0,
|
|
787
878
|
resizable: C,
|
|
788
879
|
disabledResizeColumns: w,
|
|
789
|
-
totalColumnsWidth:
|
|
880
|
+
totalColumnsWidth: Q,
|
|
790
881
|
needSpacer: $,
|
|
791
|
-
headerRowSpan:
|
|
882
|
+
headerRowSpan: F
|
|
792
883
|
}),
|
|
793
884
|
/* @__PURE__ */ s("div", {
|
|
794
885
|
className: "custom-table-body-wrapper",
|
|
795
886
|
style: { position: "relative" },
|
|
796
887
|
children: /* @__PURE__ */ s("div", {
|
|
797
888
|
style: {
|
|
798
|
-
minHeight:
|
|
799
|
-
height:
|
|
800
|
-
paddingBottom:
|
|
801
|
-
paddingTop:
|
|
889
|
+
minHeight: V,
|
|
890
|
+
height: xe,
|
|
891
|
+
paddingBottom: Ae > 0 ? `${Ae}px` : void 0,
|
|
892
|
+
paddingTop: Ce > 0 ? `${Ce}px` : void 0,
|
|
802
893
|
position: "relative"
|
|
803
894
|
},
|
|
804
|
-
children:
|
|
805
|
-
columns:
|
|
806
|
-
flatColumns:
|
|
807
|
-
leftFixedColumns:
|
|
808
|
-
normalColumns:
|
|
809
|
-
rightFixedColumns:
|
|
810
|
-
totalColumnsWidth:
|
|
895
|
+
children: j ? j({
|
|
896
|
+
columns: H,
|
|
897
|
+
flatColumns: U,
|
|
898
|
+
leftFixedColumns: J,
|
|
899
|
+
normalColumns: Y,
|
|
900
|
+
rightFixedColumns: X,
|
|
901
|
+
totalColumnsWidth: Q,
|
|
811
902
|
needSpacer: $,
|
|
812
|
-
rowRefCallback:
|
|
813
|
-
isDynamicHeight:
|
|
814
|
-
rowHeight:
|
|
903
|
+
rowRefCallback: q,
|
|
904
|
+
isDynamicHeight: je,
|
|
905
|
+
rowHeight: W,
|
|
815
906
|
onRowClick: u,
|
|
816
|
-
scrollRef:
|
|
817
|
-
virtualRows:
|
|
818
|
-
virtualEnabled:
|
|
819
|
-
}) : /* @__PURE__ */ s(
|
|
820
|
-
leftFixedColumns:
|
|
821
|
-
normalColumns:
|
|
822
|
-
rightFixedColumns:
|
|
823
|
-
dataSource:
|
|
907
|
+
scrollRef: R,
|
|
908
|
+
virtualRows: G,
|
|
909
|
+
virtualEnabled: Ne
|
|
910
|
+
}) : /* @__PURE__ */ s(me, {
|
|
911
|
+
leftFixedColumns: J,
|
|
912
|
+
normalColumns: Y,
|
|
913
|
+
rightFixedColumns: X,
|
|
914
|
+
dataSource: Ie,
|
|
824
915
|
rowKey: r,
|
|
825
|
-
rowHeight:
|
|
826
|
-
emptyText:
|
|
827
|
-
emptyRowContent:
|
|
828
|
-
showEmptyRow:
|
|
916
|
+
rowHeight: W,
|
|
917
|
+
emptyText: Pe,
|
|
918
|
+
emptyRowContent: ze,
|
|
919
|
+
showEmptyRow: Ve,
|
|
829
920
|
onRowClick: u,
|
|
830
921
|
onRow: b,
|
|
831
922
|
onCell: x,
|
|
832
|
-
totalColumnsWidth:
|
|
923
|
+
totalColumnsWidth: Q,
|
|
833
924
|
needSpacer: $,
|
|
834
|
-
rowRefCallback:
|
|
835
|
-
isDynamicHeight:
|
|
925
|
+
rowRefCallback: q,
|
|
926
|
+
isDynamicHeight: je
|
|
836
927
|
})
|
|
837
928
|
})
|
|
838
929
|
}),
|
|
839
|
-
y && (f || h || v) ? /* @__PURE__ */ s(
|
|
840
|
-
leftFixedColumns:
|
|
841
|
-
normalColumns:
|
|
842
|
-
rightFixedColumns:
|
|
930
|
+
y && (f || h || v) ? /* @__PURE__ */ s(ve, {
|
|
931
|
+
leftFixedColumns: J,
|
|
932
|
+
normalColumns: Y,
|
|
933
|
+
rightFixedColumns: X,
|
|
843
934
|
footerData: f,
|
|
844
935
|
summary: h,
|
|
845
936
|
render: v,
|
|
846
|
-
enableFixed:
|
|
847
|
-
totalColumnsWidth:
|
|
937
|
+
enableFixed: Re,
|
|
938
|
+
totalColumnsWidth: Q,
|
|
848
939
|
needSpacer: $
|
|
849
940
|
}) : null
|
|
850
941
|
]
|
|
851
942
|
}),
|
|
852
|
-
|
|
943
|
+
Be ? /* @__PURE__ */ s("div", {
|
|
853
944
|
className: "custom-table-empty-overlay",
|
|
854
945
|
style: {
|
|
855
|
-
height:
|
|
856
|
-
left:
|
|
857
|
-
top:
|
|
858
|
-
width:
|
|
946
|
+
height: V,
|
|
947
|
+
left: de.left,
|
|
948
|
+
top: de.top + B + (a ? 1 : 0),
|
|
949
|
+
width: z || void 0
|
|
859
950
|
},
|
|
860
951
|
children: /* @__PURE__ */ s("div", {
|
|
861
952
|
className: "custom-table-empty-overlay-inner",
|
|
862
|
-
children:
|
|
953
|
+
children: Be
|
|
863
954
|
})
|
|
864
955
|
}) : null,
|
|
865
956
|
C ? /* @__PURE__ */ s("div", {
|
|
866
957
|
className: "custom-table-resize-handle",
|
|
867
|
-
ref:
|
|
958
|
+
ref: ge
|
|
868
959
|
}) : null,
|
|
869
|
-
|
|
960
|
+
te.left !== !1 && Fe > 0 ? /* @__PURE__ */ s("div", {
|
|
870
961
|
className: "fixed-shadow-mask left",
|
|
871
|
-
style: { width:
|
|
962
|
+
style: { width: Fe }
|
|
872
963
|
}) : null,
|
|
873
|
-
!$ &&
|
|
964
|
+
!$ && te.right !== !1 && Z > 0 ? /* @__PURE__ */ s("div", {
|
|
874
965
|
className: "fixed-shadow-mask right",
|
|
875
|
-
style: { width:
|
|
966
|
+
style: { width: Z }
|
|
876
967
|
}) : null
|
|
877
968
|
]
|
|
878
969
|
});
|
|
879
970
|
});
|
|
880
|
-
|
|
881
|
-
var
|
|
971
|
+
Ae.displayName = "Table";
|
|
972
|
+
var K = l.memo(Ae), q = {
|
|
882
973
|
axisOffset: 18,
|
|
883
974
|
arrowSize: 16,
|
|
884
975
|
branchContinueOffset: 11,
|
|
@@ -888,26 +979,26 @@ var Ce = l.memo(Se), W = {
|
|
|
888
979
|
prefixOffset: 34,
|
|
889
980
|
textGap: 16,
|
|
890
981
|
textOffset: 42
|
|
891
|
-
},
|
|
892
|
-
top: 17 +
|
|
982
|
+
}, je = {
|
|
983
|
+
top: 17 + q.branchContinueOffset,
|
|
893
984
|
bottom: -1
|
|
894
|
-
},
|
|
985
|
+
}, Me = {
|
|
895
986
|
top: -1,
|
|
896
987
|
bottom: -1
|
|
897
|
-
},
|
|
988
|
+
}, Ne = {
|
|
898
989
|
top: -1,
|
|
899
990
|
bottom: "10%"
|
|
900
|
-
},
|
|
901
|
-
let t = Math.max(Number(e) || 0, 0), n =
|
|
991
|
+
}, Pe = /* @__PURE__ */ new Map(), J = (e = 0) => {
|
|
992
|
+
let t = Math.max(Number(e) || 0, 0), n = Pe.get(t);
|
|
902
993
|
if (n) return n;
|
|
903
|
-
let r = t *
|
|
904
|
-
axisCenter:
|
|
905
|
-
arrowLeft:
|
|
906
|
-
prefixWidth:
|
|
907
|
-
textOffset:
|
|
994
|
+
let r = t * q.levelStep, i = {
|
|
995
|
+
axisCenter: q.axisOffset + r,
|
|
996
|
+
arrowLeft: q.iconOffset + r,
|
|
997
|
+
prefixWidth: q.prefixOffset + r,
|
|
998
|
+
textOffset: q.textOffset + r
|
|
908
999
|
};
|
|
909
|
-
return
|
|
910
|
-
},
|
|
1000
|
+
return Pe.set(t, i), i;
|
|
1001
|
+
}, Y = (e) => {
|
|
911
1002
|
if (!Array.isArray(e) || e.length === 0) return [];
|
|
912
1003
|
let t = e.length, n = Array(t), r = [];
|
|
913
1004
|
for (let i = 0; i < t; i += 1) {
|
|
@@ -926,32 +1017,32 @@ var Ce = l.memo(Se), W = {
|
|
|
926
1017
|
e !== void 0 && (n[e].subtreeEndIndex = t - 1);
|
|
927
1018
|
}
|
|
928
1019
|
return n;
|
|
929
|
-
},
|
|
1020
|
+
}, X = ({ rowIndex: e, subtreeEndIndex: t, type: n = "ancestor" }) => n === "current" ? je : e < t ? Me : Ne, Fe = ({ depth: e = 0, hasChildren: t = !1, previousDepth: n = -1, rowIndex: r = 0, rowMeta: i = null, treeMeta: a = [] }) => {
|
|
930
1021
|
if (t) return null;
|
|
931
|
-
let o = Math.max(Number(e) || 0, 0), { prefixWidth: s, axisCenter: c } =
|
|
1022
|
+
let o = Math.max(Number(e) || 0, 0), { prefixWidth: s, axisCenter: c } = J(o), l = i?.ancestorIndices || [];
|
|
932
1023
|
if ((Number(n) || 0) > o) return {
|
|
933
1024
|
left: c,
|
|
934
1025
|
width: s - c
|
|
935
1026
|
};
|
|
936
1027
|
for (let e = 0; e < l.length; e += 1) {
|
|
937
1028
|
let t = l[e], n = a?.[t];
|
|
938
|
-
if (
|
|
1029
|
+
if (X({
|
|
939
1030
|
rowIndex: r,
|
|
940
1031
|
subtreeEndIndex: n?.subtreeEndIndex ?? r
|
|
941
|
-
}) !==
|
|
942
|
-
let t =
|
|
1032
|
+
}) !== Me) {
|
|
1033
|
+
let t = J(e).axisCenter;
|
|
943
1034
|
return {
|
|
944
1035
|
left: t,
|
|
945
1036
|
width: s - t
|
|
946
1037
|
};
|
|
947
1038
|
}
|
|
948
1039
|
}
|
|
949
|
-
let u = o === 0 ? 0 :
|
|
1040
|
+
let u = o === 0 ? 0 : J(o - 1).prefixWidth;
|
|
950
1041
|
return {
|
|
951
1042
|
left: u,
|
|
952
1043
|
width: s - u
|
|
953
1044
|
};
|
|
954
|
-
},
|
|
1045
|
+
}, Z = {
|
|
955
1046
|
root: "_root_1vwno_1",
|
|
956
1047
|
gutter: "_gutter_1vwno_26",
|
|
957
1048
|
rail: "_rail_1vwno_33",
|
|
@@ -961,48 +1052,48 @@ var Ce = l.memo(Se), W = {
|
|
|
961
1052
|
loading: "_loading_1vwno_82",
|
|
962
1053
|
value: "_value_1vwno_95",
|
|
963
1054
|
loadMore: "_loadMore_1vwno_106"
|
|
964
|
-
},
|
|
1055
|
+
}, Q = (e) => {
|
|
965
1056
|
e.stopPropagation();
|
|
966
|
-
},
|
|
967
|
-
let { prefixWidth: n } =
|
|
1057
|
+
}, $ = ({ depth: e, loadMore: t }) => {
|
|
1058
|
+
let { prefixWidth: n } = J(e);
|
|
968
1059
|
return /* @__PURE__ */ c("div", {
|
|
969
|
-
className:
|
|
1060
|
+
className: Z.root,
|
|
970
1061
|
"data-testid": "hierarchy-tree",
|
|
971
1062
|
children: [/* @__PURE__ */ s("div", {
|
|
972
|
-
className:
|
|
1063
|
+
className: Z.gutter,
|
|
973
1064
|
style: { width: n },
|
|
974
1065
|
children: /* @__PURE__ */ s("span", {
|
|
975
|
-
className:
|
|
1066
|
+
className: Z.divider,
|
|
976
1067
|
style: {
|
|
977
1068
|
left: 0,
|
|
978
1069
|
width: "100%"
|
|
979
1070
|
}
|
|
980
1071
|
})
|
|
981
1072
|
}), /* @__PURE__ */ s("div", {
|
|
982
|
-
className:
|
|
1073
|
+
className: Z.value,
|
|
983
1074
|
children: /* @__PURE__ */ s("button", {
|
|
984
1075
|
type: "button",
|
|
985
|
-
className:
|
|
1076
|
+
className: Z.loadMore,
|
|
986
1077
|
disabled: t.loading,
|
|
987
1078
|
onClick: (e) => {
|
|
988
|
-
|
|
1079
|
+
Q(e), t.onClick();
|
|
989
1080
|
},
|
|
990
1081
|
children: t.label
|
|
991
1082
|
})
|
|
992
1083
|
})]
|
|
993
1084
|
});
|
|
994
|
-
},
|
|
1085
|
+
}, Ie = (e, t, n) => (t.ancestorIndices || []).map((t, r) => {
|
|
995
1086
|
let i = n[t];
|
|
996
1087
|
return {
|
|
997
|
-
axisCenter:
|
|
1088
|
+
axisCenter: J(r).axisCenter,
|
|
998
1089
|
key: `${t}-${r}`,
|
|
999
|
-
segmentStyle:
|
|
1090
|
+
segmentStyle: X({
|
|
1000
1091
|
rowIndex: e,
|
|
1001
1092
|
subtreeEndIndex: i?.subtreeEndIndex ?? e
|
|
1002
1093
|
})
|
|
1003
1094
|
};
|
|
1004
|
-
}),
|
|
1005
|
-
let { axisCenter: m, prefixWidth: h } =
|
|
1095
|
+
}), Le = ({ depth: t, children: n, rowIndex: i, previousDepth: a = -1, rowMeta: o, treeMeta: l, hasChildren: u = !1, expanded: d = !1, loading: f = !1, onToggle: p }) => {
|
|
1096
|
+
let { axisCenter: m, prefixWidth: h } = J(t), g = i === Math.max(l.length - 1, 0), _ = Ie(i, o, l), v = Fe({
|
|
1006
1097
|
depth: t,
|
|
1007
1098
|
hasChildren: u && d,
|
|
1008
1099
|
previousDepth: a,
|
|
@@ -1012,39 +1103,39 @@ var Ce = l.memo(Se), W = {
|
|
|
1012
1103
|
}), b = g ? {
|
|
1013
1104
|
left: 0,
|
|
1014
1105
|
width: "100%"
|
|
1015
|
-
} : v, x = u && d && o.subtreeEndIndex > i, S =
|
|
1106
|
+
} : v, x = u && d && o.subtreeEndIndex > i, S = X({
|
|
1016
1107
|
rowIndex: i,
|
|
1017
1108
|
subtreeEndIndex: o.subtreeEndIndex,
|
|
1018
1109
|
type: "current"
|
|
1019
1110
|
});
|
|
1020
1111
|
return /* @__PURE__ */ c("div", {
|
|
1021
|
-
className:
|
|
1112
|
+
className: Z.root,
|
|
1022
1113
|
"data-testid": "hierarchy-tree",
|
|
1023
1114
|
children: [/* @__PURE__ */ c("div", {
|
|
1024
|
-
className:
|
|
1115
|
+
className: Z.gutter,
|
|
1025
1116
|
style: { width: h },
|
|
1026
1117
|
children: [
|
|
1027
1118
|
b ? /* @__PURE__ */ s("span", {
|
|
1028
|
-
className:
|
|
1119
|
+
className: Z.divider,
|
|
1029
1120
|
"data-testid": "hierarchy-tree-divider",
|
|
1030
1121
|
style: b
|
|
1031
1122
|
}) : null,
|
|
1032
1123
|
_.map((e) => /* @__PURE__ */ s("span", {
|
|
1033
|
-
className:
|
|
1124
|
+
className: Z.rail,
|
|
1034
1125
|
style: {
|
|
1035
1126
|
left: e.axisCenter,
|
|
1036
1127
|
...e.segmentStyle
|
|
1037
1128
|
}
|
|
1038
1129
|
}, e.key)),
|
|
1039
1130
|
x ? /* @__PURE__ */ s("span", {
|
|
1040
|
-
className:
|
|
1131
|
+
className: Z.rail,
|
|
1041
1132
|
style: {
|
|
1042
1133
|
left: m,
|
|
1043
1134
|
...S
|
|
1044
1135
|
}
|
|
1045
1136
|
}) : null,
|
|
1046
1137
|
u ? f ? /* @__PURE__ */ s("span", {
|
|
1047
|
-
className:
|
|
1138
|
+
className: Z.loading,
|
|
1048
1139
|
"data-testid": "hierarchy-tree-loading",
|
|
1049
1140
|
style: { left: m },
|
|
1050
1141
|
children: /* @__PURE__ */ s(r, {
|
|
@@ -1053,11 +1144,11 @@ var Ce = l.memo(Se), W = {
|
|
|
1053
1144
|
})
|
|
1054
1145
|
}) : /* @__PURE__ */ s("button", {
|
|
1055
1146
|
type: "button",
|
|
1056
|
-
className: y(
|
|
1147
|
+
className: y(Z.toggle, d && Z.toggleExpanded),
|
|
1057
1148
|
style: { left: m },
|
|
1058
1149
|
"aria-expanded": d,
|
|
1059
1150
|
onClick: (e) => {
|
|
1060
|
-
|
|
1151
|
+
Q(e), p?.();
|
|
1061
1152
|
},
|
|
1062
1153
|
children: /* @__PURE__ */ s(e, {
|
|
1063
1154
|
name: "arrow-right",
|
|
@@ -1066,13 +1157,13 @@ var Ce = l.memo(Se), W = {
|
|
|
1066
1157
|
}) : null
|
|
1067
1158
|
]
|
|
1068
1159
|
}), /* @__PURE__ */ s("div", {
|
|
1069
|
-
className:
|
|
1160
|
+
className: Z.value,
|
|
1070
1161
|
children: n
|
|
1071
1162
|
})]
|
|
1072
1163
|
});
|
|
1073
|
-
},
|
|
1164
|
+
}, Re = (e) => e.loadMore ? /* @__PURE__ */ s($, {
|
|
1074
1165
|
depth: e.depth,
|
|
1075
1166
|
loadMore: e.loadMore
|
|
1076
|
-
}) : /* @__PURE__ */ s(
|
|
1167
|
+
}) : /* @__PURE__ */ s(Le, { ...e });
|
|
1077
1168
|
//#endregion
|
|
1078
|
-
export { k as _,
|
|
1169
|
+
export { k as _, G as a, B as c, P as d, M as f, ne as g, te as h, Te as i, de as l, I as m, Y as n, ye as o, L as p, K as r, me as s, Re as t, V as u, E as v, j as y };
|