@baishuyun/ui-base 6.29.0 → 6.29.2

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.
Files changed (44) hide show
  1. package/dist/Amap/index.js +1 -1
  2. package/dist/Calendar/{Calendar-DHRiaiXw.js → Calendar-MCtQbn-u.js} +1 -1
  3. package/dist/Calendar/index.js +3 -3
  4. package/dist/Card/index.js +1 -1
  5. package/dist/CheckBox/index.js +1 -1
  6. package/dist/ColorPicker/index.js +1 -1
  7. package/dist/ConfigProvider/index.js +1 -1
  8. package/dist/DatePicker/{DatePicker-BfyiYmTl.js → DatePicker-CRnA0EoA.js} +1 -1
  9. package/dist/DatePicker/{DatePickerPanel-D8qVQZ0a.js → DatePickerPanel-DFk0OP4X.js} +1 -1
  10. package/dist/DatePicker/index.js +2 -2
  11. package/dist/DropDown/index.js +1 -1
  12. package/dist/Editor/index.js +1 -1
  13. package/dist/FieldCard/index.js +1 -1
  14. package/dist/Gantt/index.js +2 -2
  15. package/dist/Icon/index.js +1 -1
  16. package/dist/InputTag/index.js +1 -1
  17. package/dist/Kanban/index.js +8 -3
  18. package/dist/Loading/index.js +1 -1
  19. package/dist/Modal/index.js +1 -1
  20. package/dist/NotFoundContent/index.js +1 -1
  21. package/dist/Overlay/index.js +1 -1
  22. package/dist/Radio/index.js +1 -1
  23. package/dist/ScrollBar/index.js +1 -1
  24. package/dist/Segmented/index.js +1 -1
  25. package/dist/Select/index.js +1 -1
  26. package/dist/Table/{Table-BmPAWvbO.js → Table-B8381Lni.js} +399 -308
  27. package/dist/Table/index.js +2 -2
  28. package/dist/Tabs/index.js +1 -1
  29. package/dist/Tooltip/index.js +1 -1
  30. package/dist/Tree/index.js +1 -1
  31. package/dist/components/Table/components/TableBody.d.ts +1 -40
  32. package/dist/components/Table/components/TableFooter.d.ts +3 -3
  33. package/dist/components/Table/components/TableHeader.d.ts +2 -2
  34. package/dist/components/Table/hooks/useTableColumnWidths.d.ts +2 -2
  35. package/dist/components/Table/hooks/useTableVirtual.d.ts +7 -3
  36. package/dist/components/Table/index.d.ts +1 -2
  37. package/dist/components/Table/interface.d.ts +48 -9
  38. package/dist/components/Table/utils/flattenColumns.d.ts +1 -1
  39. package/dist/components/Table/utils/processRowspan.d.ts +1 -1
  40. package/dist/components/Table/utils/tableUtils.d.ts +9 -9
  41. package/dist/index.js +4 -4
  42. package/dist/style.css +1 -1
  43. package/dist/vendors/{version-BovtV-fV.js → version-CohiolFd.js} +1 -1
  44. 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
- }, j = {
44
+ }, ee = {
45
45
  ASC: "asc",
46
46
  DESC: "desc",
47
47
  NONE: null
48
- }, M = {
48
+ }, j = {
49
49
  wrapper: "custom-table-wrapper",
50
50
  body: "custom-table-body"
51
- }, N = (e = []) => e.flatMap((e) => e.children?.length ? e.children : [e]), P = (e, t) => t.findIndex((t) => e.isParent ? t.parentKey === e.key : t.key === e.key), F = (e, t, n, r = k.DEFAULT_WIDTH) => o(n === "left" ? t.slice(0, e) : t.slice(e + 1), (e) => e.width || r), I = (e, t, n) => n !== "left" && n !== "right" ? null : {
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]: F(e, t, n),
53
+ [n]: P(e, t, n),
54
54
  zIndex: 2
55
- }, ee = (e, t, n, r) => {
55
+ }, te = (e, t, n, r) => {
56
56
  if (!t || !n) return e;
57
- let i = n === j.DESC ? -1 : 1;
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
- }, L = (e, t, n) => {
62
+ }, I = (e, t = "id", n) => {
63
+ if (!e) return n;
63
64
  let r = e[t];
64
- return typeof r == "string" || typeof r == "number" ? r : n;
65
- }, te = (e) => {
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
- }, R = (e, t = k.DEFAULT_WIDTH) => o(e, (e) => e.children?.length ? o(e.children, (e) => e.width || t) : e.width || t), ne = (e, t) => {
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
- }, re = (e, t) => {
93
- let n = te(e), r = R(e);
95
+ }, ie = (e, t) => {
96
+ let n = ne(e), r = L(e);
94
97
  return {
95
98
  ...n,
96
- fixedLeftWidth: R(n.leftFixedColumns),
97
- fixedRightWidth: R(n.rightFixedColumns),
99
+ fixedLeftWidth: L(n.leftFixedColumns),
100
+ fixedRightWidth: L(n.rightFixedColumns),
98
101
  totalColumnsWidth: r,
99
102
  needSpacer: r < t
100
103
  };
101
- }, ie = d(({ column: e, style: t = {}, className: n = "", onResizeStart: r, isResizing: i = !1, resizable: a = !0, colSpan: o = 1, rowSpan: l = 1 }) => {
102
- let u = _(null), d = f((e) => {
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
- }, []), p = f((t) => {
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", n, !0), document.addEventListener("mouseup", () => {
111
- setTimeout(() => document.removeEventListener("click", n, !0), 0);
112
- }, { once: !0 }), r(e.key, e.width || k.DEFAULT_WIDTH, t.clientX);
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
- ]), m = typeof e.header == "function" ? e.header(e, { menuRef: u }) : e.title;
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: d,
135
+ onClick: m,
125
136
  children: [/* @__PURE__ */ s("div", {
126
137
  className: "header-cell-content",
127
- children: m
138
+ children: g
128
139
  }), a ? /* @__PURE__ */ s("div", {
129
140
  className: `resize-handle ${i ? "resizing" : ""}`,
130
- onMouseDown: p
141
+ onMouseDown: h
131
142
  }) : null]
132
143
  });
133
144
  });
134
- ie.displayName = "HeaderCell";
145
+ oe.displayName = "HeaderCell";
135
146
  //#endregion
136
147
  //#region src/components/Table/utils/flattenColumns.ts
137
- var ae = (e) => {
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
- }, oe = u(({ columns: e = [], enableFixed: t = !1, height: n = E.HEADER_HEIGHT, resizingColumn: r = null, onResizeStart: i, resizable: a = !0, disabledResizeColumns: o = [], totalColumnsWidth: l = 0, needSpacer: u = !1, headerRowSpan: d = 1 }, f) => {
188
- let p = g(() => e.some((e) => e.children && e.children.length > 0), [e]), { flatColumns: m, headerRows: h } = g(() => {
189
- if (p) return ae(e);
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
- ]), _ = (e) => {
213
- let t = P(e, m), n = e.align || "left", c = o.includes(e.key), l = {
214
- textAlign: n,
215
- ...I(t, m, e.fixed)
216
- }, u = `custom-table-header-cell ${e.className || ""}`.trim();
217
- return e.fixed === "left" && (u += " fixed-left"), e.fixed === "right" && (u += " fixed-right"), t === 0 && (u += " first"), t === m.length - 1 && (u += " last"), /* @__PURE__ */ s(ie, {
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: l,
220
- className: u,
263
+ style: t.style,
264
+ className: t.className,
221
265
  onResizeStart: i,
222
266
  isResizing: r === e.key,
223
- resizable: a && !e.children && !c,
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) => _(e)), u && t === 0 ? /* @__PURE__ */ s("th", {
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
- oe.displayName = "TableHeader";
254
- var se = d(oe), z = (e, t) => {
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
- }, ce = (e, t, n = "_id") => {
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] = z(t, e);
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
- }, le = (e, t) => B(e, t) > 0, V = (e, t, n) => {
310
- let r = P(e, t), i = e.align || "left", a = I(r, t, n);
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?.type || "", e?.colorEnable ? "color-enable" : "", e?.regex === "barcode" ? "bar-code" : "", e?.regex === "qrcode" ? "qr-code" : ""),
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
- }, ue = ({ leftFixedColumns: e = [], normalColumns: t = [], rightFixedColumns: n = [], dataSource: r = [], 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 }) => {
323
- let T = g(() => N(e), [e]), D = g(() => N(t), [t]), O = g(() => N(n), [n]), A = 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
- ]), j = g(() => {
332
- let e = T.map((e) => V(e, A, "left")), t = D.map((e) => V(e, A, void 0)), n = O.map((e) => V(e, A, "right"));
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
- ]), M = f((e) => {
389
+ ]), j = f((e) => {
344
390
  e && h && h(e);
345
- }, [h]), P = (e, t, n) => {
391
+ }, [h]), N = (e, t, n) => {
346
392
  let { column: r, className: i, style: a } = e;
347
- if (!le(t, r)) return null;
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
- className: i,
350
- style: a
351
- };
352
- return d && typeof d == "function" && (u = d(c, t, r, n, {
353
- className: i,
354
- style: a
355
- }) || {}), /* @__PURE__ */ s("td", {
356
- className: `${i} ${u.className || ""}`.trim(),
357
- style: { ...a },
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 F = () => v ?? /* @__PURE__ */ s("tr", {
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
- }), I = w || !_;
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 ? F() : null : r.map((e, t) => {
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: _ ? M : void 0,
456
+ ref: _ ? j : void 0,
406
457
  style: {
407
- height: I ? a : "auto",
458
+ height: F ? a : "auto",
408
459
  ...n.style
409
460
  },
410
461
  className: y("custom-table-row", n.className),
411
- onClick: (n) => l?.(e, t, n),
462
+ onClick: l ? (n) => l(e, t, n) : void 0,
412
463
  "data-index": _ ? r : void 0,
413
464
  ...n,
414
- children: [j.map((n) => P(n, e, t)), m ? /* @__PURE__ */ s("td", { className: "spacer-cell" }) : null]
415
- }, L(e, i, t));
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
- ue.displayName = "TableBody";
421
- var de = d(ue), H = ({ leftFixedColumns: e = [], normalColumns: t = [], rightFixedColumns: n = [], footerData: r = {}, summary: i, render: a, enableFixed: o = !0, totalColumnsWidth: l = 0, needSpacer: u = !1 }) => {
422
- let d = g(() => N(e), [e]), f = g(() => N(t), [t]), p = g(() => N(n), [n]), m = 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 = (e) => {
431
- let t = (e.dataIndex ? r?.[e.dataIndex] : void 0) ?? i?.[e.key], { renderFooter: n } = e, c = n && typeof n == "function" ? n(t, e) : a && typeof a == "function" ? a(t, e) : t, l = { textAlign: e.align || "left" }, u = "custom-table-footer-cell";
432
- if (o && e.fixed) {
433
- let t = I(P(e, m), m, e.fixed);
434
- t && (l = {
435
- ...l,
436
- ...t
437
- }, u += e.fixed === "left" ? " fixed-left" : " fixed-right");
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: u,
441
- style: l,
503
+ className: c.cellClassName,
504
+ style: c.cellStyle,
442
505
  children: /* @__PURE__ */ s("div", {
443
506
  className: "cell-content",
444
- children: c
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) => h(e)),
464
- f.map((e) => h(e)),
465
- p.map((e) => h(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
- H.displayName = "TableFooter";
472
- var fe = d(H), U = [];
473
- function pe(e, t, n) {
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) : typeof o == "string" ? D.MIN_HEIGHT : i(typeof o == "function" ? o(e) : o || D.MIN_HEIGHT, 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 = g(() => t.enabled === !0 ? !0 : t.enabled === !1 ? !1 : e.length > O.ENABLE_AUTO_SIZE, [t.enabled, e.length]), d = typeof o == "string", m = _(/* @__PURE__ */ new Map()), h = _(null), v = g(() => {
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 t = e[0]?.uniqueId || e[0]?._id || e[0]?.id, n = e[e.length - 1]?.uniqueId || e[e.length - 1]?._id || e[e.length - 1]?.id;
488
- return `${String(t)}-${String(n)}-${e.length}`;
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
- }), C = u ? b.getTotalSize() : 0, w = u ? b.getVirtualItems() : U, E = u && w.length > 0 && w[0].start || 0, k = u && w.length > 0 ? C - (w[w.length - 1].end || 0) : 0, A = S(() => {
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
- }), j = S((e) => {
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 t = Array.isArray(e) ? e : [e], n = m.current, i = r.current ?? [];
524
- t.forEach((e) => {
525
- if (typeof e == "number") n.delete(String(e));
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 t = i.findIndex((t) => t.uniqueId === e || t._id === e || t.id === e);
528
- t !== -1 && n.delete(String(t));
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,17 +600,17 @@ function pe(e, t, n) {
537
600
  paddingTop: E,
538
601
  paddingBottom: k,
539
602
  remeasure: A,
540
- clearRowHeightCache: j,
603
+ clearRowHeightCache: ee,
541
604
  isDynamicHeight: d
542
605
  };
543
606
  }
544
- function me(e, t, n, r) {
545
- let i = n ? t.map((t) => {
607
+ function be(e, t, n, r) {
608
+ let i = n ? t.flatMap((t) => {
546
609
  let n = e[t.index];
547
- return n && {
610
+ return n ? [{
548
611
  ...n,
549
612
  dataIndex: t.index
550
- };
613
+ }] : [];
551
614
  }) : e.map((e, t) => ({
552
615
  ...e,
553
616
  dataIndex: t
@@ -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 he(e = {}) {
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 ge = {};
588
- function _e({ columns: e, scrollRef: t, minColumnWidth: n, maxColumnWidth: r, onColumnResize: i, onColumnResizeEnd: a }) {
589
- let s = _(null), c = _(/* @__PURE__ */ new Map()), l = _(/* @__PURE__ */ new Map()), [u, d] = v(ge), f = g(() => N(e), [e]), m = g(() => ne(e, u), [e, u]), h = g(() => N(m), [m]);
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 = l.current, t = /* @__PURE__ */ new Map();
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 = c.current.get(n);
610
- (i === void 0 || t !== void 0 && t !== r || i === r) && c.current.set(n, 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
- l.current = t;
675
+ c.current = t;
613
676
  }, [f]);
614
- let y = S((e) => c.current.get(e.key) || e.width || k.DEFAULT_WIDTH), b = 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 = o(h.slice(0, n + 1), (e) => y(e));
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
- s.current && (s.current.style.display = "block", s.current.style.left = `${b(e)}px`);
684
+ o.current && (o.current.style.display = "block", o.current.style.left = `${e}px`);
621
685
  }), C = S((e, t) => {
622
- c.current.set(e, t), d((n) => n[e] === t ? n : {
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 } = he({
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, c.current), s.current && (s.current.style.display = "none");
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
- C(t, n), i?.(t, n, c.current), x(t);
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
- x(e), E(e, t, n);
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: s
714
+ resizeHandleRef: o
645
715
  };
646
716
  }
647
717
  //#endregion
648
718
  //#region src/components/Table/hooks/useTableViewport.ts
649
- function ve({ scrollRef: e, tableHeaderRef: t, bordered: n, hasFooter: r, headerRowSpan: i, dataSourceLength: a, overlayScrollbarOptions: o }) {
650
- let s = C(e), c = s?.width ?? 0, l = s?.height ?? 0, [u, d] = v(0), [f, p] = v(!1), [m, _] = v({
719
+ var Ce = {
720
+ elementWidth: 0,
721
+ viewportClientHeight: 0,
722
+ scrollOffset: {
651
723
  left: 0,
652
724
  top: 0
653
- }), [y, b] = v(E.HEADER_HEIGHT), [x] = w({ options: {
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
- return h(() => {
741
+ h(() => {
665
742
  if (!e.current) return;
666
743
  let t = e.current, n = t.parentElement;
667
- n && x({
744
+ n && d({
668
745
  target: n,
669
746
  elements: { viewport: t }
670
747
  });
671
- }, [x]), h(() => {
748
+ }, [d, e]), h(() => {
672
749
  let n = e.current;
673
- n && (d(n.clientHeight), _({
674
- left: n.offsetLeft,
675
- top: n.offsetTop
676
- }), b(t.current?.clientHeight || E.HEADER_HEIGHT), p(n.scrollHeight > n.clientHeight));
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
- elementWidth: c,
687
- hasYScroll: f,
688
- scrollOffset: m,
689
- headerHeight: y,
690
- bodyMinHeight: g(() => {
691
- if (!l || !u) return;
692
- let e = n ? 2 : 0, t = u - y - (r ? E.HEADER_HEIGHT : 0) - e;
693
- return Math.max(0, t);
694
- }, [
695
- l,
696
- u,
697
- y,
698
- r,
699
- n
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 ye = (e) => {
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
- }, be = [], xe = {
796
+ }, Ee = Object.freeze([]), De = Object.freeze({
710
797
  left: !0,
711
798
  right: !0
712
- }, Se = u(({ columns: e = [], dataSource: n = [], 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 = be, minColumnWidth: T, maxColumnWidth: D, onColumnResize: k, onColumnResizeEnd: j, renderBody: M, estimateSize: N, virtualEnabled: P, dataProcessor: F, headerRowSpan: I, fixedShadowMask: ee = xe, onRenderEmpty: L, overlayScrollbarOptions: te, wrapperStyle: R, theme: ne }, ie) => {
713
- let { t: ae } = t(), oe = g(() => ye(ne), [ne]), z = _(null), ce = _(null), { elementWidth: B, hasYScroll: le, scrollOffset: V, headerHeight: ue, bodyMinHeight: H } = ve({
714
- scrollRef: z,
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: I,
805
+ headerRowSpan: F,
719
806
  dataSourceLength: n.length,
720
- overlayScrollbarOptions: te
721
- }), { sizedColumns: U, flatColumns: he, isResizing: ge, resizingColumn: Se, handleResizeStart: Ce, resizeHandleRef: W } = _e({
807
+ overlayScrollbarOptions: ne
808
+ }), { sizedColumns: H, flatColumns: U, isResizing: fe, resizingColumn: pe, handleResizeStart: he, resizeHandleRef: ge } = Se({
722
809
  columns: e,
723
- scrollRef: z,
810
+ scrollRef: R,
724
811
  minColumnWidth: T,
725
812
  maxColumnWidth: D,
726
813
  onColumnResize: k,
727
- onColumnResizeEnd: j
728
- }), { className: we, height: G } = A[S] || A.auto, { virtualRows: K, totalHeight: Te, paddingTop: q, paddingBottom: Ee, remeasure: J, rowRefCallback: De, isDynamicHeight: Y, clearRowHeightCache: X, enabled: Z } = pe(n, g(() => ({
729
- rowHeight: G,
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: N,
732
- ...P === void 0 ? {} : { enabled: P }
820
+ estimateSize: M,
821
+ ...N === void 0 ? {} : { enabled: N }
733
822
  }), [
734
- G,
735
- N,
736
- P
737
- ]), z);
738
- m(ie, () => ({
739
- clearRowHeightCache: X,
740
- remeasure: J
741
- }), [X, J]);
742
- let Oe = o || ae(E.EMPTY_TEXT_KEY);
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
- J?.();
745
- }, [G, J]);
746
- let { leftFixedColumns: Q, normalColumns: ke, rightFixedColumns: Ae, fixedLeftWidth: je, fixedRightWidth: Me, totalColumnsWidth: Ne, needSpacer: $ } = g(() => re(U, B), [U, B]), Pe = g(() => me(n, K, Z, F), [
747
- Z,
748
- K,
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
- F
751
- ]), Fe = g(() => {
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
- ]), Ie = !!(i || d?.y), Le, Re, ze = !0;
759
- if (!M && n.length === 0 && typeof L == "function") {
760
- let e = L();
761
- l.isValidElement(e) && e.type === "tr" ? Le = e : e && (Re = e, ze = !1);
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 ${le ? "has-y-scroll" : ""}`,
855
+ className: `custom-table ${ue ? "has-y-scroll" : ""}`,
765
856
  style: {
766
857
  position: "relative",
767
858
  height: "100%",
768
- ...oe
859
+ ...se
769
860
  },
770
861
  "data-overlayscrollbars-initialize": "",
771
862
  children: [
772
863
  /* @__PURE__ */ c("div", {
773
- ref: z,
774
- className: `custom-table-wrapper ${ge ? "resizing" : ""} ${we} os-enabled`,
864
+ ref: R,
865
+ className: `custom-table-wrapper ${fe ? "resizing" : ""} ${_e} os-enabled`,
775
866
  style: {
776
- ...Fe,
777
- ...R
867
+ ...Le,
868
+ ...L
778
869
  },
779
870
  children: [
780
- /* @__PURE__ */ s(se, {
871
+ /* @__PURE__ */ s(le, {
781
872
  ref: ce,
782
- columns: U,
783
- enableFixed: Ie,
873
+ columns: H,
874
+ enableFixed: Re,
784
875
  height: E.HEADER_HEIGHT,
785
- resizingColumn: Se,
786
- onResizeStart: C ? Ce : void 0,
876
+ resizingColumn: pe,
877
+ onResizeStart: C ? he : void 0,
787
878
  resizable: C,
788
879
  disabledResizeColumns: w,
789
- totalColumnsWidth: Ne,
880
+ totalColumnsWidth: Q,
790
881
  needSpacer: $,
791
- headerRowSpan: I
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: H,
799
- height: Te,
800
- paddingBottom: Ee > 0 ? `${Ee}px` : void 0,
801
- paddingTop: q > 0 ? `${q}px` : void 0,
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: M ? M({
805
- columns: U,
806
- flatColumns: he,
807
- leftFixedColumns: Q,
808
- normalColumns: ke,
809
- rightFixedColumns: Ae,
810
- totalColumnsWidth: Ne,
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: De,
813
- isDynamicHeight: Y,
814
- rowHeight: G,
903
+ rowRefCallback: q,
904
+ isDynamicHeight: je,
905
+ rowHeight: W,
815
906
  onRowClick: u,
816
- scrollRef: z,
817
- virtualRows: K,
818
- virtualEnabled: Z
819
- }) : /* @__PURE__ */ s(de, {
820
- leftFixedColumns: Q,
821
- normalColumns: ke,
822
- rightFixedColumns: Ae,
823
- dataSource: Pe,
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: G,
826
- emptyText: Oe,
827
- emptyRowContent: Le,
828
- showEmptyRow: ze,
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: Ne,
923
+ totalColumnsWidth: Q,
833
924
  needSpacer: $,
834
- rowRefCallback: De,
835
- isDynamicHeight: Y
925
+ rowRefCallback: q,
926
+ isDynamicHeight: je
836
927
  })
837
928
  })
838
929
  }),
839
- y && (f || h || v) ? /* @__PURE__ */ s(fe, {
840
- leftFixedColumns: Q,
841
- normalColumns: ke,
842
- rightFixedColumns: Ae,
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: Ie,
847
- totalColumnsWidth: Ne,
937
+ enableFixed: Re,
938
+ totalColumnsWidth: Q,
848
939
  needSpacer: $
849
940
  }) : null
850
941
  ]
851
942
  }),
852
- Re ? /* @__PURE__ */ s("div", {
943
+ Be ? /* @__PURE__ */ s("div", {
853
944
  className: "custom-table-empty-overlay",
854
945
  style: {
855
- height: H,
856
- left: V.left,
857
- top: V.top + ue + (a ? 1 : 0),
858
- width: B || void 0
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: Re
953
+ children: Be
863
954
  })
864
955
  }) : null,
865
956
  C ? /* @__PURE__ */ s("div", {
866
957
  className: "custom-table-resize-handle",
867
- ref: W
958
+ ref: ge
868
959
  }) : null,
869
- ee.left !== !1 && je > 0 ? /* @__PURE__ */ s("div", {
960
+ te.left !== !1 && Fe > 0 ? /* @__PURE__ */ s("div", {
870
961
  className: "fixed-shadow-mask left",
871
- style: { width: je }
962
+ style: { width: Fe }
872
963
  }) : null,
873
- !$ && ee.right !== !1 && Me > 0 ? /* @__PURE__ */ s("div", {
964
+ !$ && te.right !== !1 && Z > 0 ? /* @__PURE__ */ s("div", {
874
965
  className: "fixed-shadow-mask right",
875
- style: { width: Me }
966
+ style: { width: Z }
876
967
  }) : null
877
968
  ]
878
969
  });
879
970
  });
880
- Se.displayName = "Table";
881
- var Ce = l.memo(Se), W = {
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
- }, we = {
892
- top: 17 + W.branchContinueOffset,
982
+ }, je = {
983
+ top: 17 + q.branchContinueOffset,
893
984
  bottom: -1
894
- }, G = {
985
+ }, Me = {
895
986
  top: -1,
896
987
  bottom: -1
897
- }, K = {
988
+ }, Ne = {
898
989
  top: -1,
899
990
  bottom: "10%"
900
- }, Te = /* @__PURE__ */ new Map(), q = (e = 0) => {
901
- let t = Math.max(Number(e) || 0, 0), n = Te.get(t);
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 * W.levelStep, i = {
904
- axisCenter: W.axisOffset + r,
905
- arrowLeft: W.iconOffset + r,
906
- prefixWidth: W.prefixOffset + r,
907
- textOffset: W.textOffset + r
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 Te.set(t, i), i;
910
- }, Ee = (e) => {
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
- }, J = ({ rowIndex: e, subtreeEndIndex: t, type: n = "ancestor" }) => n === "current" ? we : e < t ? G : K, De = ({ depth: e = 0, hasChildren: t = !1, previousDepth: n = -1, rowIndex: r = 0, rowMeta: i = null, treeMeta: a = [] }) => {
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 } = q(o), l = i?.ancestorIndices || [];
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 (J({
1029
+ if (X({
939
1030
  rowIndex: r,
940
1031
  subtreeEndIndex: n?.subtreeEndIndex ?? r
941
- }) !== G) {
942
- let t = q(e).axisCenter;
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 : q(o - 1).prefixWidth;
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
- }, Y = {
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
- }, X = (e) => {
1055
+ }, Q = (e) => {
965
1056
  e.stopPropagation();
966
- }, Z = ({ depth: e, loadMore: t }) => {
967
- let { prefixWidth: n } = q(e);
1057
+ }, $ = ({ depth: e, loadMore: t }) => {
1058
+ let { prefixWidth: n } = J(e);
968
1059
  return /* @__PURE__ */ c("div", {
969
- className: Y.root,
1060
+ className: Z.root,
970
1061
  "data-testid": "hierarchy-tree",
971
1062
  children: [/* @__PURE__ */ s("div", {
972
- className: Y.gutter,
1063
+ className: Z.gutter,
973
1064
  style: { width: n },
974
1065
  children: /* @__PURE__ */ s("span", {
975
- className: Y.divider,
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: Y.value,
1073
+ className: Z.value,
983
1074
  children: /* @__PURE__ */ s("button", {
984
1075
  type: "button",
985
- className: Y.loadMore,
1076
+ className: Z.loadMore,
986
1077
  disabled: t.loading,
987
1078
  onClick: (e) => {
988
- X(e), t.onClick();
1079
+ Q(e), t.onClick();
989
1080
  },
990
1081
  children: t.label
991
1082
  })
992
1083
  })]
993
1084
  });
994
- }, Oe = (e, t, n) => (t.ancestorIndices || []).map((t, r) => {
1085
+ }, Ie = (e, t, n) => (t.ancestorIndices || []).map((t, r) => {
995
1086
  let i = n[t];
996
1087
  return {
997
- axisCenter: q(r).axisCenter,
1088
+ axisCenter: J(r).axisCenter,
998
1089
  key: `${t}-${r}`,
999
- segmentStyle: J({
1090
+ segmentStyle: X({
1000
1091
  rowIndex: e,
1001
1092
  subtreeEndIndex: i?.subtreeEndIndex ?? e
1002
1093
  })
1003
1094
  };
1004
- }), Q = ({ depth: t, children: n, rowIndex: i, previousDepth: a = -1, rowMeta: o, treeMeta: l, hasChildren: u = !1, expanded: d = !1, loading: f = !1, onToggle: p }) => {
1005
- let { axisCenter: m, prefixWidth: h } = q(t), g = i === Math.max(l.length - 1, 0), _ = Oe(i, o, l), v = De({
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 = J({
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: Y.root,
1112
+ className: Z.root,
1022
1113
  "data-testid": "hierarchy-tree",
1023
1114
  children: [/* @__PURE__ */ c("div", {
1024
- className: Y.gutter,
1115
+ className: Z.gutter,
1025
1116
  style: { width: h },
1026
1117
  children: [
1027
1118
  b ? /* @__PURE__ */ s("span", {
1028
- className: Y.divider,
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: Y.rail,
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: Y.rail,
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: Y.loading,
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(Y.toggle, d && Y.toggleExpanded),
1147
+ className: y(Z.toggle, d && Z.toggleExpanded),
1057
1148
  style: { left: m },
1058
1149
  "aria-expanded": d,
1059
1150
  onClick: (e) => {
1060
- X(e), p?.();
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: Y.value,
1160
+ className: Z.value,
1070
1161
  children: n
1071
1162
  })]
1072
1163
  });
1073
- }, ke = (e) => e.loadMore ? /* @__PURE__ */ s(Z, {
1164
+ }, Re = (e) => e.loadMore ? /* @__PURE__ */ s($, {
1074
1165
  depth: e.depth,
1075
1166
  loadMore: e.loadMore
1076
- }) : /* @__PURE__ */ s(Q, { ...e });
1167
+ }) : /* @__PURE__ */ s(Le, { ...e });
1077
1168
  //#endregion
1078
- export { k as _, he as a, B as c, F as d, N as f, te as g, ee as h, ye as i, ce as l, L as m, Ee as n, pe as o, R as p, Ce as r, de as s, ke as t, le as u, E as v, M as y };
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 };