@flowselections/layout-maker 1.3.2

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 (145) hide show
  1. package/README.md +24 -0
  2. package/dist-lib/_core-safelist.d.ts +2 -0
  3. package/dist-lib/_core-safelist.d.ts.map +1 -0
  4. package/dist-lib/_core-safelist.js +18 -0
  5. package/dist-lib/components/AfdrukKnop.d.ts +13 -0
  6. package/dist-lib/components/AfdrukKnop.d.ts.map +1 -0
  7. package/dist-lib/components/AfdrukKnop.js +38 -0
  8. package/dist-lib/components/AiLayoutImportDialog.d.ts +6 -0
  9. package/dist-lib/components/AiLayoutImportDialog.d.ts.map +1 -0
  10. package/dist-lib/components/AiLayoutImportDialog.js +133 -0
  11. package/dist-lib/components/BlokOntwerperPage.d.ts +5 -0
  12. package/dist-lib/components/BlokOntwerperPage.d.ts.map +1 -0
  13. package/dist-lib/components/BlokOntwerperPage.js +67 -0
  14. package/dist-lib/components/DocumentSettingsPanel.d.ts +13 -0
  15. package/dist-lib/components/DocumentSettingsPanel.d.ts.map +1 -0
  16. package/dist-lib/components/DocumentSettingsPanel.js +65 -0
  17. package/dist-lib/components/FormaatOrientatieBar.d.ts +10 -0
  18. package/dist-lib/components/FormaatOrientatieBar.d.ts.map +1 -0
  19. package/dist-lib/components/FormaatOrientatieBar.js +51 -0
  20. package/dist-lib/components/LayoutsPage.d.ts +2 -0
  21. package/dist-lib/components/LayoutsPage.d.ts.map +1 -0
  22. package/dist-lib/components/LayoutsPage.js +196 -0
  23. package/dist-lib/components/LogoBibliotheekDialog.d.ts +7 -0
  24. package/dist-lib/components/LogoBibliotheekDialog.d.ts.map +1 -0
  25. package/dist-lib/components/LogoBibliotheekDialog.js +27 -0
  26. package/dist-lib/components/LogosPage.d.ts +7 -0
  27. package/dist-lib/components/LogosPage.d.ts.map +1 -0
  28. package/dist-lib/components/LogosPage.js +131 -0
  29. package/dist-lib/components/PaginaDocument.d.ts +22 -0
  30. package/dist-lib/components/PaginaDocument.d.ts.map +1 -0
  31. package/dist-lib/components/PaginaDocument.js +80 -0
  32. package/dist-lib/components/PakbonBuilderPage.d.ts +5 -0
  33. package/dist-lib/components/PakbonBuilderPage.d.ts.map +1 -0
  34. package/dist-lib/components/PakbonBuilderPage.js +69 -0
  35. package/dist-lib/components/PakbonPreview.d.ts +13 -0
  36. package/dist-lib/components/PakbonPreview.d.ts.map +1 -0
  37. package/dist-lib/components/PakbonPreview.js +423 -0
  38. package/dist-lib/components/PakbonSectiesPanel.d.ts +18 -0
  39. package/dist-lib/components/PakbonSectiesPanel.d.ts.map +1 -0
  40. package/dist-lib/components/PakbonSectiesPanel.js +156 -0
  41. package/dist-lib/components/PreviewFit.d.ts +9 -0
  42. package/dist-lib/components/PreviewFit.d.ts.map +1 -0
  43. package/dist-lib/components/PreviewFit.js +38 -0
  44. package/dist-lib/components/PrintQueuePage.d.ts +2 -0
  45. package/dist-lib/components/PrintQueuePage.d.ts.map +1 -0
  46. package/dist-lib/components/PrintQueuePage.js +59 -0
  47. package/dist-lib/components/PrinterSetupWizard.d.ts +6 -0
  48. package/dist-lib/components/PrinterSetupWizard.d.ts.map +1 -0
  49. package/dist-lib/components/PrinterSetupWizard.js +119 -0
  50. package/dist-lib/components/PrintersPage.d.ts +2 -0
  51. package/dist-lib/components/PrintersPage.d.ts.map +1 -0
  52. package/dist-lib/components/PrintersPage.js +60 -0
  53. package/dist-lib/components/ProductiebonBlokkenPanel.d.ts +7 -0
  54. package/dist-lib/components/ProductiebonBlokkenPanel.d.ts.map +1 -0
  55. package/dist-lib/components/ProductiebonBlokkenPanel.js +85 -0
  56. package/dist-lib/components/ProductiebonBuilderPage.d.ts +5 -0
  57. package/dist-lib/components/ProductiebonBuilderPage.d.ts.map +1 -0
  58. package/dist-lib/components/ProductiebonBuilderPage.js +48 -0
  59. package/dist-lib/components/ProductiebonPreview.d.ts +12 -0
  60. package/dist-lib/components/ProductiebonPreview.d.ts.map +1 -0
  61. package/dist-lib/components/ProductiebonPreview.js +237 -0
  62. package/dist-lib/components/TemplateModuleLogo.d.ts +6 -0
  63. package/dist-lib/components/TemplateModuleLogo.d.ts.map +1 -0
  64. package/dist-lib/components/TemplateModuleLogo.js +4 -0
  65. package/dist-lib/components/settings/MijnModuleSettingsCard.d.ts +2 -0
  66. package/dist-lib/components/settings/MijnModuleSettingsCard.d.ts.map +1 -0
  67. package/dist-lib/components/settings/MijnModuleSettingsCard.js +42 -0
  68. package/dist-lib/hooks/useMijnModuleData.d.ts +13 -0
  69. package/dist-lib/hooks/useMijnModuleData.d.ts.map +1 -0
  70. package/dist-lib/hooks/useMijnModuleData.js +49 -0
  71. package/dist-lib/index.d.ts +38 -0
  72. package/dist-lib/index.d.ts.map +1 -0
  73. package/dist-lib/index.js +56 -0
  74. package/dist-lib/integrations/supabase/auth-attacher.d.ts +2 -0
  75. package/dist-lib/integrations/supabase/auth-attacher.d.ts.map +1 -0
  76. package/dist-lib/integrations/supabase/auth-attacher.js +12 -0
  77. package/dist-lib/integrations/supabase/auth-middleware.d.ts +19847 -0
  78. package/dist-lib/integrations/supabase/auth-middleware.d.ts.map +1 -0
  79. package/dist-lib/integrations/supabase/auth-middleware.js +52 -0
  80. package/dist-lib/integrations/supabase/client.d.ts +2 -0
  81. package/dist-lib/integrations/supabase/client.d.ts.map +1 -0
  82. package/dist-lib/integrations/supabase/client.js +3 -0
  83. package/dist-lib/integrations/supabase/client.server.d.ts +19843 -0
  84. package/dist-lib/integrations/supabase/client.server.d.ts.map +1 -0
  85. package/dist-lib/integrations/supabase/client.server.js +30 -0
  86. package/dist-lib/integrations/supabase/types.d.ts +20423 -0
  87. package/dist-lib/integrations/supabase/types.d.ts.map +1 -0
  88. package/dist-lib/integrations/supabase/types.js +78 -0
  89. package/dist-lib/lib/aiLayout.functions.d.ts +19864 -0
  90. package/dist-lib/lib/aiLayout.functions.d.ts.map +1 -0
  91. package/dist-lib/lib/aiLayout.functions.js +28 -0
  92. package/dist-lib/lib/aiLayout.server.d.ts +14 -0
  93. package/dist-lib/lib/aiLayout.server.d.ts.map +1 -0
  94. package/dist-lib/lib/aiLayout.server.js +197 -0
  95. package/dist-lib/lib/browserPrint.d.ts +38 -0
  96. package/dist-lib/lib/browserPrint.d.ts.map +1 -0
  97. package/dist-lib/lib/browserPrint.js +104 -0
  98. package/dist-lib/lib/documentProfiles.d.ts +50 -0
  99. package/dist-lib/lib/documentProfiles.d.ts.map +1 -0
  100. package/dist-lib/lib/documentProfiles.js +458 -0
  101. package/dist-lib/lib/documentTypes.d.ts +123 -0
  102. package/dist-lib/lib/documentTypes.d.ts.map +1 -0
  103. package/dist-lib/lib/documentTypes.js +74 -0
  104. package/dist-lib/lib/fieldRegistry.d.ts +20 -0
  105. package/dist-lib/lib/fieldRegistry.d.ts.map +1 -0
  106. package/dist-lib/lib/fieldRegistry.js +123 -0
  107. package/dist-lib/lib/formaatPrinters.d.ts +14 -0
  108. package/dist-lib/lib/formaatPrinters.d.ts.map +1 -0
  109. package/dist-lib/lib/formaatPrinters.js +39 -0
  110. package/dist-lib/lib/layoutPreview.d.ts +18 -0
  111. package/dist-lib/lib/layoutPreview.d.ts.map +1 -0
  112. package/dist-lib/lib/layoutPreview.js +134 -0
  113. package/dist-lib/lib/logoLibrary.d.ts +80 -0
  114. package/dist-lib/lib/logoLibrary.d.ts.map +1 -0
  115. package/dist-lib/lib/logoLibrary.js +264 -0
  116. package/dist-lib/lib/pakbonBuilder.d.ts +210 -0
  117. package/dist-lib/lib/pakbonBuilder.d.ts.map +1 -0
  118. package/dist-lib/lib/pakbonBuilder.js +910 -0
  119. package/dist-lib/lib/pakbonHtml.d.ts +48 -0
  120. package/dist-lib/lib/pakbonHtml.d.ts.map +1 -0
  121. package/dist-lib/lib/pakbonHtml.js +754 -0
  122. package/dist-lib/lib/printApi.d.ts +45 -0
  123. package/dist-lib/lib/printApi.d.ts.map +1 -0
  124. package/dist-lib/lib/printApi.js +98 -0
  125. package/dist-lib/lib/productiebonBuilder.d.ts +137 -0
  126. package/dist-lib/lib/productiebonBuilder.d.ts.map +1 -0
  127. package/dist-lib/lib/productiebonBuilder.js +661 -0
  128. package/dist-lib/lib/supabaseClient.d.ts +4 -0
  129. package/dist-lib/lib/supabaseClient.d.ts.map +1 -0
  130. package/dist-lib/lib/supabaseClient.js +10 -0
  131. package/dist-lib/lib/useDocumentData.d.ts +97 -0
  132. package/dist-lib/lib/useDocumentData.d.ts.map +1 -0
  133. package/dist-lib/lib/useDocumentData.js +286 -0
  134. package/dist-lib/lib/useLayoutIdParam.d.ts +7 -0
  135. package/dist-lib/lib/useLayoutIdParam.d.ts.map +1 -0
  136. package/dist-lib/lib/useLayoutIdParam.js +10 -0
  137. package/dist-lib/lib/utils.d.ts +3 -0
  138. package/dist-lib/lib/utils.d.ts.map +1 -0
  139. package/dist-lib/lib/utils.js +5 -0
  140. package/dist-lib/lib/validationSchemas.d.ts +15 -0
  141. package/dist-lib/lib/validationSchemas.d.ts.map +1 -0
  142. package/dist-lib/lib/validationSchemas.js +25 -0
  143. package/dist-lib/styles.css +1 -0
  144. package/package.json +117 -0
  145. package/public/logo.png +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PakbonPreview.d.ts","sourceRoot":"","sources":["../../src/components/PakbonPreview.tsx"],"names":[],"mappings":"AAGA,OAAO,EAoBL,KAAK,YAAY,EAEjB,KAAK,YAAY,EAClB,MAAM,sBAAsB,CAAC;AAS9B,wBAAgB,aAAa,CAAC,EAC5B,MAAM,EACN,SAAe,EACf,QAAc,GACf,EAAE;IACD,MAAM,EAAE,YAAY,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,+BAgFA;AAsKD,oEAAoE;AACpE,wBAAgB,mBAAmB,CAAC,EAClC,MAAM,EACN,MAAM,EACN,SAAS,GACV,EAAE;IACD,MAAM,EAAE,YAAY,CAAC;IACrB,MAAM,EAAE,YAAY,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,+BAmCA"}
@@ -0,0 +1,423 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useMemo } from "react";
3
+ import { PaginaDocument } from "./PaginaDocument";
4
+ import { useLogos } from "../lib/logoLibrary";
5
+ import { DEMO_ORDER, conditieContext, groepeerIdentiekeKarren, groepeerIdentiekeLagen, karBundelTekst, fustVerzamellijst, pickMethode, productVeldBreedtes, sectieOnderdrukt, kolomLabel, laagBundelTekst, sectieZichtbaar, sorteerProducten, totalen, vulVeldcodes, } from "../lib/pakbonBuilder";
6
+ export function PakbonPreview({ config, breedteMm = 210, hoogteMm = 297, }) {
7
+ const order = DEMO_ORDER;
8
+ const ctx = conditieContext(order);
9
+ const alleSecties = Array.isArray(config?.secties) ? config.secties : [];
10
+ const methode = pickMethode(alleSecties);
11
+ const secties = alleSecties.filter((s) => sectieZichtbaar(s, ctx) && !sectieOnderdrukt(s.type, methode));
12
+ const zoek = (type) => secties.find((s) => s.type === type);
13
+ const segmenten = [];
14
+ if (config?.logo?.logoId) {
15
+ segmenten.push({
16
+ key: "documentlogo",
17
+ node: (_jsx(DocumentLogo, { logoId: config.logo.logoId, hoogte: config.logo.hoogte ?? 18, uitlijning: config.logo.uitlijning ?? "left" })),
18
+ });
19
+ }
20
+ const totalenSectie = zoek("totalen");
21
+ const totalenElkePagina = totalenSectie
22
+ ? opt(totalenSectie, "elke_pagina", false) === true
23
+ : false;
24
+ const toonPaginanummer = totalenSectie
25
+ ? opt(totalenSectie, "toon_paginanummer", false) === true
26
+ : false;
27
+ for (const s of secties) {
28
+ if (s.type === "karren") {
29
+ segmenten.push(...karSegmenten(s, order, zoek));
30
+ }
31
+ else if (s.type === "totalen" && (totalenElkePagina || toonPaginanummer)) {
32
+ // wordt als voettekst onder elke pagina getoond
33
+ }
34
+ else {
35
+ segmenten.push({
36
+ key: s.id,
37
+ node: (_jsx(BlokFrame, { sectie: s, children: _jsx(SectieView, { sectie: s, order: order, zoek: zoek }) })),
38
+ });
39
+ }
40
+ }
41
+ const voet = totalenSectie && (totalenElkePagina || toonPaginanummer)
42
+ ? (pagina, totaalPaginas) => (_jsxs("div", { className: "space-y-1", children: [totalenElkePagina && (_jsx(BlokFrame, { sectie: totalenSectie, children: _jsx(SectieView, { sectie: totalenSectie, order: order, zoek: zoek }) })), toonPaginanummer && (_jsxs("div", { className: "text-right text-[9px] text-neutral-500", children: ["Pagina ", pagina, " van ", totaalPaginas] }))] }))
43
+ : undefined;
44
+ return (_jsx(PaginaDocument, { breedteMm: breedteMm, hoogteMm: hoogteMm, leeg: "Nog geen zichtbare secties.", voet: voet, items: segmenten.map((seg) => ({
45
+ id: seg.key,
46
+ node: seg.node,
47
+ breakBefore: seg.breakBefore,
48
+ })) }));
49
+ }
50
+ /** Bouwt de segmenten voor de karrensectie, inclusief pagina-afbrekingen. */
51
+ function karSegmenten(s, order, zoek) {
52
+ const modus = optS(s, "modus", "pagina");
53
+ if (modus === "geen")
54
+ return [];
55
+ const scheiding = optS(s, "scheiding", "kop");
56
+ const lagenSectie = zoek("lagen");
57
+ const productSectie = zoek("producten");
58
+ const fustSectie = zoek("fusten");
59
+ const nieuwePaginaPerKar = modus === "pagina" || scheiding === "pagina";
60
+ const lagenModus = lagenSectie ? optS(lagenSectie, "modus", "apart") : "geen";
61
+ const nieuwePaginaPerLaag = modus !== "nummer" && lagenModus === "pagina";
62
+ const wrap = (node) => _jsx(BlokFrame, { sectie: s, children: node });
63
+ const bundelKarren = opt(s, "bundel_identiek", true) !== false;
64
+ // Bij samenvoegen staat er geen uniek karnummer meer op de kar.
65
+ const velden = lijst(s, "velden").filter((v) => !(bundelKarren && (v === "karnummer" || v === "barcode" || v === "qrcode")));
66
+ const karGroepen = groepeerIdentiekeKarren(order.karren, bundelKarren);
67
+ if (modus === "naast") {
68
+ return [
69
+ {
70
+ key: s.id,
71
+ node: wrap(_jsx("div", { className: "grid grid-cols-2 gap-3", children: karGroepen.map((g) => (_jsx(KarBlok, { sectie: s, kar: g.kar, aantal: g.aantal, velden: velden, lagen: g.kar.lagen, lagenSectie: lagenSectie, productSectie: productSectie, fustSectie: fustSectie, omkaderd: false }, g.kar.karnummer))) })),
72
+ },
73
+ ];
74
+ }
75
+ const segmenten = [];
76
+ karGroepen.forEach((groep, i) => {
77
+ const kar = groep.kar;
78
+ const lagenVanKar = modus === "nummer" ? [] : kar.lagen;
79
+ if (nieuwePaginaPerLaag && lagenVanKar.length > 0) {
80
+ const laagGroepen = groepeerIdentiekeLagen(lagenVanKar, String(lagenModus) === "gebundeld");
81
+ laagGroepen.forEach((lg, j) => {
82
+ segmenten.push({
83
+ key: `${s.id}-${kar.karnummer}-${lg.laag.laagnummer}`,
84
+ breakBefore: i > 0 || j > 0,
85
+ node: wrap(_jsx(KarBlok, { sectie: s, kar: kar, aantal: groep.aantal, velden: velden, lagen: [lg.laag], lagenSectie: lagenSectie, productSectie: productSectie, fustSectie: fustSectie, omkaderd: modus === "blok" || modus === "passend" })),
86
+ });
87
+ });
88
+ return;
89
+ }
90
+ segmenten.push({
91
+ key: `${s.id}-${kar.karnummer}`,
92
+ breakBefore: i > 0 && nieuwePaginaPerKar,
93
+ node: wrap(_jsxs("div", { className: "space-y-2", children: [i > 0 && !nieuwePaginaPerKar && _jsx(Scheiding, { modus: scheiding }), _jsx(KarBlok, { sectie: s, kar: kar, aantal: groep.aantal, velden: velden, lagen: lagenVanKar, lagenSectie: lagenSectie, productSectie: productSectie, fustSectie: fustSectie, omkaderd: modus === "blok" || modus === "passend" })] })),
94
+ });
95
+ });
96
+ return segmenten;
97
+ }
98
+ /** Melding boven een gebundelde kar of laag. */
99
+ function BundelMelding({ tekst }) {
100
+ return (_jsx("div", { className: "rounded border border-dashed px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide", children: tekst }));
101
+ }
102
+ function KarBlok({ sectie, kar, velden, lagen, lagenSectie, productSectie, fustSectie, omkaderd, aantal = 1, }) {
103
+ return (_jsxs("div", { className: `space-y-2 ${omkaderd ? "rounded border p-2" : ""}`, children: [_jsx(KarKop, { sectie: sectie, kar: kar, velden: velden, bundelTekst: karBundelTekst(aantal) }), 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}` }))] }));
104
+ }
105
+ /** Losse weergave van één blok — gebruikt door de blokontwerper. */
106
+ export function PakbonSectiePreview({ sectie, config, breedteMm, }) {
107
+ const order = DEMO_ORDER;
108
+ const alle = Array.isArray(config?.secties) ? config.secties : [];
109
+ const zoek = (type) => alle.find((s) => s.type === type);
110
+ const segmenten = sectie.type === "karren" ? karSegmenten(sectie, order, zoek) : null;
111
+ return (_jsx("div", { className: "mx-auto bg-background p-4 text-[10px] leading-snug text-foreground shadow-sm", style: breedteMm ? { width: `${breedteMm}mm` } : undefined, 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 }) })) }));
112
+ }
113
+ /** Kaderinstellingen (breedte, uitlijning, marges, achtergrond, rand) per blok. */
114
+ function BlokFrame({ sectie, children }) {
115
+ const o = sectie.opties ?? {};
116
+ const breedte = Number(o.blok_breedte ?? 100);
117
+ const uitlijning = String(o.blok_uitlijning ?? "left");
118
+ const marge = Number(o.blok_marge ?? 0);
119
+ const padding = Number(o.blok_padding ?? 0);
120
+ const achtergrond = o.blok_achtergrond ? String(o.blok_achtergrond) : undefined;
121
+ const randKleur = o.blok_randkleur ? String(o.blok_randkleur) : "#e5e7eb";
122
+ const rand = !!o.blok_rand;
123
+ const radius = Number(o.blok_radius ?? 0);
124
+ const schaal = Number(o.blok_tekstschaal ?? 100);
125
+ return (_jsx("div", { style: {
126
+ display: "flow-root",
127
+ width: `${Math.min(Math.max(breedte, 5), 100)}%`,
128
+ marginLeft: uitlijning === "right" ? "auto" : uitlijning === "center" ? "auto" : undefined,
129
+ marginRight: uitlijning === "left" ? "auto" : uitlijning === "center" ? "auto" : undefined,
130
+ marginTop: `${marge}mm`,
131
+ marginBottom: `${marge}mm`,
132
+ padding: padding ? `${padding}mm` : undefined,
133
+ background: achtergrond,
134
+ border: rand ? `0.3mm solid ${randKleur}` : undefined,
135
+ borderRadius: radius ? `${radius}mm` : undefined,
136
+ fontSize: schaal !== 100 ? `${(10 * schaal) / 100}px` : undefined,
137
+ }, children: children }));
138
+ }
139
+ const opt = (s, key, fallback) => s.opties?.[key] ?? fallback;
140
+ const optS = (s, key, fallback) => String(s.opties?.[key] ?? fallback);
141
+ const lijst = (s, key) => Array.isArray(s.opties?.[key]) ? s.opties[key] : [];
142
+ function Blok({ titel, children }) {
143
+ return (_jsxs("div", { className: "space-y-1", children: [titel && _jsx("div", { className: "text-[9px] font-semibold uppercase text-muted-foreground", children: titel }), children] }));
144
+ }
145
+ function SectieView({ sectie, order, zoek, }) {
146
+ const s = sectie;
147
+ switch (s.type) {
148
+ case "logo":
149
+ return _jsx(LogoSectie, { sectie: s });
150
+ case "bedrijfsgegevens":
151
+ return (_jsxs(Blok, { titel: s.titel, children: [opt(s, "toonNaam", true) && _jsx("div", { className: "font-semibold", children: order.bedrijf.naam }), opt(s, "toonAdres", true) && (_jsxs("div", { children: [order.bedrijf.adres, " \u00B7 ", order.bedrijf.plaats] })), opt(s, "toonContact", true) && (_jsxs("div", { children: [order.bedrijf.telefoon, " \u00B7 ", order.bedrijf.email] })), opt(s, "toonKvk", false) && (_jsxs("div", { children: [order.bedrijf.kvk, " \u00B7 ", order.bedrijf.btw] }))] }));
152
+ case "klantgegevens":
153
+ return (_jsxs(Blok, { titel: s.titel, children: [_jsx("div", { className: "font-semibold", children: order.klant.naam }), opt(s, "toonKlantnummer", true) && _jsxs("div", { children: ["Klantnummer: ", order.klant.nummer] }), opt(s, "toonContact", true) && _jsxs("div", { children: ["Contact: ", order.klant.contact] }), opt(s, "toonReferentie", true) && _jsxs("div", { children: ["Referentie: ", order.klant.referentie] })] }));
154
+ case "afleveradres":
155
+ case "factuuradres": {
156
+ const a = s.type === "afleveradres" ? order.afleveradres : order.factuuradres;
157
+ return (_jsxs(Blok, { titel: s.titel, children: [_jsx("div", { className: "font-semibold", children: a.naam }), _jsx("div", { children: a.adres }), _jsx("div", { children: a.plaats }), opt(s, "toonLand", true) && _jsx("div", { children: a.land })] }));
158
+ }
159
+ case "orderinformatie":
160
+ return (_jsx(Blok, { titel: s.titel, children: _jsxs("div", { className: "grid grid-cols-2 gap-x-4", children: [opt(s, "toonOrdernummer", true) && _jsx(Rij, { label: "Ordernummer", waarde: order.order.nummer }), opt(s, "toonDatum", true) && _jsx(Rij, { label: "Orderdatum", waarde: order.order.datum }), opt(s, "toonLeverdatum", true) && _jsx(Rij, { label: "Leverdatum", waarde: order.order.leverdatum }), opt(s, "toonReferentie", true) && _jsx(Rij, { label: "Referentie", waarde: order.order.referentie })] }) }));
161
+ case "transportinformatie":
162
+ return (_jsx(Blok, { titel: s.titel, children: _jsxs("div", { className: "grid grid-cols-2 gap-x-4", children: [opt(s, "toonTransporteur", true) && (_jsx(Rij, { label: "Transporteur", waarde: order.transport.transporteur })), opt(s, "toonRoute", true) && _jsx(Rij, { label: "Route", waarde: order.transport.route }), opt(s, "toonChauffeur", false) && _jsx(Rij, { label: "Chauffeur", waarde: order.transport.chauffeur }), opt(s, "toonTrack", false) && _jsx(Rij, { label: "Track & trace", waarde: order.transport.track })] }) }));
163
+ case "opmerkingen":
164
+ return (_jsxs("div", { className: opt(s, "kader", true) ? "rounded border p-2" : "", children: [_jsx("span", { className: "font-semibold", children: "Opmerkingen: " }), order.order.opmerking] }));
165
+ case "orderregels": {
166
+ const kolommen = Array.isArray(s.kolommen) ? s.kolommen : [];
167
+ const groepering = optS(s, "groepering", "order");
168
+ const groepen = groepeer(order, groepering, optS(s, "sortering", "eigen"));
169
+ return (_jsx("div", { className: "space-y-2", children: groepen.map((g) => (_jsxs("div", { className: "space-y-1", children: [g.titel !== "—" && _jsx("div", { className: "font-semibold", children: g.titel }), _jsx(RegelWeergave, { producten: g.producten, kolommen: kolommen, weergave: optS(s, "weergave", "tabel"), toonKoppen: opt(s, "toonKoppen", true), zebra: opt(s, "zebra", false), randen: opt(s, "randen", true) })] }, g.titel))) }));
170
+ }
171
+ case "pickmethode":
172
+ if (optS(s, "methode", "kar") !== "fusten")
173
+ return null;
174
+ return (_jsx(FustVerzamellijst, { order: order, kop: String(s.opties?.["kop"] ?? "Te verzamelen fusten — karindeling zelf bepalen"), velden: lijst(s, "velden"), toonFusthoogte: opt(s, "toonFusthoogte", true) !== false, toonTotaal: opt(s, "toonTotaal", true) !== false }));
175
+ case "karren":
176
+ // wordt via karSegmenten gerenderd (pagina-afbrekingen)
177
+ return null;
178
+ case "lagen":
179
+ case "producten":
180
+ // worden binnen de karrensectie gerenderd
181
+ return null;
182
+ case "fusten": {
183
+ const modus = optS(s, "modus", "totaal");
184
+ if (modus !== "totaal")
185
+ return null;
186
+ const alle = order.karren.flatMap((k) => k.lagen.flatMap((l) => l.fusten));
187
+ return _jsx(FustTabel, { velden: lijst(s, "velden"), fusten: alle, titel: s.titel });
188
+ }
189
+ case "totalen": {
190
+ const t = totalen(order);
191
+ const perFust = optS(zoek("pickmethode") ?? s, "methode", "kar") === "fusten";
192
+ const velden = lijst(s, "velden").filter((v) => !(perFust && (v === "karren" || v === "lagen")));
193
+ return (_jsx("div", { className: "flex flex-wrap gap-4 border-t pt-2 font-medium", style: { justifyContent: optS(s, "uitlijning", "right") === "right" ? "flex-end" : "flex-start" }, children: velden.map((v) => (_jsx("span", { children: t[v] ?? v }, v))) }));
194
+ }
195
+ case "handtekening":
196
+ return (_jsxs("div", { className: "mt-3 space-y-1", children: [_jsx("div", { className: "text-[9px] uppercase text-muted-foreground", children: opt(s, "label", "") }), opt(s, "toonNaam", true) && _jsx("div", { className: "mt-3 border-b border-foreground/40 pb-3", children: "Naam" }), opt(s, "toonDatum", true) && _jsx("div", { className: "mt-3 border-b border-foreground/40 pb-3", children: "Datum" }), _jsx("div", { className: "mt-3 h-12 border-b border-foreground/40" })] }));
197
+ case "tekstblok":
198
+ return (_jsx("div", { className: opt(s, "kader", false) ? "rounded border p-2" : "", style: { fontSize: `${opt(s, "fontgrootte", 9)}pt` }, children: vulVeldcodes(String(opt(s, "tekst", "")), order) }));
199
+ case "qrcode":
200
+ return (_jsxs("div", { className: "space-y-1", children: [_jsx("div", { className: "flex items-center justify-center border border-dashed text-muted-foreground", style: { width: `${opt(s, "grootte", 25)}mm`, height: `${opt(s, "grootte", 25)}mm` }, children: "QR" }), _jsx("div", { className: "text-[8px] text-muted-foreground", children: vulVeldcodes(String(opt(s, "waarde", "")), order) })] }));
201
+ case "barcode":
202
+ return (_jsxs("div", { className: "space-y-1", children: [_jsx("div", { className: "w-48", style: {
203
+ height: `${opt(s, "hoogte", 15)}mm`,
204
+ backgroundImage: "repeating-linear-gradient(to right, currentColor 0 2px, transparent 2px 5px)",
205
+ } }), _jsx("div", { children: vulVeldcodes(String(opt(s, "waarde", "")), order) })] }));
206
+ case "afbeelding": {
207
+ const url = String(opt(s, "url", ""));
208
+ return url ? (_jsx("img", { src: url, alt: s.titel, style: { height: `${opt(s, "hoogte", 25)}mm` } })) : (_jsx("div", { className: "flex items-center justify-center rounded border border-dashed text-muted-foreground", style: { height: `${opt(s, "hoogte", 25)}mm` }, children: "Afbeelding" }));
209
+ }
210
+ default:
211
+ return null;
212
+ }
213
+ }
214
+ function Rij({ label, waarde }) {
215
+ return (_jsxs("div", { className: "flex justify-between gap-2", children: [_jsx("span", { className: "text-muted-foreground", children: label }), _jsx("span", { className: "font-medium", children: waarde })] }));
216
+ }
217
+ function alignToFlex(v) {
218
+ return v === "center" ? "center" : v === "right" ? "flex-end" : "flex-start";
219
+ }
220
+ function Scheiding({ modus }) {
221
+ if (modus === "geen")
222
+ return null;
223
+ if (modus === "lijn")
224
+ return _jsx("div", { className: "border-t" });
225
+ if (modus === "balk")
226
+ return _jsx("div", { className: "h-1 w-full bg-foreground/70" });
227
+ if (modus === "kop" || modus === "kleur")
228
+ return null; // kop/kleur zit in de karkop zelf
229
+ return _jsx("div", { className: "border-t" });
230
+ }
231
+ function KarKop({ sectie, kar, velden, bundelTekst = "" }) {
232
+ const scheiding = optS(sectie, "scheiding", "kop");
233
+ const tekst = String(opt(sectie, "koptekst", "KAR {kar}"))
234
+ .replace(/{kar}/g, String(kar.karnummer))
235
+ .replace(/{route}/g, kar.route)
236
+ .replace(/{chauffeur}/g, kar.chauffeur)
237
+ .replace(/{lagen}/g, String(kar.lagen.length))
238
+ .replace(/{producten}/g, String(kar.lagen.reduce((n, l) => n + l.producten.length, 0)));
239
+ const info = [];
240
+ if (velden.includes("lagen"))
241
+ info.push(`${kar.lagen.length} lagen`);
242
+ if (velden.includes("producten"))
243
+ info.push(`${kar.lagen.reduce((n, l) => n + l.producten.reduce((m, p) => m + p.aantal, 0), 0)} producten`);
244
+ if (velden.includes("gewicht"))
245
+ info.push(kar.gewicht);
246
+ if (velden.includes("chauffeur"))
247
+ info.push(kar.chauffeur);
248
+ if (velden.includes("route"))
249
+ info.push(kar.route);
250
+ const groot = scheiding === "kop";
251
+ const gekleurd = scheiding === "kleur" || groot;
252
+ const toonNummer = velden.includes("karnummer");
253
+ if (!toonNummer &&
254
+ info.length === 0 &&
255
+ !bundelTekst &&
256
+ !velden.includes("barcode") &&
257
+ !velden.includes("qrcode"))
258
+ return null;
259
+ return (_jsxs("div", { className: `flex items-center justify-between rounded px-2 py-1 ${groot ? "text-[13px] font-bold" : "font-semibold"}`, style: gekleurd ? { background: String(opt(sectie, "kleur", "#e8eef7")) } : undefined, children: [_jsxs("span", { className: "flex items-center gap-2", children: [toonNummer && _jsx("span", { children: tekst }), bundelTekst && _jsx(BundelMelding, { tekst: bundelTekst })] }), _jsxs("span", { className: "flex gap-3 text-[9px] font-normal", children: [info.map((t) => (_jsx("span", { children: t }, t))), velden.includes("barcode") && _jsxs("span", { children: ["\u25AE\u25AF\u25AE\u25AF\u25AE ", kar.karnummer] }), velden.includes("qrcode") && _jsx("span", { children: "[QR]" })] })] }));
260
+ }
261
+ function LagenView({ sectie, lagen, productSectie, fustSectie, }) {
262
+ const modus = optS(sectie, "modus", "apart");
263
+ if (modus === "geen")
264
+ return null;
265
+ const velden = lijst(sectie, "velden");
266
+ const toonProducten = modus !== "nummer" && modus !== "regel";
267
+ const bundel = modus === "gebundeld";
268
+ const groepen = groepeerIdentiekeLagen(lagen, bundel);
269
+ return (_jsx("div", { className: "space-y-2", children: groepen.map(({ laag, aantal }, index) => (_jsxs("div", { className: "space-y-1", children: [_jsx(LaagKop, { sectie: sectie, laag: laag, velden: velden, compact: modus === "regel", bundelTekst: aantal > 1 ? laagBundelTekst(aantal) : "" }), toonProducten && productSectie && (_jsx(ProductenView, { sectie: productSectie, laag: laag, toonKop: index === 0 || opt(productSectie, "kop_eenmalig", true) === false })), fustSectie && optS(fustSectie, "modus", "totaal") === "laag" && (_jsx(FustTabel, { velden: lijst(fustSectie, "velden"), fusten: laag.fusten, titel: `Fusten laag ${laag.laagnummer}` })), fustSectie && optS(fustSectie, "modus", "totaal") === "product" && (_jsx(FustTabel, { velden: lijst(fustSectie, "velden"), fusten: laag.fusten, titel: `Fusten per product · laag ${laag.laagnummer}` }))] }, laag.laagnummer))) }));
270
+ }
271
+ function LaagKop({ sectie, laag, velden, compact, bundelTekst = "", }) {
272
+ const tekst = String(opt(sectie, "koptekst", "Laag {laag}")).replace(/{laag}/g, String(laag.laagnummer));
273
+ const info = [];
274
+ if (velden.includes("belading"))
275
+ info.push(`Belading ${laag.belading}`);
276
+ if (velden.includes("potmaat"))
277
+ info.push(laag.potmaat);
278
+ if (velden.includes("producten"))
279
+ info.push(`${laag.producten.reduce((n, p) => n + p.aantal, 0)} producten`);
280
+ if (velden.includes("fusten"))
281
+ info.push(`${laag.fusten.reduce((n, f) => n + f.aantal, 0)} fusten`);
282
+ if (velden.includes("gewicht"))
283
+ info.push(laag.gewicht);
284
+ if (velden.includes("opmerking") && laag.opmerking)
285
+ info.push(laag.opmerking);
286
+ if (!velden.includes("laagnummer") && info.length === 0 && !bundelTekst)
287
+ return null;
288
+ return (_jsxs("div", { className: `flex items-center justify-between ${compact ? "" : "border-b pb-0.5"}`, children: [_jsxs("span", { className: "flex items-center gap-2 font-medium", children: [velden.includes("laagnummer") ? tekst : "", bundelTekst && _jsx(BundelMelding, { tekst: bundelTekst })] }), _jsx("span", { className: "flex gap-3 text-[9px] text-muted-foreground", children: info.map((t) => (_jsx("span", { children: t }, t))) })] }));
289
+ }
290
+ function ProductenView({ sectie, laag, toonKop = true, }) {
291
+ const velden = lijst(sectie, "velden");
292
+ const weergave = optS(sectie, "weergave", "tabel");
293
+ let producten = sorteerProducten(laag.producten, String(opt(sectie, "sortering", "eigen")));
294
+ if (opt(sectie, "groeperen", false)) {
295
+ const map = new Map();
296
+ for (const p of producten) {
297
+ const bestaand = map.get(p.artikelnummer);
298
+ if (bestaand) {
299
+ bestaand.aantal += p.aantal;
300
+ bestaand.fust_aantal += p.fust_aantal;
301
+ }
302
+ else
303
+ map.set(p.artikelnummer, { ...p });
304
+ }
305
+ producten = [...map.values()];
306
+ }
307
+ if (!velden.length)
308
+ return null;
309
+ const cel = (p, v) => {
310
+ if (v === "foto")
311
+ return "🖼";
312
+ if (v === "qrcode")
313
+ return "[QR]";
314
+ return String(p[v] ?? "");
315
+ };
316
+ const label = (v) => (v === "foto" ? "Foto" : v === "qrcode" ? "QR-code" : kolomLabel(v));
317
+ const breedtes = productVeldBreedtes(velden);
318
+ if (weergave === "tabel") {
319
+ return (_jsxs("table", { className: "w-full table-fixed border-collapse", children: [_jsx("colgroup", { children: velden.map((veld, index) => (_jsx("col", { style: { width: `${breedtes[index]}%` } }, veld))) }), toonKop && (_jsx("thead", { children: _jsx("tr", { children: velden.map((v) => (_jsx("th", { className: "break-words border-b px-1 py-0.5 text-left text-[9px] text-muted-foreground", children: label(v) }, v))) }) })), _jsx("tbody", { children: producten.map((p, i) => (_jsx("tr", { children: velden.map((v) => (_jsx("td", { className: "break-words border-b px-1 py-0.5 align-top", children: cel(p, v) }, v))) }, `${p.artikelnummer}-${i}`))) })] }));
320
+ }
321
+ return (_jsx("div", { className: weergave === "naast" ? "grid grid-cols-2 gap-1" : "space-y-0.5", children: producten.map((p, i) => (_jsx("div", { className: "flex gap-2", children: velden.map((v) => (_jsx("span", { children: cel(p, v) }, v))) }, `${p.artikelnummer}-${i}`))) }));
322
+ }
323
+ const FUST_KOLOM_LABELS = {
324
+ artikelnummer: "Artikel",
325
+ artikelnaam: "Omschrijving",
326
+ potmaat: "Potmaat",
327
+ kleur: "Kleur",
328
+ productgroep: "Productgroep",
329
+ locatie: "Locatie",
330
+ fustsoort: "Tray/fust",
331
+ planten_per_fust: "Pl./fust",
332
+ aantal: "Planten",
333
+ };
334
+ const FUST_RECHTS = new Set(["planten_per_fust", "aantal"]);
335
+ /** Verzamellijst met alle te picken fusten per fusttype, incl. producten. */
336
+ function FustVerzamellijst({ order, kop = "Te verzamelen fusten — karindeling zelf bepalen", velden, toonFusthoogte = true, toonTotaal = true, }) {
337
+ const groepen = fustVerzamellijst(order?.karren);
338
+ const kolommen = (Array.isArray(velden) && velden.length
339
+ ? velden
340
+ : Object.keys(FUST_KOLOM_LABELS)).filter((v) => FUST_KOLOM_LABELS[v]);
341
+ const totaal = groepen.reduce((n, f) => n + f.aantal, 0);
342
+ if (!groepen.length)
343
+ return _jsx("p", { className: "text-muted-foreground", children: "Geen fusten in deze order." });
344
+ return (_jsxs("div", { className: "space-y-2", children: [kop && (_jsx("div", { className: "text-[9px] font-semibold uppercase text-muted-foreground", children: kop })), groepen.map((f) => (_jsxs("div", { className: "space-y-0.5", children: [_jsxs("div", { className: "flex items-baseline justify-between border-b border-foreground/40 pb-0.5", children: [_jsxs("span", { className: "font-semibold", children: [f.fusttype, toonFusthoogte && f.hoogte ? ` · ${f.hoogte}` : "", toonFusthoogte && f.belading ? ` · ${f.belading}` : ""] }), _jsxs("span", { className: "font-semibold", children: [f.aantal, "\u00D7 fust"] })] }), kolommen.length > 0 && (_jsxs("table", { className: "w-full border-collapse", children: [_jsx("thead", { children: _jsx("tr", { className: "text-muted-foreground", children: kolommen.map((k) => (_jsx("th", { className: `px-1 py-0.5 font-medium ${FUST_RECHTS.has(k) ? "text-right" : "text-left"}`, children: FUST_KOLOM_LABELS[k] }, k))) }) }), _jsxs("tbody", { children: [f.producten.map((pr) => (_jsx("tr", { className: "border-b", children: kolommen.map((k) => (_jsx("td", { className: `px-1 py-0.5 ${FUST_RECHTS.has(k) ? "text-right" : ""}`, children: String(pr[k] ?? "") }, k))) }, pr.artikelnummer))), f.producten.length === 0 && (_jsx("tr", { children: _jsx("td", { colSpan: kolommen.length, className: "px-1 py-0.5 text-muted-foreground", children: "Geen producten bekend." }) }))] })] }))] }, f.fusttype))), toonTotaal && (_jsxs("div", { className: "flex justify-between border-t border-foreground/40 pt-0.5 font-semibold", children: [_jsx("span", { children: "Totaal fusten" }), _jsx("span", { children: totaal })] }))] }));
345
+ }
346
+ function FustTabel({ velden, fusten, titel, }) {
347
+ if (!fusten.length || !velden.length)
348
+ return null;
349
+ return (_jsxs("div", { className: "space-y-1", children: [_jsx("div", { className: "text-[9px] font-semibold uppercase text-muted-foreground", children: titel }), _jsx("table", { className: "w-full border-collapse", children: _jsx("tbody", { children: fusten.map((f, i) => (_jsx("tr", { children: velden.map((v) => (_jsx("td", { className: "border-b px-1 py-0.5", children: String(f[v] ?? "") }, v))) }, i))) }) })] }));
350
+ }
351
+ function RegelWeergave({ producten, kolommen, weergave, toonKoppen, zebra, randen, }) {
352
+ const stijl = (k) => ({
353
+ textAlign: k.uitlijning,
354
+ fontFamily: k.fontfamilie || undefined,
355
+ fontSize: k.fontgrootte ? `${k.fontgrootte}pt` : undefined,
356
+ color: k.kleur || undefined,
357
+ fontWeight: k.vet ? 700 : undefined,
358
+ background: k.achtergrond || undefined,
359
+ border: k.rand ? "1px solid currentColor" : undefined,
360
+ overflowWrap: "anywhere",
361
+ });
362
+ // Vaste kolombreedtes zodat elke laag/kar dezelfde uitlijning houdt
363
+ const breedtes = useMemo(() => {
364
+ const opgegeven = kolommen.map((k) => (Number(k.breedte) > 0 ? Number(k.breedte) : 0));
365
+ const som = opgegeven.reduce((a, b) => a + b, 0);
366
+ const leeg = opgegeven.filter((b) => b === 0).length;
367
+ const rest = Math.max(0, 100 - som);
368
+ const per = leeg ? rest / leeg : 0;
369
+ const ruw = opgegeven.map((b) => (b === 0 ? per : b));
370
+ const totaal = ruw.reduce((a, b) => a + b, 0) || 1;
371
+ return ruw.map((b) => (b / totaal) * 100);
372
+ }, [kolommen]);
373
+ if (!kolommen.length)
374
+ return null;
375
+ if (weergave === "tabel") {
376
+ return (_jsxs("table", { className: "w-full border-collapse", style: { tableLayout: "fixed" }, children: [_jsx("colgroup", { children: kolommen.map((k, i) => (_jsx("col", { style: { width: `${breedtes[i]}%` } }, k.key))) }), toonKoppen && (_jsx("thead", { children: _jsx("tr", { children: kolommen.map((k) => (_jsx("th", { className: `px-1 py-0.5 text-[9px] uppercase text-muted-foreground ${randen ? "border" : "border-b"}`, style: stijl(k), children: k.label }, k.key))) }) })), _jsx("tbody", { children: producten.map((p, i) => (_jsx("tr", { className: zebra && i % 2 === 1 ? "bg-muted/50" : "", children: kolommen.map((k) => (_jsx("td", { className: `px-1 py-0.5 ${randen ? "border" : "border-b"}`, style: stijl(k), children: String(p[k.key] ?? "") }, k.key))) }, i))) })] }));
377
+ }
378
+ return (_jsx("div", { className: weergave === "naast" ? "grid grid-cols-2 gap-1" : "space-y-0.5", children: producten.map((p, i) => (_jsx("div", { className: "flex gap-2", children: kolommen.map((k) => (_jsx("span", { style: stijl(k), children: String(p[k.key] ?? "") }, k.key))) }, i))) }));
379
+ }
380
+ function groepeer(order, groepering, sortering) {
381
+ const alle = order.karren.flatMap((k) => k.lagen.flatMap((l) => l.producten.map((p) => ({ p, kar: k, laag: l }))));
382
+ const maak = (titel, items) => ({
383
+ titel,
384
+ producten: sorteerProducten(items, sortering),
385
+ });
386
+ if (groepering === "kar")
387
+ return order.karren.map((k) => maak(`Kar ${k.karnummer}`, k.lagen.flatMap((l) => l.producten)));
388
+ if (groepering === "laag") {
389
+ const map = new Map();
390
+ for (const r of alle) {
391
+ const t = `Kar ${r.kar.karnummer} · laag ${r.laag.laagnummer}`;
392
+ map.set(t, [...(map.get(t) ?? []), r.p]);
393
+ }
394
+ return [...map.entries()].map(([t, items]) => maak(t, items));
395
+ }
396
+ if (groepering === "productgroep") {
397
+ const map = new Map();
398
+ for (const r of alle)
399
+ map.set(r.p.productgroep, [...(map.get(r.p.productgroep) ?? []), r.p]);
400
+ return [...map.entries()].map(([t, items]) => maak(t, items));
401
+ }
402
+ if (groepering === "afleveradres")
403
+ return [maak(order.afleveradres.naam, alle.map((r) => r.p))];
404
+ if (groepering === "klant")
405
+ return [maak(order.klant.naam, alle.map((r) => r.p))];
406
+ return [maak("—", alle.map((r) => r.p))];
407
+ }
408
+ /** Toont het gekozen bibliotheek-logo, of een placeholder wanneer er geen is. */
409
+ function LogoSectie({ sectie }) {
410
+ const { logos } = useLogos();
411
+ const logoId = typeof sectie.opties?.logoId === "string" ? sectie.opties.logoId : null;
412
+ const logo = Array.isArray(logos) ? logos.find((l) => l.id === logoId) : undefined;
413
+ const hoogte = `${opt(sectie, "hoogte", 18)}mm`;
414
+ return (_jsx("div", { className: "flex", style: { justifyContent: alignToFlex(optS(sectie, "uitlijning", "left")) }, children: logo?.viewUrl ? (_jsx("img", { src: logo.viewUrl, alt: logo.naam, style: { height: hoogte }, className: "object-contain" })) : (_jsx("div", { className: "flex items-center justify-center rounded border border-dashed px-6 text-muted-foreground", style: { height: hoogte }, children: "LOGO" })) }));
415
+ }
416
+ /** Documentlogo bovenaan het document, gekoppeld aan de Logo Bibliotheek. */
417
+ function DocumentLogo({ logoId, hoogte, uitlijning, }) {
418
+ const { logos } = useLogos();
419
+ const logo = Array.isArray(logos) ? logos.find((l) => l.id === logoId) : undefined;
420
+ if (!logo?.viewUrl)
421
+ return null;
422
+ return (_jsx("div", { className: "mb-2 flex", style: { justifyContent: alignToFlex(uitlijning) }, children: _jsx("img", { src: logo.viewUrl, alt: logo.naam, style: { height: `${hoogte}mm` }, className: "object-contain" }) }));
423
+ }
@@ -0,0 +1,18 @@
1
+ import { type PakbonConfig, type PakbonSectie } from "../lib/pakbonBuilder";
2
+ /** Beheer van de secties waaruit de pakbon is opgebouwd. */
3
+ export declare function PakbonSectiesPanel({ config, onChange, }: {
4
+ config: PakbonConfig;
5
+ onChange: (c: PakbonConfig) => void;
6
+ }): import("react").JSX.Element;
7
+ /** Volledige instellingen van één blok — herbruikt in de blokontwerper. */
8
+ export declare function PakbonSectieEditor({ sectie, onChange, methode, }: {
9
+ sectie: PakbonSectie;
10
+ onChange: (patch: Partial<PakbonSectie>) => void;
11
+ methode?: "kar" | "fusten";
12
+ }): import("react").JSX.Element;
13
+ /** Kaderinstellingen (breedte, uitlijning, marges, opmaak) van één blok. */
14
+ export declare function PakbonBlokKaderEditor({ sectie, onChange, }: {
15
+ sectie: PakbonSectie;
16
+ onChange: (patch: Partial<PakbonSectie>) => void;
17
+ }): import("react").JSX.Element;
18
+ //# sourceMappingURL=PakbonSectiesPanel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PakbonSectiesPanel.d.ts","sourceRoot":"","sources":["../../src/components/PakbonSectiesPanel.tsx"],"names":[],"mappings":"AAmBA,OAAO,EASL,KAAK,YAAY,EAEjB,KAAK,YAAY,EAElB,MAAM,sBAAsB,CAAC;AAE9B,4DAA4D;AAC5D,wBAAgB,kBAAkB,CAAC,EACjC,MAAM,EACN,QAAQ,GACT,EAAE;IACD,MAAM,EAAE,YAAY,CAAC;IACrB,QAAQ,EAAE,CAAC,CAAC,EAAE,YAAY,KAAK,IAAI,CAAC;CACrC,+BA6KA;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,KAAK,GAAG,QAAQ,CAAC;CAC5B,+BAiGA;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"}