@underverse-ui/underverse 0.2.69 → 0.2.70
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/index.cjs +7 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -13145,6 +13145,12 @@ function DataTable({
|
|
|
13145
13145
|
const cellPadding = density === "compact" ? "py-1.5 px-3" : density === "comfortable" ? "py-3 px-4" : "py-2.5 px-4";
|
|
13146
13146
|
const visibleColsSet = import_react32.default.useMemo(() => new Set(visibleCols), [visibleCols]);
|
|
13147
13147
|
const visibleColumns = columns.filter((c) => visibleColsSet.has(c.key));
|
|
13148
|
+
const totalColumnsWidth = import_react32.default.useMemo(() => {
|
|
13149
|
+
return visibleColumns.reduce((sum, col) => {
|
|
13150
|
+
const colWidth = typeof col.width === "number" ? col.width : parseInt(String(col.width) || "150", 10);
|
|
13151
|
+
return sum + colWidth;
|
|
13152
|
+
}, 0);
|
|
13153
|
+
}, [visibleColumns]);
|
|
13148
13154
|
const stickyPositions = import_react32.default.useMemo(() => {
|
|
13149
13155
|
const positions = {};
|
|
13150
13156
|
let leftOffset = 0;
|
|
@@ -13500,6 +13506,7 @@ function DataTable({
|
|
|
13500
13506
|
"table-fixed",
|
|
13501
13507
|
stickyHeader && ["[&_thead]:sticky", "[&_thead]:top-0", "[&_thead]:z-20", "[&_thead]:shadow-[0_1px_3px_rgba(0,0,0,0.1)]"]
|
|
13502
13508
|
),
|
|
13509
|
+
style: { minWidth: totalColumnsWidth > 0 ? `${totalColumnsWidth}px` : void 0 },
|
|
13503
13510
|
children: [
|
|
13504
13511
|
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(TableHeader, { children: renderHeader }),
|
|
13505
13512
|
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(TableBody, { children: loading2 ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(TableCell, { colSpan: visibleColumns.length, className: "text-center py-8", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "flex items-center justify-center gap-2 text-muted-foreground", children: [
|