@flowselections/floriday-afhandeling-module 1.0.98 → 1.0.100
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-lib/components/afhandeling/ControlePage.d.ts.map +1 -1
- package/dist-lib/components/afhandeling/ControlePage.js +14 -6
- package/dist-lib/components/afhandeling/DagDetailDialog.js +7 -7
- package/dist-lib/components/afhandeling/LeveringenPage.d.ts.map +1 -1
- package/dist-lib/components/afhandeling/LeveringenPage.js +13 -2
- package/dist-lib/components/afhandeling/PickingPage.d.ts.map +1 -1
- package/dist-lib/components/afhandeling/PickingPage.js +2 -1
- package/dist-lib/components/afhandeling/PlanningAgendaPage.d.ts.map +1 -1
- package/dist-lib/components/afhandeling/PlanningAgendaPage.js +3 -1
- package/dist-lib/components/afhandeling/VervoerdersPage.d.ts.map +1 -1
- package/dist-lib/components/afhandeling/VervoerdersPage.js +63 -6
- package/dist-lib/components/fs-ui/DataTable.d.ts +23 -0
- package/dist-lib/components/fs-ui/DataTable.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/DataTable.js +14 -0
- package/dist-lib/components/fs-ui/EmptyState.d.ts +9 -0
- package/dist-lib/components/fs-ui/EmptyState.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/EmptyState.js +5 -0
- package/dist-lib/components/fs-ui/FilterChips.d.ts +12 -0
- package/dist-lib/components/fs-ui/FilterChips.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/FilterChips.js +8 -0
- package/dist-lib/components/fs-ui/HoverTip.d.ts +15 -0
- package/dist-lib/components/fs-ui/HoverTip.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/HoverTip.js +24 -0
- package/dist-lib/components/fs-ui/InlineAlert.d.ts +11 -0
- package/dist-lib/components/fs-ui/InlineAlert.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/InlineAlert.js +15 -0
- package/dist-lib/components/fs-ui/KpiRow.d.ts +6 -0
- package/dist-lib/components/fs-ui/KpiRow.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/KpiRow.js +5 -0
- package/dist-lib/components/fs-ui/KpiTile.d.ts +21 -0
- package/dist-lib/components/fs-ui/KpiTile.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/KpiTile.js +40 -0
- package/dist-lib/components/fs-ui/MobilePrimaryAction.d.ts +7 -0
- package/dist-lib/components/fs-ui/MobilePrimaryAction.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/MobilePrimaryAction.js +7 -0
- package/dist-lib/components/fs-ui/PageHeader.d.ts +9 -0
- package/dist-lib/components/fs-ui/PageHeader.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/PageHeader.js +5 -0
- package/dist-lib/components/fs-ui/PillTabs.d.ts +15 -0
- package/dist-lib/components/fs-ui/PillTabs.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/PillTabs.js +13 -0
- package/dist-lib/components/fs-ui/SearchInput.d.ts +8 -0
- package/dist-lib/components/fs-ui/SearchInput.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/SearchInput.js +21 -0
- package/dist-lib/components/fs-ui/ShortcutHelp.d.ts +10 -0
- package/dist-lib/components/fs-ui/ShortcutHelp.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/ShortcutHelp.js +17 -0
- package/dist-lib/components/fs-ui/StatusIcon.d.ts +7 -0
- package/dist-lib/components/fs-ui/StatusIcon.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/StatusIcon.js +9 -0
- package/dist-lib/components/fs-ui/TableSkeleton.d.ts +6 -0
- package/dist-lib/components/fs-ui/TableSkeleton.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/TableSkeleton.js +6 -0
- package/dist-lib/components/fs-ui/Toolbar.d.ts +7 -0
- package/dist-lib/components/fs-ui/Toolbar.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/Toolbar.js +5 -0
- package/dist-lib/components/fs-ui/UpdatedAt.d.ts +6 -0
- package/dist-lib/components/fs-ui/UpdatedAt.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/UpdatedAt.js +9 -0
- package/dist-lib/components/fs-ui/useShortcuts.d.ts +12 -0
- package/dist-lib/components/fs-ui/useShortcuts.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/useShortcuts.js +36 -0
- package/dist-lib/integrations/supabase/types.d.ts +1470 -0
- package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
- package/dist-lib/lib/cartControl.functions.js +1 -1
- package/dist-lib/lib/floridayAutoProcess.js +2 -2
- package/dist-lib/lib/floridayLoading.functions.js +5 -5
- package/dist-lib/lib/signupMailText.js +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ControlePage.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/ControlePage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ControlePage.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/ControlePage.tsx"],"names":[],"mappings":"AA2JA,wBAAgB,YAAY,CAAC,EAAE,MAAM,EAAE,GAAE;IAAE,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;CAAO,+BAi9BpE"}
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fragment as _Fragment, jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useAfhandelingDefaults } from "../../hooks/useAfhandelingDefaults.js";
|
|
3
3
|
import { ophaalTekst } from "../../lib/pickupMoment.js";
|
|
4
4
|
import { useEffect, useMemo, useRef, useState } from "react";
|
|
5
5
|
import { Button, Card, Checkbox, Dialog, DialogDescription, DialogTitle, Input, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, Textarea, Badge, toast, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "@flowselections/core";
|
|
6
|
-
import { Printer, CheckCircle2, AlertTriangle, History, ChevronLeft, ChevronRight, ScanLine } from "lucide-react";
|
|
6
|
+
import { Printer, CheckCircle2, AlertTriangle, History, ChevronLeft, ChevronRight, ScanLine, Package } from "lucide-react";
|
|
7
|
+
import { PageHeader } from "../fs-ui/PageHeader.js";
|
|
8
|
+
import { UpdatedAt } from "../fs-ui/UpdatedAt.js";
|
|
9
|
+
import { PillTabs } from "../fs-ui/PillTabs.js";
|
|
10
|
+
import { KpiRow } from "../fs-ui/KpiRow.js";
|
|
11
|
+
import { KpiTile } from "../fs-ui/KpiTile.js";
|
|
7
12
|
import { ResponsiveDialogBody, ResponsiveDialogContent, ResponsiveDialogFooter, ResponsiveDialogHeader, } from "../ui/responsive-dialog.js";
|
|
8
13
|
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
9
14
|
import { useServerFn } from "@tanstack/react-start";
|
|
@@ -519,7 +524,7 @@ export function ControlePage({ onExit } = {}) {
|
|
|
519
524
|
const pendingNotReadyCount = pendingProposals.length + pendingBlocked.length;
|
|
520
525
|
const criticalTomorrowCount = pendingProposals.filter((p) => isTomorrowIso(p.pickupDate)).length +
|
|
521
526
|
pendingBlocked.filter((b) => isTomorrowIso(b.pickupDate)).length;
|
|
522
|
-
return (_jsxs("main", { className: "h-full overflow-y-auto p-
|
|
527
|
+
return (_jsxs("main", { className: "flex h-full flex-col gap-4 overflow-y-auto p-4 pb-24 sm:p-6 sm:pb-24", children: [_jsxs("div", { className: "flex flex-wrap items-start justify-between gap-3", children: [_jsx(PageHeader, { title: "Controle", description: _jsxs(_Fragment, { children: ["Dagelijkse eindcontrole \u2014 vandaag ", new Date().toLocaleDateString("nl-NL")] }), updatedAt: _jsx(UpdatedAt, { at: cartsQ.dataUpdatedAt || null, refreshing: cartsQ.isFetching && !cartsQ.isLoading }) }), _jsxs("div", { className: "flex flex-wrap gap-2", children: [_jsxs(Button, { variant: "outline", disabled: printBezig || carts.length === 0, onClick: async () => {
|
|
523
528
|
setPrintBezig(true);
|
|
524
529
|
try {
|
|
525
530
|
const documentnaam = `CTRL-${new Date().toISOString().slice(0, 10)}`;
|
|
@@ -544,9 +549,12 @@ export function ControlePage({ onExit } = {}) {
|
|
|
544
549
|
finally {
|
|
545
550
|
setPrintBezig(false);
|
|
546
551
|
}
|
|
547
|
-
}, children: [_jsx(Printer, { className: "h-4 w-4 mr-2" }), printBezig ? "Bezig met printen…" : "Controlelijst afdrukken"] }), _jsxs(Button, { onClick: runControl, disabled: submitM.isPending || proposalM.isPending || carts.length === 0 || tab !== "controle", children: [_jsx(CheckCircle2, { className: "h-4 w-4 mr-2" }), proposalM.isPending ? "Controleren…" : "Controle uitvoeren"] })] })] }),
|
|
548
|
-
|
|
549
|
-
|
|
552
|
+
}, children: [_jsx(Printer, { className: "h-4 w-4 mr-2" }), printBezig ? "Bezig met printen…" : "Controlelijst afdrukken"] }), _jsxs(Button, { onClick: runControl, disabled: submitM.isPending || proposalM.isPending || carts.length === 0 || tab !== "controle", children: [_jsx(CheckCircle2, { className: "h-4 w-4 mr-2" }), proposalM.isPending ? "Controleren…" : "Controle uitvoeren"] })] })] }), _jsx(PillTabs, { ariaLabel: "Controle", value: tab, onChange: (v) => setTab(v), tabs: [
|
|
553
|
+
{ value: "controle", label: "Controle", icon: _jsx(CheckCircle2, {}), count: stats.total },
|
|
554
|
+
{ value: "scan", label: "Scancontrole", icon: _jsx(ScanLine, {}) },
|
|
555
|
+
{ value: "afgeleverd", label: "Afgeleverd", icon: _jsx(CheckCircle2, {}) },
|
|
556
|
+
{ value: "historie", label: "Historie", icon: _jsx(History, {}) },
|
|
557
|
+
] }), tab === "controle" && (_jsxs(_Fragment, { children: [_jsxs(KpiRow, { children: [_jsx(KpiTile, { title: "Totaal karren vandaag", icon: _jsx(Package, {}), loading: cartsQ.isLoading, value: stats.total, sub: "te controleren" }), _jsx(KpiTile, { title: "Geprint", icon: _jsx(Printer, {}), loading: cartsQ.isLoading, value: stats.printed, sub: "pakbon gemaakt" }), _jsx(KpiTile, { title: "Aangevinkt", icon: _jsx(CheckCircle2, {}), loading: cartsQ.isLoading, value: stats.checked, sub: "klaar voor controle" }), _jsx(KpiTile, { title: "Nog niet gereed", icon: _jsx(AlertTriangle, {}), loading: cartsQ.isLoading, value: Math.max(0, stats.total - stats.checked), tone: stats.total - stats.checked > 0 ? "warning" : "default", sub: "nog niet aangevinkt" })] }), cartsQ.isError && (_jsx(Card, { className: "border-destructive/40 bg-destructive/10 p-4", children: _jsxs("div", { className: "flex items-start gap-2 text-destructive", children: [_jsx(AlertTriangle, { className: "mt-0.5 h-4 w-4 shrink-0" }), _jsxs("div", { className: "space-y-2 text-sm", children: [_jsx("div", { className: "font-medium", children: "De karren konden niet worden opgehaald" }), _jsx("p", { children: "Lukt het niet, probeer het opnieuw. Blijft dit gebeuren, vraag dan de beheerder." }), _jsx(Button, { size: "sm", variant: "outline", onClick: () => void cartsQ.refetch(), children: "Opnieuw proberen" })] })] }) })), !cartsQ.isError && cartsQ.data && (cartsQ.data.warnings ?? []).length > 0 && (_jsx(Card, { className: "border-warning/30 bg-warning-soft p-4", children: _jsxs("div", { className: "flex items-start gap-2 text-warning-soft-foreground", children: [_jsx(AlertTriangle, { className: "mt-0.5 h-4 w-4 shrink-0" }), _jsxs("div", { className: "space-y-1 text-sm", children: [_jsx("div", { className: "font-medium", children: "Niet alle gegevens konden worden opgehaald" }), (cartsQ.data.warnings ?? []).map((w) => (_jsx("p", { children: w }, w)))] })] }) })), _jsxs(Card, { className: "p-0 overflow-hidden", children: [_jsxs(Table, { children: [_jsx(TableHeader, { children: _jsxs(TableRow, { children: [_jsx(TableHead, { className: "w-12", children: _jsx(Checkbox, { checked: pagedCarts.length > 0 &&
|
|
550
558
|
pagedCarts.every((c) => checked.has(controlCartKey(c)))
|
|
551
559
|
? true
|
|
552
560
|
: pagedCarts.some((c) => checked.has(controlCartKey(c)))
|
|
@@ -251,7 +251,7 @@ function DagDetailContent({ open, date, planned, onOpenChange, basis = "pick", h
|
|
|
251
251
|
// Tel karren op unieke kar-id (gedeelde bufferkar één keer); rijen zonder id tellen los.
|
|
252
252
|
const signupFlags = useSignupFlags(dayKey ?? null);
|
|
253
253
|
const uniekeKarren = new Set(cartRows.map((c) => c.cartId ?? `zonder-id:${c.key}`)).size;
|
|
254
|
-
return (_jsx(SignupFlagCtx.Provider, { value: signupFlags, children: _jsx(HighlightCtx.Provider, { value: highlightOrderId ?? null, children: _jsx(ShipStateCtx.Provider, { value: shipState, children: _jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: _jsxs(ResponsiveDialogContent, { size: "xl", children: [_jsxs(ResponsiveDialogHeader, { children: [_jsxs(DialogTitle, { children: ["Dagdetails \u2014 ", NL_DATE.format(date), " (", basis === "lever" ? "leverdag" : "pickdag", ")"] }), _jsxs(DialogDescription, { children: [basis === "lever" ? "Bestellingen die op deze dag worden geleverd. " : "Bestellingen die op deze dag worden gepickt. ", ordersOnDay.length, " ", ordersOnDay.length === 1 ? "bestelling" : "bestellingen", " \u00B7 ", uniekeKarren, " ", uniekeKarren === 1 ? "kar" : "karren", " \u00B7", " ", ordersOnDay.filter((o) => voortgang(o.status).done).length, " van ", ordersOnDay.length, " ", ordersOnDay.length === 1 ? "bestelling" : "bestellingen", " afgehandeld \u00B7 ", new Set(cartRows.filter((c) => voortgang(c.status).done).map((c) => c.cartId ?? `zonder-id:${c.key}`)).size, " van", " ", uniekeKarren, " ", uniekeKarren === 1 ? "kar" : "karren", " afgehandeld"] })] }), _jsxs(ResponsiveDialogBody, { children: [_jsx(DayCapacityWarning, { date: date }), engineDay.isError && (
|
|
254
|
+
return (_jsx(SignupFlagCtx.Provider, { value: signupFlags, children: _jsx(HighlightCtx.Provider, { value: highlightOrderId ?? null, children: _jsx(ShipStateCtx.Provider, { value: shipState, children: _jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: _jsxs(ResponsiveDialogContent, { size: "xl", className: "!left-auto !right-0 !top-0 !translate-x-0 !translate-y-0 h-[100dvh] !max-h-[100dvh] rounded-none border-y-0 border-r-0 shadow-lg sm:rounded-l-xl", style: { width: "min(64rem, 100vw)", maxWidth: "100vw" }, children: [_jsxs(ResponsiveDialogHeader, { children: [_jsxs(DialogTitle, { children: ["Dagdetails \u2014 ", NL_DATE.format(date), " (", basis === "lever" ? "leverdag" : "pickdag", ")"] }), _jsxs(DialogDescription, { children: [basis === "lever" ? "Bestellingen die op deze dag worden geleverd. " : "Bestellingen die op deze dag worden gepickt. ", ordersOnDay.length, " ", ordersOnDay.length === 1 ? "bestelling" : "bestellingen", " \u00B7 ", uniekeKarren, " ", uniekeKarren === 1 ? "kar" : "karren", " \u00B7", " ", ordersOnDay.filter((o) => voortgang(o.status).done).length, " van ", ordersOnDay.length, " ", ordersOnDay.length === 1 ? "bestelling" : "bestellingen", " afgehandeld \u00B7 ", new Set(cartRows.filter((c) => voortgang(c.status).done).map((c) => c.cartId ?? `zonder-id:${c.key}`)).size, " van", " ", uniekeKarren, " ", uniekeKarren === 1 ? "kar" : "karren", " afgehandeld"] })] }), _jsxs(ResponsiveDialogBody, { children: [_jsx(DayCapacityWarning, { date: date }), engineDay.isError && (_jsx("p", { className: "mb-2 text-xs text-destructive", children: "De orderlijst kon niet worden bijgewerkt; de lijst hieronder komt uit de planning. Probeer het later opnieuw." })), _jsx(BezettingCard, { date: date, cartsToday: uniekeKarren }), _jsx(SignupMailMoments, { from: dayKey, to: dayKey }), _jsxs(Tabs, { defaultValue: "bestellingen", children: [_jsxs(TabsList, { children: [_jsxs(TabsTrigger, { value: "bestellingen", children: ["Bestellingen (", ordersOnDay.length, ")"] }), _jsxs(TabsTrigger, { value: "karren", children: ["Karren (", uniekeKarren, ")"] })] }), _jsx(TabsContent, { value: "bestellingen", className: "mt-4", children: _jsx(BestellingenTab, { orders: ordersOnDay, isLoading: agenda.isLoading }) }), _jsx(TabsContent, { value: "karren", className: "mt-4", children: _jsx(KarrenTab, { carts: cartRows }) })] })] }), _jsx(ResponsiveDialogFooter, { children: _jsx(Button, { variant: "outline", onClick: () => onOpenChange(false), children: "Sluiten" }) })] }) }) }) }) }));
|
|
255
255
|
}
|
|
256
256
|
function BezettingCard({ date, cartsToday }) {
|
|
257
257
|
const queryClient = useQueryClient();
|
|
@@ -409,7 +409,7 @@ function meldPrintUitkomst(r) {
|
|
|
409
409
|
toast.error(`Er is niets in de Printwachtrij gezet. ${r.reasons[0] ?? ""}`.trim());
|
|
410
410
|
}
|
|
411
411
|
else if (r.failed > 0) {
|
|
412
|
-
toast.error(`${r.failed} document${r.failed === 1 ? "" : "en"} niet
|
|
412
|
+
toast.error(`${r.failed} document${r.failed === 1 ? "" : "en"} niet naar de printer gestuurd: ${r.reasons[0] ?? ""}`);
|
|
413
413
|
}
|
|
414
414
|
}
|
|
415
415
|
async function meldAchtergrond(r) {
|
|
@@ -638,11 +638,11 @@ function BufferGroup({ bufferId, orders: dayOrders }) {
|
|
|
638
638
|
}
|
|
639
639
|
}
|
|
640
640
|
if (ok > 0)
|
|
641
|
-
toast.success(`${ok} van ${refs.length} bestelling${refs.length === 1 ? "" : "en"} uit deze
|
|
641
|
+
toast.success(`${ok} van ${refs.length} bestelling${refs.length === 1 ? "" : "en"} uit deze gezamenlijke levering afgehandeld (verzonden).`);
|
|
642
642
|
if (failed.length > 0)
|
|
643
643
|
toast.error(`Niet afgehandeld: ${failed.join(" · ")}`);
|
|
644
644
|
if (ok === 0 && failed.length === 0)
|
|
645
|
-
toast.error("Er is niets afgehandeld:
|
|
645
|
+
toast.error("Er is niets afgehandeld: deze gezamenlijke levering heeft geen orders.");
|
|
646
646
|
for (const key of [
|
|
647
647
|
["logistics-pick-agenda"],
|
|
648
648
|
["engine"],
|
|
@@ -681,7 +681,7 @@ function BufferGroup({ bufferId, orders: dayOrders }) {
|
|
|
681
681
|
setPrinting(false);
|
|
682
682
|
}
|
|
683
683
|
};
|
|
684
|
-
return (_jsxs("div", { className: "rounded-lg border border-primary/40 bg-primary/5", children: [_jsxs("div", { className: "flex flex-col gap-3 p-3", children: [_jsxs("button", { type: "button", onClick: () => setOpen((o) => !o), className: "-m-1 flex items-start gap-3 rounded-md p-1 text-left hover:bg-primary/10", children: [open ? (_jsx(ChevronDown, { className: "mt-1 h-4 w-4 shrink-0" })) : (_jsx(ChevronRight, { className: "mt-1 h-4 w-4 shrink-0" })), _jsxs("div", { className: "min-w-0 flex-1 space-y-2", children: [_jsxs("div", { className: "flex flex-wrap items-center gap-2 text-sm", children: [_jsx(Badge, { variant: "secondary", children: "
|
|
684
|
+
return (_jsxs("div", { className: "rounded-lg border border-primary/40 bg-primary/5", children: [_jsxs("div", { className: "flex flex-col gap-3 p-3", children: [_jsxs("button", { type: "button", onClick: () => setOpen((o) => !o), className: "-m-1 flex items-start gap-3 rounded-md p-1 text-left hover:bg-primary/10", children: [open ? (_jsx(ChevronDown, { className: "mt-1 h-4 w-4 shrink-0" })) : (_jsx(ChevronRight, { className: "mt-1 h-4 w-4 shrink-0" })), _jsxs("div", { className: "min-w-0 flex-1 space-y-2", children: [_jsxs("div", { className: "flex flex-wrap items-center gap-2 text-sm", children: [_jsx(Badge, { variant: "secondary", children: "Gezamenlijke levering" }), _jsxs("span", { className: "font-medium", children: [orders.length, " bestellingen samen"] }), klant ? _jsx("span", { className: "text-xs text-muted-foreground", children: klant }) : null] }), _jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [_jsxs(Badge, { variant: "secondary", children: [carts, " ", carts === 1 ? "kar" : "karren", " vandaag"] }), bufCartIds.size > 0 && (_jsxs(Badge, { variant: bufferKlaar ? "default" : "outline", children: [scannedCount, " van ", bufCartIds.size, " ", bufCartIds.size === 1 ? "kar" : "karren", " gescand"] })), _jsx(Badge, { variant: alleAf ? "default" : "outline", children: alleAf ? "Gemeld bij Floriday" : (bufCartIds.size > 0 ? bufferKlaar : orders.every(engineKlaar)) ? "Klaar voor verzending" : orders.some(engineKlaar) ? "Deels gescand" : "Nog te picken" }), _jsx("span", { className: "text-xs text-muted-foreground", children: refs.join(", ") })] })] })] }), _jsxs("div", { className: "flex flex-wrap items-center gap-2 border-t pt-3", children: [_jsxs(Button, { size: "sm", variant: "outline", onClick: afhandelen, disabled: busy || alleAf, title: "Alle orders van deze gezamenlijke levering in \u00E9\u00E9n keer afhandelen", children: [_jsx(CheckCircle2, { className: "mr-1 h-3.5 w-3.5" }), alleAf ? "Afgehandeld" : busy ? "Bezig…" : "Hele levering afhandelen (verzonden)"] }), refs[0] && alleFloriday && !alleAf ? _jsx(NuVersturenButton, { orderRef: refs[0], label: "Belading versturen" }) : null, _jsxs(Button, { size: "sm", variant: "outline", onClick: printAlles, disabled: printing, title: "Alle pakbonnen van deze gezamenlijke levering afdrukken", children: [_jsx(Printer, { className: "mr-1 h-3.5 w-3.5" }), printing ? "In de Printwachtrij…" : "Documenten afdrukken"] }), _jsxs(Button, { size: "sm", variant: "outline", onClick: () => setVerzetOpen(true), title: "Alle orders van deze gezamenlijke levering verzetten", children: [_jsx(CalendarClock, { className: "mr-1 h-3.5 w-3.5" }), "Verzetten"] })] })] }), open && (_jsx("div", { className: "space-y-2 border-t border-primary/30 px-2 py-2", children: orders.map((o) => (_jsxs("div", { className: "space-y-1", children: [o.planned ? (_jsx(OrderRow, { planned: o.planned, cartsToday: o.carts, engineStatus: o.status })) : (_jsx(EngineOrderRow, { order: o })), _jsx(ZonderKarRegel, { order: o })] }, o.ref))) })), _jsx(BulkVerzetDialog, { open: verzetOpen, orders: verzetOrders, cartCount: carts, onOpenChange: setVerzetOpen, onDone: () => setVerzetOpen(false) })] }));
|
|
685
685
|
}
|
|
686
686
|
/** Bestelling die alleen de Engine kent; verdere ordergegevens ontbreken. */
|
|
687
687
|
/** Knop "Afhandelen (verzonden)" — zet de bestelling in de orderadministratie op Verzonden. */
|
|
@@ -734,7 +734,7 @@ function SignupFlagLabel({ orderId }) {
|
|
|
734
734
|
if (!flag)
|
|
735
735
|
return null;
|
|
736
736
|
if (flag === "floriday")
|
|
737
|
-
return _jsx("div", { className: "text-xs font-medium text-primary", children: "Afgehandeld
|
|
737
|
+
return _jsx("div", { className: "text-xs font-medium text-primary", children: "Afgehandeld (gekoppeld met Floriday)" });
|
|
738
738
|
return (_jsx("div", { className: "text-xs font-medium text-destructive", children: flag === "late" ? "Te laat aangemeld bij de vervoerder" : "Heeft nog geen karindeling en is nog niet aangemeld bij de vervoerder" }));
|
|
739
739
|
}
|
|
740
740
|
function OrderRow({ planned: p, cartsToday, engineStatus, }) {
|
|
@@ -982,7 +982,7 @@ function KarRow({ cart: c, cartTotal, selected, onToggle, }) {
|
|
|
982
982
|
setBezig(null);
|
|
983
983
|
}
|
|
984
984
|
};
|
|
985
|
-
return (_jsxs("div", { className: `rounded-md border p-3 ${selected ? "border-primary bg-primary/5" : ""}`, children: [_jsxs("div", { className: "flex items-start gap-3", children: [_jsx(Checkbox, { checked: selected, onCheckedChange: onToggle, className: "mt-1" }), _jsxs("div", { className: "grid flex-1 gap-3 lg:grid-cols-[1fr_1.4fr_1fr_auto] lg:items-center", children: [_jsx(Field, { label: "Karnummer", value: c.cartNumber }), _jsx(Field, { label: "Klant", value: c.customerName }), _jsx(Field, { label: "Bestelling", value: c.orderRef }), _jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [_jsx(Badge, { variant: voortgang(c.status).variant, children: voortgang(c.status).label }), c.coverageLabel && _jsx(Badge, { variant: "secondary", children: c.coverageLabel }), c.hasContent ? (_jsxs(_Fragment, { children: [c.shared && _jsx(Badge, { variant: "outline", children: "Gedeelde
|
|
985
|
+
return (_jsxs("div", { className: `rounded-md border p-3 ${selected ? "border-primary bg-primary/5" : ""}`, children: [_jsxs("div", { className: "flex items-start gap-3", children: [_jsx(Checkbox, { checked: selected, onCheckedChange: onToggle, className: "mt-1" }), _jsxs("div", { className: "grid flex-1 gap-3 lg:grid-cols-[1fr_1.4fr_1fr_auto] lg:items-center", children: [_jsx(Field, { label: "Karnummer", value: c.cartNumber }), _jsx(Field, { label: "Klant", value: c.customerName }), _jsx(Field, { label: "Bestelling", value: c.orderRef }), _jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [_jsx(Badge, { variant: voortgang(c.status).variant, children: voortgang(c.status).label }), c.coverageLabel && _jsx(Badge, { variant: "secondary", children: c.coverageLabel }), c.hasContent ? (_jsxs(_Fragment, { children: [c.shared && _jsx(Badge, { variant: "outline", children: "Gedeelde kar" }), c.karTekst ? (_jsx(Badge, { variant: "outline", children: c.karTekst })) : (_jsxs(_Fragment, { children: [_jsxs(Badge, { variant: "outline", children: [c.layers ?? "—", c.maxLayers != null ? ` / ${c.maxLayers}` : "", " lagen"] }), _jsx(Badge, { variant: "outline", children: c.platen == null ? "DC (platen onbekend)" : `DC + ${c.platen} ${c.platen === 1 ? "plaat" : "platen"}` }), _jsxs(Badge, { variant: "outline", children: [c.occupancy ?? "—", "%"] })] })), _jsxs(Badge, { variant: "outline", children: [c.crates ?? "—", " fusten"] }), _jsxs(Badge, { variant: "outline", children: [c.plants ?? "—", " planten"] })] })) : (_jsx(Badge, { variant: "outline", className: "text-muted-foreground", children: c.contentLoading ? "Karinhoud laden…" : c.coverageLabel ? "Geen kar in deze indeling" : "Nog geen karindeling" })), _jsxs(Button, { size: "sm", variant: "outline", disabled: bezig !== null, onClick: printPakbon, title: `Pakbon van deze kar opnieuw printen. ${AUTOMATISCH_DOCUMENT_TEKST}`, children: [_jsx(Printer, { className: "mr-1 h-3.5 w-3.5" }), bezig === "pakbon" ? "Bezig…" : "Pakbon"] }), _jsxs(Button, { size: "sm", variant: "outline", disabled: bezig !== null, onClick: printVerzendbrief, title: `Verzenddocument van deze bestelling printen. ${AUTOMATISCH_DOCUMENT_TEKST}`, children: [_jsx(Printer, { className: "mr-1 h-3.5 w-3.5" }), bezig === "brief" ? "Bezig…" : "Verzendbrief"] }), _jsxs(Button, { size: "sm", variant: "outline", onClick: () => setVerzetOpen(true), title: "Ophaaldag of ophaaltijd van de bestelling van deze kar wijzigen", children: [_jsx(CalendarClock, { className: "mr-1 h-3.5 w-3.5" }), "Verzetten"] })] })] })] }), _jsx(VerzetOrderDialog, { open: verzetOpen, orderRef: c.orderRef, carrierTarget: {
|
|
986
986
|
carrierId: c.order?.order.carrierId ?? null,
|
|
987
987
|
country: c.order?.order.country ?? null,
|
|
988
988
|
province: c.order?.order.province ?? null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LeveringenPage.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/LeveringenPage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LeveringenPage.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/LeveringenPage.tsx"],"names":[],"mappings":"AA0BA,wBAAgB,cAAc,gCA8D7B"}
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useAfhandelingDefaults } from "../../hooks/useAfhandelingDefaults.js";
|
|
3
3
|
import { useEffect, useMemo, useState } from "react";
|
|
4
4
|
import { Button } from "@flowselections/core";
|
|
5
|
+
import { CalendarDays, Package, ShoppingCart, AlertTriangle } from "lucide-react";
|
|
6
|
+
import { PageHeader } from "../fs-ui/PageHeader.js";
|
|
7
|
+
import { KpiRow } from "../fs-ui/KpiRow.js";
|
|
8
|
+
import { KpiTile } from "../fs-ui/KpiTile.js";
|
|
9
|
+
import { InlineAlert } from "../fs-ui/InlineAlert.js";
|
|
10
|
+
import { isExcludedOrderStatus, isFulfilledOrderStatus } from "../../lib/orderStatus.js";
|
|
5
11
|
import { WeekAgendaView } from "./WeekAgendaView.js";
|
|
6
12
|
import { DagDetailDialog } from "./DagDetailDialog.js";
|
|
7
13
|
import { useOrderPlanning } from "../../hooks/useOrderPlanning.js";
|
|
@@ -34,5 +40,10 @@ export function LeveringenPage() {
|
|
|
34
40
|
setHighlightOrderId(orderId);
|
|
35
41
|
}
|
|
36
42
|
}, []);
|
|
37
|
-
|
|
43
|
+
const actief = planned.filter((p) => !isExcludedOrderStatus(p.order.status));
|
|
44
|
+
const karren = actief.reduce((n, p) => n + (p.order.cartCount ?? 0), 0);
|
|
45
|
+
const open = actief.filter((p) => !isFulfilledOrderStatus(p.order.status)).length;
|
|
46
|
+
const zonderPlanning = actief.filter((p) => p.state !== "planned").length;
|
|
47
|
+
const today = new Date();
|
|
48
|
+
return (_jsxs("main", { className: "flex flex-col gap-4 p-4 pb-24 sm:p-6 sm:pb-24", children: [_jsx(PageHeader, { title: "Leveringen", description: "Planning van de orders per leverdag. Klik op een dag voor de details." }), _jsxs(KpiRow, { children: [_jsx(KpiTile, { title: "Orders deze week", icon: _jsx(ShoppingCart, {}), loading: isLoading, value: actief.length, sub: "in de getoonde week" }), _jsx(KpiTile, { title: "Karren", icon: _jsx(Package, {}), loading: isLoading, value: karren, sub: "volgens de orders" }), _jsx(KpiTile, { title: "Nog af te handelen", icon: _jsx(CalendarDays, {}), loading: isLoading, value: open, sub: "klik voor vandaag", onClick: () => { setHighlightOrderId(null); setDayDetailDate(today); } }), _jsx(KpiTile, { title: "Nog niet gepland", icon: _jsx(AlertTriangle, {}), loading: isLoading, value: zonderPlanning, tone: zonderPlanning ? "warning" : "default", sub: zonderPlanning ? _jsx("span", { className: "text-destructive", children: "wacht op karindeling" }) : "alles ingepland" })] }), warning && !error && (_jsxs(InlineAlert, { tone: "warning", children: [warning, " De beschikbare orders blijven zichtbaar."] })), error ? (_jsx(InlineAlert, { tone: "error", title: "De planning kon niet worden geladen", action: _jsx(Button, { size: "sm", variant: "outline", onClick: () => refetch(), children: "Opnieuw proberen" }), children: error })) : (_jsx(WeekAgendaView, { planned: planned, mode: "delivery", isLoading: isLoading, onWeekChange: setWeekStart, onDayClick: (d) => { setHighlightOrderId(null); setDayDetailDate(d); }, jumpToDate: linkDay ?? nearestDeliveryDate })), _jsx(DagDetailDialog, { open: !!dayDetailDate, date: dayDetailDate, planned: planned, basis: "lever", highlightOrderId: highlightOrderId, onOpenChange: (o) => !o && setDayDetailDate(null) })] }));
|
|
38
49
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PickingPage.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/PickingPage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PickingPage.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/PickingPage.tsx"],"names":[],"mappings":"AAIA,wBAAgB,WAAW,gCAY1B"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { PageHeader } from "../fs-ui/PageHeader.js";
|
|
2
3
|
import { useAfhandelingDefaults } from "../../hooks/useAfhandelingDefaults.js";
|
|
3
4
|
import { PickAgendaView } from "./PickAgendaView.js";
|
|
4
5
|
export function PickingPage() {
|
|
5
6
|
useAfhandelingDefaults();
|
|
6
|
-
return (_jsxs("main", { className: "flex h-full flex-col gap-
|
|
7
|
+
return (_jsxs("main", { className: "flex h-full flex-col gap-4 overflow-hidden p-4 sm:p-6", children: [_jsx("div", { className: "shrink-0", children: _jsx(PageHeader, { title: "Picken", description: "Overzicht van alle orders die gepickt moeten worden." }) }), _jsx("div", { className: "min-h-0 flex-1", children: _jsx(PickAgendaView, {}) })] }));
|
|
7
8
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlanningAgendaPage.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/PlanningAgendaPage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PlanningAgendaPage.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/PlanningAgendaPage.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAkB,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGvE,UAAU,KAAK;IACb,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,cAAc,CAAC;CACtB;AAED,wBAAgB,kBAAkB,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,EAAE,KAAK,+BAWrE"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { PageHeader } from "../fs-ui/PageHeader.js";
|
|
3
|
+
import { InlineAlert } from "../fs-ui/InlineAlert.js";
|
|
2
4
|
import { useAfhandelingDefaults } from "../../hooks/useAfhandelingDefaults.js";
|
|
3
5
|
import { WeekAgendaView } from "./WeekAgendaView.js";
|
|
4
6
|
import { useOrderPlanning } from "../../hooks/useOrderPlanning.js";
|
|
5
7
|
export function PlanningAgendaPage({ title, description, mode }) {
|
|
6
8
|
useAfhandelingDefaults();
|
|
7
9
|
const { planned, isLoading, error, warning } = useOrderPlanning();
|
|
8
|
-
return (_jsxs("main", { className: "p-
|
|
10
|
+
return (_jsxs("main", { className: "flex flex-col gap-4 p-4 pb-24 sm:p-6 sm:pb-24", children: [_jsx(PageHeader, { title: title, description: description }), error && _jsx(InlineAlert, { tone: "error", children: error }), warning && !error && _jsxs(InlineAlert, { tone: "warning", children: [warning, " De beschikbare orders blijven zichtbaar."] }), _jsx(WeekAgendaView, { planned: planned, mode: mode, isLoading: isLoading })] }));
|
|
9
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VervoerdersPage.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/VervoerdersPage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"VervoerdersPage.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/VervoerdersPage.tsx"],"names":[],"mappings":"AA8CA;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,KAAK,GAAE;IAAE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAA;CAAO,+BAM3G"}
|
|
@@ -1,10 +1,23 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useAfhandelingDefaults } from "../../hooks/useAfhandelingDefaults.js";
|
|
3
|
-
import { useState } from "react";
|
|
4
|
-
import { Button,
|
|
5
|
-
import {
|
|
3
|
+
import { useRef, useState } from "react";
|
|
4
|
+
import { Button, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogDescription, AlertDialogTitle, toast, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, } from "@flowselections/core";
|
|
5
|
+
import { PageHeader } from "../fs-ui/PageHeader.js";
|
|
6
|
+
import { UpdatedAt } from "../fs-ui/UpdatedAt.js";
|
|
7
|
+
import { KpiRow } from "../fs-ui/KpiRow.js";
|
|
8
|
+
import { KpiTile } from "../fs-ui/KpiTile.js";
|
|
9
|
+
import { Toolbar } from "../fs-ui/Toolbar.js";
|
|
10
|
+
import { SearchInput } from "../fs-ui/SearchInput.js";
|
|
11
|
+
import { DataTable } from "../fs-ui/DataTable.js";
|
|
12
|
+
import { EmptyState } from "../fs-ui/EmptyState.js";
|
|
13
|
+
import { InlineAlert } from "../fs-ui/InlineAlert.js";
|
|
14
|
+
import { TableSkeleton } from "../fs-ui/TableSkeleton.js";
|
|
15
|
+
import { MobilePrimaryAction } from "../fs-ui/MobilePrimaryAction.js";
|
|
16
|
+
import { useShortcuts } from "../fs-ui/useShortcuts.js";
|
|
17
|
+
import { ShortcutHelp, Kbd } from "../fs-ui/ShortcutHelp.js";
|
|
18
|
+
import { Plus, Pencil, Archive, Truck, ArrowUp, ArrowDown, Star, AlertTriangle, Check, X, Mail, MoreHorizontal } from "lucide-react";
|
|
6
19
|
import { ResponsiveAlertDialogBody, ResponsiveAlertDialogContent, ResponsiveAlertDialogFooter, ResponsiveAlertDialogHeader, } from "../ui/responsive-dialog.js";
|
|
7
|
-
import { Link } from "@tanstack/react-router";
|
|
20
|
+
import { Link, useNavigate } from "@tanstack/react-router";
|
|
8
21
|
import { useServerFn } from "@tanstack/react-start";
|
|
9
22
|
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
10
23
|
import { toServerFnError } from "../../lib/serverFnError.js";
|
|
@@ -35,8 +48,13 @@ function VervoerdersLijst() {
|
|
|
35
48
|
const access = useQuery({ queryKey: ["carriers", "access"], queryFn: () => fetchAccess() });
|
|
36
49
|
const canManage = access.data?.canManage === true;
|
|
37
50
|
const [deletingId, setDeletingId] = useState(null);
|
|
51
|
+
const [search, setSearch] = useState("");
|
|
52
|
+
const [sel, setSel] = useState(null);
|
|
53
|
+
const [help, setHelp] = useState(false);
|
|
54
|
+
const searchRef = useRef(null);
|
|
55
|
+
const navigate = useNavigate();
|
|
38
56
|
const ensureDefaults = useServerFn(ensureCarrierDefaults);
|
|
39
|
-
const { data, isLoading, error, refetch } = useQuery({
|
|
57
|
+
const { data, isLoading, isFetching, dataUpdatedAt, error, refetch } = useQuery({
|
|
40
58
|
queryKey: ["carriers"],
|
|
41
59
|
queryFn: async () => {
|
|
42
60
|
try {
|
|
@@ -87,7 +105,46 @@ function VervoerdersLijst() {
|
|
|
87
105
|
[ids[index], ids[target]] = [ids[target], ids[index]];
|
|
88
106
|
reorderMutation.mutate(ids);
|
|
89
107
|
};
|
|
90
|
-
|
|
108
|
+
const q = search.trim().toLowerCase();
|
|
109
|
+
const shown = q ? carriers.filter((c) => `${c.name} ${c.email ?? ""}`.toLowerCase().includes(q)) : carriers;
|
|
110
|
+
const favorite = carriers.find((c) => c.is_favorite);
|
|
111
|
+
const notReady = carriers.filter((c) => carrierReadiness(c).warnings.length > 0).length;
|
|
112
|
+
const withMail = carriers.filter((c) => !!c.email).length;
|
|
113
|
+
const goNew = () => navigate({ to: "/afhandeling/vervoerders/nieuw" });
|
|
114
|
+
useShortcuts({
|
|
115
|
+
onNew: goNew,
|
|
116
|
+
onSearch: () => searchRef.current?.focus(),
|
|
117
|
+
onNext: () => setSel((i) => Math.min((i ?? -1) + 1, shown.length - 1)),
|
|
118
|
+
onPrev: () => setSel((i) => Math.max((i ?? 1) - 1, 0)),
|
|
119
|
+
onOpen: () => { const c = sel != null ? shown[sel] : null; if (c)
|
|
120
|
+
navigate({ to: "/afhandeling/vervoerders/$carrierId", params: { carrierId: c.id } }); },
|
|
121
|
+
onEscape: () => { if (search)
|
|
122
|
+
setSearch("");
|
|
123
|
+
else
|
|
124
|
+
setSel(null); },
|
|
125
|
+
onHelp: () => setHelp(true),
|
|
126
|
+
});
|
|
127
|
+
const columns = [
|
|
128
|
+
{
|
|
129
|
+
key: "prio", header: "Prioriteit", width: "8.5rem",
|
|
130
|
+
cell: (c) => {
|
|
131
|
+
const index = carriers.indexOf(c);
|
|
132
|
+
return (_jsxs("div", { className: "flex items-center gap-1", onClick: (e) => e.stopPropagation(), children: [_jsx("span", { className: "w-6 text-sm font-medium tabular-nums text-muted-foreground", children: index + 1 }), _jsx(Button, { variant: "ghost", size: "sm", className: "h-8 w-8 p-0", onClick: () => move(index, -1), disabled: !!q || index === 0 || reorderMutation.isPending, "aria-label": "Hoger", children: _jsx(ArrowUp, { className: "h-4 w-4" }) }), _jsx(Button, { variant: "ghost", size: "sm", className: "h-8 w-8 p-0", onClick: () => move(index, 1), disabled: !!q || index === carriers.length - 1 || reorderMutation.isPending, "aria-label": "Lager", children: _jsx(ArrowDown, { className: "h-4 w-4" }) })] }));
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
key: "name", header: "Bedrijfsnaam", width: "26%",
|
|
137
|
+
cell: (c) => (_jsxs("div", { className: "flex min-w-0 items-center gap-3", children: [_jsx("span", { className: "inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-primary/10 text-xs font-semibold text-primary", "aria-hidden": true, children: c.name.split(/\s+/).map((w) => w[0]).join("").slice(0, 2).toUpperCase() }), _jsxs("div", { className: "min-w-0", children: [_jsxs("div", { className: "flex items-center gap-1 truncate font-medium", children: [c.name, c.is_favorite && _jsx(Star, { className: "h-4 w-4 shrink-0 fill-primary text-primary", "aria-label": "Favoriet" })] }), _jsx("div", { className: "truncate text-xs text-muted-foreground", children: c.email ?? "geen e-mail" })] })] })),
|
|
138
|
+
},
|
|
139
|
+
{ key: "kind", header: "Soort", width: "12%", cell: (c) => c.carrier_kind ? CARRIER_KIND_LABEL[c.carrier_kind] : _jsx("span", { className: "text-destructive", children: "Nog niet gekozen" }) },
|
|
140
|
+
{ key: "ready", header: "Gereed", width: "30%", cell: (c) => _jsx(ReadinessCell, { carrier: c }) },
|
|
141
|
+
{ key: "lead", header: "Levertijd", width: "10%", cell: (c) => _jsxs("span", { className: "tabular-nums", children: [carrierLeadDaysFromMoments(c.pickup_moments), " werkdagen"] }) },
|
|
142
|
+
{
|
|
143
|
+
key: "acties", header: _jsx("span", { className: "sr-only", children: "Acties" }), width: "4rem",
|
|
144
|
+
cell: (c) => (_jsx("div", { onClick: (e) => e.stopPropagation(), children: _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(Button, { variant: "ghost", size: "sm", className: "h-8 w-8 p-0", "aria-label": `Acties voor ${c.name}`, children: _jsx(MoreHorizontal, { className: "h-4 w-4" }) }) }), _jsxs(DropdownMenuContent, { align: "end", children: [_jsx(DropdownMenuItem, { asChild: true, children: _jsxs(Link, { to: "/afhandeling/vervoerders/$carrierId", params: { carrierId: c.id }, children: [_jsx(Pencil, { className: "mr-2 h-4 w-4" }), " Bewerken"] }) }), !c.is_favorite && canManage && carrierReadiness(c).canBeFavorite && (_jsxs(DropdownMenuItem, { disabled: favoriteMutation.isPending, onSelect: () => favoriteMutation.mutate(c.id), children: [_jsx(Star, { className: "mr-2 h-4 w-4" }), " Maak favoriet"] })), _jsxs(DropdownMenuItem, { disabled: !canManage || c.is_favorite, onSelect: () => setDeletingId(c.id), className: "text-destructive focus:text-destructive", children: [_jsx(Archive, { className: "mr-2 h-4 w-4" }), " ", c.is_favorite ? "Archiveren (kies eerst een andere favoriet)" : "Archiveren"] })] })] }) })),
|
|
145
|
+
},
|
|
146
|
+
];
|
|
147
|
+
return (_jsxs("div", { className: "flex flex-col gap-4 p-4 pb-24 sm:p-6 sm:pb-24", children: [_jsx(PageHeader, { title: "Vervoerders", description: "Beheer vervoerders, hun werkgebied en ophaalmomenten.", updatedAt: _jsx(UpdatedAt, { at: dataUpdatedAt || null, refreshing: isFetching && !isLoading }), actions: _jsx(Button, { asChild: true, className: "hidden h-9 md:inline-flex", children: _jsxs(Link, { to: "/afhandeling/vervoerders/nieuw", children: [_jsx(Plus, { className: "mr-1 h-4 w-4" }), "Vervoerder toevoegen", _jsx(Kbd, { children: "N" })] }) }) }), _jsxs(KpiRow, { children: [_jsx(KpiTile, { title: "Vervoerders", icon: _jsx(Truck, {}), loading: isLoading, value: carriers.length, sub: "actief in de lijst" }), _jsx(KpiTile, { title: "Favoriet", icon: _jsx(Star, {}), loading: isLoading, value: _jsx("span", { className: "block truncate text-lg", children: favorite?.name ?? "Niet gekozen" }), sub: "eerste keuze bij plannen", tone: favorite ? "default" : "warning" }), _jsx(KpiTile, { title: "Met e-mailadres", icon: _jsx(Mail, {}), loading: isLoading, value: withMail, sub: "kunnen een aanmeldmail krijgen" }), _jsx(KpiTile, { title: "Nog niet gereed", icon: _jsx(AlertTriangle, {}), loading: isLoading, value: notReady, sub: notReady ? _jsx("span", { className: "text-destructive", children: "vul de ontbrekende gegevens aan" }) : "alles compleet", tone: notReady ? "warning" : "default" })] }), access.data && access.data.managersCount === 0 && (_jsx(InlineAlert, { tone: "error", children: "Niemand mag vervoerders beheren; vraag een beheerder om een rol." })), access.data && access.data.managersCount > 0 && !canManage && (_jsx(InlineAlert, { tone: "info", children: "Je kunt de vervoerders bekijken. Wijzigen kan alleen met de rol beheerder, manager of planner." })), !isLoading && !error && !hasFavorite && carriers.length > 0 && (_jsx(InlineAlert, { tone: "warning", title: "Kies een favoriete vervoerder", children: "Open het menu bij een vervoerder en kies \"Maak favoriet\"." })), _jsxs(Toolbar, { children: [_jsx(SearchInput, { ref: searchRef, value: search, onChange: setSearch, placeholder: "Zoek vervoerder" }), q && _jsx("span", { className: "text-xs text-muted-foreground", children: "Volgorde wijzigen kan als het zoekveld leeg is." })] }), isLoading ? (_jsx(TableSkeleton, { columns: 6, rows: 5 })) : error ? (_jsx(InlineAlert, { tone: "error", title: "De vervoerders konden niet worden geladen", action: _jsx(Button, { variant: "outline", size: "sm", onClick: () => refetch(), children: "Opnieuw proberen" }), children: "Lukt het niet, probeer het later opnieuw." })) : carriers.length === 0 ? (_jsx("div", { className: "rounded-xl border border-border bg-card shadow-sm", children: _jsx(EmptyState, { icon: _jsx(Truck, { className: "h-7 w-7" }), title: "Nog geen vervoerders", text: "Voeg een vervoerder toe om orders te kunnen plannen.", action: _jsx(Button, { asChild: true, children: _jsxs(Link, { to: "/afhandeling/vervoerders/nieuw", children: [_jsx(Plus, { className: "mr-1 h-4 w-4" }), "Vervoerder toevoegen"] }) }) }) })) : shown.length === 0 ? (_jsx("div", { className: "rounded-xl border border-border bg-card shadow-sm", children: _jsx(EmptyState, { icon: _jsx(Truck, { className: "h-7 w-7" }), title: "Geen vervoerder gevonden", text: "Pas je zoekopdracht aan.", action: _jsx(Button, { variant: "outline", onClick: () => setSearch(""), children: "Zoekopdracht wissen" }) }) })) : (_jsx(DataTable, { ariaLabel: "Vervoerders", columns: columns, rows: shown, rowKey: (c) => c.id, selectedIndex: sel, onRowClick: (c, i) => { setSel(i); navigate({ to: "/afhandeling/vervoerders/$carrierId", params: { carrierId: c.id } }); } })), _jsx(MobilePrimaryAction, { children: _jsx(Button, { asChild: true, children: _jsxs(Link, { to: "/afhandeling/vervoerders/nieuw", children: [_jsx(Plus, { className: "mr-1 h-4 w-4" }), "Vervoerder toevoegen"] }) }) }), _jsx(ShortcutHelp, { open: help, onOpenChange: setHelp }), _jsx(AlertDialog, { open: !!deletingId, onOpenChange: (o) => !o && setDeletingId(null), children: _jsxs(ResponsiveAlertDialogContent, { size: "sm", children: [_jsx(ResponsiveAlertDialogHeader, { children: _jsx(AlertDialogTitle, { children: "Vervoerder archiveren?" }) }), _jsx(ResponsiveAlertDialogBody, { children: _jsx(AlertDialogDescription, { children: "De vervoerder verdwijnt uit de lijst en wordt niet meer gekozen. Er wordt niets verwijderd." }) }), _jsxs(ResponsiveAlertDialogFooter, { children: [_jsx(AlertDialogCancel, { children: "Annuleren" }), _jsx(AlertDialogAction, { onClick: () => deletingId && deleteMutation.mutate(deletingId), className: "bg-destructive text-destructive-foreground hover:bg-destructive/90", children: "Archiveren" })] })] }) })] }));
|
|
91
148
|
}
|
|
92
149
|
function ReadinessCell({ carrier }) {
|
|
93
150
|
const r = carrierReadiness(carrier);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export interface DataColumn<T> {
|
|
3
|
+
key: string;
|
|
4
|
+
header: ReactNode;
|
|
5
|
+
/** Vaste breedte (bv. "12rem" of "20%"). */
|
|
6
|
+
width?: string;
|
|
7
|
+
cell: (row: T, index: number) => ReactNode;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Tabel in één afgerond vlak: kop blijft zichtbaar, alles links, rij 60 px,
|
|
11
|
+
* hover lichtgrijs, geselecteerde rij met groene streep links. Minimaal 900 px
|
|
12
|
+
* breed, scrolt horizontaal op smalle schermen.
|
|
13
|
+
*/
|
|
14
|
+
export declare function DataTable<T>({ columns, rows, rowKey, selectedIndex, onRowClick, footer, ariaLabel, }: {
|
|
15
|
+
columns: DataColumn<T>[];
|
|
16
|
+
rows: T[];
|
|
17
|
+
rowKey: (row: T) => string;
|
|
18
|
+
selectedIndex?: number | null;
|
|
19
|
+
onRowClick?: (row: T, index: number) => void;
|
|
20
|
+
footer?: ReactNode;
|
|
21
|
+
ariaLabel?: string;
|
|
22
|
+
}): import("react").JSX.Element;
|
|
23
|
+
//# sourceMappingURL=DataTable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataTable.d.ts","sourceRoot":"","sources":["../../../src/components/fs-ui/DataTable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,UAAU,CAAC,CAAC;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,SAAS,CAAC;IAClB,4CAA4C;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,SAAS,CAAC;CAC5C;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,EAC3B,OAAO,EACP,IAAI,EACJ,MAAM,EACN,aAAa,EACb,UAAU,EACV,MAAM,EACN,SAAS,GACV,EAAE;IACD,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;IACzB,IAAI,EAAE,CAAC,EAAE,CAAC;IACV,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,MAAM,CAAC;IAC3B,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,+BAgDA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Tabel in één afgerond vlak: kop blijft zichtbaar, alles links, rij 60 px,
|
|
4
|
+
* hover lichtgrijs, geselecteerde rij met groene streep links. Minimaal 900 px
|
|
5
|
+
* breed, scrolt horizontaal op smalle schermen.
|
|
6
|
+
*/
|
|
7
|
+
export function DataTable({ columns, rows, rowKey, selectedIndex, onRowClick, footer, ariaLabel, }) {
|
|
8
|
+
return (_jsxs("div", { className: "overflow-hidden rounded-xl border border-border bg-card shadow-sm", children: [_jsx("div", { className: "max-h-[70vh] overflow-auto", children: _jsxs("table", { className: "w-full min-w-[900px] table-fixed border-collapse text-left text-sm", "aria-label": ariaLabel, children: [_jsx("colgroup", { children: columns.map((c) => (_jsx("col", { style: c.width ? { width: c.width } : undefined }, c.key))) }), _jsx("thead", { className: "sticky top-0 z-10 bg-card", children: _jsx("tr", { className: "h-10 border-b border-border", children: columns.map((c) => (_jsx("th", { scope: "col", className: "px-4 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground", children: c.header }, c.key))) }) }), _jsx("tbody", { children: rows.map((r, i) => {
|
|
9
|
+
const selected = selectedIndex === i;
|
|
10
|
+
return (_jsx("tr", { "data-selected": selected || undefined, "aria-selected": selected || undefined, onClick: onRowClick ? () => onRowClick(r, i) : undefined, className: "group h-[60px] border-b border-border transition-colors duration-150 ease-out last:border-0 hover:bg-muted/50 motion-reduce:transition-none " +
|
|
11
|
+
(onRowClick ? "cursor-pointer " : "") +
|
|
12
|
+
(selected ? "bg-muted/40 shadow-[inset_3px_0_0_var(--color-primary)]" : ""), children: columns.map((c) => (_jsx("td", { className: "truncate px-4 align-middle text-foreground", children: c.cell(r, i) }, c.key))) }, rowKey(r)));
|
|
13
|
+
}) })] }) }), footer && _jsx("div", { className: "border-t border-border px-4 py-2", children: footer })] }));
|
|
14
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
/** Lege toestand: groot zacht icoon, korte zin, één actie. */
|
|
3
|
+
export declare function EmptyState({ icon, title, text, action, }: {
|
|
4
|
+
icon: ReactNode;
|
|
5
|
+
title: string;
|
|
6
|
+
text?: string;
|
|
7
|
+
action?: ReactNode;
|
|
8
|
+
}): import("react").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=EmptyState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmptyState.d.ts","sourceRoot":"","sources":["../../../src/components/fs-ui/EmptyState.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,8DAA8D;AAC9D,wBAAgB,UAAU,CAAC,EACzB,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,MAAM,GACP,EAAE;IACD,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,SAAS,CAAC;CACpB,+BAaA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/** Lege toestand: groot zacht icoon, korte zin, één actie. */
|
|
3
|
+
export function EmptyState({ icon, title, text, action, }) {
|
|
4
|
+
return (_jsxs("div", { className: "flex flex-col items-center gap-3 px-4 py-14 text-center", children: [_jsx("span", { className: "inline-flex h-14 w-14 items-center justify-center rounded-full bg-muted text-muted-foreground", "aria-hidden": true, children: icon }), _jsxs("div", { children: [_jsx("div", { className: "text-sm font-semibold text-foreground", children: title }), text && _jsx("div", { className: "mt-1 max-w-sm text-sm text-muted-foreground", children: text })] }), action] }));
|
|
5
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export interface FilterChip {
|
|
3
|
+
key: string;
|
|
4
|
+
label: string;
|
|
5
|
+
icon?: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
/** Actieve filters als ronde chips met icoon en kruisje. */
|
|
8
|
+
export declare function FilterChips({ chips, onRemove }: {
|
|
9
|
+
chips: FilterChip[];
|
|
10
|
+
onRemove: (key: string) => void;
|
|
11
|
+
}): import("react").JSX.Element | null;
|
|
12
|
+
//# sourceMappingURL=FilterChips.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterChips.d.ts","sourceRoot":"","sources":["../../../src/components/fs-ui/FilterChips.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAED,4DAA4D;AAC5D,wBAAgB,WAAW,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE;IAAE,KAAK,EAAE,UAAU,EAAE,CAAC;IAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAA;CAAE,sCAoBxG"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { X } from "lucide-react";
|
|
3
|
+
/** Actieve filters als ronde chips met icoon en kruisje. */
|
|
4
|
+
export function FilterChips({ chips, onRemove }) {
|
|
5
|
+
if (chips.length === 0)
|
|
6
|
+
return null;
|
|
7
|
+
return (_jsx("div", { className: "flex flex-wrap items-center gap-2", children: chips.map((c) => (_jsxs("span", { className: "inline-flex h-8 items-center gap-1.5 rounded-full border border-primary/30 bg-primary/10 pl-3 pr-1 text-xs font-medium text-primary [&_svg]:h-3.5 [&_svg]:w-3.5", children: [c.icon, c.label, _jsx("button", { type: "button", "aria-label": `Filter ${c.label} weghalen`, onClick: () => onRemove(c.key), className: "inline-flex h-6 w-6 items-center justify-center rounded-full hover:bg-primary/15 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", children: _jsx(X, {}) })] }, c.key))) }));
|
|
8
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Tooltip op basis van Popover (core heeft geen Tooltip-export): opent bij
|
|
4
|
+
* aanwijzen én bij toetsenbordfocus, sluit met Esc of bij verlaten. De
|
|
5
|
+
* trigger is een knop met een toegankelijke naam.
|
|
6
|
+
*/
|
|
7
|
+
export declare function HoverTip({ content, label, children, side, align, className, }: {
|
|
8
|
+
align?: "start" | "center" | "end";
|
|
9
|
+
content: ReactNode;
|
|
10
|
+
label: string;
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
side?: "top" | "bottom" | "left" | "right";
|
|
13
|
+
className?: string;
|
|
14
|
+
}): import("react").JSX.Element;
|
|
15
|
+
//# sourceMappingURL=HoverTip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HoverTip.d.ts","sourceRoot":"","sources":["../../../src/components/fs-ui/HoverTip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGzD;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,EACvB,OAAO,EACP,KAAK,EACL,QAAQ,EACR,IAAY,EACZ,KAAgB,EAChB,SAAc,GACf,EAAE;IACD,KAAK,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;IACnC,OAAO,EAAE,SAAS,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,SAAS,CAAC;IACpB,IAAI,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,+BA4CA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useState } from "react";
|
|
3
|
+
import { Popover, PopoverContent, PopoverTrigger } from "@flowselections/core";
|
|
4
|
+
/**
|
|
5
|
+
* Tooltip op basis van Popover (core heeft geen Tooltip-export): opent bij
|
|
6
|
+
* aanwijzen én bij toetsenbordfocus, sluit met Esc of bij verlaten. De
|
|
7
|
+
* trigger is een knop met een toegankelijke naam.
|
|
8
|
+
*/
|
|
9
|
+
export function HoverTip({ content, label, children, side = "top", align = "center", className = "", }) {
|
|
10
|
+
const [open, setOpen] = useState(false);
|
|
11
|
+
const timer = useRef(null);
|
|
12
|
+
const show = () => {
|
|
13
|
+
if (timer.current)
|
|
14
|
+
clearTimeout(timer.current);
|
|
15
|
+
setOpen(true);
|
|
16
|
+
};
|
|
17
|
+
const hide = () => {
|
|
18
|
+
if (timer.current)
|
|
19
|
+
clearTimeout(timer.current);
|
|
20
|
+
timer.current = setTimeout(() => setOpen(false), 80);
|
|
21
|
+
};
|
|
22
|
+
return (_jsxs(Popover, { open: open, onOpenChange: setOpen, children: [_jsx(PopoverTrigger, { type: "button", "aria-label": label, onPointerEnter: show, onPointerLeave: hide, onFocus: show, onBlur: hide, onClick: (e) => e.stopPropagation(), className: "inline-flex shrink-0 items-center justify-center rounded-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring " +
|
|
23
|
+
className, children: children }), _jsx(PopoverContent, { side: side, align: align, avoidCollisions: true, collisionPadding: 8, onOpenAutoFocus: (e) => e.preventDefault(), onCloseAutoFocus: (e) => e.preventDefault(), onPointerEnter: show, onPointerLeave: hide, onClick: (e) => e.stopPropagation(), className: "w-auto min-w-[14rem] max-w-[20rem] rounded-lg p-3 text-xs leading-snug shadow-lg motion-reduce:animate-none", children: content })] }));
|
|
24
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
/** Melding: zacht rood/oker/neutraal vlak, icoon links, actie rechts, optioneel ingeklapte details. */
|
|
3
|
+
export declare function InlineAlert({ tone, title, children, action, details, }: {
|
|
4
|
+
tone?: "warning" | "error" | "info";
|
|
5
|
+
title?: string;
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
action?: ReactNode;
|
|
8
|
+
/** Alleen tonen aan beheerders; ingeklapt onder "Details". */
|
|
9
|
+
details?: ReactNode;
|
|
10
|
+
}): import("react").JSX.Element;
|
|
11
|
+
//# sourceMappingURL=InlineAlert.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InlineAlert.d.ts","sourceRoot":"","sources":["../../../src/components/fs-ui/InlineAlert.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGjD,uGAAuG;AACvG,wBAAgB,WAAW,CAAC,EAC1B,IAAgB,EAChB,KAAK,EACL,QAAQ,EACR,MAAM,EACN,OAAO,GACR,EAAE;IACD,IAAI,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,8DAA8D;IAC9D,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB,+BA4BA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { AlertTriangle, Info, XCircle } from "lucide-react";
|
|
4
|
+
/** Melding: zacht rood/oker/neutraal vlak, icoon links, actie rechts, optioneel ingeklapte details. */
|
|
5
|
+
export function InlineAlert({ tone = "warning", title, children, action, details, }) {
|
|
6
|
+
const [open, setOpen] = useState(false);
|
|
7
|
+
const Icon = tone === "error" ? XCircle : tone === "info" ? Info : AlertTriangle;
|
|
8
|
+
const box = tone === "error"
|
|
9
|
+
? "border-destructive/30 bg-destructive/5"
|
|
10
|
+
: tone === "info"
|
|
11
|
+
? "border-border bg-muted/50"
|
|
12
|
+
: "border-warning/30 bg-warning-soft";
|
|
13
|
+
const ic = tone === "error" ? "text-destructive" : tone === "info" ? "text-muted-foreground" : "text-warning-soft-foreground";
|
|
14
|
+
return (_jsxs("div", { role: tone === "error" ? "alert" : "status", className: "flex flex-wrap items-start gap-3 rounded-lg border p-3 text-sm text-foreground " + box, children: [_jsx(Icon, { className: "mt-0.5 h-4 w-4 shrink-0 " + ic, "aria-hidden": true }), _jsxs("div", { className: "min-w-0 flex-1", children: [title && _jsx("div", { className: "font-medium", children: title }), children && _jsx("div", { className: title ? "mt-0.5 text-muted-foreground" : "", children: children }), details && (_jsxs("div", { className: "mt-1", children: [_jsx("button", { type: "button", className: "text-xs text-muted-foreground underline-offset-2 hover:underline", onClick: () => setOpen((o) => !o), children: open ? "Details verbergen" : "Details" }), open && _jsx("div", { className: "mt-1 break-words text-xs text-muted-foreground", children: details })] }))] }), action && _jsx("div", { className: "shrink-0", children: action })] }));
|
|
15
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
/** 4 tegels naast elkaar; mobiel een veegbare rij (snap per tegel, ~78% breed). */
|
|
3
|
+
export declare function KpiRow({ children }: {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
}): import("react").JSX.Element;
|
|
6
|
+
//# sourceMappingURL=KpiRow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KpiRow.d.ts","sourceRoot":"","sources":["../../../src/components/fs-ui/KpiRow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,mFAAmF;AACnF,wBAAgB,MAAM,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,+BAM3D"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/** 4 tegels naast elkaar; mobiel een veegbare rij (snap per tegel, ~78% breed). */
|
|
3
|
+
export function KpiRow({ children }) {
|
|
4
|
+
return (_jsx("div", { className: "-mx-4 flex snap-x snap-mandatory gap-3 overflow-x-auto px-4 pb-1 sm:mx-0 sm:grid sm:grid-cols-2 sm:overflow-visible sm:px-0 lg:grid-cols-4 [&>*]:w-[78%] [&>*]:shrink-0 [&>*]:snap-start sm:[&>*]:w-auto", children: children }));
|
|
5
|
+
}
|