feat(mui): fixed-width DataTable columns + restore Projects next-number hint

DataTable: optional per-column width; when any column sets one, the table uses table-layout:fixed with a colgroup so columns keep a stable size instead of reflowing as rows are filtered (overflow clipped with ellipsis). Tables without widths keep auto layout. Projects: assign column widths; restore the original '(přiděleno automaticky)' suffix on the next-number hint.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
BOHA
2026-06-06 23:02:40 +02:00
parent 1b372b93ea
commit 26f12b01a0
2 changed files with 45 additions and 3 deletions

View File

@@ -245,6 +245,7 @@ export default function Projects() {
{
key: "project_number",
header: "Číslo",
width: "12%",
sortKey: "project_number",
mono: true,
render: (p) => p.project_number,
@@ -252,6 +253,7 @@ export default function Projects() {
{
key: "name",
header: "Název",
width: "16%",
sortKey: "name",
bold: true,
render: (p) => p.name || "—",
@@ -259,16 +261,19 @@ export default function Projects() {
{
key: "customer",
header: "Zákazník",
width: "13%",
render: (p) => p.customer_name || "—",
},
{
key: "responsible",
header: "Zodpovědná osoba",
width: "14%",
render: (p) => p.responsible_user_name || "—",
},
{
key: "status",
header: "Stav",
width: "10%",
sortKey: "status",
render: (p) => (
<StatusChip
@@ -280,6 +285,7 @@ export default function Projects() {
{
key: "order",
header: "Objednávka",
width: "12%",
render: (p) =>
p.order_id ? (
<Box
@@ -300,18 +306,21 @@ export default function Projects() {
{
key: "start_date",
header: "Začátek",
width: "8%",
mono: true,
render: (p) => formatDate(p.start_date),
},
{
key: "end_date",
header: "Konec",
width: "8%",
mono: true,
render: (p) => formatDate(p.end_date),
},
{
key: "actions",
header: "Akce",
width: "7%",
align: "right",
render: (p) => (
<Box sx={{ display: "flex", gap: 0.5, justifyContent: "flex-end" }}>
@@ -443,7 +452,7 @@ export default function Projects() {
nextNumberQuery.data?.number ??
nextNumberQuery.data?.next_number ??
""
}`}
} (přiděleno automaticky)`}
submitText="Vytvořit"
loading={creating}
>