@flowselections/layout-maker 1.69.51 → 1.69.53
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-lib/components/AfleverbriefBuilderPage.d.ts.map +1 -1
- package/dist-lib/components/AfleverbriefBuilderPage.js +3 -3
- package/dist-lib/components/BlokOntwerperPage.d.ts.map +1 -1
- package/dist-lib/components/BlokOntwerperPage.js +4 -2
- package/dist-lib/components/LayoutsPage.d.ts.map +1 -1
- package/dist-lib/components/LayoutsPage.js +21 -4
- package/dist-lib/components/PakbonBuilderPage.d.ts.map +1 -1
- package/dist-lib/components/PakbonBuilderPage.js +3 -3
- package/dist-lib/components/PakbonPreview.d.ts +4 -1
- package/dist-lib/components/PakbonPreview.d.ts.map +1 -1
- package/dist-lib/components/PakbonPreview.js +6 -2
- package/dist-lib/components/PrintbestandVoorbeeld.d.ts +18 -0
- package/dist-lib/components/PrintbestandVoorbeeld.d.ts.map +1 -0
- package/dist-lib/components/PrintbestandVoorbeeld.js +88 -0
- package/dist-lib/components/PrintenPage.d.ts.map +1 -1
- package/dist-lib/components/PrintenPage.js +0 -5
- package/dist-lib/components/ProductiebonBuilderPage.d.ts.map +1 -1
- package/dist-lib/components/ProductiebonBuilderPage.js +3 -3
- package/dist-lib/components/StickerOntwerpPage.d.ts.map +1 -1
- package/dist-lib/components/StickerOntwerpPage.js +4 -4
- package/dist-lib/integrations/supabase/types.d.ts +446 -201
- package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
- package/dist-lib/lib/bewerkvlak.d.ts +14 -0
- package/dist-lib/lib/bewerkvlak.d.ts.map +1 -0
- package/dist-lib/lib/bewerkvlak.js +20 -0
- package/dist-lib/lib/inhoudsControle.d.ts +68 -0
- package/dist-lib/lib/inhoudsControle.d.ts.map +1 -0
- package/dist-lib/lib/inhoudsControle.js +152 -0
- package/dist-lib/lib/layoutOpslaan.d.ts.map +1 -1
- package/dist-lib/lib/layoutOpslaan.js +11 -0
- package/dist-lib/lib/printQueue.server.d.ts +77 -1
- package/dist-lib/lib/printQueue.server.d.ts.map +1 -1
- package/dist-lib/lib/printQueue.server.js +415 -23
- package/dist-lib/lib/printbestand.functions.d.ts +55 -0
- package/dist-lib/lib/printbestand.functions.d.ts.map +1 -0
- package/dist-lib/lib/printbestand.functions.js +105 -0
- package/dist-lib/lib/queueTick.d.ts.map +1 -1
- package/dist-lib/lib/queueTick.js +3 -2
- package/dist-lib/lib/standaardLayouts.server.d.ts +9 -0
- package/dist-lib/lib/standaardLayouts.server.d.ts.map +1 -1
- package/dist-lib/lib/standaardLayouts.server.js +29 -0
- package/dist-lib/lib/standaardenBron.d.ts +4 -0
- package/dist-lib/lib/standaardenBron.d.ts.map +1 -1
- package/dist-lib/lib/standaardenBron.js +17 -0
- package/dist-lib/lib/useDocumentData.d.ts +10 -0
- package/dist-lib/lib/useDocumentData.d.ts.map +1 -1
- package/dist-lib/lib/useDocumentData.js +63 -10
- package/dist-lib/lib/versie.generated.d.ts +1 -1
- package/dist-lib/lib/versie.generated.js +1 -1
- package/dist-lib/lib/voorbeeldPrint.d.ts +6 -1
- package/dist-lib/lib/voorbeeldPrint.d.ts.map +1 -1
- package/dist-lib/lib/voorbeeldPrint.js +57 -3
- package/package.json +1 -1
- package/sql/print-schema.sql +1351 -695
- package/sql/print-schema.verslag.md +75 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AfleverbriefBuilderPage.d.ts","sourceRoot":"","sources":["../../src/components/AfleverbriefBuilderPage.tsx"],"names":[],"mappings":"AAgCA;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAO,+
|
|
1
|
+
{"version":3,"file":"AfleverbriefBuilderPage.d.ts","sourceRoot":"","sources":["../../src/components/AfleverbriefBuilderPage.tsx"],"names":[],"mappings":"AAgCA;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAO,+BAuL7F"}
|
|
@@ -4,7 +4,7 @@ import { Link } from "@tanstack/react-router";
|
|
|
4
4
|
import { Badge, Button, Card, CardContent, CardDescription, CardHeader, CardTitle, toast, } from "@flowselections/core";
|
|
5
5
|
import { AlertTriangle, ArrowLeft, CheckCircle2, Loader2, Printer, Save } from "lucide-react";
|
|
6
6
|
import { PakbonSectiesPanel } from "./PakbonSectiesPanel.js";
|
|
7
|
-
import {
|
|
7
|
+
import { PrintbestandVoorbeeld } from "./PrintbestandVoorbeeld.js";
|
|
8
8
|
import { FormaatOrientatieBar } from "./FormaatOrientatieBar.js";
|
|
9
9
|
import { FustKolomVolgorde } from "./FustKolomVolgorde.js";
|
|
10
10
|
import { AFLEVERBRIEF_SECTIE_TYPES, leesAfleverbriefConfig, } from "../lib/pakbonBuilder.js";
|
|
@@ -90,7 +90,7 @@ export function AfleverbriefBuilderPage({ layoutId: layoutIdProp } = {}) {
|
|
|
90
90
|
naam: layout?.naam,
|
|
91
91
|
documenttype: layout?.documenttype ?? "afleverbrief",
|
|
92
92
|
papierformaat: layout?.papierformaat,
|
|
93
|
-
}, voorbeeldHtml);
|
|
93
|
+
}, voorbeeldHtml, { sleutel: "afleverbrief", indeling: config });
|
|
94
94
|
}
|
|
95
95
|
catch (e) {
|
|
96
96
|
toast.error(e instanceof Error ? e.message : "Voorbeeld printen mislukt");
|
|
@@ -105,5 +105,5 @@ export function AfleverbriefBuilderPage({ layoutId: layoutIdProp } = {}) {
|
|
|
105
105
|
return _jsx("main", { className: "p-6 text-sm text-muted-foreground", children: "Layout laden\u2026" });
|
|
106
106
|
if (!layout || !config)
|
|
107
107
|
return _jsx("main", { className: "p-6 text-sm text-muted-foreground", children: "Layout niet gevonden." });
|
|
108
|
-
return (_jsxs("main", { className: "space-y-4 p-6", children: [_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, _jsx(FormaatOrientatieBar, { layout: layout, onChange: (patch) => setLayout((l) => (l ? { ...l, ...patch } : l)), vergrendeld: Boolean(layout.systeem) }), _jsxs("div", { className: "grid items-start gap-4 lg:grid-cols-[400px_1fr]", children: [_jsxs(Card, { className: "flex h-[calc(100vh-14rem)] min-h-[420px] flex-col overflow-hidden lg:sticky lg:top-4", children: [_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 }) })] }), _jsxs(Card, { className: "flex h-[calc(100vh-14rem)] min-h-[420px] flex-col overflow-hidden", children: [_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(
|
|
108
|
+
return (_jsxs("main", { className: "space-y-4 p-6", children: [_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, _jsx(FormaatOrientatieBar, { layout: layout, onChange: (patch) => setLayout((l) => (l ? { ...l, ...patch } : l)), vergrendeld: Boolean(layout.systeem) }), _jsxs("div", { className: "grid items-start gap-4 lg:grid-cols-[400px_1fr]", children: [_jsxs(Card, { className: "flex h-[calc(100vh-14rem)] min-h-[420px] flex-col overflow-hidden lg:sticky lg:top-4", children: [_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 }) })] }), _jsxs(Card, { className: "flex h-[calc(100vh-14rem)] min-h-[420px] flex-col overflow-hidden", children: [_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 }) })] })] })] })] }));
|
|
109
109
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlokOntwerperPage.d.ts","sourceRoot":"","sources":["../../src/components/BlokOntwerperPage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BlokOntwerperPage.d.ts","sourceRoot":"","sources":["../../src/components/BlokOntwerperPage.tsx"],"names":[],"mappings":"AAsCA,yEAAyE;AACzE,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAO,+BAqOvF"}
|
|
@@ -5,11 +5,13 @@ import { Badge, Button, Card, CardContent, CardDescription, CardHeader, CardTitl
|
|
|
5
5
|
import { ArrowLeft, Plus, Save } from "lucide-react";
|
|
6
6
|
import { PakbonSectieEditor, PakbonBlokKaderEditor } from "./PakbonSectiesPanel.js";
|
|
7
7
|
import { PakbonSectiePreview } from "./PakbonPreview.js";
|
|
8
|
+
import { PrintbestandVoorbeeld } from "./PrintbestandVoorbeeld.js";
|
|
8
9
|
import { SECTIE_REGISTER, leesAfleverbriefConfig, leesPakbonConfig, nieuweSectie, sectieDef, } from "../lib/pakbonBuilder.js";
|
|
9
10
|
import { useLayoutDetail } from "../lib/useDocumentData.js";
|
|
10
11
|
import { bewaarIndeling, foutTekstVan, opgeslagenMelding } from "../lib/layoutOpslaan.js";
|
|
11
12
|
import { SysteemLayoutMelding } from "./SysteemLayoutMelding.js";
|
|
12
13
|
import { useLayoutIdParam } from "../lib/useLayoutIdParam.js";
|
|
14
|
+
import { BEWERKVLAK_LETTER, PAKBON_LETTER_PT, binnenBreedteMm } from "../lib/bewerkvlak.js";
|
|
13
15
|
/** Ontwerp elk pakbon-blok afzonderlijk, los van de volledige pagina. */
|
|
14
16
|
export function BlokOntwerperPage({ layoutId: layoutIdProp } = {}) {
|
|
15
17
|
const layoutId = useLayoutIdParam(layoutIdProp);
|
|
@@ -67,7 +69,7 @@ export function BlokOntwerperPage({ layoutId: layoutIdProp } = {}) {
|
|
|
67
69
|
return _jsx("main", { className: "p-6 text-sm text-muted-foreground", children: "Layout laden\u2026" });
|
|
68
70
|
if (!layout || !config)
|
|
69
71
|
return _jsx("main", { className: "p-6 text-sm text-muted-foreground", children: "Layout niet gevonden." });
|
|
70
|
-
return (_jsxs("main", { className: "space-y-4 p-6", children: [_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: layout.documenttype === "afleverbrief" || layout.documenttype === "veilingbrief" ? (_jsxs(Link, { to: "/layouts-printers/afleverbrief/$layoutId", params: { layoutId }, children: [_jsx(ArrowLeft, { className: "mr-2 h-4 w-4" }), " Afleverbriefopbouw"] })) : (_jsxs(Link, { to: "/layouts-printers/pakbon/$layoutId", params: { layoutId }, children: [_jsx(ArrowLeft, { className: "mr-2 h-4 w-4" }), " Pakbonopbouw"] })) }), _jsxs("div", { children: [_jsx("h1", { className: "text-lg font-semibold", children: "Blokken ontwerpen" }), _jsxs("p", { className: "text-xs text-muted-foreground", children: [layout.naam, " \u00B7 elk blok afzonderlijk vormgeven"] })] })] }), _jsxs(Button, { size: "sm", onClick: opslaan, disabled: bezig, children: [_jsx(Save, { className: "mr-2 h-4 w-4" }), " Opslaan"] })] }), layout.systeem ? _jsx(SysteemLayoutMelding, { layoutId: layout.id, route: "blokken" }) : null, _jsxs("div", { className: "grid gap-4 lg:grid-cols-[240px_1fr_360px]", children: [_jsxs(Card, { className: "h-fit", children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsx(CardTitle, { className: "text-base", children: "Blokken" }), _jsx(CardDescription, { children: "Kies welk blok je wilt ontwerpen." })] }), _jsxs(CardContent, { className: "space-y-3", children: [_jsxs("div", { className: "space-y-1", children: [secties.map((s) => (_jsxs("button", { type: "button", onClick: () => setActief(s.id), className: `flex w-full items-center justify-between rounded-md border px-2 py-1.5 text-left text-sm ${s.id === actief ? "border-primary bg-accent" : "hover:bg-accent/50"}`, children: [_jsx("span", { className: "truncate", children: s.titel }), !s.zichtbaar && _jsx(Badge, { variant: "outline", children: "verborgen" })] }, s.id))), secties.length === 0 && (_jsx("p", { className: "text-sm text-muted-foreground", children: "Nog geen blokken." }))] }), _jsx(Separator, {}), _jsxs("div", { className: "flex gap-2", children: [_jsxs(Select, { value: toevoegen, onValueChange: (v) => setToevoegen(v), children: [_jsx(SelectTrigger, { className: "h-8", children: _jsx(SelectValue, {}) }), _jsx(SelectContent, { children: SECTIE_REGISTER.map((d) => (_jsx(SelectItem, { value: d.type, children: d.label }, d.type))) })] }), _jsx(Button, { size: "sm", onClick: () => {
|
|
72
|
+
return (_jsxs("main", { className: "space-y-4 p-6", children: [_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: layout.documenttype === "afleverbrief" || layout.documenttype === "veilingbrief" ? (_jsxs(Link, { to: "/layouts-printers/afleverbrief/$layoutId", params: { layoutId }, children: [_jsx(ArrowLeft, { className: "mr-2 h-4 w-4" }), " Afleverbriefopbouw"] })) : (_jsxs(Link, { to: "/layouts-printers/pakbon/$layoutId", params: { layoutId }, children: [_jsx(ArrowLeft, { className: "mr-2 h-4 w-4" }), " Pakbonopbouw"] })) }), _jsxs("div", { children: [_jsx("h1", { className: "text-lg font-semibold", children: "Blokken ontwerpen" }), _jsxs("p", { className: "text-xs text-muted-foreground", children: [layout.naam, " \u00B7 elk blok afzonderlijk vormgeven"] })] })] }), _jsxs(Button, { size: "sm", onClick: opslaan, disabled: bezig, children: [_jsx(Save, { className: "mr-2 h-4 w-4" }), " Opslaan"] })] }), layout.systeem ? _jsx(SysteemLayoutMelding, { layoutId: layout.id, route: "blokken" }) : null, _jsxs("div", { className: "grid gap-4 lg:grid-cols-[240px_1fr_360px] 2xl:grid-cols-[240px_1fr_360px_360px]", children: [_jsxs(Card, { className: "h-fit", children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsx(CardTitle, { className: "text-base", children: "Blokken" }), _jsx(CardDescription, { children: "Kies welk blok je wilt ontwerpen." })] }), _jsxs(CardContent, { className: "space-y-3", children: [_jsxs("div", { className: "space-y-1", children: [secties.map((s) => (_jsxs("button", { type: "button", onClick: () => setActief(s.id), className: `flex w-full items-center justify-between rounded-md border px-2 py-1.5 text-left text-sm ${s.id === actief ? "border-primary bg-accent" : "hover:bg-accent/50"}`, children: [_jsx("span", { className: "truncate", children: s.titel }), !s.zichtbaar && _jsx(Badge, { variant: "outline", children: "verborgen" })] }, s.id))), secties.length === 0 && (_jsx("p", { className: "text-sm text-muted-foreground", children: "Nog geen blokken." }))] }), _jsx(Separator, {}), _jsxs("div", { className: "flex gap-2", children: [_jsxs(Select, { value: toevoegen, onValueChange: (v) => setToevoegen(v), children: [_jsx(SelectTrigger, { className: "h-8", children: _jsx(SelectValue, {}) }), _jsx(SelectContent, { children: SECTIE_REGISTER.map((d) => (_jsx(SelectItem, { value: d.type, children: d.label }, d.type))) })] }), _jsx(Button, { size: "sm", onClick: () => {
|
|
71
73
|
const s = nieuweSectie(toevoegen);
|
|
72
74
|
setConfig({ ...config, secties: [...secties, s] });
|
|
73
75
|
setActief(s.id);
|
|
@@ -75,5 +77,5 @@ export function BlokOntwerperPage({ layoutId: layoutIdProp } = {}) {
|
|
|
75
77
|
transform: `scale(${zoom})`,
|
|
76
78
|
transformOrigin: "top left",
|
|
77
79
|
width: `${100 / zoom}%`,
|
|
78
|
-
}, children: _jsx(PakbonSectiePreview, { sectie: sectie, config: config }) })) : (_jsx("p", { className: "text-sm text-muted-foreground", children: "Geen blok geselecteerd." })) }) })] }), _jsxs(Card, { className: "h-fit", children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsx(CardTitle, { className: "text-base", children: "Instellingen" }), _jsx(CardDescription, { children: "Inhoud, opmaak en kader van dit blok." })] }), _jsx(CardContent, { className: "space-y-4", children: sectie ? (_jsxs(_Fragment, { children: [_jsx(PakbonBlokKaderEditor, { sectie: sectie, onChange: patch }), _jsx(Separator, {}), _jsx(PakbonSectieEditor, { sectie: sectie, onChange: patch })] })) : (_jsx("p", { className: "text-sm text-muted-foreground", children: "Kies eerst een blok." })) })] })] })] }));
|
|
80
|
+
}, children: _jsx(PakbonSectiePreview, { sectie: sectie, config: config, breedteMm: layout ? binnenBreedteMm(layout) || undefined : undefined, lettertype: BEWERKVLAK_LETTER, lettergroottePt: PAKBON_LETTER_PT }) })) : (_jsx("p", { className: "text-sm text-muted-foreground", children: "Geen blok geselecteerd." })) }) })] }), _jsxs(Card, { className: "h-fit", children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsx(CardTitle, { className: "text-base", children: "Printbestand" }), _jsx(CardDescription, { children: "Zo komt het uit de printer, met voorbeeldgegevens." })] }), _jsx(CardContent, { children: layout && config ? (_jsx(PrintbestandVoorbeeld, { layoutId: layout.id, sleutel: layout.documenttype === "afleverbrief" || layout.documenttype === "veilingbrief" ? "afleverbrief" : "pakbon", indeling: config })) : null })] }), _jsxs(Card, { className: "h-fit", children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsx(CardTitle, { className: "text-base", children: "Instellingen" }), _jsx(CardDescription, { children: "Inhoud, opmaak en kader van dit blok." })] }), _jsx(CardContent, { className: "space-y-4", children: sectie ? (_jsxs(_Fragment, { children: [_jsx(PakbonBlokKaderEditor, { sectie: sectie, onChange: patch }), _jsx(Separator, {}), _jsx(PakbonSectieEditor, { sectie: sectie, onChange: patch })] })) : (_jsx("p", { className: "text-sm text-muted-foreground", children: "Kies eerst een blok." })) })] })] })] }));
|
|
79
81
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LayoutsPage.d.ts","sourceRoot":"","sources":["../../src/components/LayoutsPage.tsx"],"names":[],"mappings":"AA8FA,wBAAgB,WAAW,CAAC,EAAE,OAAe,EAAE,GAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAO,+
|
|
1
|
+
{"version":3,"file":"LayoutsPage.d.ts","sourceRoot":"","sources":["../../src/components/LayoutsPage.tsx"],"names":[],"mappings":"AA8FA,wBAAgB,WAAW,CAAC,EAAE,OAAe,EAAE,GAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAO,+BAqsB1E"}
|
|
@@ -9,7 +9,7 @@ import { StandaardLayoutActies } from "./StandaardLayoutActies.js";
|
|
|
9
9
|
import { BedrijfsgegevensMelding } from "./BedrijfsgegevensMelding.js";
|
|
10
10
|
import { DubbeleLayoutsMelding } from "./DubbeleLayoutsMelding.js";
|
|
11
11
|
import { supabase as moduleDb } from "../lib/supabaseClient.js";
|
|
12
|
-
import { maakStandaardLayout } from "../lib/useDocumentData.js";
|
|
12
|
+
import { maakStandaardLayout, activeerLayout, LayoutActieGeweigerd } from "../lib/useDocumentData.js";
|
|
13
13
|
import { ontbrekendeStandaarden, soortenZonderKeuze } from "../lib/klaarOmTePrinten.js";
|
|
14
14
|
import { documentTypeLabel as soortLabel } from "../lib/documentTypes.js";
|
|
15
15
|
import { dupliceerLayout, maakLayout, updateLayout, useLayouts, laatsteLayoutBeheerMelding, verwijderLayout, } from "../lib/useDocumentData.js";
|
|
@@ -126,6 +126,9 @@ export function LayoutsPage({ ingebed = false } = {}) {
|
|
|
126
126
|
return false;
|
|
127
127
|
if (l.gearchiveerd === true)
|
|
128
128
|
return false;
|
|
129
|
+
// Klantvarianten niet meer tonen; de gegevens blijven bewaard.
|
|
130
|
+
if (l.rol === "variant")
|
|
131
|
+
return false;
|
|
129
132
|
if (typeFilter !== "alle" && l.documenttype !== typeFilter)
|
|
130
133
|
return false;
|
|
131
134
|
if (statusFilter === "actief" && !l.actief)
|
|
@@ -211,7 +214,19 @@ export function LayoutsPage({ ingebed = false } = {}) {
|
|
|
211
214
|
toast.error(e instanceof Error ? e.message : "Standaard maken mislukt");
|
|
212
215
|
}
|
|
213
216
|
}, children: "Maak standaard" })] }, o.soort))), soortenZonderKeuze(layouts).map((o) => (_jsxs("div", { className: "flex items-center gap-2 rounded-md border border-destructive/40 bg-destructive/5 p-3 text-sm", children: [_jsx(AlertTriangle, { className: "h-4 w-4 text-destructive" }), _jsxs("span", { children: ["Geen standaardlayout voor ", soortLabel(o.soort), " \u2013 er zijn ", o.aantal, " actieve layouts. Kies er zelf \u00E9\u00E9n met ", _jsx("strong", { children: "Maak standaard" }), "."] })] }, `keuze-${o.soort}-${o.bron}`))), _jsx(LayoutVerwijzingenKaart, { onGewijzigd: () => void reload() }), _jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsx(CardTitle, { className: "text-base", children: "Overzicht" }), _jsx(CardDescription, { children: loading ? "Laden…" : `${gefilterd.length} van ${layouts.length} layouts` })] }), _jsxs(CardContent, { className: "space-y-4", children: [_jsxs("div", { className: "grid gap-3 md:grid-cols-5", children: [_jsxs("div", { className: "relative md:col-span-2", children: [_jsx(Search, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }), _jsx(Input, { className: "pl-9", placeholder: "Zoek op naam of omschrijving", value: zoek, onChange: (e) => setZoek(e.target.value) })] }), _jsxs(Select, { value: typeFilter, onValueChange: setTypeFilter, children: [_jsx(SelectTrigger, { children: _jsx(SelectValue, { placeholder: "Documenttype" }) }), _jsxs(SelectContent, { children: [_jsx(SelectItem, { value: "alle", children: "Alle documenttypes" }), DOCUMENT_TYPES.map((d) => (_jsx(SelectItem, { value: d.value, children: d.label }, d.value)))] })] }), _jsxs(Select, { value: statusFilter, onValueChange: setStatusFilter, children: [_jsx(SelectTrigger, { children: _jsx(SelectValue, { placeholder: "Status" }) }), _jsxs(SelectContent, { children: [_jsx(SelectItem, { value: "alle", children: "Alle statussen" }), _jsx(SelectItem, { value: "actief", children: "Actief" }), _jsx(SelectItem, { value: "inactief", children: "Inactief" })] })] }), _jsxs(Select, { value: bronFilter, onValueChange: setBronFilter, children: [_jsx(SelectTrigger, { children: _jsx(SelectValue, { placeholder: "Herkomst" }) }), _jsxs(SelectContent, { children: [_jsx(SelectItem, { value: "alle", children: "Alle herkomsten" }), _jsx(SelectItem, { value: "eigen", children: "Eigen ontwerp" }), _jsx(SelectItem, { value: "floriday", children: "Uit Floriday" })] })] })] }), _jsxs(Table, { children: [_jsx(TableHeader, { children: _jsxs(TableRow, { children: [_jsx(TableHead, { children: "Naam" }), _jsx(TableHead, { children: "Documenttype" }), _jsx(TableHead, { children: "Formaat" }), _jsxs(TableHead, { children: [_jsx("div", { children: "Printer nu" }), _jsxs("div", { className: "text-xs font-normal", children: ["bedrijfsstandaard, in te stellen op", " ", _jsx(Link, { to: "/layouts-printers/printplekken", className: "text-primary underline", children: "Printen" })] })] }), _jsx(TableHead, { children: "Actief" }), _jsx(TableHead, { className: "text-right", children: "Acties" })] }) }), _jsxs(TableBody, { children: [gefilterd.length === 0 && (_jsx(TableRow, { children: _jsx(TableCell, { colSpan: 6, className: "py-10 text-center text-sm text-muted-foreground", children: "Geen layouts gevonden." }) })), gefilterd.map((l) => (_jsxs(TableRow, { children: [_jsxs(TableCell, { children: [_jsxs("div", { className: "flex items-center gap-2 font-medium", children: [_jsx(FileText, { className: "h-4 w-4 text-muted-foreground" }), l.naam, l.is_standaard && _jsx(Badge, { variant: "secondary", children: "Standaard" }), isFloridayLayout(l) && _jsx(Badge, { variant: "outline", children: "Uit Floriday" })] }), (l.omschrijving || isFloridayLayout(l)) && (_jsx("span", { className: "text-xs text-muted-foreground", children: isFloridayLayout(l) ? FLORIDAY_LAYOUT_TOELICHTING : l.omschrijving })), !isFloridayLayout(l) && !klantOntwerpLayout(l) && (_jsx(StandaardLayoutActies, { layout: l, standaarden: standaarden, onGewijzigd: () => void reload() }))] }), _jsx(TableCell, { children: documentTypeLabel(l.documenttype) }), _jsxs(TableCell, { className: "text-sm text-muted-foreground", children: [l.papierformaat, " \u00B7 ", maatTekst(afdrukMaat(l))] }), _jsx(TableCell, { className: "min-w-52", children: _jsx(LayoutPrinterSelect, { layoutId: l.id, documenttype: l.documenttype }) }), _jsx(TableCell, { children: _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Switch, { checked: l.actief, onCheckedChange: async (v) => {
|
|
214
|
-
|
|
217
|
+
try {
|
|
218
|
+
if (isFloridayLayout(l))
|
|
219
|
+
await updateLayout(l.id, { actief: v });
|
|
220
|
+
else if (v)
|
|
221
|
+
await activeerLayout(l.id);
|
|
222
|
+
else
|
|
223
|
+
throw new LayoutActieGeweigerd("Dit is de actieve versie. Activeer een andere versie; dan gaat deze vanzelf uit.");
|
|
224
|
+
}
|
|
225
|
+
catch (e) {
|
|
226
|
+
toast.error(e instanceof LayoutActieGeweigerd ? e.message : "Activeren is niet gelukt. Neem contact op met de beheerder.");
|
|
227
|
+
if (!(e instanceof LayoutActieGeweigerd))
|
|
228
|
+
console.error("[layouts] activeren", e);
|
|
229
|
+
}
|
|
215
230
|
void reload();
|
|
216
231
|
} }), !l.is_standaard && (_jsx(Button, { variant: "ghost", size: "sm", onClick: async () => {
|
|
217
232
|
try {
|
|
@@ -237,8 +252,10 @@ export function LayoutsPage({ ingebed = false } = {}) {
|
|
|
237
252
|
toast.success("Layout verwijderd");
|
|
238
253
|
void reload();
|
|
239
254
|
}
|
|
240
|
-
catch {
|
|
241
|
-
toast.error("Verwijderen
|
|
255
|
+
catch (e) {
|
|
256
|
+
toast.error(e instanceof LayoutActieGeweigerd ? e.message : "Verwijderen is niet gelukt. Neem contact op met de beheerder.");
|
|
257
|
+
if (!(e instanceof LayoutActieGeweigerd))
|
|
258
|
+
console.error("[layouts] verwijderen", e);
|
|
242
259
|
}
|
|
243
260
|
}, children: _jsx(Trash2, { className: "h-4 w-4" }) }))] }) })] }, l.id)))] })] })] })] }), _jsx(Dialog, { open: wizardOpen, onOpenChange: (v) => {
|
|
244
261
|
setWizardOpen(v);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PakbonBuilderPage.d.ts","sourceRoot":"","sources":["../../src/components/PakbonBuilderPage.tsx"],"names":[],"mappings":"AAkCA,iFAAiF;AACjF,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAO,+
|
|
1
|
+
{"version":3,"file":"PakbonBuilderPage.d.ts","sourceRoot":"","sources":["../../src/components/PakbonBuilderPage.tsx"],"names":[],"mappings":"AAkCA,iFAAiF;AACjF,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAO,+BA8MvF"}
|
|
@@ -5,7 +5,7 @@ import { isStickerOntwerpSoort } from "../lib/stickerRoute.js";
|
|
|
5
5
|
import { Badge, Button, Card, CardContent, CardDescription, CardHeader, CardTitle, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, toast, } from "@flowselections/core";
|
|
6
6
|
import { AlertTriangle, ArrowLeft, CheckCircle2, Loader2, Printer, Save } from "lucide-react";
|
|
7
7
|
import { PakbonSectiesPanel } from "./PakbonSectiesPanel.js";
|
|
8
|
-
import {
|
|
8
|
+
import { PrintbestandVoorbeeld } from "./PrintbestandVoorbeeld.js";
|
|
9
9
|
import { FormaatOrientatieBar } from "./FormaatOrientatieBar.js";
|
|
10
10
|
import { leesPakbonConfig, pickMethode } from "../lib/pakbonBuilder.js";
|
|
11
11
|
import { renderPakbonDocument, voorbeeldPakbonOrder } from "../lib/pakbonHtml.js";
|
|
@@ -95,7 +95,7 @@ export function PakbonBuilderPage({ layoutId: layoutIdProp } = {}) {
|
|
|
95
95
|
naam: layout?.naam,
|
|
96
96
|
documenttype: layout?.documenttype ?? "pakbon",
|
|
97
97
|
papierformaat: layout?.papierformaat,
|
|
98
|
-
}, html);
|
|
98
|
+
}, html, { sleutel: "pakbon", indeling: config });
|
|
99
99
|
}
|
|
100
100
|
catch (e) {
|
|
101
101
|
toast.error(e instanceof Error ? e.message : "Voorbeeld printen mislukt");
|
|
@@ -110,5 +110,5 @@ export function PakbonBuilderPage({ layoutId: layoutIdProp } = {}) {
|
|
|
110
110
|
return _jsx("main", { className: "p-6 text-sm text-muted-foreground", children: "Layout laden\u2026" });
|
|
111
111
|
if (!layout || !config)
|
|
112
112
|
return _jsx("main", { className: "p-6 text-sm text-muted-foreground", children: "Layout niet gevonden." });
|
|
113
|
-
return (_jsxs("main", { className: "space-y-4 p-6", children: [_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, _jsx(FormaatOrientatieBar, { layout: layout, onChange: (patch) => setLayout((l) => (l ? { ...l, ...patch } : l)), vergrendeld: Boolean(layout.systeem) }), _jsxs("div", { className: "grid items-start gap-4 lg:grid-cols-[400px_1fr]", children: [_jsxs(Card, { className: "flex h-[calc(100vh-14rem)] min-h-[420px] flex-col overflow-hidden lg:sticky lg:top-4", children: [_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 }) })] }), _jsxs(Card, { className: "flex h-[calc(100vh-14rem)] min-h-[420px] flex-col overflow-hidden", children: [_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"] })] })] }), _jsx(CardContent, { className: "min-h-0 flex-1 overflow-hidden", children: _jsx("div", { className: "h-full rounded-md border bg-muted/30 p-2", children: voorbeeldHtml ? (_jsx(
|
|
113
|
+
return (_jsxs("main", { className: "space-y-4 p-6", children: [_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, _jsx(FormaatOrientatieBar, { layout: layout, onChange: (patch) => setLayout((l) => (l ? { ...l, ...patch } : l)), vergrendeld: Boolean(layout.systeem) }), _jsxs("div", { className: "grid items-start gap-4 lg:grid-cols-[400px_1fr]", children: [_jsxs(Card, { className: "flex h-[calc(100vh-14rem)] min-h-[420px] flex-col overflow-hidden lg:sticky lg:top-4", children: [_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 }) })] }), _jsxs(Card, { className: "flex h-[calc(100vh-14rem)] min-h-[420px] flex-col overflow-hidden", children: [_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"] })] })] }), _jsx(CardContent, { className: "min-h-0 flex-1 overflow-hidden", children: _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 }) })] })] })] }));
|
|
114
114
|
}
|
|
@@ -7,9 +7,12 @@ export declare function PakbonPreview({ config, breedteMm, hoogteMm, variant, }:
|
|
|
7
7
|
variant?: PakbonLayoutVariant | null;
|
|
8
8
|
}): import("react").JSX.Element;
|
|
9
9
|
/** Losse weergave van één blok — gebruikt door de blokontwerper. */
|
|
10
|
-
export declare function PakbonSectiePreview({ sectie, config, breedteMm, }: {
|
|
10
|
+
export declare function PakbonSectiePreview({ sectie, config, breedteMm, lettertype, lettergroottePt, }: {
|
|
11
11
|
sectie: PakbonSectie;
|
|
12
12
|
config: PakbonConfig;
|
|
13
13
|
breedteMm?: number;
|
|
14
|
+
/** Bewerkvlak gelijk aan het printbestand: zelfde letter en grootte (pt). */
|
|
15
|
+
lettertype?: string;
|
|
16
|
+
lettergroottePt?: number;
|
|
14
17
|
}): import("react").JSX.Element;
|
|
15
18
|
//# sourceMappingURL=PakbonPreview.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PakbonPreview.d.ts","sourceRoot":"","sources":["../../src/components/PakbonPreview.tsx"],"names":[],"mappings":"AAMA,OAAO,EA8BL,KAAK,YAAY,EAEjB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACzB,MAAM,sBAAsB,CAAC;AA6B9B,wBAAgB,aAAa,CAAC,EAC5B,MAAM,EACN,SAAe,EACf,QAAc,EACd,OAAc,GACf,EAAE;IACD,MAAM,EAAE,YAAY,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oFAAoF;IACpF,OAAO,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAAC;CACtC,+BAiJA;AAiLD,oEAAoE;AACpE,wBAAgB,mBAAmB,CAAC,EAClC,MAAM,EACN,MAAM,EACN,SAAS,
|
|
1
|
+
{"version":3,"file":"PakbonPreview.d.ts","sourceRoot":"","sources":["../../src/components/PakbonPreview.tsx"],"names":[],"mappings":"AAMA,OAAO,EA8BL,KAAK,YAAY,EAEjB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACzB,MAAM,sBAAsB,CAAC;AA6B9B,wBAAgB,aAAa,CAAC,EAC5B,MAAM,EACN,SAAe,EACf,QAAc,EACd,OAAc,GACf,EAAE;IACD,MAAM,EAAE,YAAY,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oFAAoF;IACpF,OAAO,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAAC;CACtC,+BAiJA;AAiLD,oEAAoE;AACpE,wBAAgB,mBAAmB,CAAC,EAClC,MAAM,EACN,MAAM,EACN,SAAS,EACT,UAAU,EACV,eAAe,GAChB,EAAE;IACD,MAAM,EAAE,YAAY,CAAC;IACrB,MAAM,EAAE,YAAY,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6EAA6E;IAC7E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,+BAuCA"}
|
|
@@ -151,12 +151,16 @@ function KarBlok({ sectie, kar, velden, lagen, lagenSectie, productSectie, fustS
|
|
|
151
151
|
return (_jsxs("div", { className: `space-y-2 ${omkaderd ? "rounded border p-2" : ""}`, children: [_jsx(KarKop, { sectie: sectie, kar: kar, velden: velden, bundelTekst: karBundelTekst(aantal) }), kar.barcode ? (_jsxs("div", { className: "space-y-1 py-1", children: [_jsx(BarcodeStrepen, { waarde: kar.barcode, hoogteMm: Number(opt(sectie, "barcodeHoogte", 15)) }), _jsx("div", { className: "text-[8px] text-muted-foreground", children: "Voorbeeld \u2014 iedere kar krijgt de eigen barcode van de Engine." })] })) : null, lagen.length > 0 && lagenSectie && (_jsx(LagenView, { sectie: lagenSectie, lagen: lagen, productSectie: productSectie, fustSectie: fustSectie })), fustSectie && optS(fustSectie, "modus", "totaal") === "kar" && (_jsx(FustTabel, { velden: lijst(fustSectie, "velden"), fusten: lagen.flatMap((l) => l.fusten), titel: `Fusten kar ${kar.karnummer}` }))] }));
|
|
152
152
|
}
|
|
153
153
|
/** Losse weergave van één blok — gebruikt door de blokontwerper. */
|
|
154
|
-
export function PakbonSectiePreview({ sectie, config, breedteMm, }) {
|
|
154
|
+
export function PakbonSectiePreview({ sectie, config, breedteMm, lettertype, lettergroottePt, }) {
|
|
155
155
|
const order = DEMO_ORDER;
|
|
156
156
|
const alle = Array.isArray(config?.secties) ? config.secties : [];
|
|
157
157
|
const zoek = (type) => alle.find((s) => s.type === type);
|
|
158
158
|
const segmenten = sectie.type === "karren" ? karSegmenten(sectie, order, zoek) : null;
|
|
159
|
-
return (_jsx("div", { className: "mx-auto bg-background p-4 text-[10px] leading-snug text-foreground shadow-sm", style:
|
|
159
|
+
return (_jsx("div", { className: "mx-auto bg-background p-4 text-[10px] leading-snug text-foreground shadow-sm", style: {
|
|
160
|
+
...(breedteMm ? { width: `${breedteMm}mm`, boxSizing: "content-box" } : {}),
|
|
161
|
+
...(lettertype ? { fontFamily: lettertype } : {}),
|
|
162
|
+
...(lettergroottePt ? { fontSize: `${lettergroottePt}pt`, lineHeight: 1.35 } : {}),
|
|
163
|
+
}, children: segmenten ? (_jsxs("div", { className: "space-y-3", children: [segmenten.map((seg, i) => (_jsxs("div", { className: "space-y-1", children: [seg.breakBefore && (_jsx("div", { className: "border-t-2 border-dashed pt-1 text-center text-[8px] uppercase text-muted-foreground", children: "Nieuwe pagina" })), seg.node, i === segmenten.length - 1 && null] }, seg.key))), segmenten.length === 0 && (_jsx("p", { className: "text-muted-foreground", children: "Deze sectie is uitgeschakeld." }))] })) : (_jsx(BlokFrame, { sectie: sectie, children: _jsx(SectieView, { sectie: sectie, order: order, zoek: zoek }) })) }));
|
|
160
164
|
}
|
|
161
165
|
/** Kaderinstellingen (breedte, uitlijning, marges, achtergrond, rand) per blok. */
|
|
162
166
|
function BlokFrame({ sectie, children }) {
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
/** De versie die getoond wordt. */
|
|
3
|
+
layoutId: string | null | undefined;
|
|
4
|
+
/** Sleutel waaronder de ontwerper zijn inhoud in de versie bewaart. */
|
|
5
|
+
sleutel?: string;
|
|
6
|
+
/** Huidige inhoud (mag nog niet opgeslagen zijn); alleen voor dit voorbeeld. */
|
|
7
|
+
indeling?: unknown;
|
|
8
|
+
onControle?: (status: "controleren" | "gereed" | "afwijking", fout?: string) => void;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Fase 1b: het voorbeeld is het echte printbestand (zelfde weg als de print,
|
|
12
|
+
* met de vaste voorbeeldorder), op ware verhouding van het papier of etiket.
|
|
13
|
+
* Een gestippelde lijn toont de rand die de printer niet kan printen.
|
|
14
|
+
* Ververst vanzelf kort na een wijziging.
|
|
15
|
+
*/
|
|
16
|
+
export declare function PrintbestandVoorbeeld({ layoutId, sleutel, indeling, onControle }: Props): import("react").JSX.Element;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=PrintbestandVoorbeeld.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PrintbestandVoorbeeld.d.ts","sourceRoot":"","sources":["../../src/components/PrintbestandVoorbeeld.tsx"],"names":[],"mappings":"AAIA,UAAU,KAAK;IACb,mCAAmC;IACnC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACpC,uEAAuE;IACvE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gFAAgF;IAChF,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,aAAa,GAAG,QAAQ,GAAG,WAAW,EAAE,IAAI,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CACtF;AAUD;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,KAAK,+BA+FvF"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef, useState } from "react";
|
|
3
|
+
import { AlertTriangle, Loader2 } from "lucide-react";
|
|
4
|
+
import { printbestandVoorbeeld } from "../lib/printbestand.functions.js";
|
|
5
|
+
const PT_NAAR_MM = 25.4 / 72;
|
|
6
|
+
/**
|
|
7
|
+
* Fase 1b: het voorbeeld is het echte printbestand (zelfde weg als de print,
|
|
8
|
+
* met de vaste voorbeeldorder), op ware verhouding van het papier of etiket.
|
|
9
|
+
* Een gestippelde lijn toont de rand die de printer niet kan printen.
|
|
10
|
+
* Ververst vanzelf kort na een wijziging.
|
|
11
|
+
*/
|
|
12
|
+
export function PrintbestandVoorbeeld({ layoutId, sleutel, indeling, onControle }) {
|
|
13
|
+
const volgnummer = useRef(0);
|
|
14
|
+
const controle = useRef(onControle);
|
|
15
|
+
const [paginas, setPaginas] = useState([]);
|
|
16
|
+
const [randMm, setRandMm] = useState(null);
|
|
17
|
+
const [bezig, setBezig] = useState(false);
|
|
18
|
+
const [fout, setFout] = useState(null);
|
|
19
|
+
const inhoud = JSON.stringify(indeling ?? null);
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
controle.current = onControle;
|
|
22
|
+
}, [onControle]);
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
if (!layoutId)
|
|
25
|
+
return;
|
|
26
|
+
const volgorde = ++volgnummer.current;
|
|
27
|
+
const timer = window.setTimeout(() => {
|
|
28
|
+
setBezig(true);
|
|
29
|
+
setFout(null);
|
|
30
|
+
controle.current?.("controleren");
|
|
31
|
+
void printbestandVoorbeeld({ data: { layoutId, sleutel, indeling: indeling === undefined ? undefined : JSON.parse(inhoud) } })
|
|
32
|
+
.then(async (res) => {
|
|
33
|
+
if (volgorde !== volgnummer.current)
|
|
34
|
+
return;
|
|
35
|
+
if (!res.ok)
|
|
36
|
+
throw new Error(res.fout);
|
|
37
|
+
const bin = atob(res.pdfBase64);
|
|
38
|
+
const bytes = new Uint8Array(bin.length);
|
|
39
|
+
for (let i = 0; i < bin.length; i += 1)
|
|
40
|
+
bytes[i] = bin.charCodeAt(i);
|
|
41
|
+
const pdfjs = await import("pdfjs-dist");
|
|
42
|
+
pdfjs.GlobalWorkerOptions.workerSrc = new URL("pdfjs-dist/build/pdf.worker.min.mjs", import.meta.url).toString();
|
|
43
|
+
const pdf = await pdfjs.getDocument({ data: bytes }).promise;
|
|
44
|
+
const nieuw = [];
|
|
45
|
+
for (let nummer = 1; nummer <= pdf.numPages; nummer += 1) {
|
|
46
|
+
const pagina = await pdf.getPage(nummer);
|
|
47
|
+
const basis = pagina.getViewport({ scale: 1 });
|
|
48
|
+
const viewport = pagina.getViewport({ scale: 2 });
|
|
49
|
+
const canvas = document.createElement("canvas");
|
|
50
|
+
canvas.width = viewport.width;
|
|
51
|
+
canvas.height = viewport.height;
|
|
52
|
+
const context = canvas.getContext("2d");
|
|
53
|
+
if (!context)
|
|
54
|
+
throw new Error("Het voorbeeld kon niet worden getoond.");
|
|
55
|
+
await pagina.render({ canvas, canvasContext: context, viewport }).promise;
|
|
56
|
+
nieuw.push({ src: canvas.toDataURL("image/png"), breedteMm: basis.width * PT_NAAR_MM, hoogteMm: basis.height * PT_NAAR_MM });
|
|
57
|
+
}
|
|
58
|
+
if (volgorde !== volgnummer.current)
|
|
59
|
+
return;
|
|
60
|
+
setPaginas(nieuw);
|
|
61
|
+
setRandMm(res.randMm);
|
|
62
|
+
controle.current?.("gereed");
|
|
63
|
+
})
|
|
64
|
+
.catch((e) => {
|
|
65
|
+
if (volgorde !== volgnummer.current)
|
|
66
|
+
return;
|
|
67
|
+
const melding = e instanceof Error ? e.message : "Het voorbeeld kon niet worden gemaakt.";
|
|
68
|
+
console.error("[voorbeeld] printbestand tonen mislukt", e);
|
|
69
|
+
setPaginas([]);
|
|
70
|
+
setFout(melding);
|
|
71
|
+
controle.current?.("afwijking", melding);
|
|
72
|
+
})
|
|
73
|
+
.finally(() => {
|
|
74
|
+
if (volgorde === volgnummer.current)
|
|
75
|
+
setBezig(false);
|
|
76
|
+
});
|
|
77
|
+
}, 600);
|
|
78
|
+
return () => window.clearTimeout(timer);
|
|
79
|
+
// inhoud is de vaste weergave van indeling
|
|
80
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
81
|
+
}, [layoutId, sleutel, inhoud]);
|
|
82
|
+
return (_jsx("div", { className: "h-full w-full rounded-md bg-muted p-3", children: _jsxs("div", { className: "mx-auto flex max-w-full flex-col items-center gap-4", children: [paginas.map((p, index) => (_jsxs("div", { className: "relative max-w-full border bg-background shadow-sm", style: { aspectRatio: `${p.breedteMm} / ${p.hoogteMm}`, width: "100%" }, children: [_jsx("img", { src: p.src, alt: `Printbestand pagina ${index + 1}`, className: "h-full w-full" }), randMm && randMm > 0 ? (_jsx("div", { "aria-hidden": true, className: "pointer-events-none absolute border border-dashed border-destructive/60", style: {
|
|
83
|
+
left: `${(randMm / p.breedteMm) * 100}%`,
|
|
84
|
+
right: `${(randMm / p.breedteMm) * 100}%`,
|
|
85
|
+
top: `${(randMm / p.hoogteMm) * 100}%`,
|
|
86
|
+
bottom: `${(randMm / p.hoogteMm) * 100}%`,
|
|
87
|
+
} })) : null] }, `${index}-${p.src.length}`))), bezig ? _jsx(Loader2, { className: "mt-4 h-6 w-6 animate-spin text-muted-foreground", "aria-label": "Voorbeeld wordt gemaakt" }) : null, fout ? (_jsxs("div", { className: "mt-4 flex max-w-md items-start gap-2 text-sm text-destructive", children: [_jsx(AlertTriangle, { className: "mt-0.5 h-4 w-4 shrink-0" }), fout] })) : null] }) }));
|
|
88
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrintenPage.d.ts","sourceRoot":"","sources":["../../src/components/PrintenPage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PrintenPage.d.ts","sourceRoot":"","sources":["../../src/components/PrintenPage.tsx"],"names":[],"mappings":"AAgBA,MAAM,MAAM,UAAU,GAAG,cAAc,GAAG,aAAa,GAAG,WAAW,GAAG,WAAW,CAAC;AACpF,KAAK,GAAG,GAAG,UAAU,CAAC;AAatB,wBAAgB,WAAW,CAAC,EAC1B,GAAoB,GACrB,EAAE;IACD,GAAG,CAAC,EAAE,GAAG,CAAC;CACX,+BA8BA"}
|
|
@@ -4,7 +4,6 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
4
4
|
// printplekken (plekken, computers en printers samen) en standaardregels.
|
|
5
5
|
// ============================================================================
|
|
6
6
|
import { useEffect, useState } from "react";
|
|
7
|
-
import { zorgVoorStandaardLayouts } from "../lib/useDocumentData.js";
|
|
8
7
|
import { Laptop, MapPin, Route as RouteIcon, Tag } from "lucide-react";
|
|
9
8
|
import { GeladenEtiketTab } from "./GeladenEtiketTab.js";
|
|
10
9
|
import { ModuleTabs } from "./ModuleTabs.js";
|
|
@@ -25,10 +24,6 @@ const TABS = [
|
|
|
25
24
|
{ id: "routering", label: "Standaardregels", icon: RouteIcon },
|
|
26
25
|
];
|
|
27
26
|
export function PrintenPage({ tab = "printplekken", }) {
|
|
28
|
-
// Bij openen: ontbrekende standaardlayouts en eenduidige printers aanvullen (server, servicerol).
|
|
29
|
-
useEffect(() => {
|
|
30
|
-
void zorgVoorStandaardLayouts();
|
|
31
|
-
}, []);
|
|
32
27
|
const [actiefTab, setActiefTab] = useState(tab);
|
|
33
28
|
useEffect(() => setActiefTab(tab), [tab]);
|
|
34
29
|
return (_jsx(_Fragment, { children: _jsxs(ModuleTabs, { titel: "Printen", omschrijving: "Stel per plek in het bedrijf in welke computers, printers en documenten daar horen.", tabs: TABS, actiefTab: actiefTab, onTabWijzig: (nieuwTab) => setActiefTab(nieuwTab === "routering" || nieuwTab === "werkplekken" || nieuwTab === "etiketten" ? nieuwTab : "printplekken"), children: [_jsx(LivePrintstatusRegel, {}), _jsx(PrintwachtrijGezondheid, {}), _jsx(KlaarOmTePrintenBlok, {}), actiefTab === "etiketten" ? (_jsx(GeladenEtiketTab, {})) : actiefTab === "werkplekken" ? (_jsx(WerkplekkenTab, {})) : actiefTab === "routering" ? (_jsx(DocumentRouteringPage, { ingebed: true })) : (_jsx(PrintplekkenPage, { ingebed: true }))] }) }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductiebonBuilderPage.d.ts","sourceRoot":"","sources":["../../src/components/ProductiebonBuilderPage.tsx"],"names":[],"mappings":"AAyBA,+EAA+E;AAC/E,wBAAgB,uBAAuB,CAAC,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAO,+
|
|
1
|
+
{"version":3,"file":"ProductiebonBuilderPage.d.ts","sourceRoot":"","sources":["../../src/components/ProductiebonBuilderPage.tsx"],"names":[],"mappings":"AAyBA,+EAA+E;AAC/E,wBAAgB,uBAAuB,CAAC,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAO,+BA4J7F"}
|
|
@@ -4,7 +4,7 @@ import { Link } from "@tanstack/react-router";
|
|
|
4
4
|
import { Badge, Button, Card, CardContent, CardDescription, CardHeader, CardTitle, toast, } from "@flowselections/core";
|
|
5
5
|
import { AlertTriangle, ArrowLeft, CheckCircle2, Loader2, Printer, Save } from "lucide-react";
|
|
6
6
|
import { ProductiebonBlokkenPanel } from "./ProductiebonBlokkenPanel.js";
|
|
7
|
-
import {
|
|
7
|
+
import { PrintbestandVoorbeeld } from "./PrintbestandVoorbeeld.js";
|
|
8
8
|
import { FormaatOrientatieBar } from "./FormaatOrientatieBar.js";
|
|
9
9
|
import { leesProductiebonConfig } from "../lib/productiebonBuilder.js";
|
|
10
10
|
import { useLayoutDetail } from "../lib/useDocumentData.js";
|
|
@@ -66,7 +66,7 @@ export function ProductiebonBuilderPage({ layoutId: layoutIdProp } = {}) {
|
|
|
66
66
|
naam: layout?.naam,
|
|
67
67
|
documenttype: layout?.documenttype ?? "productiebon",
|
|
68
68
|
papierformaat: layout?.papierformaat,
|
|
69
|
-
}, voorbeeldHtml);
|
|
69
|
+
}, voorbeeldHtml, { sleutel: "productiebon", indeling: config });
|
|
70
70
|
}
|
|
71
71
|
catch (e) {
|
|
72
72
|
toast.error(e instanceof Error ? e.message : "Voorbeeld printen mislukt");
|
|
@@ -81,5 +81,5 @@ export function ProductiebonBuilderPage({ layoutId: layoutIdProp } = {}) {
|
|
|
81
81
|
return _jsx("main", { className: "p-6 text-sm text-muted-foreground", children: "Layout laden\u2026" });
|
|
82
82
|
if (!layout || !config)
|
|
83
83
|
return _jsx("main", { className: "p-6 text-sm text-muted-foreground", children: "Layout niet gevonden." });
|
|
84
|
-
return (_jsxs("main", { className: "space-y-4 p-6", children: [_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, _jsx(FormaatOrientatieBar, { layout: layout, onChange: (patch) => setLayout((l) => (l ? { ...l, ...patch } : l)), vergrendeld: Boolean(layout.systeem) }), _jsxs("div", { className: "grid items-start gap-4 lg:grid-cols-[400px_1fr]", children: [_jsxs(Card, { className: "flex h-[calc(100vh-14rem)] min-h-[420px] flex-col overflow-hidden lg:sticky lg:top-4", children: [_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 }) })] }), _jsxs(Card, { className: "flex h-[calc(100vh-14rem)] min-h-[420px] flex-col overflow-hidden", children: [_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(
|
|
84
|
+
return (_jsxs("main", { className: "space-y-4 p-6", children: [_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, _jsx(FormaatOrientatieBar, { layout: layout, onChange: (patch) => setLayout((l) => (l ? { ...l, ...patch } : l)), vergrendeld: Boolean(layout.systeem) }), _jsxs("div", { className: "grid items-start gap-4 lg:grid-cols-[400px_1fr]", children: [_jsxs(Card, { className: "flex h-[calc(100vh-14rem)] min-h-[420px] flex-col overflow-hidden lg:sticky lg:top-4", children: [_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 }) })] }), _jsxs(Card, { className: "flex h-[calc(100vh-14rem)] min-h-[420px] flex-col overflow-hidden", children: [_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 }) })] })] })] }));
|
|
85
85
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StickerOntwerpPage.d.ts","sourceRoot":"","sources":["../../src/components/StickerOntwerpPage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StickerOntwerpPage.d.ts","sourceRoot":"","sources":["../../src/components/StickerOntwerpPage.tsx"],"names":[],"mappings":"AA8BA,wBAAgB,kBAAkB,CAAC,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAO,+BAqIxF"}
|
|
@@ -12,6 +12,7 @@ import { useLayoutDetail } from "../lib/useDocumentData.js";
|
|
|
12
12
|
import { useLayoutIdParam } from "../lib/useLayoutIdParam.js";
|
|
13
13
|
import { bewaarIndeling, foutTekstVan } from "../lib/layoutOpslaan.js";
|
|
14
14
|
import { voorbeeldPrint } from "../lib/voorbeeldPrint.js";
|
|
15
|
+
import { PrintbestandVoorbeeld } from "./PrintbestandVoorbeeld.js";
|
|
15
16
|
import { afdrukMaat, maatTekst } from "../lib/formaatWeergave.js";
|
|
16
17
|
import { formaatKlasse } from "../lib/etiketRollen.js";
|
|
17
18
|
import { documentTypeLabel } from "../lib/documentTypes.js";
|
|
@@ -56,7 +57,7 @@ export function StickerOntwerpPage({ layoutId: layoutIdProp } = {}) {
|
|
|
56
57
|
return;
|
|
57
58
|
setPrinten(true);
|
|
58
59
|
try {
|
|
59
|
-
await voorbeeldPrint({ ...layout, id: layout.id, naam: layout.naam, documenttype: layout.documenttype, papierformaat: layout.papierformaat }, html);
|
|
60
|
+
await voorbeeldPrint({ ...layout, id: layout.id, naam: layout.naam, documenttype: layout.documenttype, papierformaat: layout.papierformaat }, html, { sleutel: "fs_sticker", indeling: { velden } });
|
|
60
61
|
}
|
|
61
62
|
catch (e) {
|
|
62
63
|
toast.error(e instanceof Error ? e.message : "Voorbeeld printen mislukt");
|
|
@@ -71,7 +72,6 @@ export function StickerOntwerpPage({ layoutId: layoutIdProp } = {}) {
|
|
|
71
72
|
return _jsx("main", { className: "text-muted-foreground p-6 text-sm", children: "Layout laden\u2026" });
|
|
72
73
|
if (!layout)
|
|
73
74
|
return _jsx("main", { className: "text-muted-foreground p-6 text-sm", children: "Layout niet gevonden." });
|
|
74
|
-
//
|
|
75
|
-
|
|
76
|
-
return (_jsxs("main", { className: "space-y-4 p-6", children: [_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-muted-foreground text-xs", children: ["Stickerontwerp \u00B7 ", documentTypeLabel(layout.documenttype), " \u00B7 ", maatTekst(maat)] })] })] }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(LayoutPrinterSelect, { layoutId: layout.id }), _jsxs(Button, { size: "sm", variant: "outline", onClick: () => void voorbeeldPrinten(), disabled: printen || !html, 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: () => void 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: "sticker" }) : null, _jsx(FormaatOrientatieBar, { layout: layout, onChange: (patch) => setLayout((l) => (l ? { ...l, ...patch } : l)), vergrendeld: Boolean(layout.systeem) }), _jsxs("div", { className: "grid items-start gap-4 lg:grid-cols-[320px_1fr]", children: [_jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsx(CardTitle, { className: "text-base", children: "Stickervelden" }), _jsx(CardDescription, { children: "Kies wat er op de sticker staat. Lege gegevens blijven leeg." })] }), _jsxs(CardContent, { className: "space-y-2", children: [STICKER_VELDEN.map((v) => (_jsxs("label", { className: "flex items-center gap-2 text-sm", children: [_jsx("input", { type: "checkbox", checked: velden.includes(v.veld), onChange: () => wissel(v.veld), disabled: Boolean(layout.systeem) }), v.label] }, v.veld))), _jsx(Button, { size: "sm", variant: "outline", className: "mt-2", disabled: Boolean(layout.systeem), onClick: () => setVelden(VELDEN_PER_KLASSE[formaatKlasse(maat.breedte_mm || 100, maat.hoogte_mm || 100)]), children: "Velden voor dit formaat" })] })] }), _jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsxs(CardTitle, { className: "text-base", children: ["Voorbeeld (", maatTekst(maat), ")"] }), _jsx(CardDescription, { children: "Met voorbeeldgegevens, op ware verhouding." })] }), _jsx(CardContent, { children: html ? (_jsx("div", { className: "bg-muted/40 overflow-auto rounded-md p-4", children: _jsx("iframe", { title: "Stickervoorbeeld", srcDoc: html, className: "bg-background border", style: { width: `${maat.breedte_mm}mm`, height: `${maat.hoogte_mm}mm`, transform: `scale(${schaal / 3.78})`, transformOrigin: "top left" } }) })) : (_jsx("p", { className: "text-muted-foreground text-sm", children: "Vul eerst een formaat in." })) })] })] })] }));
|
|
75
|
+
// Geen apart bewerkvlak: het voorbeeld is het echte printbestand (zelfde letter en mm-maat).
|
|
76
|
+
return (_jsxs("main", { className: "space-y-4 p-6", children: [_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-muted-foreground text-xs", children: ["Stickerontwerp \u00B7 ", documentTypeLabel(layout.documenttype), " \u00B7 ", maatTekst(maat)] })] })] }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(LayoutPrinterSelect, { layoutId: layout.id }), _jsxs(Button, { size: "sm", variant: "outline", onClick: () => void voorbeeldPrinten(), disabled: printen || !html, 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: () => void 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: "sticker" }) : null, _jsx(FormaatOrientatieBar, { layout: layout, onChange: (patch) => setLayout((l) => (l ? { ...l, ...patch } : l)), vergrendeld: Boolean(layout.systeem) }), _jsxs("div", { className: "grid items-start gap-4 lg:grid-cols-[320px_1fr]", children: [_jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsx(CardTitle, { className: "text-base", children: "Stickervelden" }), _jsx(CardDescription, { children: "Kies wat er op de sticker staat. Lege gegevens blijven leeg." })] }), _jsxs(CardContent, { className: "space-y-2", children: [STICKER_VELDEN.map((v) => (_jsxs("label", { className: "flex items-center gap-2 text-sm", children: [_jsx("input", { type: "checkbox", checked: velden.includes(v.veld), onChange: () => wissel(v.veld), disabled: Boolean(layout.systeem) }), v.label] }, v.veld))), _jsx(Button, { size: "sm", variant: "outline", className: "mt-2", disabled: Boolean(layout.systeem), onClick: () => setVelden(VELDEN_PER_KLASSE[formaatKlasse(maat.breedte_mm || 100, maat.hoogte_mm || 100)]), children: "Velden voor dit formaat" })] })] }), _jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsxs(CardTitle, { className: "text-base", children: ["Voorbeeld (", maatTekst(maat), ")"] }), _jsx(CardDescription, { children: "Het printbestand met voorbeeldgegevens, op ware verhouding." })] }), _jsx(CardContent, { children: html ? (_jsx(PrintbestandVoorbeeld, { layoutId: layout.id, sleutel: "fs_sticker", indeling: { velden } })) : (_jsx("p", { className: "text-muted-foreground text-sm", children: "Vul eerst een formaat in." })) })] })] })] }));
|
|
77
77
|
}
|