@flowselections/pick-schermen-kwekers 1.0.41 → 1.0.46

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 (56) hide show
  1. package/dist-lib/components/PickstationsPage.js +1 -1
  2. package/dist-lib/components/pick/PickScherm.d.ts.map +1 -1
  3. package/dist-lib/components/pick/PickScherm.js +194 -37
  4. package/dist-lib/components/pick/QueueTable.d.ts +10 -1
  5. package/dist-lib/components/pick/QueueTable.d.ts.map +1 -1
  6. package/dist-lib/components/pick/QueueTable.js +57 -16
  7. package/dist-lib/components/pick/ReferentiedataBanner.js +1 -1
  8. package/dist-lib/index.d.ts +1 -0
  9. package/dist-lib/index.d.ts.map +1 -1
  10. package/dist-lib/index.js +1 -0
  11. package/dist-lib/integrations/supabase/previewAuthStorage.d.ts.map +1 -1
  12. package/dist-lib/integrations/supabase/previewAuthStorage.js +22 -4
  13. package/dist-lib/integrations/supabase/types.d.ts +725 -0
  14. package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
  15. package/dist-lib/lib/__tests__/pick142.test.d.ts +2 -0
  16. package/dist-lib/lib/__tests__/pick142.test.d.ts.map +1 -0
  17. package/dist-lib/lib/__tests__/pick142.test.js +80 -0
  18. package/dist-lib/lib/__tests__/pick143.test.d.ts +2 -0
  19. package/dist-lib/lib/__tests__/pick143.test.d.ts.map +1 -0
  20. package/dist-lib/lib/__tests__/pick143.test.js +61 -0
  21. package/dist-lib/lib/__tests__/pick144.test.d.ts +2 -0
  22. package/dist-lib/lib/__tests__/pick144.test.d.ts.map +1 -0
  23. package/dist-lib/lib/__tests__/pick144.test.js +23 -0
  24. package/dist-lib/lib/__tests__/pick145.test.d.ts +2 -0
  25. package/dist-lib/lib/__tests__/pick145.test.d.ts.map +1 -0
  26. package/dist-lib/lib/__tests__/pick145.test.js +35 -0
  27. package/dist-lib/lib/pick142.d.ts +58 -0
  28. package/dist-lib/lib/pick142.d.ts.map +1 -0
  29. package/dist-lib/lib/pick142.js +235 -0
  30. package/dist-lib/lib/pick143.d.ts +31 -0
  31. package/dist-lib/lib/pick143.d.ts.map +1 -0
  32. package/dist-lib/lib/pick143.js +93 -0
  33. package/dist-lib/lib/pick144.d.ts +17 -0
  34. package/dist-lib/lib/pick144.d.ts.map +1 -0
  35. package/dist-lib/lib/pick144.js +53 -0
  36. package/dist-lib/lib/pick145.d.ts +23 -0
  37. package/dist-lib/lib/pick145.d.ts.map +1 -0
  38. package/dist-lib/lib/pick145.js +88 -0
  39. package/dist-lib/lib/pickApi.d.ts +17 -0
  40. package/dist-lib/lib/pickApi.d.ts.map +1 -1
  41. package/dist-lib/lib/pickApi.js +37 -6
  42. package/dist-lib/lib/pickCartResults.d.ts +1 -1
  43. package/dist-lib/lib/pickCartResults.d.ts.map +1 -1
  44. package/dist-lib/lib/pickCartResults.js +2 -2
  45. package/dist-lib/lib/pickI18n.js +6 -6
  46. package/dist-lib/lib/pickPrintJobText.js +2 -2
  47. package/dist-lib/lib/pickRowState.d.ts +1 -1
  48. package/dist-lib/lib/pickRowState.d.ts.map +1 -1
  49. package/dist-lib/lib/pickRowState.js +6 -2
  50. package/dist-lib/lib/pickTypes.d.ts +31 -1
  51. package/dist-lib/lib/pickTypes.d.ts.map +1 -1
  52. package/dist-lib/lib/pickTypes.js +42 -8
  53. package/dist-lib/lib/pickUiText.d.ts.map +1 -1
  54. package/dist-lib/lib/pickUiText.js +10 -0
  55. package/dist-lib/lib/shippingNoteStatus.js +2 -2
  56. package/package.json +1 -1
@@ -1,8 +1,12 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { MARK_PRINTED_CONFIRM, departureOf } from "../../lib/pick144";
3
+ import { crateLabelOf, departureLabel } from "../../lib/pick145";
2
4
  import { Badge, Button, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from "@flowselections/core";
3
5
  import { AlertTriangle, Check, Eye, Loader2, Lock, Printer, RefreshCw, RotateCcw } from "lucide-react";
4
- import { bufferOrdersOf, cartColumnInfo, comparePickQueue, dedupeByUnit, displayCartCount, displayPageCount, sinceLabel, unitTitleOf } from "../../lib/pickTypes";
6
+ import { cartColumnInfo, comparePickQueue, dedupeByUnit, displayCartCount, displayPageCount, sinceLabel, unitTitleOf } from "../../lib/pickTypes";
5
7
  import { duplicateNameTag } from "../../lib/pickRowState";
8
+ import { CART_PLAN_MISMATCH_MESSAGE, orderNumbersLabel } from "../../lib/pick142";
9
+ import { isRowPrintable, rowWaitMessage, rowWaitOf } from "../../lib/pick143";
6
10
  import { getPickTranslator } from "../../lib/pickI18n";
7
11
  import { parseSentElsewhere } from "../../lib/pickApi";
8
12
  import { sentElsewhereMessage } from "../../lib/pickCartResults";
@@ -30,6 +34,30 @@ function printedSlipCount(item) {
30
34
  return printed;
31
35
  return displayCartCount(item.cart_count) ?? 1;
32
36
  }
37
+ /** Kar die nu niet geprint mag worden: karindeling klopt niet, of deelkar wacht. */
38
+ function blockedMessage(r, timeZone, item) {
39
+ if (r?.mismatch)
40
+ return CART_PLAN_MISMATCH_MESSAGE;
41
+ if (r?.notStarted)
42
+ return r.notStarted;
43
+ const wait = item ? rowWaitOf(item.payload) : null;
44
+ if (wait && !wait.printable)
45
+ return rowWaitMessage(wait, timeZone);
46
+ if (r?.notPrintable || r?.waitUntil)
47
+ return rowWaitMessage({ printable: false, until: r.waitUntil ?? null, reason: null }, timeZone);
48
+ return null;
49
+ }
50
+ /** Vier stappen per kar; alleen wat echt bekend is, wordt als gedaan getoond. */
51
+ function CartSteps({ printed, waiting }) {
52
+ const steps = [
53
+ { label: "Printen", done: printed },
54
+ { label: "Bij printer", done: printed && !waiting },
55
+ { label: "Gescand", done: false },
56
+ { label: "Gemeld bij Floriday", done: false },
57
+ ];
58
+ return (_jsx("ol", { className: "mt-3 flex flex-wrap items-center gap-1 text-xs", children: steps.map((step, i) => (_jsxs("li", { className: "flex items-center gap-1", children: [_jsx("span", { className: "rounded-full px-2 py-0.5 font-medium " +
59
+ (step.done ? "bg-primary text-primary-foreground" : "bg-muted text-muted-foreground"), children: step.label }), i < steps.length - 1 && _jsx("span", { className: "text-muted-foreground", children: "\u2192" })] }, step.label))) }));
60
+ }
33
61
  function priorityTone(priority, urgent) {
34
62
  if (urgent)
35
63
  return "bg-destructive text-destructive-foreground";
@@ -39,7 +67,7 @@ function priorityTone(priority, urgent) {
39
67
  return "bg-secondary text-secondary-foreground";
40
68
  return "bg-muted text-muted-foreground";
41
69
  }
42
- export function QueueTable({ items, lockedIds, statuses, documentTypes, busyId, readinessById, waitingIds, onPick, onReprint, onPrintAll, onSelectPrinted, onMarkPrinted, onPreview, readOnly, t: translator, }) {
70
+ export function QueueTable({ items, lockedIds, statuses, documentTypes, busyId, readinessById, waitingIds, onPick, onReprint, onPrintAll, onSelectPrinted, onMarkPrinted, onPreview, readOnly, t: translator, siteTimeZone = null, pickDay = null, }) {
43
71
  const t = translator ?? getPickTranslator("nl");
44
72
  // Volgorde identiek aan de keuze van "volgende uitprinten" (zie
45
73
  // comparePickQueue): niet-geprinte regels bovenaan, en bij gelijke stand op
@@ -50,7 +78,7 @@ export function QueueTable({ items, lockedIds, statuses, documentTypes, busyId,
50
78
  .slice()
51
79
  .sort(comparePickQueue);
52
80
  const docById = new Map((Array.isArray(documentTypes) ? documentTypes : []).map((d) => [d.id, d]));
53
- return (_jsxs(_Fragment, { children: [_jsx("div", { className: "hidden overflow-x-auto rounded-lg border md:block", children: _jsxs(Table, { children: [_jsx(TableHeader, { children: _jsxs(TableRow, { children: [_jsx(TableHead, { children: t("document") }), _jsx(TableHead, { children: t("order") }), _jsx(TableHead, { children: t("customer") }), _jsx(TableHead, { className: "text-right", children: t("lines") }), _jsx(TableHead, { className: "text-right", children: "Karren" }), _jsx(TableHead, { className: "text-right", children: "Pakbonnen" }), _jsx(TableHead, { className: "text-right", children: t("page") }), _jsx(TableHead, { children: t("status") }), _jsx(TableHead, { children: t("priority") }), _jsx(TableHead, { children: t("announced") }), _jsx(TableHead, { children: t("waiting") }), _jsx(TableHead, { className: "text-right", children: t("action") })] }) }), _jsxs(TableBody, { children: [safeItems.map((item) => {
81
+ return (_jsxs(_Fragment, { children: [_jsx("div", { className: "hidden overflow-x-auto rounded-lg border min-[1100px]:block", children: _jsxs(Table, { children: [_jsx(TableHeader, { children: _jsxs(TableRow, { children: [_jsx(TableHead, { children: t("document") }), _jsx(TableHead, { children: t("order") }), _jsx(TableHead, { children: t("customer") }), _jsx(TableHead, { className: "text-right", children: t("lines") }), _jsx(TableHead, { className: "text-right", children: "Karren" }), _jsx(TableHead, { className: "text-right", children: "Pakbonnen" }), _jsx(TableHead, { className: "text-right", children: t("page") }), _jsx(TableHead, { children: t("status") }), _jsx(TableHead, { children: t("priority") }), _jsx(TableHead, { children: t("announced") }), _jsx(TableHead, { children: t("waiting") }), _jsx(TableHead, { className: "sticky right-0 z-10 bg-background text-right shadow-[-8px_0_8px_-8px_hsl(var(--border))]", children: t("action") })] }) }), _jsxs(TableBody, { children: [safeItems.map((item) => {
54
82
  const printed = !!item.printed_at;
55
83
  const readiness = readinessById[item.id];
56
84
  const checking = !readiness || readiness.checking;
@@ -62,7 +90,7 @@ export function QueueTable({ items, lockedIds, statuses, documentTypes, busyId,
62
90
  const doc = item.document_type_id ? docById.get(item.document_type_id) : undefined;
63
91
  const warnings = Array.isArray(item.warnings) ? item.warnings : [];
64
92
  const selectable = !!onSelectPrinted && !readOnly && !locked;
65
- return (_jsxs(TableRow, { tabIndex: selectable ? 0 : undefined, role: selectable ? "button" : undefined, "aria-label": selectable ? `Selecteer ${item.document_number}` : undefined, className: (locked || printed ? "opacity-60 " : "") + (selectable ? "cursor-pointer hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring" : ""), onClick: () => {
93
+ return (_jsxs(TableRow, { tabIndex: selectable ? 0 : undefined, role: selectable ? "button" : undefined, "aria-label": selectable ? `Selecteer ${item.document_number}` : undefined, className: (locked || printed || !isRowPrintable(item) ? "opacity-60 " : "") + (selectable ? "cursor-pointer hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring" : ""), onClick: () => {
66
94
  if (selectable)
67
95
  onSelectPrinted?.(item);
68
96
  }, onKeyDown: (event) => {
@@ -70,7 +98,7 @@ export function QueueTable({ items, lockedIds, statuses, documentTypes, busyId,
70
98
  event.preventDefault();
71
99
  onSelectPrinted?.(item);
72
100
  }
73
- }, children: [_jsxs(TableCell, { className: "font-medium", children: [_jsxs("div", { className: "flex items-center gap-2", children: [unitTitleOf(item), dupTag && _jsxs("span", { className: "text-xs font-normal text-muted-foreground", children: ["(", dupTag, ")"] }), replaced && (_jsx("span", { className: "rounded bg-destructive/10 px-1.5 py-0.5 text-xs font-semibold text-destructive", title: readiness?.reason ?? undefined, children: "Vervangen" })), replaced && readiness?.reason && (_jsx("span", { className: "text-xs font-normal text-destructive", children: readiness.reason })), waiting && (_jsx("span", { className: "rounded bg-muted px-1.5 py-0.5 text-xs font-semibold text-muted-foreground", children: "Wacht op printer" })), sentElsewhereLines(item).map((line) => (_jsx("span", { className: "text-xs font-normal text-muted-foreground", children: line }, line))), warnings.length > 0 && (_jsx(AlertTriangle, { className: "h-4 w-4 text-destructive", "aria-label": t("warning") }))] }), _jsx("div", { className: "text-xs text-muted-foreground", children: doc?.name ?? "-" })] }), _jsx(TableCell, { children: bufferOrdersOf(item).length > 0 ? "" : item.order_number }), _jsx(TableCell, { children: item.customer_name }), _jsx(TableCell, { className: "text-right", children: item.line_count }), _jsx(TableCell, { className: "text-right", children: (() => {
101
+ }, children: [_jsxs(TableCell, { className: "font-medium", children: [_jsxs("div", { className: "flex items-center gap-2", children: [unitTitleOf(item), dupTag && _jsxs("span", { className: "text-xs font-normal text-muted-foreground", children: ["(", dupTag, ")"] }), replaced && (_jsx("span", { className: "rounded bg-destructive/10 px-1.5 py-0.5 text-xs font-semibold text-destructive", title: readiness?.reason ?? undefined, children: "Vervangen" })), replaced && readiness?.reason && (_jsx("span", { className: "text-xs font-normal text-destructive", children: readiness.reason })), waiting && (_jsx("span", { className: "rounded bg-muted px-1.5 py-0.5 text-xs font-semibold text-muted-foreground", children: "Wacht op printer" })), sentElsewhereLines(item).map((line) => (_jsx("span", { className: "text-xs font-normal text-muted-foreground", children: line }, line))), warnings.length > 0 && (_jsx(AlertTriangle, { className: "h-4 w-4 text-destructive", "aria-label": t("warning") }))] }), _jsx("div", { className: "text-xs text-muted-foreground", children: doc?.name ?? "-" })] }), _jsx(TableCell, { children: orderNumbersLabel(item) }), _jsx(TableCell, { children: item.customer_name }), _jsx(TableCell, { className: "text-right", children: item.line_count }), _jsx(TableCell, { className: "text-right", children: (() => {
74
102
  const info = cartColumnInfo(item);
75
103
  return (_jsxs("div", { className: "flex flex-col items-end", children: [_jsx("span", { children: info.carts }), info.cartLabel && (_jsx("span", { className: "text-xs text-muted-foreground", children: info.cartLabel })), info.reason && (_jsx("span", { className: "text-xs text-muted-foreground", children: info.reason }))] }));
76
104
  })() }), _jsx(TableCell, { className: "text-right", children: printedSlipCount(item) ?? "—" }), _jsx(TableCell, { className: "text-right", children: displayPageCount(item.line_count) }), _jsxs(TableCell, { children: [_jsx(Badge, { variant: printed ? "secondary" : "default", children: printed ? t("statusPrinted") : t("statusToPrint") }), printed && (_jsx("div", { className: "mt-1 text-xs text-muted-foreground", children: new Date(item.printed_at).toLocaleTimeString([], {
@@ -80,20 +108,21 @@ export function QueueTable({ items, lockedIds, statuses, documentTypes, busyId,
80
108
  priorityTone(item.priority, item.is_urgent), children: item.is_urgent ? t("urgent") : item.priority }) }), _jsx(TableCell, { className: "whitespace-nowrap text-sm", children: new Date(item.announced_at).toLocaleTimeString(t.locale, {
81
109
  hour: "2-digit",
82
110
  minute: "2-digit",
83
- }) }), _jsx(TableCell, { className: "whitespace-nowrap text-sm", children: sinceLabel(item.announced_at) }), _jsx(TableCell, { className: "text-right", children: _jsxs("div", { className: "flex items-center justify-end gap-1", children: [onPreview && (_jsx("button", { type: "button", "aria-label": "Voorbeeld " + item.document_number, title: "Voorbeeld " + item.document_number, className: "inline-flex h-11 w-11 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground", onClick: (e) => {
111
+ }) }), _jsx(TableCell, { className: "whitespace-nowrap text-sm", children: sinceLabel(item.announced_at) }), _jsx(TableCell, { className: "sticky right-0 z-10 bg-background text-right shadow-[-8px_0_8px_-8px_hsl(var(--border))]", children: _jsxs("div", { className: "flex items-center justify-end gap-1", children: [onPreview && (_jsx("button", { type: "button", "aria-label": "Voorbeeld " + item.document_number, title: "Voorbeeld " + item.document_number, className: "inline-flex h-11 w-11 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground", onClick: (e) => {
84
112
  e.stopPropagation();
85
113
  onPreview(item);
86
114
  }, children: _jsx(Eye, { className: "h-5 w-5" }) })), !printed && onMarkPrinted && (_jsx("button", { type: "button", "aria-label": "Markeer " + item.document_number + " als geprint", title: "Markeer als geprint (zonder opnieuw printen)", disabled: readOnly || busyId === item.id, className: "inline-flex h-11 w-11 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground disabled:opacity-50", onClick: (e) => {
87
115
  e.stopPropagation();
88
- onMarkPrinted(item);
89
- }, children: _jsx(Check, { className: "h-5 w-5" }) })), printed ? (_jsxs(Button, { size: "sm", variant: "ghost", disabled: readOnly || busyId === item.id || checking || replaced, onClick: (e) => {
116
+ if (window.confirm(MARK_PRINTED_CONFIRM))
117
+ onMarkPrinted(item);
118
+ }, children: _jsx(Check, { className: "h-5 w-5" }) })), blockedMessage(readinessById[item.id], siteTimeZone, item) && !printed ? (_jsx("span", { className: "max-w-56 text-right text-xs font-medium text-destructive", children: blockedMessage(readinessById[item.id], siteTimeZone, item) })) : printed ? (_jsxs(Button, { size: "sm", variant: "ghost", disabled: readOnly || busyId === item.id || checking || replaced, onClick: (e) => {
90
119
  e.stopPropagation();
91
120
  (onPrintAll ?? onReprint ?? onPick)(item);
92
121
  }, children: [checking ? (_jsx(Loader2, { className: "mr-1 h-4 w-4 animate-spin" })) : ready ? (_jsx(RotateCcw, { className: "mr-1 h-4 w-4" })) : (_jsx(RefreshCw, { className: "mr-1 h-4 w-4" })), replaced ? "Vervangen" : checking ? "Pakbon controleren" : ready ? t("print") : "Pakbon ophalen"] })) : locked ? (_jsxs("span", { className: "inline-flex items-center gap-1 text-xs text-muted-foreground", children: [_jsx(Lock, { className: "h-3.5 w-3.5" }), " ", t("inProgress")] })) : (_jsxs(Button, { size: "sm", variant: "outline", disabled: readOnly || busyId === item.id || checking || replaced, onClick: (e) => {
93
122
  e.stopPropagation();
94
123
  (onPrintAll ?? onPick)(item);
95
124
  }, children: [checking ? (_jsx(Loader2, { className: "mr-1 h-4 w-4 animate-spin" })) : !ready ? (_jsx(RefreshCw, { className: "mr-1 h-4 w-4" })) : (_jsx(Printer, { className: "mr-1 h-4 w-4" })), replaced ? "Vervangen" : checking ? "Pakbon controleren" : ready ? t("print") : "Pakbon ophalen"] }))] }) })] }, item.id));
96
- }), safeItems.length === 0 && (_jsx(TableRow, { children: _jsx(TableCell, { colSpan: 11, className: "py-10 text-center text-muted-foreground", children: t("emptyQueue") }) }))] })] }) }), _jsxs("div", { className: "space-y-3 md:hidden", children: [safeItems.map((item) => {
125
+ }), safeItems.length === 0 && (_jsx(TableRow, { children: _jsx(TableCell, { colSpan: 11, className: "py-10 text-center text-muted-foreground", children: t("emptyQueue") }) }))] })] }) }), _jsxs("div", { className: "space-y-3 min-[1100px]:hidden", children: [safeItems.map((item) => {
97
126
  const printed = !!item.printed_at;
98
127
  const readiness = readinessById[item.id];
99
128
  const checking = !readiness || readiness.checking;
@@ -105,7 +134,7 @@ export function QueueTable({ items, lockedIds, statuses, documentTypes, busyId,
105
134
  const doc = item.document_type_id ? docById.get(item.document_type_id) : undefined;
106
135
  const warnings = Array.isArray(item.warnings) ? item.warnings : [];
107
136
  const selectable = !!onSelectPrinted && !readOnly && !locked;
108
- return (_jsxs("div", { tabIndex: selectable ? 0 : undefined, role: selectable ? "button" : undefined, "aria-label": selectable ? `Selecteer ${item.document_number}` : undefined, className: "rounded-lg border bg-card p-4 " + (locked || printed ? "opacity-60 " : "") + (selectable ? "cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring" : ""), onClick: () => {
137
+ return (_jsxs("div", { tabIndex: selectable ? 0 : undefined, role: selectable ? "button" : undefined, "aria-label": selectable ? `Selecteer ${item.document_number}` : undefined, className: "rounded-lg border bg-card p-4 " + (locked || printed || !isRowPrintable(item) ? "opacity-60 " : "") + (selectable ? "cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring" : ""), onClick: () => {
109
138
  if (selectable)
110
139
  onSelectPrinted?.(item);
111
140
  }, onKeyDown: (event) => {
@@ -120,21 +149,33 @@ export function QueueTable({ items, lockedIds, statuses, documentTypes, busyId,
120
149
  hour: "2-digit",
121
150
  minute: "2-digit",
122
151
  }) })), _jsx("span", { className: "rounded px-2 py-0.5 text-xs font-semibold " +
123
- priorityTone(item.priority, item.is_urgent), children: item.is_urgent ? t("urgent") : item.priority })] })] })] }), _jsxs("div", { className: "mt-2 min-w-0 space-y-0.5 text-sm", children: [bufferOrdersOf(item).length > 0 ? null : (_jsx("p", { className: "truncate text-foreground", children: item.order_number })), _jsx("p", { className: "truncate text-muted-foreground", children: item.customer_name })] }), _jsxs("div", { className: "mt-2 flex flex-wrap gap-x-3 gap-y-1 text-xs text-muted-foreground", children: [_jsxs("span", { children: [t("lines"), ": ", item.line_count] }), (() => {
152
+ priorityTone(item.priority, item.is_urgent), children: item.is_urgent ? t("urgent") : item.priority })] })] })] }), _jsxs("div", { className: "mt-2 min-w-0 space-y-0.5 text-sm", children: [orderNumbersLabel(item) && (_jsx("p", { className: "truncate text-foreground", children: orderNumbersLabel(item) })), _jsx("p", { className: "truncate text-muted-foreground", children: item.customer_name })] }), _jsxs("div", { className: "mt-2 flex flex-wrap gap-x-3 gap-y-1 text-xs text-muted-foreground", children: [_jsxs("span", { children: [t("lines"), ": ", item.line_count] }), (() => {
124
153
  const info = cartColumnInfo(item);
125
154
  return (_jsxs("span", { children: ["Karren: ", info.carts, info.cartLabel ? ` · ${info.cartLabel}` : "", info.reason ? ` · ${info.reason}` : ""] }));
126
155
  })(), _jsxs("span", { children: ["Pakbonnen: ", printedSlipCount(item) ?? "—"] }), _jsxs("span", { children: [t("page"), ": ", displayPageCount(item.line_count)] }), _jsxs("span", { children: [t("announced"), ":", " ", new Date(item.announced_at).toLocaleTimeString(t.locale, {
127
156
  hour: "2-digit",
128
157
  minute: "2-digit",
129
- })] }), _jsxs("span", { children: [t("waiting"), ": ", sinceLabel(item.announced_at)] })] }), _jsxs("div", { className: "mt-3", children: [printed ? (_jsxs(Button, { size: "lg", variant: "outline", className: "h-12 w-full", disabled: readOnly || busyId === item.id || checking || replaced, onClick: (e) => {
158
+ })] }), _jsxs("span", { children: [t("waiting"), ": ", sinceLabel(item.announced_at)] })] }), (() => {
159
+ const info = cartColumnInfo(item);
160
+ const payload = (item.payload && typeof item.payload === "object" ? item.payload : {});
161
+ const cartType = typeof payload["cartTypeName"] === "string" ? payload["cartTypeName"] : null;
162
+ const crates = crateLabelOf(item);
163
+ const departure = departureLabel(departureOf(item), pickDay, siteTimeZone);
164
+ const late = readiness?.lateSignup === true;
165
+ return (_jsxs("div", { className: "mt-2 space-y-0.5", children: [info.cartLabel && (_jsx("p", { className: "text-xl font-bold text-foreground", children: [info.cartLabel, cartType].filter(Boolean).join(" · ") })), _jsx("p", { className: "text-sm text-muted-foreground", children: [
166
+ crates,
167
+ departure,
168
+ ].filter(Boolean).join(" · ") }), late && (_jsx("span", { className: "inline-block rounded border border-primary/40 bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary", children: "Te laat aangemeld" }))] }));
169
+ })(), _jsx(CartSteps, { printed: printed, waiting: waiting }), _jsxs("div", { className: "mt-3", children: [blockedMessage(readiness, siteTimeZone, item) && !printed ? (_jsx("p", { className: "rounded-md border border-destructive/40 bg-destructive/5 p-3 text-sm font-medium text-destructive", children: blockedMessage(readiness, siteTimeZone, item) })) : printed ? (_jsxs(Button, { size: "lg", variant: "outline", className: "h-12 w-full", disabled: readOnly || busyId === item.id || checking || replaced, onClick: (e) => {
130
170
  e.stopPropagation();
131
171
  (onPrintAll ?? onReprint ?? onPick)(item);
132
172
  }, children: [checking ? (_jsx(Loader2, { className: "mr-2 h-4 w-4 animate-spin" })) : ready ? (_jsx(RotateCcw, { className: "mr-2 h-4 w-4" })) : (_jsx(RefreshCw, { className: "mr-2 h-4 w-4" })), replaced ? "Vervangen" : checking ? "Pakbon controleren" : ready ? t("print") : "Pakbon ophalen"] })) : locked ? (_jsxs("span", { className: "inline-flex items-center gap-1 text-xs text-muted-foreground", children: [_jsx(Lock, { className: "h-3.5 w-3.5" }), " ", t("inProgress")] })) : (_jsxs(Button, { size: "lg", className: "h-12 w-full", disabled: readOnly || busyId === item.id || checking || replaced, onClick: (e) => {
133
173
  e.stopPropagation();
134
174
  (onPrintAll ?? onPick)(item);
135
- }, children: [checking ? (_jsx(Loader2, { className: "mr-2 h-4 w-4 animate-spin" })) : !ready ? (_jsx(RefreshCw, { className: "mr-2 h-4 w-4" })) : (_jsx(Printer, { className: "mr-2 h-4 w-4" })), replaced ? "Vervangen" : checking ? "Pakbon controleren" : ready ? t("print") : "Pakbon ophalen"] })), !printed && onMarkPrinted && (_jsxs(Button, { size: "sm", variant: "ghost", className: "mt-2 w-full", disabled: readOnly || busyId === item.id, onClick: (e) => {
136
- e.stopPropagation();
137
- onMarkPrinted(item);
138
- }, children: [_jsx(Check, { className: "mr-2 h-4 w-4" }), "Markeer als geprint"] }))] })] }, item.id));
175
+ }, children: [checking ? (_jsx(Loader2, { className: "mr-2 h-4 w-4 animate-spin" })) : !ready ? (_jsx(RefreshCw, { className: "mr-2 h-4 w-4" })) : (_jsx(Printer, { className: "mr-2 h-4 w-4" })), replaced ? "Vervangen" : checking ? "Pakbon controleren" : ready ? t("print") : "Pakbon ophalen"] })), !printed && onMarkPrinted && (_jsxs("details", { className: "mt-2 text-sm", onClick: (e) => e.stopPropagation(), children: [_jsx("summary", { className: "cursor-pointer select-none text-muted-foreground", children: "Meer" }), _jsxs(Button, { size: "sm", variant: "ghost", className: "mt-1 w-full", disabled: readOnly || busyId === item.id, onClick: (e) => {
176
+ e.stopPropagation();
177
+ if (window.confirm(MARK_PRINTED_CONFIRM))
178
+ onMarkPrinted(item);
179
+ }, children: [_jsx(Check, { className: "mr-2 h-4 w-4" }), "Markeer als geprint"] })] }))] })] }, item.id));
139
180
  }), safeItems.length === 0 && (_jsx("div", { className: "rounded-lg border py-10 text-center text-muted-foreground", children: t("emptyQueue") }))] })] }));
140
181
  }
@@ -13,5 +13,5 @@ export function ReferentiedataBanner() {
13
13
  const problemen = referentieProblemen(data);
14
14
  if (problemen.length === 0)
15
15
  return null;
16
- return (_jsxs("div", { className: "space-y-3 rounded-lg border border-destructive/50 bg-destructive/5 p-4", children: [_jsxs("div", { className: "flex items-start gap-3", children: [_jsx(AlertTriangle, { className: "mt-0.5 h-5 w-5 shrink-0 text-destructive" }), _jsxs("div", { className: "space-y-1", children: [_jsx("h2", { className: "font-semibold text-destructive", children: "Referentiedata ontbreekt \u2014 er komt niets in de pickwachtrij" }), _jsx("ul", { className: "list-inside list-disc text-sm text-destructive", children: problemen.map((p) => (_jsx("li", { children: p }, p))) }), _jsx("p", { className: "text-sm text-muted-foreground", children: "De synchronisatie stopt hierop en pickstations blijven leeg." })] })] }), _jsx(Button, { variant: "outline", size: "sm", asChild: true, children: _jsx(Link, { to: "/instellingen", children: "Naar referentiedata-instellingen" }) })] }));
16
+ return (_jsxs("div", { className: "space-y-3 rounded-lg border border-destructive/50 bg-destructive/5 p-4", children: [_jsxs("div", { className: "flex items-start gap-3", children: [_jsx(AlertTriangle, { className: "mt-0.5 h-5 w-5 shrink-0 text-destructive" }), _jsxs("div", { className: "space-y-1", children: [_jsx("h2", { className: "font-semibold text-destructive", children: "Instellingen voor pickdocumenten ontbreken; er komen geen orders op het pickstation. Vraag kantoor dit te herstellen." }), _jsxs("details", { className: "text-sm text-muted-foreground", children: [_jsx("summary", { children: "Details voor beheer" }), _jsx("ul", { className: "list-inside list-disc", children: problemen.map((p) => (_jsx("li", { children: p }, p))) })] })] })] }), _jsx(Button, { variant: "outline", size: "sm", asChild: true, children: _jsx(Link, { to: "/instellingen", children: "Naar instellingen" }) })] }));
17
17
  }
@@ -27,4 +27,5 @@ export { ReferentiedataBanner } from './components/pick/ReferentiedataBanner';
27
27
  export declare const pickSchermenModule: FlowModule;
28
28
  export * from './lib/pickStickers';
29
29
  export { CartStickerState, OrderStickerMeldingen } from './components/pick/StickerState';
30
+ export * from "./lib/pick145";
30
31
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAGvD,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAErE,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACtE,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAC9F,OAAO,EAAE,gCAAgC,EAAE,MAAM,wDAAwD,CAAC;AAC1G,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAE9E,eAAO,MAAM,kBAAkB,EAAE,UAYhC,CAAC;AAEF,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAGvD,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAErE,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACtE,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAC9F,OAAO,EAAE,gCAAgC,EAAE,MAAM,wDAAwD,CAAC;AAC1G,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAE9E,eAAO,MAAM,kBAAkB,EAAE,UAYhC,CAAC;AAEF,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACzF,cAAc,eAAe,CAAC"}
package/dist-lib/index.js CHANGED
@@ -52,3 +52,4 @@ export const pickSchermenModule = {
52
52
  };
53
53
  export * from './lib/pickStickers';
54
54
  export { CartStickerState, OrderStickerMeldingen } from './components/pick/StickerState';
55
+ export * from "./lib/pick145";
@@ -1 +1 @@
1
- {"version":3,"file":"previewAuthStorage.d.ts","sourceRoot":"","sources":["../../../src/integrations/supabase/previewAuthStorage.ts"],"names":[],"mappings":"AAIA,wBAAgB,sBAAsB;mBA2Db,MAAM;mBAeZ,MAAM,SAAS,MAAM;sBASlB,MAAM;cAK3B"}
1
+ {"version":3,"file":"previewAuthStorage.d.ts","sourceRoot":"","sources":["../../../src/integrations/supabase/previewAuthStorage.ts"],"names":[],"mappings":"AAIA,wBAAgB,sBAAsB;mBA6Db,MAAM;mBAwBZ,MAAM,SAAS,MAAM;sBASlB,MAAM;cAM3B"}
@@ -61,21 +61,38 @@ export function brokeredPreviewStorage() {
61
61
  // The editor may not be listening yet at the first getItem, so retry once.
62
62
  let firstGet = true;
63
63
  const RETRY_DELAY = 250;
64
+ // Blocked third-party storage throws here; seeding must not break broker reads.
65
+ const readLocal = (key) => { try {
66
+ return localStorage.getItem(key);
67
+ }
68
+ catch {
69
+ return undefined;
70
+ } };
64
71
  return {
65
72
  getItem: async (key) => {
66
- let res = await request('lovable-preview-auth:get', key);
73
+ // Sent with GET and REMOVE so an editor that never cached this session can check or revoke it.
74
+ const local = readLocal(key);
75
+ let res = await request('lovable-preview-auth:get', key, local ?? undefined);
67
76
  if (!res && firstGet) {
68
77
  await new Promise((r) => setTimeout(r, RETRY_DELAY));
69
- res = await request('lovable-preview-auth:get', key);
78
+ res = await request('lovable-preview-auth:get', key, local ?? undefined);
70
79
  }
71
80
  firstGet = false;
72
81
  // '' is the logout tombstone: clear the local copy too so it can't resurrect if
73
82
  // the broker later goes silent. A null reply means never-synced -> keep local.
74
83
  if (res && res.ok && typeof res.value === 'string') {
75
84
  if (res.value === '') {
76
- localStorage.removeItem(key);
85
+ if (local !== undefined && readLocal(key) === local)
86
+ localStorage.removeItem(key);
77
87
  return null;
78
88
  }
89
+ // Seed this origin so a new tab, whose editor holds no session, stays signed in.
90
+ if (local === null && readLocal(key) === null) {
91
+ try {
92
+ localStorage.setItem(key, res.value);
93
+ }
94
+ catch { /* storage full: still return the editor's session */ }
95
+ }
79
96
  return res.value;
80
97
  }
81
98
  return localStorage.getItem(key);
@@ -92,8 +109,9 @@ export function brokeredPreviewStorage() {
92
109
  });
93
110
  },
94
111
  removeItem: (key) => {
112
+ const local = readLocal(key);
95
113
  localStorage.removeItem(key);
96
- return request('lovable-preview-auth:remove', key).then(() => undefined);
114
+ return request('lovable-preview-auth:remove', key, local ?? undefined).then(() => undefined);
97
115
  },
98
116
  };
99
117
  }