+ {/* Selection checkbox (always left) */}
+ {features.selection && (
+ |
+ toggleSelect(row[rowKey])}
+ />
+ |
)}
-
- );
- }
+
+ {/* Expand toggle next to selection */}
+ {features.expand && (
+
+
+ |
+ )}
+
+ {/* Data columns */}
+ {visibleColumns.map((col) => {
+ const style = {
+ minWidth: col.width || 120,
+ width: col.width || undefined,
+ };
+
+ if (col.pinned) style.position = "sticky";
+ if (col.pinned === "left")
+ style.left = `${getLeftOffset(colState, col.key)}px`;
+ if (col.pinned === "right")
+ style.right = `${getRightOffset(colState, col.key)}px`;
+
+ return (
+
+ {col.render ? col.render(row) : row[col.key] ?? ""}
+ |
+ );
+ })}
+
+ {/* Actions column (always right) */}
+ {features.actions && (
+
+
+ {Array.isArray(features.actions)
+ ? features.actions.map((act, i) => (
+
+ ))
+ : typeof features.actions === "function"
+ ? features.actions(row, toggleExpand)
+ : null}
+
+ |
+ )}
+
+
+ {/* 🔹 5. Expanded row content (full width) */}
+ {isExpanded && renderExpanded && (
+