@helpwave/hightide 0.6.9 → 0.6.10

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.js CHANGED
@@ -13599,17 +13599,20 @@ var import_clsx27 = __toESM(require("clsx"));
13599
13599
  var import_jsx_runtime56 = require("react/jsx-runtime");
13600
13600
  var TableBody = import_react58.default.memo(function TableBodyVisual() {
13601
13601
  const { table, onRowClick, onFillerRowClick, isUsingFillerRows, fillerRowCell, pagination, rows } = useTableDataContext();
13602
- const pinnedColumnsLeft = table.getState().columnPinning?.left ?? [];
13603
- const pinnedColumnsRight = table.getState().columnPinning?.right ?? [];
13604
- let columnOrder = table.getState().columnOrder;
13605
- columnOrder = [...pinnedColumnsLeft, ...columnOrder.filter((id) => !pinnedColumnsLeft.includes(id) && !pinnedColumnsRight.includes(id)), ...pinnedColumnsRight];
13606
- const columnVisibility = table.getState().columnVisibility;
13607
- const columns = columnOrder.map((id) => {
13608
- const column = table.getColumn(id);
13609
- if (!column) return null;
13610
- if (columnVisibility[id] === false) return null;
13611
- return column;
13612
- }).filter(Boolean);
13602
+ const state = table.getState();
13603
+ const baseOrder = state.columnOrder?.length ? state.columnOrder : table.getVisibleLeafColumns().map((col) => col.id);
13604
+ const pinnedLeft = state.columnPinning?.left ?? [];
13605
+ const pinnedRight = state.columnPinning?.right ?? [];
13606
+ const columnOrder = [
13607
+ ...pinnedLeft,
13608
+ ...baseOrder.filter(
13609
+ (id) => !pinnedLeft.includes(id) && !pinnedRight.includes(id)
13610
+ ),
13611
+ ...pinnedRight
13612
+ ];
13613
+ const columns = columnOrder.map((id) => table.getColumn(id)).filter(
13614
+ (col) => !!col && state.columnVisibility?.[col.id] !== false
13615
+ );
13613
13616
  return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("tbody", { children: [
13614
13617
  rows.map((row) => {
13615
13618
  return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(