@flowselections/layout-maker 1.69.61 → 1.69.63

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 (70) hide show
  1. package/dist-lib/components/AfleverbriefBuilderPage.d.ts.map +1 -1
  2. package/dist-lib/components/AfleverbriefBuilderPage.js +2 -1
  3. package/dist-lib/components/DocumentenPage.js +1 -1
  4. package/dist-lib/components/PakbonBuilderPage.d.ts.map +1 -1
  5. package/dist-lib/components/PakbonBuilderPage.js +2 -1
  6. package/dist-lib/components/PakbonSectiesPanel.d.ts +9 -6
  7. package/dist-lib/components/PakbonSectiesPanel.d.ts.map +1 -1
  8. package/dist-lib/components/PakbonSectiesPanel.js +93 -51
  9. package/dist-lib/components/PlekInstellingen.d.ts.map +1 -1
  10. package/dist-lib/components/PlekInstellingen.js +2 -2
  11. package/dist-lib/components/ProductiebonBlokkenPanel.d.ts +4 -3
  12. package/dist-lib/components/ProductiebonBlokkenPanel.d.ts.map +1 -1
  13. package/dist-lib/components/ProductiebonBlokkenPanel.js +50 -23
  14. package/dist-lib/components/ProductiebonBuilderPage.js +1 -1
  15. package/dist-lib/components/VersieBewerkenPage.d.ts.map +1 -1
  16. package/dist-lib/components/VersieBewerkenPage.js +28 -17
  17. package/dist-lib/components/layoutBewerker/NogGeenLogo.d.ts +7 -0
  18. package/dist-lib/components/layoutBewerker/NogGeenLogo.d.ts.map +1 -0
  19. package/dist-lib/components/layoutBewerker/NogGeenLogo.js +22 -0
  20. package/dist-lib/components/layoutBewerker/OnderdelenLijst.d.ts +28 -0
  21. package/dist-lib/components/layoutBewerker/OnderdelenLijst.d.ts.map +1 -0
  22. package/dist-lib/components/layoutBewerker/OnderdelenLijst.js +31 -0
  23. package/dist-lib/integrations/supabase/types.d.ts +64 -0
  24. package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
  25. package/dist-lib/lib/bewerkerContext.d.ts +21 -0
  26. package/dist-lib/lib/bewerkerContext.d.ts.map +1 -0
  27. package/dist-lib/lib/bewerkerContext.js +8 -0
  28. package/dist-lib/lib/factuurPdf.d.ts.map +1 -1
  29. package/dist-lib/lib/factuurPdf.js +7 -0
  30. package/dist-lib/lib/htmlPdf.server.d.ts.map +1 -1
  31. package/dist-lib/lib/htmlPdf.server.js +5 -3
  32. package/dist-lib/lib/layoutOpslaan.d.ts +1 -0
  33. package/dist-lib/lib/layoutOpslaan.d.ts.map +1 -1
  34. package/dist-lib/lib/layoutOpslaan.js +7 -2
  35. package/dist-lib/lib/layoutStand.d.ts +11 -0
  36. package/dist-lib/lib/layoutStand.d.ts.map +1 -0
  37. package/dist-lib/lib/layoutStand.js +17 -0
  38. package/dist-lib/lib/onderdelenPerSoort.d.ts +9 -0
  39. package/dist-lib/lib/onderdelenPerSoort.d.ts.map +1 -0
  40. package/dist-lib/lib/onderdelenPerSoort.js +80 -0
  41. package/dist-lib/lib/paginaVoet.d.ts +6 -0
  42. package/dist-lib/lib/paginaVoet.d.ts.map +1 -0
  43. package/dist-lib/lib/paginaVoet.js +15 -0
  44. package/dist-lib/lib/pakbonHtml.d.ts +2 -0
  45. package/dist-lib/lib/pakbonHtml.d.ts.map +1 -1
  46. package/dist-lib/lib/pakbonHtml.js +21 -9
  47. package/dist-lib/lib/plekLabelprinters.d.ts +0 -1
  48. package/dist-lib/lib/plekLabelprinters.d.ts.map +1 -1
  49. package/dist-lib/lib/plekLabelprinters.js +0 -1
  50. package/dist-lib/lib/plekRechterblok.d.ts +4 -1
  51. package/dist-lib/lib/plekRechterblok.d.ts.map +1 -1
  52. package/dist-lib/lib/plekRechterblok.js +12 -3
  53. package/dist-lib/lib/printQueue.server.d.ts +7 -0
  54. package/dist-lib/lib/printQueue.server.d.ts.map +1 -1
  55. package/dist-lib/lib/printQueue.server.js +36 -4
  56. package/dist-lib/lib/productiebonHtml.d.ts.map +1 -1
  57. package/dist-lib/lib/productiebonHtml.js +3 -0
  58. package/dist-lib/lib/useDocumentData.d.ts.map +1 -1
  59. package/dist-lib/lib/useDocumentData.js +2 -0
  60. package/dist-lib/lib/useMinBreedte.d.ts +2 -0
  61. package/dist-lib/lib/useMinBreedte.d.ts.map +1 -0
  62. package/dist-lib/lib/useMinBreedte.js +14 -0
  63. package/dist-lib/lib/vanzelfOpslaan.d.ts +3 -1
  64. package/dist-lib/lib/vanzelfOpslaan.d.ts.map +1 -1
  65. package/dist-lib/lib/vanzelfOpslaan.js +61 -15
  66. package/dist-lib/lib/versie.generated.d.ts +1 -1
  67. package/dist-lib/lib/versie.generated.js +1 -1
  68. package/package.json +1 -1
  69. package/sql/print-schema.sql +241 -211
  70. package/sql/print-schema.verslag.md +9 -2
@@ -1 +1 @@
1
- {"version":3,"file":"AfleverbriefBuilderPage.d.ts","sourceRoot":"","sources":["../../src/components/AfleverbriefBuilderPage.tsx"],"names":[],"mappings":"AA6BA,OAAO,EAAqB,KAAK,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAG7E;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAe,EAAE,eAAe,EAAE,WAAW,EAAE,gBAAgB,EAAE,GAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,YAAiB,+BAwM7K"}
1
+ {"version":3,"file":"AfleverbriefBuilderPage.d.ts","sourceRoot":"","sources":["../../src/components/AfleverbriefBuilderPage.tsx"],"names":[],"mappings":"AA8BA,OAAO,EAAqB,KAAK,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAG7E;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAe,EAAE,eAAe,EAAE,WAAW,EAAE,gBAAgB,EAAE,GAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,YAAiB,+BA0M7K"}
@@ -5,6 +5,7 @@ import { Badge, Button, Card, CardContent, CardDescription, CardHeader, CardTitl
5
5
  import { AlertTriangle, ArrowLeft, CheckCircle2, Loader2, Printer, Save } from "lucide-react";
6
6
  import { PakbonSectiesPanel } from "./PakbonSectiesPanel.js";
7
7
  import { PrintbestandVoorbeeld } from "./PrintbestandVoorbeeld.js";
8
+ import { NogGeenLogo } from "./layoutBewerker/NogGeenLogo.js";
8
9
  import { FormaatOrientatieBar } from "./FormaatOrientatieBar.js";
9
10
  import { FustKolomVolgorde } from "./FustKolomVolgorde.js";
10
11
  import { AFLEVERBRIEF_SECTIE_TYPES, leesAfleverbriefConfig, } from "../lib/pakbonBuilder.js";
@@ -116,5 +117,5 @@ export function AfleverbriefBuilderPage({ layoutId: layoutIdProp, ingebed = fals
116
117
  return _jsx("main", { className: "p-6 text-sm text-muted-foreground", children: "Layout laden\u2026" });
117
118
  if (!layout || !config)
118
119
  return _jsx("main", { className: "p-6 text-sm text-muted-foreground", children: "Layout niet gevonden." });
119
- return (_jsxs("main", { className: "space-y-4 p-6", children: [!ingebed && (_jsxs("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx(Button, { variant: "ghost", size: "sm", asChild: true, children: _jsxs(Link, { to: "/layouts-printers/documenten", children: [_jsx(ArrowLeft, { className: "mr-2 h-4 w-4" }), " Layouts"] }) }), _jsxs("div", { children: [_jsx("h1", { className: "text-lg font-semibold", children: layout.naam }), _jsxs("p", { className: "text-xs text-muted-foreground", children: ["Afleverbrief per kar \u00B7 ", config.secties.length, " secties"] })] })] }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(LayoutPrinterSelect, { layoutId: layoutId }), _jsxs(Button, { size: "sm", variant: "outline", onClick: () => void voorbeeldPrinten(), disabled: printen || controle !== "gereed", children: [printen ? (_jsx(Loader2, { className: "mr-2 h-4 w-4 animate-spin" })) : (_jsx(Printer, { className: "mr-2 h-4 w-4" })), "Voorbeeld printen"] }), _jsx(Button, { size: "sm", variant: "outline", asChild: true, children: _jsx(Link, { to: "/layouts-printers/blokken/$layoutId", params: { layoutId }, children: "Blokken ontwerpen" }) }), _jsxs(Button, { size: "sm", onClick: opslaan, disabled: bezig || Boolean(layout.systeem), children: [_jsx(Save, { className: "mr-2 h-4 w-4" }), " Opslaan"] })] })] })), layout.systeem ? _jsx(SysteemLayoutMelding, { layoutId: layout.id, route: "afleverbrief" }) : null, !ingebed && _jsx(FormaatOrientatieBar, { layout: layout, onChange: (patch) => setLayout((l) => (l ? { ...l, ...patch } : l)), vergrendeld: Boolean(layout.systeem) }), _jsxs("div", { className: ingebed ? "grid items-start gap-4 lg:grid-cols-[16rem_minmax(0,1fr)]" : "grid items-start gap-4 lg:grid-cols-[400px_1fr]", children: [_jsxs(Card, { className: ingebed ? "flex flex-col" : "flex h-[calc(100vh-14rem)] min-h-[420px] flex-col overflow-hidden lg:sticky lg:top-4", children: [!ingebed && (_jsxs(CardHeader, { className: "pb-3", children: [_jsx(CardTitle, { className: "text-base", children: "Secties" }), _jsx(CardDescription, { children: "Voeg blokken toe, wijzig de volgorde en stel elk blok afzonderlijk in." })] })), _jsx(CardContent, { className: "min-h-0 flex-1 overflow-y-auto", children: _jsx(PakbonSectiesPanel, { config: config, onChange: setConfig, beschikbareTypes: AFLEVERBRIEF_SECTIE_TYPES, documenttype: "afleverbrief", referentie: referentieConfig === undefined ? null : leesAfleverbriefConfig(referentieConfig).secties }) })] }), _jsxs(Card, { className: ingebed ? "flex min-h-[75vh] flex-col" : "flex h-[calc(100vh-14rem)] min-h-[420px] flex-col overflow-hidden", children: [!ingebed && (_jsxs(CardHeader, { className: "flex-row items-center justify-between space-y-0 pb-3", children: [_jsxs("div", { children: [_jsx(CardTitle, { className: "text-base", children: "Live voorbeeld" }), _jsx(CardDescription, { children: "Voorbeeld van de afleverbrief van \u00E9\u00E9n kar." })] }), _jsxs(Badge, { variant: controle === "afwijking" ? "destructive" : "secondary", children: [controle === "controleren" ? _jsx(Loader2, { className: "mr-1 h-3 w-3 animate-spin" }) : controle === "gereed" ? _jsx(CheckCircle2, { className: "mr-1 h-3 w-3" }) : _jsx(AlertTriangle, { className: "mr-1 h-3 w-3" }), controle === "controleren" ? "Controleren" : controle === "gereed" ? "Afdruk gereed" : "Afwijking gevonden"] })] })), _jsxs(CardContent, { className: "flex min-h-0 flex-1 flex-col overflow-hidden p-0", children: [_jsx(FustKolomVolgorde, { config: config, onChange: setConfig }), _jsx("div", { className: "min-h-0 flex-1 p-4 pt-3", children: _jsx("div", { className: "h-full rounded-md border bg-muted/30 p-2", children: voorbeeldHtml ? (_jsx(PrintbestandVoorbeeld, { layoutId: layout?.id ?? layoutId, sleutel: "afleverbrief", indeling: config, onControle: (status, fout) => { setControle(status); setControleFout(fout ?? null); } })) : null }) })] })] })] })] }));
120
+ return (_jsxs("main", { className: "space-y-4 p-6", children: [!ingebed && (_jsxs("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx(Button, { variant: "ghost", size: "sm", asChild: true, children: _jsxs(Link, { to: "/layouts-printers/documenten", children: [_jsx(ArrowLeft, { className: "mr-2 h-4 w-4" }), " Layouts"] }) }), _jsxs("div", { children: [_jsx("h1", { className: "text-lg font-semibold", children: layout.naam }), _jsxs("p", { className: "text-xs text-muted-foreground", children: ["Afleverbrief per kar \u00B7 ", config.secties.length, " secties"] })] })] }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(LayoutPrinterSelect, { layoutId: layoutId }), _jsxs(Button, { size: "sm", variant: "outline", onClick: () => void voorbeeldPrinten(), disabled: printen || controle !== "gereed", children: [printen ? (_jsx(Loader2, { className: "mr-2 h-4 w-4 animate-spin" })) : (_jsx(Printer, { className: "mr-2 h-4 w-4" })), "Voorbeeld printen"] }), _jsx(Button, { size: "sm", variant: "outline", asChild: true, children: _jsx(Link, { to: "/layouts-printers/blokken/$layoutId", params: { layoutId }, children: "Blokken ontwerpen" }) }), _jsxs(Button, { size: "sm", onClick: opslaan, disabled: bezig || Boolean(layout.systeem), children: [_jsx(Save, { className: "mr-2 h-4 w-4" }), " Opslaan"] })] })] })), layout.systeem ? _jsx(SysteemLayoutMelding, { layoutId: layout.id, route: "afleverbrief" }) : null, !ingebed && _jsx(FormaatOrientatieBar, { layout: layout, onChange: (patch) => setLayout((l) => (l ? { ...l, ...patch } : l)), vergrendeld: Boolean(layout.systeem) }), _jsxs("div", { className: ingebed ? "grid items-start gap-4 lg:grid-cols-[17rem_minmax(0,1fr)]" : "grid items-start gap-4 lg:grid-cols-[400px_1fr]", children: [_jsxs(Card, { className: ingebed ? "flex flex-col lg:sticky lg:top-4" : "flex h-[calc(100vh-14rem)] min-h-[420px] flex-col overflow-hidden lg:sticky lg:top-4", children: [!ingebed && (_jsxs(CardHeader, { className: "pb-3", children: [_jsx(CardTitle, { className: "text-base", children: "Secties" }), _jsx(CardDescription, { children: "Voeg blokken toe, wijzig de volgorde en stel elk blok afzonderlijk in." })] })), _jsx(CardContent, { className: "min-h-0 flex-1 overflow-y-auto", children: _jsx(PakbonSectiesPanel, { config: config, onChange: setConfig, beschikbareTypes: AFLEVERBRIEF_SECTIE_TYPES, documenttype: "afleverbrief", uit: Boolean(layout.systeem), referentie: referentieConfig === undefined ? null : leesAfleverbriefConfig(referentieConfig).secties }) })] }), _jsxs(Card, { className: ingebed ? "flex min-h-[75vh] flex-col border-0 bg-transparent shadow-none" : "flex h-[calc(100vh-14rem)] min-h-[420px] flex-col overflow-hidden", children: [!ingebed && (_jsxs(CardHeader, { className: "flex-row items-center justify-between space-y-0 pb-3", children: [_jsxs("div", { children: [_jsx(CardTitle, { className: "text-base", children: "Live voorbeeld" }), _jsx(CardDescription, { children: "Voorbeeld van de afleverbrief van \u00E9\u00E9n kar." })] }), _jsxs(Badge, { variant: controle === "afwijking" ? "destructive" : "secondary", children: [controle === "controleren" ? _jsx(Loader2, { className: "mr-1 h-3 w-3 animate-spin" }) : controle === "gereed" ? _jsx(CheckCircle2, { className: "mr-1 h-3 w-3" }) : _jsx(AlertTriangle, { className: "mr-1 h-3 w-3" }), controle === "controleren" ? "Controleren" : controle === "gereed" ? "Afdruk gereed" : "Afwijking gevonden"] })] })), _jsxs(CardContent, { className: "flex min-h-0 flex-1 flex-col overflow-hidden p-0", children: [_jsx(FustKolomVolgorde, { config: config, onChange: setConfig }), _jsxs("div", { className: "min-h-0 flex-1 p-4 pt-3", children: [ingebed && _jsx(NogGeenLogo, { config: config }), _jsx("div", { className: "h-full rounded-md border bg-muted/30 p-2", children: voorbeeldHtml ? (_jsx(PrintbestandVoorbeeld, { layoutId: layout?.id ?? layoutId, sleutel: "afleverbrief", indeling: config, onControle: (status, fout) => { setControle(status); setControleFout(fout ?? null); } })) : null })] })] })] })] })] }));
120
121
  }
@@ -318,7 +318,7 @@ function DocumentenOverzicht({ focusKaart }) {
318
318
  const toonActiefId = opt[groepSleutel] ?? g?.actiefId ?? null;
319
319
  const bronVoorNieuw = g?.actiefId ?? eigen[0]?.id ?? null;
320
320
  const sticker = isStickerKaart(kaart.id);
321
- return (_jsxs("div", { children: [_jsxs("header", { className: "flex items-center gap-3 border-b border-border p-4", children: [_jsx("span", { className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-md bg-muted text-primary", children: _jsx(Icoon, { className: "h-5 w-5" }) }), _jsxs("h2", { className: "min-w-0 truncate text-lg font-semibold text-card-foreground", children: [kaart.naam, gekozen.sub ? ` · ${gekozen.sub}` : ""] })] }), sticker ? (_jsxs("div", { className: "space-y-4 p-4", children: [_jsx(StickerInstellingenKaart, {}), floridayActief && MET_FLORIDAY.includes(kaart.id) && (_jsxs("div", { className: "flex items-center gap-3", children: [_jsx(FloridayMerk, {}), _jsx("p", { className: "text-xs text-muted-foreground", children: "Floriday-orders: sticker van Floriday, niet aan te passen" })] }))] })) : (_jsxs("div", { className: "space-y-4 p-4", children: [!kaart.alleenFloriday && gekozen.actief && (_jsxs(_Fragment, { children: [_jsx(PrintbestandVoorbeeld, { layoutId: gekozen.actief.id, klein: true }), floridayActief && MET_FLORIDAY.includes(kaart.id) && (_jsx("div", { className: "flex flex-col gap-0.5 text-sm text-foreground", children: _jsx(ActieveLayout, { naam: gekozen.actiefNaam, alleenFloriday: false, metFloriday: true }) })), _jsxs("div", { className: "flex items-center justify-between gap-2", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("p", { className: "truncate font-medium text-card-foreground", children: gekozen.actiefNaam }), _jsx("p", { className: "text-xs text-muted-foreground", children: sticker ? gekozen.formaat : "Papier kies je per printplek" })] }), _jsxs(Badge, { variant: "outline", className: "shrink-0 gap-1 border-success text-success", children: [_jsx(Check, { className: "h-3 w-3" }), " Actief"] })] }), !sticker && _jsxs(Button, { className: "w-full", disabled: bezig, onClick: () => openOfKopie(gekozen.actief, kaart, bestaand), children: [_jsx(Pencil, { className: "mr-2 h-4 w-4" }), " Lay-out bewerken"] })] })), !kaart.alleenFloriday && !gekozen.actief && _jsx("p", { className: "text-sm text-muted-foreground", children: "Nog geen versie." }), _jsxs("div", { children: [!kaart.alleenFloriday && (_jsx("div", { className: "border-t border-border pt-4", children: _jsx(KopMetLink, { titel: "Versies", link: sticker ? undefined : "Nieuwe versie", disabled: bezig || !bronVoorNieuw, onLink: () => bronVoorNieuw && void kopie(bronVoorNieuw, kaart, bestaand) }) })), _jsxs("ul", { className: `mt-2 ${LIJST}`, children: [!kaart.alleenFloriday && (g?.versies ?? []).map((v) => {
321
+ return (_jsxs("div", { children: [_jsxs("header", { className: "flex items-center gap-3 border-b border-border p-4", children: [_jsx("span", { className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-md bg-muted text-primary", children: _jsx(Icoon, { className: "h-5 w-5" }) }), _jsxs("h2", { className: "min-w-0 truncate text-lg font-semibold text-card-foreground", children: [kaart.naam, gekozen.sub ? ` · ${gekozen.sub}` : ""] })] }), sticker ? (_jsx("div", { className: "space-y-4 p-4", children: _jsx(StickerInstellingenKaart, {}) })) : (_jsxs("div", { className: "space-y-4 p-4", children: [!kaart.alleenFloriday && gekozen.actief && (_jsxs(_Fragment, { children: [_jsx(PrintbestandVoorbeeld, { layoutId: gekozen.actief.id, klein: true }), floridayActief && MET_FLORIDAY.includes(kaart.id) && (_jsx("div", { className: "flex flex-col gap-0.5 text-sm text-foreground", children: _jsx(ActieveLayout, { naam: gekozen.actiefNaam, alleenFloriday: false, metFloriday: true }) })), _jsxs("div", { className: "flex items-center justify-between gap-2", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("p", { className: "truncate font-medium text-card-foreground", children: gekozen.actiefNaam }), _jsx("p", { className: "text-xs text-muted-foreground", children: sticker ? gekozen.formaat : "Papier kies je per printplek" })] }), _jsxs(Badge, { variant: "outline", className: "shrink-0 gap-1 border-success text-success", children: [_jsx(Check, { className: "h-3 w-3" }), " Actief"] })] }), !sticker && _jsxs(Button, { className: "w-full", disabled: bezig, onClick: () => openOfKopie(gekozen.actief, kaart, bestaand), children: [_jsx(Pencil, { className: "mr-2 h-4 w-4" }), " Lay-out bewerken"] })] })), !kaart.alleenFloriday && !gekozen.actief && _jsx("p", { className: "text-sm text-muted-foreground", children: "Nog geen versie." }), _jsxs("div", { children: [!kaart.alleenFloriday && (_jsx("div", { className: "border-t border-border pt-4", children: _jsx(KopMetLink, { titel: "Versies", link: sticker ? undefined : "Nieuwe versie", disabled: bezig || !bronVoorNieuw, onLink: () => bronVoorNieuw && void kopie(bronVoorNieuw, kaart, bestaand) }) })), _jsxs("ul", { className: `mt-2 ${LIJST}`, children: [!kaart.alleenFloriday && (g?.versies ?? []).map((v) => {
322
322
  const naam = namen.get(v.id) ?? v.naam;
323
323
  const plekken = gebruik.get(v.id) ?? [];
324
324
  const std = v.id === g.stdId || standaardIds.has(v.id);
@@ -1 +1 @@
1
- {"version":3,"file":"PakbonBuilderPage.d.ts","sourceRoot":"","sources":["../../src/components/PakbonBuilderPage.tsx"],"names":[],"mappings":"AA8BA,OAAO,EAAqB,KAAK,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAI7E,iFAAiF;AACjF,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAe,EAAE,eAAe,EAAE,WAAW,EAAE,gBAAgB,EAAE,GAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,YAAiB,+BAyOvK"}
1
+ {"version":3,"file":"PakbonBuilderPage.d.ts","sourceRoot":"","sources":["../../src/components/PakbonBuilderPage.tsx"],"names":[],"mappings":"AA+BA,OAAO,EAAqB,KAAK,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAI7E,iFAAiF;AACjF,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAe,EAAE,eAAe,EAAE,WAAW,EAAE,gBAAgB,EAAE,GAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,YAAiB,+BA4OvK"}
@@ -6,6 +6,7 @@ import { Badge, Button, Card, CardContent, CardDescription, CardHeader, CardTitl
6
6
  import { AlertTriangle, ArrowLeft, CheckCircle2, Loader2, Printer, Save } from "lucide-react";
7
7
  import { PakbonSectiesPanel } from "./PakbonSectiesPanel.js";
8
8
  import { PrintbestandVoorbeeld } from "./PrintbestandVoorbeeld.js";
9
+ import { NogGeenLogo } from "./layoutBewerker/NogGeenLogo.js";
9
10
  import { FormaatOrientatieBar } from "./FormaatOrientatieBar.js";
10
11
  import { leesPakbonConfig, pickMethode } from "../lib/pakbonBuilder.js";
11
12
  import { renderPakbonDocument, voorbeeldPakbonOrder } from "../lib/pakbonHtml.js";
@@ -121,5 +122,5 @@ export function PakbonBuilderPage({ layoutId: layoutIdProp, ingebed = false, doe
121
122
  return _jsx("main", { className: "p-6 text-sm text-muted-foreground", children: "Layout laden\u2026" });
122
123
  if (!layout || !config)
123
124
  return _jsx("main", { className: "p-6 text-sm text-muted-foreground", children: "Layout niet gevonden." });
124
- return (_jsxs("main", { className: "space-y-4 p-6", children: [!ingebed && (_jsxs("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx(Button, { variant: "ghost", size: "sm", asChild: true, children: _jsxs(Link, { to: "/layouts-printers/documenten", children: [_jsx(ArrowLeft, { className: "mr-2 h-4 w-4" }), " Layouts"] }) }), _jsxs("div", { children: [_jsx("h1", { className: "text-lg font-semibold", children: layout.naam }), _jsxs("p", { className: "text-xs text-muted-foreground", children: ["Pakbon opbouwen uit secties \u00B7 ", config.secties.length, " secties"] })] })] }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(LayoutPrinterSelect, { layoutId: layoutId }), _jsxs(Button, { size: "sm", variant: "outline", onClick: () => void voorbeeldPrinten(), disabled: printen || controle !== "gereed", children: [printen ? (_jsx(Loader2, { className: "mr-2 h-4 w-4 animate-spin" })) : (_jsx(Printer, { className: "mr-2 h-4 w-4" })), "Voorbeeld printen"] }), _jsx(Button, { size: "sm", variant: "outline", asChild: true, children: _jsx(Link, { to: "/layouts-printers/blokken/$layoutId", params: { layoutId }, children: "Blokken ontwerpen" }) }), _jsxs(Button, { size: "sm", onClick: opslaan, disabled: bezig || Boolean(layout.systeem), children: [_jsx(Save, { className: "mr-2 h-4 w-4" }), " Opslaan"] })] })] })), layout.systeem ? _jsx(SysteemLayoutMelding, { layoutId: layout.id, route: "pakbon" }) : null, !ingebed && _jsx(FormaatOrientatieBar, { layout: layout, onChange: (patch) => setLayout((l) => (l ? { ...l, ...patch } : l)), vergrendeld: Boolean(layout.systeem) }), _jsxs("div", { className: ingebed ? "grid items-start gap-4 lg:grid-cols-[16rem_minmax(0,1fr)]" : "grid items-start gap-4 lg:grid-cols-[400px_1fr]", children: [_jsxs(Card, { className: ingebed ? "flex flex-col" : "flex h-[calc(100vh-14rem)] min-h-[420px] flex-col overflow-hidden lg:sticky lg:top-4", children: [!ingebed && (_jsxs(CardHeader, { className: "pb-3", children: [_jsx(CardTitle, { className: "text-base", children: "Secties" }), _jsx(CardDescription, { children: "Voeg blokken toe, wijzig de volgorde en stel elk blok afzonderlijk in." })] })), _jsx(CardContent, { className: "min-h-0 flex-1 overflow-y-auto", children: _jsx(PakbonSectiesPanel, { config: config, onChange: setConfig, documenttype: "pakbon", referentie: referentieConfig === undefined ? null : leesPakbonConfig(referentieConfig).secties }) })] }), _jsxs(Card, { className: ingebed ? "flex min-h-[75vh] flex-col" : "flex h-[calc(100vh-14rem)] min-h-[420px] flex-col overflow-hidden", children: [!ingebed && (_jsxs(CardHeader, { className: "flex-row items-center justify-between space-y-0 pb-3", children: [_jsxs("div", { children: [_jsx(CardTitle, { className: "text-base", children: "Live voorbeeld" }), _jsx(CardDescription, { children: "Bekijk een volle kar of een deelkar met alleen de te verzamelen fusten." })] }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsxs(Select, { value: voorbeeldVariant, onValueChange: (value) => setVoorbeeldVariant(value), children: [_jsx(SelectTrigger, { className: "w-48", "aria-label": "Voorbeeldvariant", children: _jsx(SelectValue, {}) }), _jsxs(SelectContent, { children: [_jsx(SelectItem, { value: "full_cart", children: "Volle kar" }), _jsx(SelectItem, { value: "partial_order", children: "Deelkar" })] })] }), _jsxs(Badge, { variant: controle === "afwijking" ? "destructive" : "secondary", children: [controle === "controleren" ? _jsx(Loader2, { className: "mr-1 h-3 w-3 animate-spin" }) : controle === "gereed" ? _jsx(CheckCircle2, { className: "mr-1 h-3 w-3" }) : _jsx(AlertTriangle, { className: "mr-1 h-3 w-3" }), controle === "controleren" ? "Controleren" : controle === "gereed" ? "Afdruk gereed" : "Afwijking gevonden"] })] })] })), _jsxs(CardContent, { className: "min-h-0 flex-1 overflow-hidden", children: [ingebed && (_jsx("div", { className: "mb-2 flex justify-end", children: _jsxs(Select, { value: voorbeeldVariant, onValueChange: (value) => setVoorbeeldVariant(value), children: [_jsx(SelectTrigger, { className: "h-8 w-36", "aria-label": "Voorbeeldvariant", children: _jsx(SelectValue, {}) }), _jsxs(SelectContent, { children: [_jsx(SelectItem, { value: "full_cart", children: "Volle kar" }), _jsx(SelectItem, { value: "partial_order", children: "Deelkar" })] })] }) })), _jsx("div", { className: "h-full rounded-md border bg-muted/30 p-2", children: voorbeeldHtml ? (_jsx(PrintbestandVoorbeeld, { layoutId: layout?.id ?? layoutId, sleutel: "pakbon", indeling: config, onControle: (status, fout) => { setControle(status); setControleFout(fout ?? null); } })) : null })] })] })] })] }));
125
+ return (_jsxs("main", { className: "space-y-4 p-6", children: [!ingebed && (_jsxs("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx(Button, { variant: "ghost", size: "sm", asChild: true, children: _jsxs(Link, { to: "/layouts-printers/documenten", children: [_jsx(ArrowLeft, { className: "mr-2 h-4 w-4" }), " Layouts"] }) }), _jsxs("div", { children: [_jsx("h1", { className: "text-lg font-semibold", children: layout.naam }), _jsxs("p", { className: "text-xs text-muted-foreground", children: ["Pakbon opbouwen uit secties \u00B7 ", config.secties.length, " secties"] })] })] }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(LayoutPrinterSelect, { layoutId: layoutId }), _jsxs(Button, { size: "sm", variant: "outline", onClick: () => void voorbeeldPrinten(), disabled: printen || controle !== "gereed", children: [printen ? (_jsx(Loader2, { className: "mr-2 h-4 w-4 animate-spin" })) : (_jsx(Printer, { className: "mr-2 h-4 w-4" })), "Voorbeeld printen"] }), _jsx(Button, { size: "sm", variant: "outline", asChild: true, children: _jsx(Link, { to: "/layouts-printers/blokken/$layoutId", params: { layoutId }, children: "Blokken ontwerpen" }) }), _jsxs(Button, { size: "sm", onClick: opslaan, disabled: bezig || Boolean(layout.systeem), children: [_jsx(Save, { className: "mr-2 h-4 w-4" }), " Opslaan"] })] })] })), layout.systeem ? _jsx(SysteemLayoutMelding, { layoutId: layout.id, route: "pakbon" }) : null, !ingebed && _jsx(FormaatOrientatieBar, { layout: layout, onChange: (patch) => setLayout((l) => (l ? { ...l, ...patch } : l)), vergrendeld: Boolean(layout.systeem) }), _jsxs("div", { className: ingebed ? "grid items-start gap-4 lg:grid-cols-[17rem_minmax(0,1fr)]" : "grid items-start gap-4 lg:grid-cols-[400px_1fr]", children: [_jsxs(Card, { className: ingebed ? "flex flex-col lg:sticky lg:top-4" : "flex h-[calc(100vh-14rem)] min-h-[420px] flex-col overflow-hidden lg:sticky lg:top-4", children: [!ingebed && (_jsxs(CardHeader, { className: "pb-3", children: [_jsx(CardTitle, { className: "text-base", children: "Secties" }), _jsx(CardDescription, { children: "Voeg blokken toe, wijzig de volgorde en stel elk blok afzonderlijk in." })] })), _jsx(CardContent, { className: "min-h-0 flex-1 overflow-y-auto", children: _jsx(PakbonSectiesPanel, { config: config, onChange: setConfig, documenttype: "pakbon", uit: Boolean(layout.systeem), referentie: referentieConfig === undefined ? null : leesPakbonConfig(referentieConfig).secties }) })] }), _jsxs(Card, { className: ingebed ? "flex min-h-[75vh] flex-col border-0 bg-transparent shadow-none" : "flex h-[calc(100vh-14rem)] min-h-[420px] flex-col overflow-hidden", children: [!ingebed && (_jsxs(CardHeader, { className: "flex-row items-center justify-between space-y-0 pb-3", children: [_jsxs("div", { children: [_jsx(CardTitle, { className: "text-base", children: "Live voorbeeld" }), _jsx(CardDescription, { children: "Bekijk een volle kar of een deelkar met alleen de te verzamelen fusten." })] }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsxs(Select, { value: voorbeeldVariant, onValueChange: (value) => setVoorbeeldVariant(value), children: [_jsx(SelectTrigger, { className: "w-48", "aria-label": "Voorbeeldvariant", children: _jsx(SelectValue, {}) }), _jsxs(SelectContent, { children: [_jsx(SelectItem, { value: "full_cart", children: "Volle kar" }), _jsx(SelectItem, { value: "partial_order", children: "Deelkar" })] })] }), _jsxs(Badge, { variant: controle === "afwijking" ? "destructive" : "secondary", children: [controle === "controleren" ? _jsx(Loader2, { className: "mr-1 h-3 w-3 animate-spin" }) : controle === "gereed" ? _jsx(CheckCircle2, { className: "mr-1 h-3 w-3" }) : _jsx(AlertTriangle, { className: "mr-1 h-3 w-3" }), controle === "controleren" ? "Controleren" : controle === "gereed" ? "Afdruk gereed" : "Afwijking gevonden"] })] })] })), _jsxs(CardContent, { className: "min-h-0 flex-1 overflow-hidden", children: [ingebed && (_jsx("div", { className: "mb-3 flex justify-center", children: _jsx("div", { role: "radiogroup", "aria-label": "Voorbeeld", className: "inline-flex rounded-md border border-border bg-muted p-0.5", children: [["full_cart", "Volle kar"], ["partial_order", "Deelkar"]].map(([w, t]) => (_jsx("button", { type: "button", role: "radio", "aria-checked": voorbeeldVariant === w, onClick: () => setVoorbeeldVariant(w), className: `rounded px-4 py-1.5 text-sm font-medium ${voorbeeldVariant === w ? "bg-card text-primary shadow-sm" : "text-muted-foreground"}`, children: t }, w))) }) })), ingebed && _jsx(NogGeenLogo, { config: config }), _jsx("div", { className: "h-full rounded-md border bg-muted/30 p-2", children: voorbeeldHtml ? (_jsx(PrintbestandVoorbeeld, { layoutId: layout?.id ?? layoutId, sleutel: "pakbon", indeling: config, onControle: (status, fout) => { setControle(status); setControleFout(fout ?? null); } })) : null })] })] })] })] }));
125
126
  }
@@ -1,20 +1,23 @@
1
1
  import { type PakbonConfig, type PakbonSectie, type PakbonSectieType, type PickMethode } from "../lib/pakbonBuilder.js";
2
- /** Beheer van de secties waaruit de pakbon is opgebouwd. */
3
- export declare function PakbonSectiesPanel({ config, onChange, beschikbareTypes, documenttype, referentie, }: {
2
+ /** Beheer van de onderdelen waaruit pakbon en afleverbrief zijn opgebouwd. */
3
+ export declare function PakbonSectiesPanel({ config, onChange, beschikbareTypes, documenttype, referentie, uit, }: {
4
4
  config: PakbonConfig;
5
5
  onChange: (c: PakbonConfig) => void;
6
- /** Beperkt de keuzelijst met blokken (bijvoorbeeld voor de afleverbrief). */
6
+ /** Beperkt de keuzelijst (bijvoorbeeld voor de afleverbrief). */
7
7
  beschikbareTypes?: PakbonSectieType[];
8
- /** Soort voor de verplichte blokken (slotje). */
8
+ /** Soort voor de verplichte onderdelen (slotje). */
9
9
  documenttype?: string;
10
- /** Blokken van de laatst actieve stand (groen bolletje). */
10
+ /** Onderdelen van de laatst actieve stand (groen bolletje). */
11
11
  referentie?: PakbonSectie[] | null;
12
+ /** Vergrendelde versie: alles staat uit. */
13
+ uit?: boolean;
12
14
  }): import("react").JSX.Element;
13
15
  /** Volledige instellingen van één blok — herbruikt in de blokontwerper. */
14
- export declare function PakbonSectieEditor({ sectie, onChange, methode, }: {
16
+ export declare function PakbonSectieEditor({ sectie, onChange, methode, verbergTitel, }: {
15
17
  sectie: PakbonSectie;
16
18
  onChange: (patch: Partial<PakbonSectie>) => void;
17
19
  methode?: PickMethode;
20
+ verbergTitel?: boolean;
18
21
  }): import("react").JSX.Element;
19
22
  /** Kaderinstellingen (breedte, uitlijning, marges, opmaak) van één blok. */
20
23
  export declare function PakbonBlokKaderEditor({ sectie, onChange, }: {
@@ -1 +1 @@
1
- {"version":3,"file":"PakbonSectiesPanel.d.ts","sourceRoot":"","sources":["../../src/components/PakbonSectiesPanel.tsx"],"names":[],"mappings":"AA2BA,OAAO,EASL,KAAK,YAAY,EAEjB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EACjB,MAAM,sBAAsB,CAAC;AAE9B,4DAA4D;AAC5D,wBAAgB,kBAAkB,CAAC,EACjC,MAAM,EACN,QAAQ,EACR,gBAAgB,EAChB,YAAuB,EACvB,UAAiB,GAClB,EAAE;IACD,MAAM,EAAE,YAAY,CAAC;IACrB,QAAQ,EAAE,CAAC,CAAC,EAAE,YAAY,KAAK,IAAI,CAAC;IACpC,6EAA6E;IAC7E,gBAAgB,CAAC,EAAE,gBAAgB,EAAE,CAAC;IACtC,iDAAiD;IACjD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,4DAA4D;IAC5D,UAAU,CAAC,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC;CACpC,+BAmOA;AA0TD,2EAA2E;AAC3E,wBAAgB,kBAAkB,CAAC,EACjC,MAAM,EACN,QAAQ,EACR,OAAe,GAChB,EAAE;IACD,MAAM,EAAE,YAAY,CAAC;IACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,YAAY,CAAC,KAAK,IAAI,CAAC;IACjD,OAAO,CAAC,EAAE,WAAW,CAAC;CACvB,+BAuHA;AAED,4EAA4E;AAC5E,wBAAgB,qBAAqB,CAAC,EACpC,MAAM,EACN,QAAQ,GACT,EAAE;IACD,MAAM,EAAE,YAAY,CAAC;IACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,YAAY,CAAC,KAAK,IAAI,CAAC;CAClD,+BA4FA"}
1
+ {"version":3,"file":"PakbonSectiesPanel.d.ts","sourceRoot":"","sources":["../../src/components/PakbonSectiesPanel.tsx"],"names":[],"mappings":"AA+BA,OAAO,EASL,KAAK,YAAY,EAEjB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EACjB,MAAM,sBAAsB,CAAC;AAE9B,8EAA8E;AAC9E,wBAAgB,kBAAkB,CAAC,EACjC,MAAM,EACN,QAAQ,EACR,gBAAgB,EAChB,YAAuB,EACvB,UAAiB,EACjB,GAAW,GACZ,EAAE;IACD,MAAM,EAAE,YAAY,CAAC;IACrB,QAAQ,EAAE,CAAC,CAAC,EAAE,YAAY,KAAK,IAAI,CAAC;IACpC,iEAAiE;IACjE,gBAAgB,CAAC,EAAE,gBAAgB,EAAE,CAAC;IACtC,oDAAoD;IACpD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,+DAA+D;IAC/D,UAAU,CAAC,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC;IACnC,4CAA4C;IAC5C,GAAG,CAAC,EAAE,OAAO,CAAC;CACf,+BA0LA;AAkVD,2EAA2E;AAC3E,wBAAgB,kBAAkB,CAAC,EACjC,MAAM,EACN,QAAQ,EACR,OAAe,EACf,YAAoB,GACrB,EAAE;IACD,MAAM,EAAE,YAAY,CAAC;IACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,YAAY,CAAC,KAAK,IAAI,CAAC;IACjD,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,+BAqHA;AAED,4EAA4E;AAC5E,wBAAgB,qBAAqB,CAAC,EACpC,MAAM,EACN,QAAQ,GACT,EAAE;IACD,MAAM,EAAE,YAAY,CAAC;IACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,YAAY,CAAC,KAAK,IAAI,CAAC;CAClD,+BA4FA"}
@@ -1,56 +1,90 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { useState } from "react";
3
- import { Badge, Button, Input, Label, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, Separator, Dialog, DialogContent, DialogHeader, DialogTitle, Switch, } from "@flowselections/core";
4
- import { ChevronDown, ChevronUp, Eye, EyeOff, GripVertical, ImagePlus, Plus, Trash2 } from "lucide-react";
3
+ import { createPortal } from "react-dom";
4
+ import { useBewerker } from "../lib/bewerkerContext.js";
5
+ import { onderdeelNaam, onderdeelUitleg, onzichtbaarInLijst, pastBij, toevoegbaar } from "../lib/onderdelenPerSoort.js";
6
+ import { InstellingenKop, OnderdelenLijst } from "./layoutBewerker/OnderdelenLijst.js";
7
+ import { Button, Input, Label, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, Separator, Dialog, DialogContent, DialogHeader, DialogTitle, Switch, } from "@flowselections/core";
8
+ import { ChevronDown, ChevronUp, ImagePlus, Plus, Trash2 } from "lucide-react";
5
9
  import { useEffect } from "react";
6
10
  import { toast } from "sonner";
7
11
  import { useLogos } from "../lib/logoLibrary.js";
8
12
  import { LogoBibliotheekDialog } from "./LogoBibliotheekDialog.js";
9
13
  import { LogoThumbnail, LogosPage } from "./LogosPage.js";
10
- import { GewijzigdBolletje, VerplichtSlot } from "./BlokMarkering.js";
11
14
  import { gewijzigdeBlokken, isVergrendeld } from "../lib/verplichteBlokken.js";
12
15
  import { BESCHIKBARE_KOLOMMEN, CONDITIE_VELDEN, SECTIE_REGISTER, nieuweKolom, nieuweSectie, pickMethode, sectieDef, sectieOnderdrukt, } from "../lib/pakbonBuilder.js";
13
- /** Beheer van de secties waaruit de pakbon is opgebouwd. */
14
- export function PakbonSectiesPanel({ config, onChange, beschikbareTypes, documenttype = "pakbon", referentie = null, }) {
16
+ /** Beheer van de onderdelen waaruit pakbon en afleverbrief zijn opgebouwd. */
17
+ export function PakbonSectiesPanel({ config, onChange, beschikbareTypes, documenttype = "pakbon", referentie = null, uit = false, }) {
18
+ const bewerker = useBewerker();
15
19
  const alleSecties = Array.isArray(config?.secties) ? config.secties : [];
16
20
  const methode = pickMethode(alleSecties);
17
- const toegestaan = (t) => !beschikbareTypes || beschikbareTypes.includes(t);
18
- const secties = alleSecties.filter((s) => !sectieOnderdrukt(s.type, methode));
21
+ const toegestaan = (t) => (!beschikbareTypes || beschikbareTypes.includes(t)) && pastBij(documenttype, t);
22
+ // Onderdrukte onderdelen (per pickmethode) en onderdelen die onzichtbaar blijven werken
23
+ // (pickmethode, producten-onder-lagen) blijven bewaard, maar staan niet in de lijst.
24
+ const inLijst = (s) => !sectieOnderdrukt(s.type, methode) && !onzichtbaarInLijst(documenttype, s.type);
25
+ const secties = alleSecties.filter(inLijst);
26
+ const buiten = alleSecties.filter((s) => !inLijst(s));
19
27
  const [open, setOpen] = useState(null);
20
- const [sleep, setSleep] = useState(null);
21
- const keuzes = SECTIE_REGISTER.filter((d) => !sectieOnderdrukt(d.type, methode) && toegestaan(d.type));
22
- const [toevoegen, setToevoegen] = useState(keuzes.find((d) => d.type === "orderregels")?.type ?? keuzes[0]?.type ?? "tekstblok");
23
- // Onderdrukte blokken blijven bewaard in de configuratie, ook al staan ze niet in de lijst.
24
- const verborgen = alleSecties.filter((s) => sectieOnderdrukt(s.type, methode));
25
- const zet = (nieuw) => onChange({ ...config, secties: [...nieuw, ...verborgen] });
26
- const update = (id, patch) => zet(secties.map((s) => (s.id === id ? { ...s, ...patch } : s)));
27
28
  const gewijzigd = gewijzigdeBlokken(secties, referentie);
28
- const vergrendeld = (s) => isVergrendeld(documenttype, secties, s);
29
- const verwijder = (weg) => {
30
- if (vergrendeld(weg))
31
- return;
32
- const voor = secties;
33
- zet(secties.filter((x) => x.id !== weg.id));
34
- setOpen(null);
35
- toast(`${weg.titel} verwijderd`, { duration: 10000, action: { label: "Ongedaan maken", onClick: () => zet(voor) } });
29
+ void gewijzigd;
30
+ const zet = (nieuw) => onChange({ ...config, secties: [...nieuw, ...buiten] });
31
+ const zetAlles = (nieuw) => onChange({ ...config, secties: nieuw });
32
+ const update = (id, patch) => zetAlles(alleSecties.map((s) => (s.id === id ? { ...s, ...patch } : s)));
33
+ // "Lagen" is in de bewerker één onderdeel met "Producten op een laag"; de print leest beide.
34
+ const productenSectie = alleSecties.find((s) => s.type === "producten") ?? null;
35
+ const vergrendeld = (s) => {
36
+ if (isVergrendeld(documenttype, alleSecties, s))
37
+ return true;
38
+ return s.type === "lagen" && !!productenSectie && isVergrendeld(documenttype, alleSecties, productenSectie);
36
39
  };
37
- const sleepNaar = (van, naar) => {
38
- if (van === naar)
40
+ const verwijder = (id) => {
41
+ const weg = secties.find((x) => x.id === id);
42
+ if (!weg || vergrendeld(weg))
39
43
  return;
44
+ const wegIds = new Set([weg.id]);
45
+ if (weg.type === "lagen")
46
+ for (const p of alleSecties)
47
+ if (p.type === "producten")
48
+ wegIds.add(p.id);
49
+ const voor = alleSecties;
50
+ zetAlles(alleSecties.filter((x) => !wegIds.has(x.id)));
51
+ if (open === id)
52
+ setOpen(null);
53
+ toast(`${onderdeelNaam(weg.type, weg.titel)} verwijderd`, { duration: 10000, action: { label: "Ongedaan maken", onClick: () => zetAlles(voor) } });
54
+ };
55
+ const verplaats = (van, naar) => {
40
56
  const kopie = [...secties];
41
57
  const [x] = kopie.splice(van, 1);
42
58
  kopie.splice(naar, 0, x);
43
59
  zet(kopie);
44
60
  };
45
- const verplaats = (index, richting) => {
46
- const doel = index + richting;
47
- if (doel < 0 || doel >= secties.length)
61
+ const herhaalbaar = new Set(["tekstblok", "qrcode", "barcode", "afbeelding"]);
62
+ const volgorde = toevoegbaar(documenttype);
63
+ const keuzes = SECTIE_REGISTER
64
+ .filter((d) => !sectieOnderdrukt(d.type, methode) && toegestaan(d.type) && !onzichtbaarInLijst(documenttype, d.type))
65
+ .sort((a, b) => (volgorde ? volgorde.indexOf(a.type) - volgorde.indexOf(b.type) : 0))
66
+ .map((d) => ({
67
+ type: d.type,
68
+ naam: onderdeelNaam(d.type, d.label),
69
+ uitleg: onderdeelUitleg(d.type, d.omschrijving),
70
+ alToegevoegd: !herhaalbaar.has(d.type) && secties.some((s) => s.type === d.type && s.zichtbaar),
71
+ }));
72
+ const toevoegen = (type) => {
73
+ const t = type;
74
+ const s = nieuweSectie(t);
75
+ const extra = [];
76
+ if (t === "lagen" && !alleSecties.some((x) => x.type === "producten"))
77
+ extra.push(nieuweSectie("producten"));
78
+ // Verborgen exemplaar van hetzelfde onderdeel: dat terugzetten in plaats van een tweede.
79
+ const verborgenZelfde = !herhaalbaar.has(t) ? secties.find((x) => x.type === t && !x.zichtbaar) : undefined;
80
+ if (verborgenZelfde) {
81
+ update(verborgenZelfde.id, { zichtbaar: true });
82
+ setOpen(verborgenZelfde.id);
48
83
  return;
49
- const kopie = [...secties];
50
- [kopie[index], kopie[doel]] = [kopie[doel], kopie[index]];
51
- zet(kopie);
84
+ }
85
+ onChange({ ...config, secties: [...secties, s, ...buiten, ...extra] });
86
+ setOpen(s.id);
52
87
  };
53
- const heeftLogoBlok = secties.some((s) => s.type === "logo");
54
88
  const logoInstellingen = (_jsxs("div", { className: "space-y-2 ", children: [_jsx(LogoKiezer, { logoId: config.logo?.logoId ?? null, onKies: (logo) => onChange({
55
89
  ...config,
56
90
  logo: {
@@ -70,34 +104,40 @@ export function PakbonSectiesPanel({ config, onChange, beschikbareTypes, documen
70
104
  uitlijning: v,
71
105
  },
72
106
  }), children: [_jsx(SelectTrigger, { children: _jsx(SelectValue, {}) }), _jsxs(SelectContent, { children: [_jsx(SelectItem, { value: "left", children: "Links" }), _jsx(SelectItem, { value: "center", children: "Midden" }), _jsx(SelectItem, { value: "right", children: "Rechts" })] })] })] })] }))] }));
73
- // Delete verwijdert het gekozen (opengeklapte) blok, met Ongedaan maken.
107
+ // Delete verwijdert het gekozen onderdeel, met Ongedaan maken.
74
108
  useEffect(() => {
75
109
  const onKey = (e) => {
76
- if (e.key !== "Delete" || !open || open === "__logo")
110
+ if (e.key !== "Delete" || !open || uit)
77
111
  return;
78
112
  const el = e.target;
79
113
  if (el && (el.tagName === "INPUT" || el.tagName === "TEXTAREA" || el.isContentEditable || el.getAttribute("role") === "combobox"))
80
114
  return;
81
- const weg = secties.find((x) => x.id === open);
82
- if (!weg)
83
- return;
84
115
  e.preventDefault();
85
- verwijder(weg);
116
+ verwijder(open);
86
117
  };
87
118
  window.addEventListener("keydown", onKey);
88
119
  return () => window.removeEventListener("keydown", onKey);
89
120
  });
90
- return (_jsxs("div", { className: "space-y-3", children: [!heeftLogoBlok && (_jsxs("div", { className: "rounded-md border", children: [_jsx("button", { type: "button", className: "flex w-full items-center gap-2 px-2 py-1.5 text-left text-sm font-medium", onClick: () => setOpen(open === "__logo" ? null : "__logo"), children: "Logo" }), open === "__logo" && _jsx("div", { className: "border-t px-3 py-3", children: logoInstellingen })] })), _jsxs("div", { className: "flex gap-2", children: [_jsxs(Select, { value: toevoegen, onValueChange: (v) => setToevoegen(v), children: [_jsx(SelectTrigger, { className: "h-9", children: _jsx(SelectValue, {}) }), _jsx(SelectContent, { children: keuzes.map((d) => (_jsx(SelectItem, { value: d.type, children: d.label }, d.type))) })] }), _jsx(Button, { size: "sm", onClick: () => {
91
- const s = nieuweSectie(toevoegen);
92
- zet([...secties, s]);
93
- setOpen(s.id);
94
- }, children: _jsx(Plus, { className: "h-4 w-4" }) })] }), _jsxs("div", { className: "space-y-2", children: [secties.map((s, i) => {
95
- const def = sectieDef(s.type);
96
- const uitgeklapt = open === s.id;
97
- return (_jsxs("div", { className: `rounded-md border ${uitgeklapt ? "border-primary" : ""}`, draggable: true, onDragStart: () => setSleep(i), onDragOver: (e) => e.preventDefault(), onDrop: () => { if (sleep !== null)
98
- sleepNaar(sleep, i); setSleep(null); }, children: [_jsxs("div", { className: "flex items-center gap-1 px-2 py-1.5", children: [_jsx(GripVertical, { className: "h-4 w-4 cursor-grab text-muted-foreground", "aria-label": "Verslepen" }), _jsxs("button", { type: "button", className: "flex-1 text-left text-sm font-medium", onClick: () => setOpen(uitgeklapt ? null : s.id), children: [s.titel, gewijzigd.has(s.id) && _jsx(GewijzigdBolletje, {}), !s.zichtbaar && (_jsx(Badge, { variant: "outline", className: "ml-2", children: "verborgen" })), s.condities.length > 0 && (_jsxs(Badge, { variant: "secondary", className: "ml-2", children: [s.condities.length, " voorwaarde", s.condities.length > 1 ? "n" : ""] }))] }), _jsx(Button, { size: "icon", variant: "ghost", className: "h-7 w-7", "aria-label": s.zichtbaar ? "Verbergen" : "Tonen", "aria-disabled": vergrendeld(s) || undefined, onClick: () => { if (!vergrendeld(s))
99
- update(s.id, { zichtbaar: !s.zichtbaar }); }, children: s.zichtbaar ? _jsx(Eye, { className: "h-4 w-4" }) : _jsx(EyeOff, { className: "h-4 w-4" }) }), _jsx(Button, { size: "icon", variant: "ghost", className: "h-7 w-7", "aria-label": "Omhoog", onClick: () => verplaats(i, -1), children: _jsx(ChevronUp, { className: "h-4 w-4" }) }), _jsx(Button, { size: "icon", variant: "ghost", className: "h-7 w-7", onClick: () => verplaats(i, 1), children: _jsx(ChevronDown, { className: "h-4 w-4" }) }), vergrendeld(s) ? (_jsx("span", { className: "inline-flex h-7 w-7 items-center justify-center", children: _jsx(VerplichtSlot, { className: "h-4 w-4" }) })) : (_jsx(Button, { size: "icon", variant: "ghost", className: "h-7 w-7", "aria-label": "Verwijderen", onClick: () => verwijder(s), children: _jsx(Trash2, { className: "h-4 w-4" }) }))] }), uitgeklapt && (_jsxs("div", { className: "border-t px-3 py-3", children: [s.type === "logo" && !(typeof s.opties?.logoId === "string" && s.opties.logoId) && _jsx("div", { className: "mb-3", children: logoInstellingen }), _jsx(PakbonSectieEditor, { sectie: s, methode: methode, onChange: (patch) => update(s.id, patch) })] }))] }, s.id));
100
- }), secties.length === 0 && (_jsx("p", { className: "text-sm text-muted-foreground", children: "Nog geen secties toegevoegd." }))] })] }));
121
+ const zichtbareRijen = secties.filter((s) => s.zichtbaar);
122
+ const gekozen = secties.find((s) => s.id === open) ?? null;
123
+ const rij = (s) => ({ id: s.id, naam: onderdeelNaam(s.type, s.titel || sectieDef(s.type).label), verplicht: vergrendeld(s) });
124
+ const instellingen = gekozen ? (_jsxs("div", { className: uit ? "pointer-events-none opacity-60" : "", children: [_jsx(InstellingenKop, { naam: onderdeelNaam(gekozen.type, gekozen.titel || sectieDef(gekozen.type).label) }), gekozen.type === "logo" && !(typeof gekozen.opties?.logoId === "string" && gekozen.opties.logoId) && _jsx("div", { className: "mb-3", children: logoInstellingen }), _jsx(PakbonSectieEditor, { sectie: gekozen, methode: methode, onChange: (patch) => update(gekozen.id, patch) }), gekozen.type === "lagen" && productenSectie && (_jsxs("div", { className: "mt-4 border-t border-border pt-4", children: [_jsx("p", { className: "mb-2 text-sm font-medium text-foreground", children: "Producten op een laag" }), _jsx(PakbonSectieEditor, { sectie: productenSectie, methode: methode, verbergTitel: true, onChange: (patch) => update(productenSectie.id, patch) })] })), BEHEER_VAN[gekozen.type] && _jsx(BeheerRegel, { ...BEHEER_VAN[gekozen.type] })] })) : (_jsx("p", { className: "text-sm text-muted-foreground", children: "Kies links een onderdeel om het aan te passen." }));
125
+ return (_jsxs(_Fragment, { children: [_jsx(OnderdelenLijst, { uit: uit, rijen: zichtbareRijen.map(rij), verborgen: secties.filter((s) => !s.zichtbaar).map(rij), gekozen: open, onKies: setOpen, onVerplaats: (van, naar) => {
126
+ // Volgorde binnen de zichtbare rijen; verborgen blijven achteraan.
127
+ const zicht = [...zichtbareRijen];
128
+ const [x] = zicht.splice(van, 1);
129
+ zicht.splice(naar, 0, x);
130
+ zet([...zicht, ...secties.filter((s) => !s.zichtbaar)]);
131
+ }, onVerwijder: verwijder, onTerugzetten: (id) => update(id, { zichtbaar: true }), keuzes: keuzes, onToevoegen: toevoegen }), bewerker?.instellingenVak ? createPortal(instellingen, bewerker.instellingenVak) : _jsx("div", { className: "mt-4 border-t border-border pt-4", children: instellingen })] }));
132
+ }
133
+ /** Onderdelen waarvan de gegevens elders worden beheerd. Alleen het logo heeft een vaste plek (Logo's). */
134
+ const BEHEER_VAN = {
135
+ logo: { tekst: "Komt uit Logo's", logos: true },
136
+ bedrijfsgegevens: { tekst: "Komt uit je bedrijfsgegevens" },
137
+ };
138
+ function BeheerRegel({ tekst, logos }) {
139
+ const [open, setOpen] = useState(false);
140
+ return (_jsxs("p", { className: "mt-4 border-t border-border pt-3 text-sm text-muted-foreground", children: [tekst, logos && _jsxs(_Fragment, { children: [" \u00B7 ", _jsx("button", { type: "button", className: "font-medium text-primary", onClick: () => setOpen(true), children: "Aanpassen \u2192" })] }), logos && (_jsx(Dialog, { open: open, onOpenChange: setOpen, children: _jsxs(DialogContent, { className: "max-h-[85vh] max-w-4xl overflow-y-auto", children: [_jsx(DialogHeader, { children: _jsx(DialogTitle, { children: "Logo's" }) }), _jsx(LogosPage, { ingebed: true })] }) }))] }));
101
141
  }
102
142
  function OptieVeld({ def, waarde, onChange, }) {
103
143
  if (def.type === "schakelaar") {
@@ -135,7 +175,7 @@ function CondityEditor({ condities, onChange, }) {
135
175
  return (_jsxs("div", { className: "space-y-2", children: [_jsx(Label, { className: "text-xs uppercase text-muted-foreground", children: "Alleen tonen wanneer" }), condities.map((c, i) => (_jsxs("div", { className: "grid grid-cols-[1fr_auto_1fr_auto] items-center gap-1", children: [_jsxs(Select, { value: c.veld, onValueChange: (v) => onChange(condities.map((x, idx) => (idx === i ? { ...x, veld: v } : x))), children: [_jsx(SelectTrigger, { className: "h-8", children: _jsx(SelectValue, {}) }), _jsx(SelectContent, { children: CONDITIE_VELDEN.map((v) => (_jsx(SelectItem, { value: v.value, children: v.label }, v.value))) })] }), _jsxs(Select, { value: c.operator, onValueChange: (v) => onChange(condities.map((x, idx) => idx === i ? { ...x, operator: v } : x)), children: [_jsx(SelectTrigger, { className: "h-8 w-20", children: _jsx(SelectValue, {}) }), _jsx(SelectContent, { children: ["=", "!=", ">", "<", "bevat", "leeg", "niet_leeg"].map((o) => (_jsx(SelectItem, { value: o, children: o }, o))) })] }), _jsx(Input, { className: "h-8", value: c.waarde, onChange: (e) => onChange(condities.map((x, idx) => (idx === i ? { ...x, waarde: e.target.value } : x))) }), _jsx(Button, { size: "icon", variant: "ghost", className: "h-7 w-7", onClick: () => onChange(condities.filter((_, idx) => idx !== i)), children: _jsx(Trash2, { className: "h-4 w-4" }) })] }, i))), _jsxs(Button, { size: "sm", variant: "outline", onClick: () => onChange([...condities, { veld: "aantal_karren", operator: ">", waarde: "1" }]), children: [_jsx(Plus, { className: "mr-2 h-4 w-4" }), " Voorwaarde"] })] }));
136
176
  }
137
177
  /** Volledige instellingen van één blok — herbruikt in de blokontwerper. */
138
- export function PakbonSectieEditor({ sectie, onChange, methode = "kar", }) {
178
+ export function PakbonSectieEditor({ sectie, onChange, methode = "kar", verbergTitel = false, }) {
139
179
  const s = sectie;
140
180
  const def = sectieDef(s.type);
141
181
  const bundelAan = s.type === "karren" && (s.opties?.bundel_identiek ?? true);
@@ -144,6 +184,8 @@ export function PakbonSectieEditor({ sectie, onChange, methode = "kar", }) {
144
184
  const verzamellijstUit = s.type === "pickmethode" && methode === "kar";
145
185
  const aangepasteOpties = def.opties
146
186
  .filter((o) => !(verzamellijstUit && o.key !== "methode"))
187
+ // Kleuren op het papier volgen de stijlgids; geen eigen kleurkeuze.
188
+ .filter((o) => o.type !== "kleur" && o.key !== "toon_paginanummer" && o.key !== "kleur")
147
189
  .map((o) => {
148
190
  if (s.type === "karren" && o.key === "velden" && bundelAan) {
149
191
  return {
@@ -160,7 +202,7 @@ export function PakbonSectieEditor({ sectie, onChange, methode = "kar", }) {
160
202
  }
161
203
  return o;
162
204
  });
163
- return (_jsxs("div", { className: "space-y-3", children: [_jsxs("div", { className: "space-y-1", children: [_jsx(Label, { className: "text-xs", children: "Titel" }), _jsx(Input, { value: s.titel, onChange: (e) => onChange({ titel: e.target.value }) })] }), s.type !== "pickmethode" && (_jsxs("div", { className: "flex items-center justify-between rounded border px-3 py-2", children: [_jsx("span", { className: "text-sm", children: "Sectie tonen" }), _jsx(Switch, { checked: s.zichtbaar, onCheckedChange: (v) => onChange({ zichtbaar: v }) })] })), s.type === "logo" && typeof s.opties?.logoId === "string" && !!s.opties.logoId && (_jsx(LogoKiezer, { logoId: s.opties.logoId, onKies: (logo) => onChange({
205
+ return (_jsxs("div", { className: "space-y-3", children: [!verbergTitel && (_jsxs("div", { className: "space-y-1", children: [_jsx(Label, { className: "text-xs", children: "Kop op het papier" }), _jsx(Input, { value: s.titel, onChange: (e) => onChange({ titel: e.target.value }) })] })), s.type === "logo" && typeof s.opties?.logoId === "string" && !!s.opties.logoId && (_jsx(LogoKiezer, { logoId: s.opties.logoId, onKies: (logo) => onChange({
164
206
  opties: {
165
207
  ...s.opties,
166
208
  logoId: logo?.id ?? null,
@@ -1 +1 @@
1
- {"version":3,"file":"PlekInstellingen.d.ts","sourceRoot":"","sources":["../../src/components/PlekInstellingen.tsx"],"names":[],"mappings":"AAoBA,OAAO,EAE6H,KAAK,SAAS,EAAE,KAAK,OAAO,EAAE,KAAK,WAAW,EACjL,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAiF,KAAK,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAIxI,OAAO,EAA6C,KAAK,cAAc,EAAE,KAAK,cAAc,EAAE,KAAK,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEjJ,OAAO,EAAwW,KAAK,WAAW,EAAE,KAAK,YAAY,EAAE,KAAK,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAS1c,mGAAmG;AACnG,eAAO,MAAM,aAAa,6FAAwF,CAAC;AAqBnH,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,WAAW,GAAG,IAAI,CAAC;IAC3B,kDAAkD;IAClD,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,aAAa,EAAE,MAAM,CAAC;IACtB,qEAAqE;IACrE,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,UAAU,EAAE;QAAE,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,GAAG,SAAS,CAAC;IAC9F,OAAO,EAAE;QAAE,YAAY,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,EAAE,CAAC;IAC9D,OAAO,EAAE,SAAS,EAAE,CAAC;IACrB,WAAW,EAAE,SAAS,EAAE,CAAC;IACzB,aAAa,EAAE,YAAY,EAAE,CAAC;IAC9B,MAAM,EAAE;QAAE,QAAQ,EAAE,aAAa,EAAE,CAAC;QAAC,SAAS,EAAE,cAAc,EAAE,CAAC;QAAC,MAAM,EAAE,cAAc,EAAE,CAAC;QAAC,IAAI,EAAE,MAAM,OAAO,CAAC,cAAc,EAAE,GAAG,IAAI,CAAC,CAAA;KAAE,CAAC;IAC3I,eAAe,EAAE,OAAO,CAAC;IACzB,sDAAsD;IACtD,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,KAAK,EAAE,OAAO,CAAC;IACf,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,YAAY,EAAE,CAAC,SAAS,CAAC,EAAE,SAAS,KAAK,IAAI,CAAC;IAC9C,qGAAqG;IACrG,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;CAC3B;AAED,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,qBAAqB,+BAkjBxD"}
1
+ {"version":3,"file":"PlekInstellingen.d.ts","sourceRoot":"","sources":["../../src/components/PlekInstellingen.tsx"],"names":[],"mappings":"AAoBA,OAAO,EAE6H,KAAK,SAAS,EAAE,KAAK,OAAO,EAAE,KAAK,WAAW,EACjL,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAiF,KAAK,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAIxI,OAAO,EAA6C,KAAK,cAAc,EAAE,KAAK,cAAc,EAAE,KAAK,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEjJ,OAAO,EAAwW,KAAK,WAAW,EAAE,KAAK,YAAY,EAAE,KAAK,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAS1c,mGAAmG;AACnG,eAAO,MAAM,aAAa,6FAAwF,CAAC;AAqBnH,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,WAAW,GAAG,IAAI,CAAC;IAC3B,kDAAkD;IAClD,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,aAAa,EAAE,MAAM,CAAC;IACtB,qEAAqE;IACrE,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,UAAU,EAAE;QAAE,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,GAAG,SAAS,CAAC;IAC9F,OAAO,EAAE;QAAE,YAAY,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,EAAE,CAAC;IAC9D,OAAO,EAAE,SAAS,EAAE,CAAC;IACrB,WAAW,EAAE,SAAS,EAAE,CAAC;IACzB,aAAa,EAAE,YAAY,EAAE,CAAC;IAC9B,MAAM,EAAE;QAAE,QAAQ,EAAE,aAAa,EAAE,CAAC;QAAC,SAAS,EAAE,cAAc,EAAE,CAAC;QAAC,MAAM,EAAE,cAAc,EAAE,CAAC;QAAC,IAAI,EAAE,MAAM,OAAO,CAAC,cAAc,EAAE,GAAG,IAAI,CAAC,CAAA;KAAE,CAAC;IAC3I,eAAe,EAAE,OAAO,CAAC;IACzB,sDAAsD;IACtD,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,KAAK,EAAE,OAAO,CAAC;IACf,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,YAAY,EAAE,CAAC,SAAS,CAAC,EAAE,SAAS,KAAK,IAAI,CAAC;IAC9C,qGAAqG;IACrG,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;CAC3B;AAED,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,qBAAqB,+BAijBxD"}
@@ -29,7 +29,7 @@ import { NieuweComputerStappen } from "./NieuweComputerStappen.js";
29
29
  import { PlekMeldingen } from "./PlekMeldingen.js";
30
30
  import { PrinterFormatenLijst } from "./PrinterFormatenLijst.js";
31
31
  import { useBevestig } from "./BevestigDialog.js";
32
- import { ALLES_TERUG_TEKST, allesTerugVraag, alleDocumentenTerugNaarStandaard, haalLabelprinterWeg, haalLabelprinters, haalStickerPrinters, isOmgeleid, kiesStickerEtiket, kiesStickerPrinter, haalPlekPapier, kiesPlekPapier, toonPapierKeuze, STICKER_PRINTER_UITLEG, stickersVerschovenTekst, toonAllesTerug, voegLabelprinterToe } from "../lib/plekLabelprinters.js";
32
+ import { ALLES_TERUG_TEKST, allesTerugVraag, alleDocumentenTerugNaarStandaard, haalLabelprinterWeg, haalLabelprinters, haalStickerPrinters, isOmgeleid, kiesStickerEtiket, kiesStickerPrinter, haalPlekPapier, kiesPlekPapier, toonPapierKeuze, stickersVerschovenTekst, toonAllesTerug, voegLabelprinterToe } from "../lib/plekLabelprinters.js";
33
33
  /** 23-11: stickers hebben geen versies; ze komen uit de bron en passen zich aan elk etiket aan. */
34
34
  export const STICKER_REGEL = "Komt uit de order, Floriday, de klant of het artikel · past zich aan elk etiket aan";
35
35
  const isStickerKaartId = (id) => id === "potsticker" || id === "fuststicker";
@@ -406,7 +406,7 @@ export function PlekInstellingen(p) {
406
406
  };
407
407
  return (_jsxs("li", { className: "space-y-1 px-3 py-2", children: [_jsx("p", { className: "text-sm font-semibold text-foreground", children: r.kaart.naam }), labelLijst.length === 0 ? (_jsx("p", { className: "text-xs font-medium text-warning", children: "Geen labelprinter bij deze plek" })) : (_jsxs("div", { className: "grid gap-2 sm:grid-cols-2", children: [_jsxs("div", { className: "min-w-0 space-y-1", children: [_jsx("p", { className: "text-xs text-muted-foreground", children: "Labelprinter" }), _jsx(ZoekbareKeuzelijst, { value: gekozen, onChange: kies, options: labelLijst.map((id) => ({ value: id, label: printerNaam(id) || "Labelprinter" })) })] }), _jsxs("div", { className: "min-w-0 space-y-1", children: [_jsx("p", { className: "text-xs text-muted-foreground", children: "Standaard etiket" }), gekozen ? _jsx(StickerEtiketKeuze, { printerId: gekozen, ververs: stickerPrinters, waarde: (soort === "fust" ? stickerPrinters?.fustEtiket : stickerPrinters?.potEtiket) ?? null, onKies: (m) => void slaOp(async () => { const a = await kiesStickerEtiket(plek.id, soort, m); if (!a.ok)
408
408
  throw new Error(a.reden ?? "Kiezen is niet gelukt."); }, null, klaar) })
409
- : _jsx("p", { className: "text-sm text-muted-foreground", children: leegTekst("etiket") })] })] })), reden && labelLijst.length > 0 && _jsx("p", { className: "text-xs font-medium text-warning", children: reden }), _jsx("p", { className: "text-xs text-muted-foreground", children: STICKER_PRINTER_UITLEG })] }, r.kaart.id));
409
+ : _jsx("p", { className: "text-sm text-muted-foreground", children: leegTekst("etiket") })] })] })), reden && labelLijst.length > 0 && _jsx("p", { className: "text-xs font-medium text-warning", children: reden })] }, r.kaart.id));
410
410
  }
411
411
  const isOpen = openDoc === r.kaart.id;
412
412
  const paneelId = `doc-paneel-${r.kaart.id}`;
@@ -1,9 +1,10 @@
1
1
  import { type ProductiebonBlok, type ProductiebonConfig } from "../lib/productiebonBuilder.js";
2
- /** Beheer van de blokken waaruit de productiebon is opgebouwd. */
3
- export declare function ProductiebonBlokkenPanel({ config, onChange, referentie, }: {
2
+ /** Beheer van de onderdelen waaruit de productiebon is opgebouwd. */
3
+ export declare function ProductiebonBlokkenPanel({ config, onChange, referentie, uit, }: {
4
4
  config: ProductiebonConfig;
5
5
  onChange: (c: ProductiebonConfig) => void;
6
- /** Blokken van de laatst actieve stand (groen bolletje). */
6
+ /** Onderdelen van de laatst actieve stand. */
7
7
  referentie?: ProductiebonBlok[] | null;
8
+ uit?: boolean;
8
9
  }): import("react").JSX.Element;
9
10
  //# sourceMappingURL=ProductiebonBlokkenPanel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ProductiebonBlokkenPanel.d.ts","sourceRoot":"","sources":["../../src/components/ProductiebonBlokkenPanel.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAWL,KAAK,gBAAgB,EAErB,KAAK,kBAAkB,EAGxB,MAAM,4BAA4B,CAAC;AAEpC,kEAAkE;AAClE,wBAAgB,wBAAwB,CAAC,EACvC,MAAM,EACN,QAAQ,EACR,UAAiB,GAClB,EAAE;IACD,MAAM,EAAE,kBAAkB,CAAC;IAC3B,QAAQ,EAAE,CAAC,CAAC,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAC1C,4DAA4D;IAC5D,UAAU,CAAC,EAAE,gBAAgB,EAAE,GAAG,IAAI,CAAC;CACxC,+BAqGA"}
1
+ {"version":3,"file":"ProductiebonBlokkenPanel.d.ts","sourceRoot":"","sources":["../../src/components/ProductiebonBlokkenPanel.tsx"],"names":[],"mappings":"AAsBA,OAAO,EAWL,KAAK,gBAAgB,EAErB,KAAK,kBAAkB,EAGxB,MAAM,4BAA4B,CAAC;AAEpC,qEAAqE;AACrE,wBAAgB,wBAAwB,CAAC,EACvC,MAAM,EACN,QAAQ,EACR,UAAiB,EACjB,GAAW,GACZ,EAAE;IACD,MAAM,EAAE,kBAAkB,CAAC;IAC3B,QAAQ,EAAE,CAAC,CAAC,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAC1C,8CAA8C;IAC9C,UAAU,CAAC,EAAE,gBAAgB,EAAE,GAAG,IAAI,CAAC;IACvC,GAAG,CAAC,EAAE,OAAO,CAAC;CACf,+BAqEA"}
@@ -1,42 +1,69 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { VasteSchakelaar } from "./VasteSchakelaar.js";
3
2
  import { useState } from "react";
4
- import { Badge, Button, Input, Label, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, Separator, Switch, } from "@flowselections/core";
3
+ import { createPortal } from "react-dom";
4
+ import { toast } from "sonner";
5
+ import { useBewerker } from "../lib/bewerkerContext.js";
6
+ import { onderdeelNaam, onderdeelUitleg, pastBij, toevoegbaar } from "../lib/onderdelenPerSoort.js";
7
+ import { InstellingenKop, OnderdelenLijst } from "./layoutBewerker/OnderdelenLijst.js";
8
+ import { Button, Input, Label, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, Separator, Switch, } from "@flowselections/core";
5
9
  import { ChevronDown, ChevronUp, Plus, Trash2 } from "lucide-react";
6
- import { GewijzigdBolletje, VerplichtSlot } from "./BlokMarkering.js";
7
10
  import { gewijzigdeBlokken, isVergrendeld } from "../lib/verplichteBlokken.js";
8
11
  import { LETTERTYPEN, MATERIAAL_KOLOMMEN, PB_BLOK_REGISTER, PB_CONDITIE_VELDEN, PRODUCTINFO_VELDEN, SAMENSTELLING_KOLOMMEN, nieuwBlok, pbNieuweKolom, nieuwVeld, pbBlokDef, } from "../lib/productiebonBuilder.js";
9
- /** Beheer van de blokken waaruit de productiebon is opgebouwd. */
10
- export function ProductiebonBlokkenPanel({ config, onChange, referentie = null, }) {
12
+ /** Beheer van de onderdelen waaruit de productiebon is opgebouwd. */
13
+ export function ProductiebonBlokkenPanel({ config, onChange, referentie = null, uit = false, }) {
14
+ const bewerker = useBewerker();
11
15
  const blokken = Array.isArray(config?.blokken) ? config.blokken : [];
12
- const gewijzigd = gewijzigdeBlokken(blokken, referentie);
16
+ void gewijzigdeBlokken(blokken, referentie);
13
17
  const vergrendeld = (b) => isVergrendeld("productiebon", blokken, b);
14
- const [open, setOpen] = useState(blokken[0]?.id ?? null);
15
- const [toevoegen, setToevoegen] = useState("productinfo");
18
+ const [open, setOpen] = useState(null);
16
19
  const zet = (nieuw) => onChange({ ...config, blokken: nieuw });
17
20
  const update = (id, patch) => zet(blokken.map((b) => (b.id === id ? { ...b, ...patch } : b)));
18
- const verplaats = (index, richting) => {
19
- const doel = index + richting;
20
- if (doel < 0 || doel >= blokken.length)
21
+ const zichtbaar = blokken.filter((b) => b.zichtbaar);
22
+ const verborgen = blokken.filter((b) => !b.zichtbaar);
23
+ const rij = (b) => ({ id: b.id, naam: onderdeelNaam(b.type, b.titel || pbBlokDef(b.type).label), verplicht: vergrendeld(b) });
24
+ const volgorde = toevoegbaar("productiebon");
25
+ const keuzes = PB_BLOK_REGISTER
26
+ .filter((d) => pastBij("productiebon", d.type))
27
+ .sort((x, y) => (volgorde ? volgorde.indexOf(x.type) - volgorde.indexOf(y.type) : 0))
28
+ .map((d) => ({
29
+ type: d.type, naam: onderdeelNaam(d.type, d.label), uitleg: onderdeelUitleg(d.type, d.omschrijving),
30
+ alToegevoegd: d.type !== "tekstblok" && zichtbaar.some((b) => b.type === d.type),
31
+ }));
32
+ const verwijder = (id) => {
33
+ const weg = blokken.find((b) => b.id === id);
34
+ if (!weg || vergrendeld(weg))
21
35
  return;
22
- const kopie = [...blokken];
23
- [kopie[index], kopie[doel]] = [kopie[doel], kopie[index]];
24
- zet(kopie);
36
+ const voor = blokken;
37
+ zet(blokken.filter((b) => b.id !== id));
38
+ if (open === id)
39
+ setOpen(null);
40
+ toast(`${onderdeelNaam(weg.type, weg.titel)} verwijderd`, { duration: 10000, action: { label: "Ongedaan maken", onClick: () => zet(voor) } });
25
41
  };
26
- return (_jsxs("div", { className: "space-y-3", children: [_jsxs("div", { className: "flex gap-2", children: [_jsxs(Select, { value: toevoegen, onValueChange: (v) => setToevoegen(v), children: [_jsx(SelectTrigger, { className: "h-9", children: _jsx(SelectValue, {}) }), _jsx(SelectContent, { children: PB_BLOK_REGISTER.map((d) => (_jsx(SelectItem, { value: d.type, children: d.label }, d.type))) })] }), _jsx(Button, { size: "sm", onClick: () => {
27
- const b = nieuwBlok(toevoegen);
28
- zet([...blokken, b]);
29
- setOpen(b.id);
30
- }, children: _jsx(Plus, { className: "h-4 w-4" }) })] }), _jsxs("div", { className: "space-y-2", children: [blokken.map((b, i) => {
31
- const uitgeklapt = open === b.id;
32
- return (_jsxs("div", { className: "rounded-md border", children: [_jsxs("div", { className: "flex items-center gap-2 px-2 py-1.5", children: [_jsxs("button", { type: "button", className: "flex-1 text-left text-sm font-medium", onClick: () => setOpen(uitgeklapt ? null : b.id), children: [b.titel, gewijzigd.has(b.id) && _jsx(GewijzigdBolletje, {}), !b.zichtbaar && (_jsx(Badge, { variant: "outline", className: "ml-2", children: "verborgen" })), b.condities.length > 0 && (_jsxs(Badge, { variant: "secondary", className: "ml-2", children: [b.condities.length, " voorwaarde", b.condities.length > 1 ? "n" : ""] }))] }), _jsx(Button, { size: "icon", variant: "ghost", className: "h-7 w-7", onClick: () => verplaats(i, -1), children: _jsx(ChevronUp, { className: "h-4 w-4" }) }), _jsx(Button, { size: "icon", variant: "ghost", className: "h-7 w-7", onClick: () => verplaats(i, 1), children: _jsx(ChevronDown, { className: "h-4 w-4" }) }), vergrendeld(b) ? (_jsx("span", { className: "inline-flex h-7 w-7 items-center justify-center", children: _jsx(VerplichtSlot, { className: "h-4 w-4" }) })) : (_jsx(Button, { size: "icon", variant: "ghost", className: "h-7 w-7", "aria-label": "Verwijderen", onClick: () => zet(blokken.filter((x) => x.id !== b.id)), children: _jsx(Trash2, { className: "h-4 w-4" }) }))] }), uitgeklapt && (_jsx("div", { className: "border-t px-3 py-3", children: _jsx(BlokEditor, { blok: b, verplicht: vergrendeld(b), onChange: (patch) => update(b.id, patch) }) }))] }, b.id));
33
- }), blokken.length === 0 && (_jsx("p", { className: "text-sm text-muted-foreground", children: "Nog geen blokken toegevoegd." }))] })] }));
42
+ const gekozen = blokken.find((b) => b.id === open) ?? null;
43
+ const instellingen = gekozen ? (_jsxs("div", { className: uit ? "pointer-events-none opacity-60" : "", children: [_jsx(InstellingenKop, { naam: onderdeelNaam(gekozen.type, gekozen.titel || pbBlokDef(gekozen.type).label) }), _jsx(BlokEditor, { blok: gekozen, verplicht: vergrendeld(gekozen), onChange: (patch) => update(gekozen.id, patch) })] })) : _jsx("p", { className: "text-sm text-muted-foreground", children: "Kies links een onderdeel om het aan te passen." });
44
+ return (_jsxs(_Fragment, { children: [_jsx(OnderdelenLijst, { uit: uit, rijen: zichtbaar.map(rij), verborgen: verborgen.map(rij), gekozen: open, onKies: setOpen, onVerplaats: (van, naar) => {
45
+ const kopie = [...zichtbaar];
46
+ const [x] = kopie.splice(van, 1);
47
+ kopie.splice(naar, 0, x);
48
+ zet([...kopie, ...verborgen]);
49
+ }, onVerwijder: verwijder, onTerugzetten: (id) => update(id, { zichtbaar: true }), keuzes: keuzes, onToevoegen: (type) => {
50
+ const t = type;
51
+ const terug = t !== "tekstblok" ? verborgen.find((b) => b.type === t) : undefined;
52
+ if (terug) {
53
+ update(terug.id, { zichtbaar: true });
54
+ setOpen(terug.id);
55
+ return;
56
+ }
57
+ const b = nieuwBlok(t);
58
+ zet([...zichtbaar, b, ...verborgen]);
59
+ setOpen(b.id);
60
+ } }), bewerker?.instellingenVak ? createPortal(instellingen, bewerker.instellingenVak) : _jsx("div", { className: "mt-4 border-t border-border pt-4", children: instellingen })] }));
34
61
  }
35
62
  function BlokEditor({ blok, verplicht = false, onChange, }) {
36
63
  const def = pbBlokDef(blok.type);
37
64
  const bibliotheek = def.kolommen === "materiaal" ? MATERIAAL_KOLOMMEN : SAMENSTELLING_KOLOMMEN;
38
65
  const zetOptie = (key, waarde) => onChange({ opties: { ...blok.opties, [key]: waarde } });
39
- return (_jsxs("div", { className: "space-y-3", children: [_jsx("p", { className: "text-xs text-muted-foreground", children: def.omschrijving }), _jsxs("div", { className: "space-y-1", children: [_jsx(Label, { className: "text-xs", children: "Bloktitel" }), _jsx(Input, { value: blok.titel, onChange: (e) => onChange({ titel: e.target.value }) })] }), _jsxs("div", { className: "flex items-center justify-between rounded border px-3 py-2", children: [_jsx("span", { className: "text-sm", children: "Blok tonen" }), _jsx(VasteSchakelaar, { checked: blok.zichtbaar, vastUitleg: verplicht ? "Dit blok is verplicht" : null, onCheckedChange: (v) => onChange({ zichtbaar: v }) })] }), def.opties.map((o) => (_jsx(OptieVeld, { def: o, waarde: blok.opties?.[o.key], onChange: (v) => zetOptie(o.key, v) }, o.key))), def.velden && (_jsxs(_Fragment, { children: [_jsx(Separator, {}), _jsx(VeldenEditor, { velden: Array.isArray(blok.velden) ? blok.velden : [], onChange: (velden) => onChange({ velden }) })] })), def.kolommen && (_jsxs(_Fragment, { children: [_jsx(Separator, {}), _jsx(KolommenEditor, { kolommen: Array.isArray(blok.kolommen) ? blok.kolommen : [], bibliotheek: bibliotheek, onChange: (kolommen) => onChange({ kolommen }) })] })), _jsx(Separator, {}), _jsx(CondtiesEditor, { condities: blok.condities ?? [], onChange: (condities) => onChange({ condities }) })] }));
66
+ return (_jsxs("div", { className: "space-y-3", children: [_jsxs("div", { className: "space-y-1", children: [_jsx(Label, { className: "text-xs", children: "Kop op het papier" }), _jsx(Input, { value: blok.titel, onChange: (e) => onChange({ titel: e.target.value }) })] }), def.opties.map((o) => (_jsx(OptieVeld, { def: o, waarde: blok.opties?.[o.key], onChange: (v) => zetOptie(o.key, v) }, o.key))), def.velden && (_jsxs(_Fragment, { children: [_jsx(Separator, {}), _jsx(VeldenEditor, { velden: Array.isArray(blok.velden) ? blok.velden : [], onChange: (velden) => onChange({ velden }) })] })), def.kolommen && (_jsxs(_Fragment, { children: [_jsx(Separator, {}), _jsx(KolommenEditor, { kolommen: Array.isArray(blok.kolommen) ? blok.kolommen : [], bibliotheek: bibliotheek, onChange: (kolommen) => onChange({ kolommen }) })] })), _jsx(Separator, {}), _jsx(CondtiesEditor, { condities: blok.condities ?? [], onChange: (condities) => onChange({ condities }) })] }));
40
67
  }
41
68
  function OptieVeld({ def, waarde, onChange, }) {
42
69
  if (def.type === "schakelaar") {
@@ -92,5 +92,5 @@ export function ProductiebonBuilderPage({ layoutId: layoutIdProp, ingebed = fals
92
92
  return _jsx("main", { className: "p-6 text-sm text-muted-foreground", children: "Layout laden\u2026" });
93
93
  if (!layout || !config)
94
94
  return _jsx("main", { className: "p-6 text-sm text-muted-foreground", children: "Layout niet gevonden." });
95
- return (_jsxs("main", { className: "space-y-4 p-6", children: [!ingebed && (_jsxs("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx(Button, { variant: "ghost", size: "sm", asChild: true, children: _jsxs(Link, { to: "/layouts-printers/documenten", children: [_jsx(ArrowLeft, { className: "mr-2 h-4 w-4" }), " Layouts"] }) }), _jsxs("div", { children: [_jsx("h1", { className: "text-lg font-semibold", children: layout.naam }), _jsxs("p", { className: "text-xs text-muted-foreground", children: ["Productiebon opbouwen uit blokken \u00B7 ", config.blokken.length, " blokken"] })] })] }), _jsxs("div", { className: "flex items-center gap-2", children: [layoutId ? _jsx(LayoutPrinterSelect, { layoutId: layoutId }) : null, _jsxs(Button, { size: "sm", variant: "outline", onClick: voorbeeldPrinten, disabled: printen || controle !== "gereed", children: [printen ? (_jsx(Loader2, { className: "mr-2 h-4 w-4 animate-spin" })) : (_jsx(Printer, { className: "mr-2 h-4 w-4" })), "Voorbeeld printen"] }), _jsxs(Button, { size: "sm", onClick: opslaan, disabled: bezig || Boolean(layout.systeem), children: [_jsx(Save, { className: "mr-2 h-4 w-4" }), " Opslaan"] })] })] })), layout.systeem ? _jsx(SysteemLayoutMelding, { layoutId: layout.id, route: "productiebon" }) : null, !ingebed && _jsx(FormaatOrientatieBar, { layout: layout, onChange: (patch) => setLayout((l) => (l ? { ...l, ...patch } : l)), vergrendeld: Boolean(layout.systeem) }), _jsxs("div", { className: ingebed ? "grid items-start gap-4 lg:grid-cols-[16rem_minmax(0,1fr)]" : "grid items-start gap-4 lg:grid-cols-[400px_1fr]", children: [_jsxs(Card, { className: ingebed ? "flex flex-col" : "flex h-[calc(100vh-14rem)] min-h-[420px] flex-col overflow-hidden lg:sticky lg:top-4", children: [!ingebed && (_jsxs(CardHeader, { className: "pb-3", children: [_jsx(CardTitle, { className: "text-base", children: "Blokken" }), _jsx(CardDescription, { children: "Voeg blokken toe, wijzig de volgorde en stel elk blok afzonderlijk in." })] })), _jsx(CardContent, { className: "min-h-0 flex-1 overflow-y-auto", children: _jsx(ProductiebonBlokkenPanel, { config: config, onChange: setConfig, referentie: referentieConfig === undefined ? null : leesProductiebonConfig(referentieConfig).blokken }) })] }), _jsxs(Card, { className: ingebed ? "flex min-h-[75vh] flex-col" : "flex h-[calc(100vh-14rem)] min-h-[420px] flex-col overflow-hidden", children: [!ingebed && (_jsxs(CardHeader, { className: "flex-row items-center justify-between space-y-0 pb-3", children: [_jsxs("div", { children: [_jsx(CardTitle, { className: "text-base", children: "Live voorbeeld" }), _jsx(CardDescription, { children: "Voorbeeldproductieorder met samenstelling en belading." })] }), _jsxs(Badge, { variant: controle === "afwijking" ? "destructive" : "secondary", children: [controle === "controleren" ? _jsx(Loader2, { className: "mr-1 h-3 w-3 animate-spin" }) : controle === "gereed" ? _jsx(CheckCircle2, { className: "mr-1 h-3 w-3" }) : _jsx(AlertTriangle, { className: "mr-1 h-3 w-3" }), controle === "controleren" ? "Controleren" : controle === "gereed" ? "Afdruk gereed" : "Afwijking gevonden"] })] })), _jsx(CardContent, { className: "min-h-0 flex-1 overflow-hidden", children: _jsx("div", { className: "h-full overflow-hidden rounded-md border bg-muted/30 p-2", children: voorbeeldHtml ? _jsx(PrintbestandVoorbeeld, { layoutId: layout?.id ?? layoutId, sleutel: "productiebon", indeling: config, onControle: (status, fout) => { setControle(status); setControleFout(fout ?? null); } }) : null }) })] })] })] }));
95
+ return (_jsxs("main", { className: "space-y-4 p-6", children: [!ingebed && (_jsxs("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx(Button, { variant: "ghost", size: "sm", asChild: true, children: _jsxs(Link, { to: "/layouts-printers/documenten", children: [_jsx(ArrowLeft, { className: "mr-2 h-4 w-4" }), " Layouts"] }) }), _jsxs("div", { children: [_jsx("h1", { className: "text-lg font-semibold", children: layout.naam }), _jsxs("p", { className: "text-xs text-muted-foreground", children: ["Productiebon opbouwen uit blokken \u00B7 ", config.blokken.length, " blokken"] })] })] }), _jsxs("div", { className: "flex items-center gap-2", children: [layoutId ? _jsx(LayoutPrinterSelect, { layoutId: layoutId }) : null, _jsxs(Button, { size: "sm", variant: "outline", onClick: voorbeeldPrinten, disabled: printen || controle !== "gereed", children: [printen ? (_jsx(Loader2, { className: "mr-2 h-4 w-4 animate-spin" })) : (_jsx(Printer, { className: "mr-2 h-4 w-4" })), "Voorbeeld printen"] }), _jsxs(Button, { size: "sm", onClick: opslaan, disabled: bezig || Boolean(layout.systeem), children: [_jsx(Save, { className: "mr-2 h-4 w-4" }), " Opslaan"] })] })] })), layout.systeem ? _jsx(SysteemLayoutMelding, { layoutId: layout.id, route: "productiebon" }) : null, !ingebed && _jsx(FormaatOrientatieBar, { layout: layout, onChange: (patch) => setLayout((l) => (l ? { ...l, ...patch } : l)), vergrendeld: Boolean(layout.systeem) }), _jsxs("div", { className: ingebed ? "grid items-start gap-4 lg:grid-cols-[17rem_minmax(0,1fr)]" : "grid items-start gap-4 lg:grid-cols-[400px_1fr]", children: [_jsxs(Card, { className: ingebed ? "flex flex-col lg:sticky lg:top-4" : "flex h-[calc(100vh-14rem)] min-h-[420px] flex-col overflow-hidden lg:sticky lg:top-4", children: [!ingebed && (_jsxs(CardHeader, { className: "pb-3", children: [_jsx(CardTitle, { className: "text-base", children: "Blokken" }), _jsx(CardDescription, { children: "Voeg blokken toe, wijzig de volgorde en stel elk blok afzonderlijk in." })] })), _jsx(CardContent, { className: "min-h-0 flex-1 overflow-y-auto", children: _jsx(ProductiebonBlokkenPanel, { config: config, onChange: setConfig, uit: Boolean(layout.systeem), referentie: referentieConfig === undefined ? null : leesProductiebonConfig(referentieConfig).blokken }) })] }), _jsxs(Card, { className: ingebed ? "flex min-h-[75vh] flex-col border-0 bg-transparent shadow-none" : "flex h-[calc(100vh-14rem)] min-h-[420px] flex-col overflow-hidden", children: [!ingebed && (_jsxs(CardHeader, { className: "flex-row items-center justify-between space-y-0 pb-3", children: [_jsxs("div", { children: [_jsx(CardTitle, { className: "text-base", children: "Live voorbeeld" }), _jsx(CardDescription, { children: "Voorbeeldproductieorder met samenstelling en belading." })] }), _jsxs(Badge, { variant: controle === "afwijking" ? "destructive" : "secondary", children: [controle === "controleren" ? _jsx(Loader2, { className: "mr-1 h-3 w-3 animate-spin" }) : controle === "gereed" ? _jsx(CheckCircle2, { className: "mr-1 h-3 w-3" }) : _jsx(AlertTriangle, { className: "mr-1 h-3 w-3" }), controle === "controleren" ? "Controleren" : controle === "gereed" ? "Afdruk gereed" : "Afwijking gevonden"] })] })), _jsx(CardContent, { className: "min-h-0 flex-1 overflow-hidden", children: _jsx("div", { className: "h-full overflow-hidden rounded-md border bg-muted/30 p-2", children: voorbeeldHtml ? _jsx(PrintbestandVoorbeeld, { layoutId: layout?.id ?? layoutId, sleutel: "productiebon", indeling: config, onControle: (status, fout) => { setControle(status); setControleFout(fout ?? null); } }) : null }) })] })] })] }));
96
96
  }
@@ -1 +1 @@
1
- {"version":3,"file":"VersieBewerkenPage.d.ts","sourceRoot":"","sources":["../../src/components/VersieBewerkenPage.tsx"],"names":[],"mappings":"AAgFA,wBAAgB,kBAAkB,CAAC,EAAE,QAAQ,EAAE,UAAe,EAAE,cAAc,EAAE,WAAmB,EAAE,GAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,cAAc,CAAC,EAAE,OAAO,CAAA;CAAO,sCA+W1J"}
1
+ {"version":3,"file":"VersieBewerkenPage.d.ts","sourceRoot":"","sources":["../../src/components/VersieBewerkenPage.tsx"],"names":[],"mappings":"AAmFA,wBAAgB,kBAAkB,CAAC,EAAE,QAAQ,EAAE,UAAe,EAAE,cAAc,EAAE,WAAmB,EAAE,GAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,cAAc,CAAC,EAAE,OAAO,CAAA;CAAO,sCAyZ1J"}