@flowselections/scan-module 1.0.59 → 1.0.60

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.
@@ -1 +1 @@
1
- {"version":3,"file":"ScanModulePage.d.ts","sourceRoot":"","sources":["../../src/components/ScanModulePage.tsx"],"names":[],"mappings":"AAydA,wBAAgB,cAAc,CAAC,EAAE,SAAS,EAAE,GAAE;IAAE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAO,+BA2H/E"}
1
+ {"version":3,"file":"ScanModulePage.d.ts","sourceRoot":"","sources":["../../src/components/ScanModulePage.tsx"],"names":[],"mappings":"AA+cA,wBAAgB,cAAc,CAAC,EAAE,SAAS,EAAE,GAAE;IAAE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAO,+BA2H/E"}
@@ -8,7 +8,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
8
8
  // ============================================================================
9
9
  import { useCallback, useEffect, useMemo, useRef, useState } from "react";
10
10
  import { useRouter } from "@tanstack/react-router";
11
- import { useShellModules, moduleKey } from "@flowselections/core";
11
+ import { moduleKey } from "@flowselections/core";
12
12
  import { Button, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, Input, Label, PageContainer, cn, formatTijd, meldFout, meldSucces, } from "@flowselections/core";
13
13
  import { AlertTriangle, Check, Copy, ExternalLink, FileText, KeyRound, Loader2, MoreHorizontal, Pencil, Printer, Search } from "lucide-react";
14
14
  import { supabase } from "../integrations/supabase/client.js";
@@ -37,21 +37,13 @@ const PRINT_RIJEN = {
37
37
  { naam: "Afleverbrief", soort: "afleverbrief" },
38
38
  { naam: "Controlelijst", soort: "controlelijst" },
39
39
  { naam: "Pakbon (opnieuw)", soort: "pakbon" },
40
- { naam: "Veilingbrief", soort: "veilingbrief", alleenFloriday: true },
40
+ { naam: "Veilingbrief", soort: "veilingbrief", alleenAlsLayoutMaker: true },
41
41
  ],
42
42
  kar: [
43
43
  { naam: "Verzendbrief", soort: "afleverbrief" },
44
44
  { naam: "Restpakbon", soort: "pakbon" },
45
45
  ],
46
46
  };
47
- /** Gebruikt deze shell Floriday? Uit de modulelijst van core; zonder lijst: nee. */
48
- function useShellGebruiktFloriday() {
49
- const shell = useShellModules();
50
- return useMemo(() => {
51
- const lijst = Array.isArray(shell?.modules) ? shell.modules : [];
52
- return lijst.some((m) => /floriday/i.test(`${m?.id ?? ""} ${safeKey(m)}`));
53
- }, [shell]);
54
- }
55
47
  function safeKey(m) {
56
48
  return m && typeof m === "object" ? moduleKey(m) : "";
57
49
  }
@@ -234,7 +226,6 @@ function ScannerDetail({ scanner, basis, pincode, onNaamOpslaan, onPincode, onSl
234
226
  const [naamBewerken, setNaamBewerken] = useState(false);
235
227
  useEffect(() => { setNaamBewerken(false); }, [scanner.id]);
236
228
  const pad = usePrintplekkenPad();
237
- const metFloriday = useShellGebruiktFloriday();
238
229
  const print = usePrintStand(scanner);
239
230
  const [gekopieerd, setGekopieerd] = useState(false);
240
231
  const routePad = useScannerRoutePad();
@@ -253,7 +244,7 @@ function ScannerDetail({ scanner, basis, pincode, onNaamOpslaan, onPincode, onSl
253
244
  meldFout("Kopiëren lukt niet. Selecteer de link en kopieer hem zelf.", error);
254
245
  }
255
246
  };
256
- return (_jsxs("div", { children: [_jsxs("header", { className: "flex items-center gap-3 border-b border-border p-4", children: [_jsx("span", { className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-md bg-muted text-primary", children: _jsx(Icoon, { className: "h-5 w-5", "aria-hidden": true }) }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx(BewerkbareNaam, { naam: scanner.naam, bewerken: naamBewerken, onKlaar: () => setNaamBewerken(false), onOpslaan: onNaamOpslaan }), _jsx("span", { className: "text-xs text-muted-foreground", children: scannerSoortLabel(scanner.type) })] }), _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(Button, { variant: "ghost", size: "icon", "aria-label": `Meer voor ${scanner.naam}`, children: _jsx(MoreHorizontal, { className: "h-4 w-4" }) }) }), _jsxs(DropdownMenuContent, { align: "end", children: [_jsxs(DropdownMenuItem, { onSelect: () => window.setTimeout(() => setNaamBewerken(true), 0), children: [_jsx(Pencil, { className: "mr-2 h-4 w-4" }), " Naam wijzigen"] }), _jsxs(DropdownMenuItem, { onSelect: onPincode, children: [_jsx(Pencil, { className: "mr-2 h-4 w-4" }), " Pincode wijzigen"] })] })] })] }), _jsxs("div", { className: "space-y-4 p-4", children: [_jsxs("section", { className: "space-y-2", children: [_jsx("h3", { className: "font-semibold text-card-foreground", children: "Openen" }), basis.staat === "laden" ? (_jsx("p", { className: "text-sm text-muted-foreground", children: "Link wordt opgehaald\u2026" })) : url ? (_jsxs("div", { className: "grid gap-4 sm:grid-cols-[auto_minmax(0,1fr)] sm:items-center", children: [_jsx(KoppelQr, { link: url, alt: `QR-code om ${scanner.naam} op een telefoon te openen` }), _jsxs("div", { className: "min-w-0 space-y-2", children: [_jsx("p", { className: "text-sm text-muted-foreground", children: "Scan de QR-code met de telefoon, of open of kopieer de link." }), _jsxs("div", { className: "relative", children: [_jsx(Input, { readOnly: true, value: url, onFocus: (e) => e.currentTarget.select(), "aria-label": "Scannerlink", className: "pr-11 text-sm" }), _jsx(Button, { type: "button", variant: "ghost", size: "icon", onClick: () => void kopieer(), "aria-label": gekopieerd ? "Link gekopieerd" : "Link kopiëren", title: gekopieerd ? "Gekopieerd" : "Link kopiëren", className: "absolute right-0.5 top-1/2 h-8 w-8 -translate-y-1/2", children: gekopieerd ? _jsx(Check, { className: "h-4 w-4" }) : _jsx(Copy, { className: "h-4 w-4" }) })] }), _jsx(Button, { asChild: true, className: "w-full", children: _jsxs("a", { href: url, target: "_blank", rel: "noreferrer", children: [_jsx(ExternalLink, { className: "mr-2 h-4 w-4" }), "Scanner openen"] }) })] })] })) : (_jsx("p", { className: "text-sm text-destructive", children: "De link kan nu niet worden gemaakt. Probeer het later opnieuw; blijft het misgaan, neem contact op met de beheerder." }))] }), _jsxs("section", { className: "space-y-3 border-t border-border pt-4", children: [_jsx("h3", { className: "font-semibold text-card-foreground", children: "Printen" }), _jsxs("div", { className: "flex flex-wrap items-start gap-3 text-sm", children: [_jsx(Printer, { className: "mt-0.5 h-4 w-4 shrink-0 text-muted-foreground", "aria-hidden": true }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("p", { className: "text-xs text-muted-foreground", children: "Printen via" }), print.laden ? (_jsx("p", { className: "text-muted-foreground", children: "Laden\u2026" })) : print.fout ? (_jsx("p", { className: "text-warning", children: "De printplek kan nu niet worden gelezen. Probeer het later opnieuw." })) : print.plek ? (_jsxs(_Fragment, { children: [_jsx("p", { className: "font-semibold text-card-foreground break-words", children: print.plek }), print.klaar === true ? (_jsxs("p", { className: "inline-flex items-center gap-1 text-primary", children: [_jsx(Check, { className: "h-3.5 w-3.5", "aria-hidden": true }), "Klaar om te printen"] })) : print.klaar === false ? (_jsxs("p", { className: "inline-flex items-start gap-1 text-warning", children: [_jsx(AlertTriangle, { className: "mt-0.5 h-3.5 w-3.5 shrink-0", "aria-hidden": true }), print.reden] })) : null, print.melding ? _jsx("p", { className: "text-xs text-muted-foreground", children: print.melding }) : null] })) : (_jsxs("p", { className: "inline-flex items-center gap-1 text-warning", children: [_jsx(AlertTriangle, { className: "h-3.5 w-3.5", "aria-hidden": true }), eind ? "Nog geen controleplek gekozen" : "Nog geen printplek gekozen"] }))] }), pad ? (_jsx("a", { href: print.plekId ? `${pad}?plek=${encodeURIComponent(print.plekId)}` : pad, className: "shrink-0 font-semibold text-primary underline-offset-2 hover:underline", children: "Wijzigen" })) : (_jsx("span", { className: "w-full text-muted-foreground sm:w-auto", children: "Wijzig dit in Printen \u203A Printplekken" }))] }), _jsxs("div", { className: "space-y-2", children: [_jsx("p", { className: "text-sm font-semibold text-card-foreground", children: "Deze documenten worden hier geprint" }), _jsx("ul", { className: "overflow-hidden rounded-lg border border-border", children: PRINT_RIJEN[eind ? "eind" : "kar"].filter((rij) => !rij.alleenFloriday || metFloriday).map((rij, i) => {
247
+ return (_jsxs("div", { children: [_jsxs("header", { className: "flex items-center gap-3 border-b border-border p-4", children: [_jsx("span", { className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-md bg-muted text-primary", children: _jsx(Icoon, { className: "h-5 w-5", "aria-hidden": true }) }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx(BewerkbareNaam, { naam: scanner.naam, bewerken: naamBewerken, onKlaar: () => setNaamBewerken(false), onOpslaan: onNaamOpslaan }), _jsx("span", { className: "text-xs text-muted-foreground", children: scannerSoortLabel(scanner.type) })] }), _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(Button, { variant: "ghost", size: "icon", "aria-label": `Meer voor ${scanner.naam}`, children: _jsx(MoreHorizontal, { className: "h-4 w-4" }) }) }), _jsxs(DropdownMenuContent, { align: "end", children: [_jsxs(DropdownMenuItem, { onSelect: () => window.setTimeout(() => setNaamBewerken(true), 0), children: [_jsx(Pencil, { className: "mr-2 h-4 w-4" }), " Naam wijzigen"] }), _jsxs(DropdownMenuItem, { onSelect: onPincode, children: [_jsx(Pencil, { className: "mr-2 h-4 w-4" }), " Pincode wijzigen"] })] })] })] }), _jsxs("div", { className: "space-y-4 p-4", children: [_jsxs("section", { className: "space-y-2", children: [_jsx("h3", { className: "font-semibold text-card-foreground", children: "Openen" }), basis.staat === "laden" ? (_jsx("p", { className: "text-sm text-muted-foreground", children: "Link wordt opgehaald\u2026" })) : url ? (_jsxs("div", { className: "grid gap-4 sm:grid-cols-[auto_minmax(0,1fr)] sm:items-center", children: [_jsx(KoppelQr, { link: url, alt: `QR-code om ${scanner.naam} op een telefoon te openen` }), _jsxs("div", { className: "min-w-0 space-y-2", children: [_jsx("p", { className: "text-sm text-muted-foreground", children: "Scan de QR-code met de telefoon, of open of kopieer de link." }), _jsxs("div", { className: "relative", children: [_jsx(Input, { readOnly: true, value: url, onFocus: (e) => e.currentTarget.select(), "aria-label": "Scannerlink", className: "pr-11 text-sm" }), _jsx(Button, { type: "button", variant: "ghost", size: "icon", onClick: () => void kopieer(), "aria-label": gekopieerd ? "Link gekopieerd" : "Link kopiëren", title: gekopieerd ? "Gekopieerd" : "Link kopiëren", className: "absolute right-0.5 top-1/2 h-8 w-8 -translate-y-1/2", children: gekopieerd ? _jsx(Check, { className: "h-4 w-4" }) : _jsx(Copy, { className: "h-4 w-4" }) })] }), _jsx(Button, { asChild: true, className: "w-full", children: _jsxs("a", { href: url, target: "_blank", rel: "noreferrer", children: [_jsx(ExternalLink, { className: "mr-2 h-4 w-4" }), "Scanner openen"] }) })] })] })) : (_jsx("p", { className: "text-sm text-destructive", children: "De link kan nu niet worden gemaakt. Probeer het later opnieuw; blijft het misgaan, neem contact op met de beheerder." }))] }), _jsxs("section", { className: "space-y-3 border-t border-border pt-4", children: [_jsx("h3", { className: "font-semibold text-card-foreground", children: "Printen" }), _jsxs("div", { className: "flex flex-wrap items-start gap-3 text-sm", children: [_jsx(Printer, { className: "mt-0.5 h-4 w-4 shrink-0 text-muted-foreground", "aria-hidden": true }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("p", { className: "text-xs text-muted-foreground", children: "Printen via" }), print.laden ? (_jsx("p", { className: "text-muted-foreground", children: "Laden\u2026" })) : print.fout ? (_jsx("p", { className: "text-warning", children: "De printplek kan nu niet worden gelezen. Probeer het later opnieuw." })) : print.plek ? (_jsxs(_Fragment, { children: [_jsx("p", { className: "font-semibold text-card-foreground break-words", children: print.plek }), print.klaar === true ? (_jsxs("p", { className: "inline-flex items-center gap-1 text-primary", children: [_jsx(Check, { className: "h-3.5 w-3.5", "aria-hidden": true }), "Klaar om te printen"] })) : print.klaar === false ? (_jsxs("p", { className: "inline-flex items-start gap-1 text-warning", children: [_jsx(AlertTriangle, { className: "mt-0.5 h-3.5 w-3.5 shrink-0", "aria-hidden": true }), print.reden] })) : null, print.melding ? _jsx("p", { className: "text-xs text-muted-foreground", children: print.melding }) : null] })) : (_jsxs("p", { className: "inline-flex items-center gap-1 text-warning", children: [_jsx(AlertTriangle, { className: "h-3.5 w-3.5", "aria-hidden": true }), eind ? "Nog geen controleplek gekozen" : "Nog geen printplek gekozen"] }))] }), pad ? (_jsx("a", { href: print.plekId ? `${pad}?plek=${encodeURIComponent(print.plekId)}` : pad, className: "shrink-0 font-semibold text-primary underline-offset-2 hover:underline", children: "Wijzigen" })) : (_jsx("span", { className: "w-full text-muted-foreground sm:w-auto", children: "Wijzig dit in Printen \u203A Printplekken" }))] }), _jsxs("div", { className: "space-y-2", children: [_jsx("p", { className: "text-sm font-semibold text-card-foreground", children: "Deze documenten worden hier geprint" }), _jsx("ul", { className: "overflow-hidden rounded-lg border border-border", children: PRINT_RIJEN[eind ? "eind" : "kar"].filter((rij) => !rij.alleenAlsLayoutMaker || (Array.isArray(print.docs) && print.docs.some((d) => d.soort === rij.soort))).map((rij, i) => {
257
248
  const doc = print.docs?.find((d) => d.soort === rij.soort) ?? null;
258
249
  const extra = doc ? [doc.versie, doc.formaat].filter(Boolean).join(" · ") : "";
259
250
  return (_jsxs("li", { className: cn("flex items-start gap-3 px-3 py-2 text-sm", i > 0 && "border-t border-border"), children: [_jsx(FileText, { className: "mt-0.5 h-4 w-4 shrink-0 text-muted-foreground", "aria-hidden": true }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsxs("p", { className: "break-words", children: [_jsx("span", { className: "text-card-foreground", children: rij.naam }), extra ? _jsxs("span", { className: "text-muted-foreground", children: [" \u00B7 ", extra] }) : null] }), doc && doc.kanPrinten === false ? (_jsxs("p", { className: "inline-flex items-start gap-1 text-warning", children: [_jsx(AlertTriangle, { className: "mt-0.5 h-3.5 w-3.5 shrink-0", "aria-hidden": true }), doc.reden ?? "Dit document kan hier nu niet printen."] })) : null] })] }, rij.naam));
@@ -17268,7 +17268,7 @@ export type Database = {
17268
17268
  };
17269
17269
  Relationships: [];
17270
17270
  };
17271
- logistics_logboek_2026w47: {
17271
+ logistics_logboek_2026w48: {
17272
17272
  Row: {
17273
17273
  actor: string | null;
17274
17274
  attempts: number | null;
@@ -17388,7 +17388,7 @@ export type Database = {
17388
17388
  };
17389
17389
  Relationships: [];
17390
17390
  };
17391
- logistics_logboek_2026w48: {
17391
+ logistics_logboek_2026w49: {
17392
17392
  Row: {
17393
17393
  actor: string | null;
17394
17394
  attempts: number | null;
@@ -17508,7 +17508,7 @@ export type Database = {
17508
17508
  };
17509
17509
  Relationships: [];
17510
17510
  };
17511
- logistics_logboek_2026w49: {
17511
+ logistics_logboek_2026w50: {
17512
17512
  Row: {
17513
17513
  actor: string | null;
17514
17514
  attempts: number | null;
@@ -17628,7 +17628,7 @@ export type Database = {
17628
17628
  };
17629
17629
  Relationships: [];
17630
17630
  };
17631
- logistics_logboek_2026w50: {
17631
+ logistics_logboek_2026w51: {
17632
17632
  Row: {
17633
17633
  actor: string | null;
17634
17634
  attempts: number | null;
@@ -17748,7 +17748,7 @@ export type Database = {
17748
17748
  };
17749
17749
  Relationships: [];
17750
17750
  };
17751
- logistics_logboek_2026w51: {
17751
+ logistics_logboek_2026w52: {
17752
17752
  Row: {
17753
17753
  actor: string | null;
17754
17754
  attempts: number | null;
@@ -17868,7 +17868,7 @@ export type Database = {
17868
17868
  };
17869
17869
  Relationships: [];
17870
17870
  };
17871
- logistics_logboek_2026w52: {
17871
+ logistics_logboek_2026w53: {
17872
17872
  Row: {
17873
17873
  actor: string | null;
17874
17874
  attempts: number | null;
@@ -17988,7 +17988,7 @@ export type Database = {
17988
17988
  };
17989
17989
  Relationships: [];
17990
17990
  };
17991
- logistics_logboek_2026w53: {
17991
+ logistics_logboek_2027w01: {
17992
17992
  Row: {
17993
17993
  actor: string | null;
17994
17994
  attempts: number | null;
@@ -18108,7 +18108,7 @@ export type Database = {
18108
18108
  };
18109
18109
  Relationships: [];
18110
18110
  };
18111
- logistics_logboek_2027w01: {
18111
+ logistics_logboek_2027w02: {
18112
18112
  Row: {
18113
18113
  actor: string | null;
18114
18114
  attempts: number | null;
@@ -18228,7 +18228,7 @@ export type Database = {
18228
18228
  };
18229
18229
  Relationships: [];
18230
18230
  };
18231
- logistics_logboek_2027w02: {
18231
+ logistics_logboek_2027w03: {
18232
18232
  Row: {
18233
18233
  actor: string | null;
18234
18234
  attempts: number | null;
@@ -18348,7 +18348,7 @@ export type Database = {
18348
18348
  };
18349
18349
  Relationships: [];
18350
18350
  };
18351
- logistics_logboek_2027w03: {
18351
+ logistics_logboek_2027w04: {
18352
18352
  Row: {
18353
18353
  actor: string | null;
18354
18354
  attempts: number | null;
@@ -18468,7 +18468,7 @@ export type Database = {
18468
18468
  };
18469
18469
  Relationships: [];
18470
18470
  };
18471
- logistics_logboek_2027w04: {
18471
+ logistics_logboek_2027w05: {
18472
18472
  Row: {
18473
18473
  actor: string | null;
18474
18474
  attempts: number | null;
@@ -18588,7 +18588,7 @@ export type Database = {
18588
18588
  };
18589
18589
  Relationships: [];
18590
18590
  };
18591
- logistics_logboek_2027w05: {
18591
+ logistics_logboek_2027w06: {
18592
18592
  Row: {
18593
18593
  actor: string | null;
18594
18594
  attempts: number | null;
@@ -18708,7 +18708,7 @@ export type Database = {
18708
18708
  };
18709
18709
  Relationships: [];
18710
18710
  };
18711
- logistics_logboek_2027w06: {
18711
+ logistics_logboek_2027w07: {
18712
18712
  Row: {
18713
18713
  actor: string | null;
18714
18714
  attempts: number | null;
@@ -18828,7 +18828,7 @@ export type Database = {
18828
18828
  };
18829
18829
  Relationships: [];
18830
18830
  };
18831
- logistics_logboek_2027w07: {
18831
+ logistics_logboek_2027w08: {
18832
18832
  Row: {
18833
18833
  actor: string | null;
18834
18834
  attempts: number | null;
@@ -18948,7 +18948,7 @@ export type Database = {
18948
18948
  };
18949
18949
  Relationships: [];
18950
18950
  };
18951
- logistics_logboek_2027w08: {
18951
+ logistics_logboek_2027w09: {
18952
18952
  Row: {
18953
18953
  actor: string | null;
18954
18954
  attempts: number | null;
@@ -41294,6 +41294,10 @@ export type Database = {
41294
41294
  };
41295
41295
  Returns: Json;
41296
41296
  };
41297
+ _print_floriday_actief: {
41298
+ Args: never;
41299
+ Returns: boolean;
41300
+ };
41297
41301
  _print_herdruk_kern: {
41298
41302
  Args: {
41299
41303
  p_bron: string;
@@ -41395,6 +41399,12 @@ export type Database = {
41395
41399
  };
41396
41400
  Returns: Json;
41397
41401
  };
41402
+ _print_plek_veilingbrief: {
41403
+ Args: {
41404
+ p_plek: string;
41405
+ };
41406
+ Returns: Json;
41407
+ };
41398
41408
  _print_plek_vervang_printer: {
41399
41409
  Args: {
41400
41410
  p_nieuw: string;
@@ -47024,6 +47034,23 @@ export type Database = {
47024
47034
  Args: never;
47025
47035
  Returns: string;
47026
47036
  };
47037
+ logistics_belading_vertrouwd_aanmelden: {
47038
+ Args: {
47039
+ p_budget_ms?: number;
47040
+ p_portie?: number;
47041
+ };
47042
+ Returns: Json;
47043
+ };
47044
+ logistics_belading_vertrouwd_kandidaten: {
47045
+ Args: {
47046
+ p_max?: number;
47047
+ };
47048
+ Returns: {
47049
+ order_id: string;
47050
+ order_number: string;
47051
+ reden: string;
47052
+ }[];
47053
+ };
47027
47054
  logistics_belading_waarschuwingen_zet: {
47028
47055
  Args: {
47029
47056
  p_items: Json;
@@ -56459,6 +56486,12 @@ export type Database = {
56459
56486
  };
56460
56487
  Returns: Json;
56461
56488
  };
56489
+ print_plek_veilingbrief_v1: {
56490
+ Args: {
56491
+ p_plek: string;
56492
+ };
56493
+ Returns: Json;
56494
+ };
56462
56495
  print_plek_verwijderen_v1: {
56463
56496
  Args: {
56464
56497
  p_plek: string;