@flowselections/floriday-afhandeling-module 1.0.99 → 1.0.102
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/AutoProcessStatus.d.ts.map +1 -1
- package/dist-lib/components/afhandeling/AutoProcessStatus.js +3 -2
- package/dist-lib/components/afhandeling/AutoSendStatus.d.ts.map +1 -1
- package/dist-lib/components/afhandeling/AutoSendStatus.js +4 -5
- package/dist-lib/components/afhandeling/CapacityWarning.js +1 -1
- package/dist-lib/components/afhandeling/ControlePage.d.ts.map +1 -1
- package/dist-lib/components/afhandeling/ControlePage.js +66 -45
- package/dist-lib/components/afhandeling/DagDetailDialog.d.ts.map +1 -1
- package/dist-lib/components/afhandeling/DagDetailDialog.js +33 -17
- package/dist-lib/components/afhandeling/LeveringenPage.d.ts.map +1 -1
- package/dist-lib/components/afhandeling/LeveringenPage.js +115 -5
- package/dist-lib/components/afhandeling/NuVersturenButton.d.ts +1 -0
- package/dist-lib/components/afhandeling/NuVersturenButton.d.ts.map +1 -1
- package/dist-lib/components/afhandeling/NuVersturenButton.js +3 -7
- package/dist-lib/components/afhandeling/PickAgendaView.d.ts +7 -1
- package/dist-lib/components/afhandeling/PickAgendaView.d.ts.map +1 -1
- package/dist-lib/components/afhandeling/PickAgendaView.js +39 -22
- package/dist-lib/components/afhandeling/PickingPage.d.ts.map +1 -1
- package/dist-lib/components/afhandeling/PickingPage.js +4 -2
- package/dist-lib/components/afhandeling/PlanningAgendaPage.d.ts +2 -0
- package/dist-lib/components/afhandeling/PlanningAgendaPage.d.ts.map +1 -1
- package/dist-lib/components/afhandeling/PlanningAgendaPage.js +16 -2
- package/dist-lib/components/afhandeling/ScanControleView.d.ts.map +1 -1
- package/dist-lib/components/afhandeling/ScanControleView.js +2 -1
- package/dist-lib/components/afhandeling/ServiceAreaSelect.js +2 -2
- package/dist-lib/components/afhandeling/VervoerdersPage.d.ts.map +1 -1
- package/dist-lib/components/afhandeling/VervoerdersPage.js +116 -9
- package/dist-lib/components/afhandeling/VerzetOrderDialog.d.ts.map +1 -1
- package/dist-lib/components/afhandeling/VerzetOrderDialog.js +2 -1
- package/dist-lib/components/afhandeling/WeekAgendaView.d.ts +21 -1
- package/dist-lib/components/afhandeling/WeekAgendaView.d.ts.map +1 -1
- package/dist-lib/components/afhandeling/WeekAgendaView.js +39 -30
- package/dist-lib/components/fs-ui/DataTable.d.ts +45 -0
- package/dist-lib/components/fs-ui/DataTable.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/DataTable.js +39 -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 +19 -0
- package/dist-lib/components/fs-ui/FilterChips.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/FilterChips.js +12 -0
- package/dist-lib/components/fs-ui/FilterPanel.d.ts +19 -0
- package/dist-lib/components/fs-ui/FilterPanel.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/FilterPanel.js +14 -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 +17 -0
- package/dist-lib/components/fs-ui/InlineAlert.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/InlineAlert.js +27 -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 +15 -0
- package/dist-lib/components/fs-ui/PageHeader.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/PageHeader.js +9 -0
- package/dist-lib/components/fs-ui/PeriodPicker.d.ts +10 -0
- package/dist-lib/components/fs-ui/PeriodPicker.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/PeriodPicker.js +7 -0
- package/dist-lib/components/fs-ui/PillTabs.d.ts +17 -0
- package/dist-lib/components/fs-ui/PillTabs.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/PillTabs.js +28 -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 +28 -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 +12 -0
- package/dist-lib/components/fs-ui/Toolbar.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/Toolbar.js +11 -0
- package/dist-lib/components/fs-ui/UpdatedAt.d.ts +11 -0
- package/dist-lib/components/fs-ui/UpdatedAt.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/UpdatedAt.js +14 -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/components/settings/AutomatischVersturenCard.d.ts +6 -0
- package/dist-lib/components/settings/AutomatischVersturenCard.d.ts.map +1 -0
- package/dist-lib/components/settings/AutomatischVersturenCard.js +54 -0
- package/dist-lib/hooks/useOrderPlanning.d.ts +1 -0
- package/dist-lib/hooks/useOrderPlanning.d.ts.map +1 -1
- package/dist-lib/hooks/useOrderPlanning.js +2 -0
- package/dist-lib/integrations/supabase/types.d.ts +833 -1
- package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
- package/dist-lib/lib/cartControl.functions.js +1 -1
- package/dist-lib/lib/dateLabels.d.ts +9 -0
- package/dist-lib/lib/dateLabels.d.ts.map +1 -0
- package/dist-lib/lib/dateLabels.js +45 -0
- package/dist-lib/lib/floridayAutoProcess.js +2 -2
- package/dist-lib/lib/floridayLoading.functions.js +5 -5
- package/dist-lib/lib/labels.d.ts +80 -0
- package/dist-lib/lib/labels.d.ts.map +1 -0
- package/dist-lib/lib/labels.js +87 -0
- package/dist-lib/lib/labels.test.d.ts +2 -0
- package/dist-lib/lib/labels.test.d.ts.map +1 -0
- package/dist-lib/lib/labels.test.js +21 -0
- package/dist-lib/lib/signupMailText.js +1 -1
- package/dist-lib/moduleDefinition.d.ts.map +1 -1
- package/dist-lib/moduleDefinition.js +2 -0
- package/package.json +1 -1
|
@@ -1,15 +1,32 @@
|
|
|
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, FiltersButton } from "../fs-ui/Toolbar.js";
|
|
10
|
+
import { FilterChips } from "../fs-ui/FilterChips.js";
|
|
11
|
+
import { FilterPanel, FilterOptions } from "../fs-ui/FilterPanel.js";
|
|
12
|
+
import { label } from "../../lib/labels.js";
|
|
13
|
+
import { SearchInput } from "../fs-ui/SearchInput.js";
|
|
14
|
+
import { DataTable, Cell2 } from "../fs-ui/DataTable.js";
|
|
15
|
+
import { StatusIcon } from "../fs-ui/StatusIcon.js";
|
|
16
|
+
import { EmptyState } from "../fs-ui/EmptyState.js";
|
|
17
|
+
import { InlineAlert, NoticeStack } from "../fs-ui/InlineAlert.js";
|
|
18
|
+
import { TableSkeleton } from "../fs-ui/TableSkeleton.js";
|
|
19
|
+
import { MobilePrimaryAction } from "../fs-ui/MobilePrimaryAction.js";
|
|
20
|
+
import { useShortcuts } from "../fs-ui/useShortcuts.js";
|
|
21
|
+
import { ShortcutHelp } from "../fs-ui/ShortcutHelp.js";
|
|
22
|
+
import { Plus, Pencil, Archive, Truck, ArrowUp, ArrowDown, Star, AlertTriangle, Mail, MoreVertical } from "lucide-react";
|
|
6
23
|
import { ResponsiveAlertDialogBody, ResponsiveAlertDialogContent, ResponsiveAlertDialogFooter, ResponsiveAlertDialogHeader, } from "../ui/responsive-dialog.js";
|
|
7
|
-
import { Link } from "@tanstack/react-router";
|
|
24
|
+
import { Link, useNavigate } from "@tanstack/react-router";
|
|
8
25
|
import { useServerFn } from "@tanstack/react-start";
|
|
9
26
|
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
10
27
|
import { toServerFnError } from "../../lib/serverFnError.js";
|
|
11
28
|
import { listCarriers, deleteCarrier, reorderCarriers, setFavoriteCarrier, getCarrierAccess, ensureCarrierDefaults } from "../../lib/carriers.functions.js";
|
|
12
|
-
import { carrierReadiness
|
|
29
|
+
import { carrierReadiness } from "../../lib/carrierReadiness.js";
|
|
13
30
|
import { carrierLeadDaysFromMoments } from "../../lib/carrierPlanning.js";
|
|
14
31
|
import { VervoerderForm } from "./VervoerderForm.js";
|
|
15
32
|
import { resolveCarrierId } from "./VervoerderBewerkenPage.js";
|
|
@@ -35,8 +52,17 @@ function VervoerdersLijst() {
|
|
|
35
52
|
const access = useQuery({ queryKey: ["carriers", "access"], queryFn: () => fetchAccess() });
|
|
36
53
|
const canManage = access.data?.canManage === true;
|
|
37
54
|
const [deletingId, setDeletingId] = useState(null);
|
|
55
|
+
const [search, setSearch] = useState("");
|
|
56
|
+
const [sel, setSel] = useState(null);
|
|
57
|
+
const [help, setHelp] = useState(false);
|
|
58
|
+
const [filtersOpen, setFiltersOpen] = useState(false);
|
|
59
|
+
const [fKind, setFKind] = useState(null);
|
|
60
|
+
const [fReady, setFReady] = useState(null);
|
|
61
|
+
const [fMail, setFMail] = useState(null);
|
|
62
|
+
const searchRef = useRef(null);
|
|
63
|
+
const navigate = useNavigate();
|
|
38
64
|
const ensureDefaults = useServerFn(ensureCarrierDefaults);
|
|
39
|
-
const { data, isLoading, error, refetch } = useQuery({
|
|
65
|
+
const { data, isLoading, isFetching, dataUpdatedAt, error, refetch } = useQuery({
|
|
40
66
|
queryKey: ["carriers"],
|
|
41
67
|
queryFn: async () => {
|
|
42
68
|
try {
|
|
@@ -87,10 +113,91 @@ function VervoerdersLijst() {
|
|
|
87
113
|
[ids[index], ids[target]] = [ids[target], ids[index]];
|
|
88
114
|
reorderMutation.mutate(ids);
|
|
89
115
|
};
|
|
90
|
-
|
|
116
|
+
const q = search.trim().toLowerCase();
|
|
117
|
+
const filtering = !!q || !!fKind || !!fReady || !!fMail;
|
|
118
|
+
const shown = carriers.filter((c) => {
|
|
119
|
+
if (q && !`${c.name} ${c.email ?? ""}`.toLowerCase().includes(q))
|
|
120
|
+
return false;
|
|
121
|
+
if (fKind && (fKind === "geen" ? !!c.carrier_kind : c.carrier_kind !== fKind))
|
|
122
|
+
return false;
|
|
123
|
+
if (fReady) {
|
|
124
|
+
const ok = carrierReadiness(c).warnings.length === 0;
|
|
125
|
+
if ((fReady === "compleet") !== ok)
|
|
126
|
+
return false;
|
|
127
|
+
}
|
|
128
|
+
if (fMail && (fMail === "met") !== !!c.email)
|
|
129
|
+
return false;
|
|
130
|
+
return true;
|
|
131
|
+
});
|
|
132
|
+
const KIND_OPTS = [
|
|
133
|
+
{ value: "extern", label: label("carrierKind", "extern") },
|
|
134
|
+
{ value: "eigen_vervoer", label: label("carrierKind", "eigen_vervoer") },
|
|
135
|
+
{ value: "klant_haalt_op", label: label("carrierKind", "klant_haalt_op") },
|
|
136
|
+
{ value: "geen", label: "Nog niet gekozen" },
|
|
137
|
+
];
|
|
138
|
+
const chips = [
|
|
139
|
+
fKind && { key: "kind", label: KIND_OPTS.find((o) => o.value === fKind).label },
|
|
140
|
+
fReady && { key: "ready", label: fReady === "compleet" ? "Compleet" : "Nog niet gereed" },
|
|
141
|
+
fMail && { key: "mail", label: fMail === "met" ? "Met e-mailadres" : "Zonder e-mailadres" },
|
|
142
|
+
].filter(Boolean);
|
|
143
|
+
const removeChip = (k) => { if (k === "kind")
|
|
144
|
+
setFKind(null); if (k === "ready")
|
|
145
|
+
setFReady(null); if (k === "mail")
|
|
146
|
+
setFMail(null); };
|
|
147
|
+
const clearFilters = () => { setFKind(null); setFReady(null); setFMail(null); };
|
|
148
|
+
const favorite = carriers.find((c) => c.is_favorite);
|
|
149
|
+
const notReady = carriers.filter((c) => carrierReadiness(c).warnings.length > 0).length;
|
|
150
|
+
const withMail = carriers.filter((c) => !!c.email).length;
|
|
151
|
+
const goNew = () => navigate({ to: "/afhandeling/vervoerders/nieuw" });
|
|
152
|
+
useShortcuts({
|
|
153
|
+
onNew: goNew,
|
|
154
|
+
onSearch: () => searchRef.current?.focus(),
|
|
155
|
+
onNext: () => setSel((i) => Math.min((i ?? -1) + 1, shown.length - 1)),
|
|
156
|
+
onPrev: () => setSel((i) => Math.max((i ?? 1) - 1, 0)),
|
|
157
|
+
onOpen: () => { const c = sel != null ? shown[sel] : null; if (c)
|
|
158
|
+
navigate({ to: "/afhandeling/vervoerders/$carrierId", params: { carrierId: c.id } }); },
|
|
159
|
+
onEscape: () => { if (search)
|
|
160
|
+
setSearch("");
|
|
161
|
+
else
|
|
162
|
+
setSel(null); },
|
|
163
|
+
onHelp: () => setHelp(true),
|
|
164
|
+
});
|
|
165
|
+
const columns = [
|
|
166
|
+
{
|
|
167
|
+
key: "prio", header: "Prioriteit", width: 112,
|
|
168
|
+
cell: (c) => {
|
|
169
|
+
const index = carriers.indexOf(c);
|
|
170
|
+
return (_jsxs("div", { className: "flex items-center gap-1", onClick: (e) => e.stopPropagation(), children: [_jsx("span", { className: "w-6 text-sm tabular-nums text-foreground", children: index + 1 }), _jsx(Button, { variant: "ghost", size: "sm", className: "h-8 w-8 p-0", onClick: () => move(index, -1), disabled: filtering || 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: filtering || index === carriers.length - 1 || reorderMutation.isPending, "aria-label": "Lager", children: _jsx(ArrowDown, { className: "h-4 w-4" }) })] }));
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
key: "name", header: "Bedrijfsnaam", width: undefined,
|
|
175
|
+
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 text-sm font-medium", title: c.name, 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" })] })] })),
|
|
176
|
+
},
|
|
177
|
+
{ key: "kind", header: "Soort", width: 140, cell: (c) => c.carrier_kind ? label("carrierKind", c.carrier_kind) : _jsx("span", { className: "text-destructive", children: "Nog niet gekozen" }) },
|
|
178
|
+
{ key: "ready", header: "Gereed", width: 280, cell: (c) => _jsx(ReadinessCell, { carrier: c }) },
|
|
179
|
+
{ key: "lead", header: "Levertijd", width: 120, cell: (c) => _jsxs("span", { className: "tabular-nums", children: [carrierLeadDaysFromMoments(c.pickup_moments), " werkdagen"] }) },
|
|
180
|
+
{
|
|
181
|
+
key: "acties", header: _jsx("span", { className: "sr-only", children: "Acties" }), width: 56,
|
|
182
|
+
cell: (c) => (_jsx("div", { onClick: (e) => e.stopPropagation(), children: _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { "aria-label": `Acties voor ${c.name}`, onClick: (e) => e.stopPropagation(), className: "inline-flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", children: _jsx(MoreVertical, { 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"] })] })] }) })),
|
|
183
|
+
},
|
|
184
|
+
];
|
|
185
|
+
return (_jsxs("main", { className: "flex w-full min-w-0 flex-col gap-4 overflow-x-clip p-4 pb-[calc(7rem+env(safe-area-inset-bottom))] sm:p-6 sm:pb-24", children: [_jsx(PageHeader, { title: "Vervoerders", updatedAt: _jsx(UpdatedAt, { at: dataUpdatedAt || null, info: "Beheer vervoerders, hun werkgebied en ophaalmomenten." }), actions: _jsx(Button, { asChild: true, size: "sm", className: "hidden sm:inline-flex", children: _jsxs(Link, { to: "/afhandeling/vervoerders/nieuw", children: [_jsx(Plus, { className: "mr-2 h-4 w-4" }), "Vervoerder toevoegen", _jsx("kbd", { "aria-hidden": true, className: "ml-2 hidden rounded border border-primary-foreground/30 bg-primary-foreground/15 px-1.5 font-mono text-[10px] leading-4 text-primary-foreground sm:inline-block", children: "N" })] }) }) }), _jsx(NoticeStack, { children: [
|
|
186
|
+
access.data && access.data.managersCount === 0 ? _jsx(InlineAlert, { tone: "error", children: "Niemand mag vervoerders beheren; vraag een beheerder om een rol." }, "a") : null,
|
|
187
|
+
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." }, "b") : null,
|
|
188
|
+
!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\"." }, "c") : null,
|
|
189
|
+
] }), _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 ? "vul de ontbrekende gegevens aan" : "alles compleet", tone: notReady ? "warning" : "default" })] }), _jsxs(Toolbar, { children: [_jsx(SearchInput, { ref: searchRef, value: search, onChange: setSearch, placeholder: "Zoek vervoerder" }), _jsx(FiltersButton, { count: chips.length, onClick: () => setFiltersOpen(true) }), _jsx(FilterChips, { chips: chips, onRemove: removeChip, onClearAll: clearFilters }), filtering && _jsx("span", { className: "hidden text-xs text-muted-foreground lg:inline", children: "Volgorde wijzigen kan zonder zoeken of filters." })] }), _jsxs(FilterPanel, { open: filtersOpen, onOpenChange: setFiltersOpen, onClear: chips.length ? clearFilters : undefined, children: [_jsx(FilterOptions, { title: "Soort", value: fKind, options: KIND_OPTS.map((o) => ({ ...o })), onChange: setFKind }), _jsx(FilterOptions, { title: "Gegevens", value: fReady, options: [{ value: "compleet", label: "Compleet" }, { value: "niet", label: "Nog niet gereed" }], onChange: setFReady }), _jsx(FilterOptions, { title: "E-mailadres", value: fMail, options: [{ value: "met", label: "Met e-mailadres" }, { value: "zonder", label: "Zonder e-mailadres" }], onChange: setFMail })] }), 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", { 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", { children: _jsx(EmptyState, { icon: _jsx(Truck, { className: "h-7 w-7" }), title: "Geen vervoerder gevonden", text: "Pas je zoekopdracht of filters aan.", action: _jsx(Button, { variant: "outline", onClick: () => { setSearch(""); clearFilters(); }, children: "Alles 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
190
|
}
|
|
92
191
|
function ReadinessCell({ carrier }) {
|
|
93
192
|
const r = carrierReadiness(carrier);
|
|
94
|
-
const
|
|
95
|
-
|
|
193
|
+
const missing = [
|
|
194
|
+
!r.hasEmail && "e-mail",
|
|
195
|
+
!r.hasArea && "werkgebied",
|
|
196
|
+
!r.hasLocations && "afleverlocaties",
|
|
197
|
+
!r.hasMoment && "ophaalmoment",
|
|
198
|
+
].filter(Boolean);
|
|
199
|
+
const ok = missing.length === 0 && r.warnings.length === 0;
|
|
200
|
+
const main = ok ? "Compleet" : missing.length ? `Mist ${missing.join(", ")}` : "Let op";
|
|
201
|
+
const sub = r.warnings.join(" ");
|
|
202
|
+
return (_jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [_jsx(StatusIcon, { tone: ok ? "done" : "error", label: ok ? "Alle gegevens zijn ingevuld" : [main, sub].filter(Boolean).join(". ") }), _jsx(Cell2, { main: main, sub: sub || undefined })] }));
|
|
96
203
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VerzetOrderDialog.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/VerzetOrderDialog.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"VerzetOrderDialog.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/VerzetOrderDialog.tsx"],"names":[],"mappings":"AA8CA,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,qFAAqF;IACrF,aAAa,CAAC,EAAE;QACd,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAC1B,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QACxB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QACzB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KACtB,CAAC;IACF,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CACvC;AAmBD,wBAAgB,iBAAiB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,aAAa,EAAE,YAAY,EAAE,EAAE,sBAAsB,+BAkWxG"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useMemo, useState } from "react";
|
|
3
|
+
import { fmtDayTime } from "../../lib/dateLabels.js";
|
|
3
4
|
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
|
4
5
|
import { useServerFn } from "@tanstack/react-start";
|
|
5
6
|
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, Badge, Button, Dialog, DialogTitle, DialogDescription, Input, Label, Textarea, toast, } from "@flowselections/core";
|
|
@@ -199,5 +200,5 @@ export function VerzetOrderDialog({ open, orderRef, carrierTarget, onOpenChange
|
|
|
199
200
|
setPickupFrom(m.signup_time);
|
|
200
201
|
setPickupTo(m.signup_time);
|
|
201
202
|
}, children: [m.signup_time, _jsxs("span", { className: "ml-1 text-xs opacity-70", children: ["(", m.signup_days, " wd vooraf \u00B7 ophalen ", m.pickup_time, ")"] })] }, `${m.signup_time}-${i}`));
|
|
202
|
-
}) }), _jsx("p", { className: "text-xs text-muted-foreground", children: "Kies een aanmeldtijd van deze vervoerder." })] }))] }), preview?.current && (_jsxs("p", { className: "text-xs text-muted-foreground", children: ["Huidig aanmeldmoment: ", fmtDate(preview.current.pickupDate), " ", preview.current.pickupFrom ?? "—", "\u2013", preview.current.pickupTo ?? "—", " \u00B7 leverdatum ", fmtDate(preview.current.deliveryDate)] })), loadingPreview && _jsx("p", { className: "text-sm text-muted-foreground", children: "Voorvertoning ophalen\u2026" }), preview && preview.ok === false && (_jsx("div", { className: "rounded-md border border-destructive/30 bg-destructive/5 p-3 text-sm text-destructive", children: preview.error ?? "Deze wijziging kan nu niet worden verwerkt." })), preview && preview.ok !== false && (_jsxs("div", { className: "rounded-md border bg-muted/40 p-3 text-sm space-y-2", children: [_jsx("p", { children: summary }), _jsxs("p", { className: "text-xs text-muted-foreground", children: [preview.affectedTasks ?? 0, " taken worden opnieuw ingepland."] }), preview.planLocked && (_jsx(Badge, { variant: "outline", children: "Deze order ligt vast en kan nu niet worden verzet." }))] })), needsCustomerChoice && (_jsxs("div", { className: "space-y-1 rounded-md border p-3", children: [_jsx(Label, { children: "Reden voor de klantmelding (optioneel)" }), _jsx(Textarea, { value: reason, onChange: (e) => setReason(e.target.value), maxLength: 500, placeholder: "Bijv. Aanvoer bloemen vertraagd" })] })), history.length > 0 && (_jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-xs font-medium text-muted-foreground", children: "Verzetgeschiedenis" }), _jsx("ul", { className: "space-y-1 text-xs text-muted-foreground", children: history.map((h) => (_jsxs("li", { children: [
|
|
203
|
+
}) }), _jsx("p", { className: "text-xs text-muted-foreground", children: "Kies een aanmeldtijd van deze vervoerder." })] }))] }), preview?.current && (_jsxs("p", { className: "text-xs text-muted-foreground", children: ["Huidig aanmeldmoment: ", fmtDate(preview.current.pickupDate), " ", preview.current.pickupFrom ?? "—", "\u2013", preview.current.pickupTo ?? "—", " \u00B7 leverdatum ", fmtDate(preview.current.deliveryDate)] })), loadingPreview && _jsx("p", { className: "text-sm text-muted-foreground", children: "Voorvertoning ophalen\u2026" }), preview && preview.ok === false && (_jsx("div", { className: "rounded-md border border-destructive/30 bg-destructive/5 p-3 text-sm text-destructive", children: preview.error ?? "Deze wijziging kan nu niet worden verwerkt." })), preview && preview.ok !== false && (_jsxs("div", { className: "rounded-md border bg-muted/40 p-3 text-sm space-y-2", children: [_jsx("p", { children: summary }), _jsxs("p", { className: "text-xs text-muted-foreground", children: [preview.affectedTasks ?? 0, " taken worden opnieuw ingepland."] }), preview.planLocked && (_jsx(Badge, { variant: "outline", children: "Deze order ligt vast en kan nu niet worden verzet." }))] })), needsCustomerChoice && (_jsxs("div", { className: "space-y-1 rounded-md border p-3", children: [_jsx(Label, { children: "Reden voor de klantmelding (optioneel)" }), _jsx(Textarea, { value: reason, onChange: (e) => setReason(e.target.value), maxLength: 500, placeholder: "Bijv. Aanvoer bloemen vertraagd" })] })), history.length > 0 && (_jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-xs font-medium text-muted-foreground", children: "Verzetgeschiedenis" }), _jsx("ul", { className: "space-y-1 text-xs text-muted-foreground", children: history.map((h) => (_jsxs("li", { children: [fmtDayTime(h.created_at), " \u2014", " ", String(h.direction ?? ""), " ", String(h.reason ?? "")] }, h.id))) })] }))] }), _jsxs(ResponsiveDialogFooter, { children: [_jsx(Button, { variant: "outline", onClick: () => onOpenChange(false), children: "Annuleren" }), _jsx(Button, { onClick: handleVerzetten, disabled: saving || loadingPreview || (!pickDayChanged && (!transportChanged || blocked)), children: saving ? "Opslaan…" : "Verzetten" })] })] }), _jsx(AlertDialog, { open: confirmOpen, onOpenChange: setConfirmOpen, children: _jsxs(AlertDialogContent, { children: [_jsxs(AlertDialogHeader, { children: [_jsx(AlertDialogTitle, { children: "Klant informeren?" }), _jsx(AlertDialogDescription, { children: "De leverdatum is gewijzigd naar een latere datum. Wilt u de klant hierover informeren?" })] }), _jsxs(AlertDialogFooter, { children: [_jsx(AlertDialogCancel, { onClick: () => void submit(false), children: "Nee" }), _jsx(AlertDialogAction, { onClick: () => void submit(true), children: "Ja" })] })] }) })] }));
|
|
203
204
|
}
|
|
@@ -13,5 +13,25 @@ export interface WeekAgendaViewProps {
|
|
|
13
13
|
/** Dichtstbijzijnde datum met data buiten de zichtbare week (auto-jump). */
|
|
14
14
|
jumpToDate?: string | null;
|
|
15
15
|
}
|
|
16
|
-
export
|
|
16
|
+
export type OrderBucket = "afgehandeld" | "niet_afgemeld" | "verzendklaar" | "voorbereiding" | "uit";
|
|
17
|
+
/** Eén indeling per order. Floriday herkend op Floriday-id; afmeldstand uit de order. */
|
|
18
|
+
export declare function classify(o: FloridayOrder, scanned: boolean): OrderBucket;
|
|
19
|
+
export type AgendaStatusFilter = "alle" | "voorbereiding" | "verzendklaar" | "afgehandeld";
|
|
20
|
+
export interface AgendaTotals {
|
|
21
|
+
leveringen: number;
|
|
22
|
+
verzendklaar: number;
|
|
23
|
+
voorbereiding: number;
|
|
24
|
+
totaalStuks: number;
|
|
25
|
+
afgehandeld: number;
|
|
26
|
+
nietAfgemeld: number;
|
|
27
|
+
karren: number;
|
|
28
|
+
}
|
|
29
|
+
export declare function WeekAgendaView({ planned, mode, isLoading, onOrderClick, onDayClick, title, onWeekChange, jumpToDate, weekStart: controlledWeekStart, onJump, statusFilter, onTotals, }: WeekAgendaViewProps & {
|
|
30
|
+
/** Gestuurd vanuit de pagina (periodekiezer in de kop). */
|
|
31
|
+
weekStart?: Date;
|
|
32
|
+
/** Bij gestuurde week: vraag de pagina naar een andere week te springen. */
|
|
33
|
+
onJump?: (weekStart: Date) => void;
|
|
34
|
+
statusFilter?: AgendaStatusFilter;
|
|
35
|
+
onTotals?: (t: AgendaTotals) => void;
|
|
36
|
+
}): import("react").JSX.Element;
|
|
17
37
|
//# sourceMappingURL=WeekAgendaView.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WeekAgendaView.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/WeekAgendaView.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WeekAgendaView.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/WeekAgendaView.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAElE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAOjE,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG,QAAQ,GAAG,oBAAoB,GAAG,MAAM,CAAC;AAEnF,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,IAAI,EAAE,cAAc,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAC9C,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yEAAyE;IACzE,YAAY,CAAC,EAAE,CAAC,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,KAAK,IAAI,CAAC;IACxD,4EAA4E;IAC5E,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AA6BD,MAAM,MAAM,WAAW,GAAG,aAAa,GAAG,eAAe,GAAG,cAAc,GAAG,eAAe,GAAG,KAAK,CAAC;AAIrG,yFAAyF;AACzF,wBAAgB,QAAQ,CAAC,CAAC,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,GAAG,WAAW,CAQxE;AAgDD,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,eAAe,GAAG,cAAc,GAAG,aAAa,CAAC;AAE3F,MAAM,WAAW,YAAY;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,cAAc,CAAC,EAC7B,OAAO,EACP,IAAI,EACJ,SAAS,EACT,YAAY,EACZ,UAAU,EACV,KAAK,EACL,YAAY,EACZ,UAAU,EACV,SAAS,EAAE,mBAAmB,EAC9B,MAAM,EACN,YAAqB,EACrB,QAAQ,GACT,EAAE,mBAAmB,GAAG;IACvB,2DAA2D;IAC3D,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,4EAA4E;IAC5E,MAAM,CAAC,EAAE,CAAC,SAAS,EAAE,IAAI,KAAK,IAAI,CAAC;IACnC,YAAY,CAAC,EAAE,kBAAkB,CAAC;IAClC,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,YAAY,KAAK,IAAI,CAAC;CACtC,+BA+LA"}
|
|
@@ -3,18 +3,20 @@ import { useEffect, useMemo, useRef, useState } from "react";
|
|
|
3
3
|
import { useQuery } from "@tanstack/react-query";
|
|
4
4
|
import { supabase } from "../../integrations/supabase/moduleClient.js";
|
|
5
5
|
import { isExcludedOrderStatus, normalizeOrderStatus } from "../../lib/orderStatus.js";
|
|
6
|
-
import { Button,
|
|
7
|
-
import {
|
|
6
|
+
import { Button, Skeleton } from "@flowselections/core";
|
|
7
|
+
import { Truck, Sprout, ShoppingCart, CalendarDays } from "lucide-react";
|
|
8
|
+
import { PeriodPicker } from "../fs-ui/PeriodPicker.js";
|
|
9
|
+
import { StatusIcon } from "../fs-ui/StatusIcon.js";
|
|
10
|
+
import { EmptyState } from "../fs-ui/EmptyState.js";
|
|
8
11
|
import { isSameDay, startOfWeek, addDays } from "../../lib/pickDate.js";
|
|
9
12
|
import { useCapacityCheck } from "../../hooks/useCapacityCheck.js";
|
|
10
13
|
import { usePickAgenda } from "../../hooks/usePickAgenda.js";
|
|
11
|
-
import { useConsistencyCheck } from "../../hooks/useConsistencyCheck.js";
|
|
12
14
|
import { CapacityWarning } from "./CapacityWarning.js";
|
|
13
15
|
import { SignupMailMoments } from "./SignupMailMoments.js";
|
|
14
16
|
import { toDayKey } from "../../lib/logisticsEngine/capacity.js";
|
|
15
17
|
const SHIPPED = new Set(["verzonden", "gereed voor facturatie", "gefactureerd", "geleverd", "afgeleverd", "afgerond", "afgehandeld", "afgemeld", "shipped", "delivered", "completed", "invoiced"]);
|
|
16
18
|
/** Eén indeling per order. Floriday herkend op Floriday-id; afmeldstand uit de order. */
|
|
17
|
-
function classify(o, scanned) {
|
|
19
|
+
export function classify(o, scanned) {
|
|
18
20
|
if (/annul|cancel/i.test(o.status ?? "") || isExcludedOrderStatus(o.status))
|
|
19
21
|
return "uit";
|
|
20
22
|
if (SHIPPED.has(normalizeOrderStatus(o.status))) {
|
|
@@ -26,7 +28,6 @@ function classify(o, scanned) {
|
|
|
26
28
|
return "verzendklaar";
|
|
27
29
|
return "voorbereiding";
|
|
28
30
|
}
|
|
29
|
-
const WEEKDAY_LABELS = ["MAANDAG", "DINSDAG", "WOENSDAG", "DONDERDAG", "VRIJDAG", "ZATERDAG", "ZONDAG"];
|
|
30
31
|
const MONTHS_NL_SHORT = ["jan", "feb", "mrt", "apr", "mei", "jun", "jul", "aug", "sep", "okt", "nov", "dec"];
|
|
31
32
|
function isOrderReady(o) {
|
|
32
33
|
const s = (o.status ?? "").toLowerCase();
|
|
@@ -66,24 +67,20 @@ function dateForPlanned(p, mode) {
|
|
|
66
67
|
case "pick": return p.planning.scheduledPickDate ?? p.planning.pickStartDate;
|
|
67
68
|
}
|
|
68
69
|
}
|
|
69
|
-
|
|
70
|
-
delivery: { summary: "Leveringen deze week" },
|
|
71
|
-
pickup: { summary: "Ophalingen deze week" },
|
|
72
|
-
"transport-register": { summary: "Aanmeldingen deze week" },
|
|
73
|
-
pick: { summary: "Te picken deze week" },
|
|
74
|
-
};
|
|
75
|
-
export function WeekAgendaView({ planned, mode, isLoading, onOrderClick, onDayClick, title, onWeekChange, jumpToDate, }) {
|
|
70
|
+
export function WeekAgendaView({ planned, mode, isLoading, onOrderClick, onDayClick, title, onWeekChange, jumpToDate, weekStart: controlledWeekStart, onJump, statusFilter = "alle", onTotals, }) {
|
|
76
71
|
const [cursor, setCursor] = useState(() => {
|
|
77
72
|
const d = new Date();
|
|
78
73
|
d.setHours(0, 0, 0, 0);
|
|
79
74
|
return startOfWeek(d);
|
|
80
75
|
});
|
|
81
|
-
const
|
|
76
|
+
const controlled = !!controlledWeekStart;
|
|
77
|
+
const weekStart = useMemo(() => startOfWeek(controlledWeekStart ?? cursor), [controlledWeekStart, cursor]);
|
|
82
78
|
const weekEnd = useMemo(() => addDays(weekStart, 6), [weekStart]);
|
|
83
79
|
const weekNumber = useMemo(() => getISOWeek(weekStart), [weekStart]);
|
|
84
80
|
// Meld de zichtbare week zodat de pagina alleen die periode ophaalt.
|
|
85
81
|
useEffect(() => {
|
|
86
|
-
|
|
82
|
+
if (!controlled)
|
|
83
|
+
onWeekChange?.(weekStart, weekEnd);
|
|
87
84
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
88
85
|
}, [weekStart.getTime()]);
|
|
89
86
|
// Is de week leeg maar bestaat er wél data elders, spring dan éénmalig naar
|
|
@@ -100,8 +97,11 @@ export function WeekAgendaView({ planned, mode, isLoading, onOrderClick, onDayCl
|
|
|
100
97
|
if (Number.isNaN(target.getTime()))
|
|
101
98
|
return;
|
|
102
99
|
jumpedToRef.current = jumpToDate;
|
|
103
|
-
|
|
104
|
-
|
|
100
|
+
if (controlled)
|
|
101
|
+
onJump?.(startOfWeek(target));
|
|
102
|
+
else
|
|
103
|
+
setCursor(startOfWeek(target));
|
|
104
|
+
}, [jumpToDate, planned.length, isLoading, mode, controlled, onJump]);
|
|
105
105
|
// Pickagenda komt volledig uit de Engine-RPC; deze module rekent zelf geen
|
|
106
106
|
// pickdagen meer uit en doet geen datum-, werkdagen- of tijdzonelogica.
|
|
107
107
|
const pickAgenda = usePickAgenda(mode === "pick" ? toDayKey(weekStart) : null, mode === "pick" ? toDayKey(weekEnd) : null);
|
|
@@ -194,11 +194,15 @@ export function WeekAgendaView({ planned, mode, isLoading, onOrderClick, onDayCl
|
|
|
194
194
|
const totaalStuks = days.reduce((s, d) => s + d.planten, 0);
|
|
195
195
|
const afgehandeld = days.reduce((s, d) => s + d.afgehandeld, 0);
|
|
196
196
|
const nietAfgemeld = days.reduce((s, d) => s + d.nietAfgemeld, 0);
|
|
197
|
-
|
|
197
|
+
const karren = days.reduce((s, d) => s + d.karren, 0);
|
|
198
|
+
return { leveringen, verzendklaar, voorbereiding, totaalStuks, afgehandeld, nietAfgemeld, karren };
|
|
198
199
|
}, [days]);
|
|
199
|
-
|
|
200
|
+
useEffect(() => {
|
|
201
|
+
onTotals?.(totals);
|
|
202
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
203
|
+
}, [totals.leveringen, totals.verzendklaar, totals.voorbereiding, totals.totaalStuks, totals.afgehandeld, totals.nietAfgemeld, totals.karren]);
|
|
200
204
|
const capacity = useCapacityCheck(toDayKey(weekStart), toDayKey(weekEnd));
|
|
201
|
-
const headerLabel = `Week ${weekNumber} - ${weekStart.
|
|
205
|
+
const headerLabel = `Week ${weekNumber} - ${weekStart.getFullYear()}`;
|
|
202
206
|
const goPrev = () => setCursor((c) => addDays(c, -7));
|
|
203
207
|
const goNext = () => setCursor((c) => addDays(c, 7));
|
|
204
208
|
const goToday = () => {
|
|
@@ -206,24 +210,29 @@ export function WeekAgendaView({ planned, mode, isLoading, onOrderClick, onDayCl
|
|
|
206
210
|
d.setHours(0, 0, 0, 0);
|
|
207
211
|
setCursor(startOfWeek(d));
|
|
208
212
|
};
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
213
|
+
const visibleDays = days.filter((d) => statusFilter === "alle"
|
|
214
|
+
? true
|
|
215
|
+
: statusFilter === "voorbereiding"
|
|
216
|
+
? d.voorbereiding > 0
|
|
217
|
+
: statusFilter === "verzendklaar"
|
|
218
|
+
? d.verzendklaar > 0
|
|
219
|
+
: d.afgehandeld > 0);
|
|
220
|
+
return (_jsxs("div", { className: "flex flex-col gap-4", children: [!controlled && (_jsxs("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [title ? _jsx("h2", { className: "text-base font-semibold text-foreground", children: title }) : _jsx("span", {}), _jsx(PeriodPicker, { label: headerLabel, onPrev: goPrev, onNext: goNext, onToday: goToday, todayLabel: "Deze week" })] })), mode !== "pick" ? _jsx(SignupMailMoments, { from: toDayKey(weekStart), to: toDayKey(weekEnd), compact: true }) : null, _jsx("div", { className: "flex flex-col gap-2", children: isLoading || (mode === "pick" && pickAgenda.isLoading) ? (Array.from({ length: 5 }, (_, i) => _jsx(Skeleton, { className: "h-[84px] w-full rounded-xl" }, i))) : visibleDays.length === 0 ? (_jsx(EmptyState, { icon: _jsx(CalendarDays, {}), title: "Geen dagen met deze status", text: "Kies een ander tabblad of een andere week." })) : (visibleDays.map((day) => (_jsx(DayRow, { day: day, onOrderClick: onOrderClick, onDayClick: onDayClick, capacity: mode === "delivery" ? undefined : capacity.byDate.get(toDayKey(day.date)) }, day.date.toISOString())))) })] }));
|
|
214
221
|
}
|
|
215
|
-
|
|
222
|
+
const WEEKDAY_SHORT = ["ma", "di", "wo", "do", "vr", "za", "zo"];
|
|
223
|
+
function DayRow({ day, onOrderClick: _onOrderClick, onDayClick, capacity, }) {
|
|
216
224
|
const weekdayIdx = (day.date.getDay() + 6) % 7;
|
|
217
225
|
const today = new Date();
|
|
218
226
|
today.setHours(0, 0, 0, 0);
|
|
219
227
|
const isToday = isSameDay(day.date, today);
|
|
220
|
-
// Alles van deze dag is afgehandeld: toon een groene bevestiging.
|
|
221
228
|
const dagAfgesloten = day.bestellingen > 0 && day.afgehandeld >= day.bestellingen && day.nietAfgemeld === 0;
|
|
222
|
-
|
|
229
|
+
const clickable = !!onDayClick && day.bestellingen > 0;
|
|
230
|
+
const nf = (n) => n.toLocaleString("nl-NL");
|
|
231
|
+
return (_jsxs("div", { className: "relative rounded-xl border border-border bg-card shadow-sm " + (clickable ? "cursor-pointer transition-colors hover:bg-muted/50" : ""), role: clickable ? "button" : undefined, tabIndex: clickable ? 0 : undefined, onClick: clickable ? () => onDayClick(day.date) : undefined, onKeyDown: clickable ? (e) => { if (e.key === "Enter" || e.key === " ") {
|
|
223
232
|
e.preventDefault();
|
|
224
233
|
onDayClick(day.date);
|
|
225
|
-
} } : undefined, children: [_jsxs("div", { className: "flex flex-wrap items-center gap-6 px-4 py-
|
|
234
|
+
} } : undefined, children: [isToday && _jsx("span", { "aria-hidden": true, className: "absolute inset-y-0 left-0 w-[3px] rounded-l-xl bg-primary" }), _jsxs("div", { className: "flex flex-wrap items-center gap-x-6 gap-y-2 px-4 py-3", children: [_jsxs("div", { className: "w-28 shrink-0 leading-tight", children: [_jsxs("div", { className: "text-sm font-semibold text-foreground", children: [WEEKDAY_SHORT[weekdayIdx], " ", day.date.getDate(), " ", MONTHS_NL_SHORT[day.date.getMonth()]] }), _jsx("div", { className: "text-xs text-muted-foreground", children: isToday ? "vandaag" : "\u00a0" })] }), _jsxs("div", { className: "flex flex-1 flex-wrap items-center gap-x-6 gap-y-1 text-sm tabular-nums", children: [_jsx(Stat, { icon: _jsx(ShoppingCart, {}), value: nf(day.bestellingen), label: day.bestellingen === 1 ? "order" : "orders" }), _jsx(Stat, { icon: _jsx(Truck, {}), value: nf(day.karren), label: day.karren === 1 ? "kar" : "karren" }), _jsx(Stat, { icon: _jsx(Sprout, {}), value: nf(day.planten), label: "stuks" })] }), _jsxs("div", { className: "flex flex-wrap items-center gap-3 text-xs text-muted-foreground", children: [dagAfgesloten && _jsxs("span", { className: "inline-flex items-center gap-1.5", children: [_jsx(StatusIcon, { tone: "done", label: "Alles van deze dag is afgehandeld" }), "Afgesloten"] }), day.shiftedCount > 0 && (_jsxs("span", { className: "inline-flex items-center gap-1.5", children: [_jsx(StatusIcon, { tone: "busy", label: "Te laat aangemeld en door de planning verschoven" }), day.shiftedCount, " verschoven"] })), day.nietAfgemeld > 0 && (_jsxs("span", { className: "inline-flex items-center gap-1.5", children: [_jsx(StatusIcon, { tone: "error", label: "Afgehandeld, nog niet gemeld bij Floriday" }), day.nietAfgemeld, " niet gemeld"] })), day.verzendklaar > 0 && (_jsxs("span", { className: "inline-flex items-center gap-1.5", children: [_jsx(StatusIcon, { tone: "done", label: "Verzendklaar" }), day.verzendklaar, " verzendklaar"] })), day.voorbereiding > 0 && (_jsxs("span", { className: "inline-flex items-center gap-1.5", children: [_jsx(StatusIcon, { tone: "open", label: "In voorbereiding" }), day.voorbereiding, " in voorbereiding"] })), clickable && (_jsx(Button, { size: "sm", variant: "outline", onClick: (e) => { e.stopPropagation(); onDayClick(day.date); }, children: "Dagdetails" }))] })] }), _jsx(CapacityWarning, { day: capacity, className: "mx-4 mb-3" })] }));
|
|
226
235
|
}
|
|
227
|
-
function Stat({ icon,
|
|
228
|
-
return (_jsxs("
|
|
236
|
+
function Stat({ icon, value, label }) {
|
|
237
|
+
return (_jsxs("span", { className: "inline-flex items-center gap-1.5 text-foreground [&_svg]:h-4 [&_svg]:w-4 [&_svg]:text-muted-foreground", children: [icon, _jsx("span", { className: "font-semibold", children: value }), _jsx("span", { className: "text-muted-foreground", children: label })] }));
|
|
229
238
|
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export interface DataColumn<T> {
|
|
3
|
+
key: string;
|
|
4
|
+
header: ReactNode;
|
|
5
|
+
/** Vaste breedte in px (colgroup); laat één kolom leeg voor de rest. */
|
|
6
|
+
width?: number | string;
|
|
7
|
+
cell: (row: T, index: number) => ReactNode;
|
|
8
|
+
/** Alleen bij de kolom waarop gesorteerd wordt. */
|
|
9
|
+
sortIndicator?: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Tabel exact naar Verkooporders: eigen <table>, table-fixed, colgroup in px, min 900 px,
|
|
13
|
+
* kop 40 px/11 px hoofdletters/plakt, rij 60 px, cellen py-0 px-2 (kop en cel gelijk x).
|
|
14
|
+
* Onder 768 px: `mobileCard` als kaarten. Paginering als Verkooporders.
|
|
15
|
+
*/
|
|
16
|
+
export declare function DataTable<T>({ columns, rows, rowKey, selectedIndex, onRowClick, footer, ariaLabel, mobileCard, empty, pageSizes, defaultPageSize, paginate, }: {
|
|
17
|
+
columns: DataColumn<T>[];
|
|
18
|
+
rows: T[];
|
|
19
|
+
rowKey: (row: T) => string;
|
|
20
|
+
selectedIndex?: number | null;
|
|
21
|
+
onRowClick?: (row: T, index: number) => void;
|
|
22
|
+
footer?: ReactNode;
|
|
23
|
+
ariaLabel?: string;
|
|
24
|
+
mobileCard?: (row: T, index: number) => ReactNode;
|
|
25
|
+
empty?: ReactNode;
|
|
26
|
+
pageSizes?: number[];
|
|
27
|
+
defaultPageSize?: number;
|
|
28
|
+
paginate?: boolean;
|
|
29
|
+
}): import("react").JSX.Element;
|
|
30
|
+
/** Paginering exact als Verkooporders. */
|
|
31
|
+
export declare function Pagination({ page, totalPages, totalCount, pageSize, pageSizes, onPage, onPageSize, }: {
|
|
32
|
+
page: number;
|
|
33
|
+
totalPages: number;
|
|
34
|
+
totalCount: number;
|
|
35
|
+
pageSize: number;
|
|
36
|
+
pageSizes: number[];
|
|
37
|
+
onPage: (p: number) => void;
|
|
38
|
+
onPageSize: (n: number) => void;
|
|
39
|
+
}): import("react").JSX.Element;
|
|
40
|
+
/** Celtekst: regel 1 14 px, regel 2 12 px grijs, afkappen met volledige tekst in title. */
|
|
41
|
+
export declare function Cell2({ main, sub }: {
|
|
42
|
+
main: ReactNode;
|
|
43
|
+
sub?: ReactNode;
|
|
44
|
+
}): import("react").JSX.Element;
|
|
45
|
+
//# 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,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAIjD,MAAM,WAAW,UAAU,CAAC,CAAC;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,SAAS,CAAC;IAClB,wEAAwE;IACxE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,IAAI,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,SAAS,CAAC;IAC3C,mDAAmD;IACnD,aAAa,CAAC,EAAE,SAAS,CAAC;CAC3B;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,EAC3B,OAAO,EACP,IAAI,EACJ,MAAM,EACN,aAAa,EACb,UAAU,EACV,MAAM,EACN,SAAS,EACT,UAAU,EACV,KAAK,EACL,SAA6B,EAC7B,eAAoB,EACpB,QAAe,GAChB,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;IACnB,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,SAAS,CAAC;IAClD,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,+BA2FA;AAcD,0CAA0C;AAC1C,wBAAgB,UAAU,CAAC,EACzB,IAAI,EACJ,UAAU,EACV,UAAU,EACV,QAAQ,EACR,SAAS,EACT,MAAM,EACN,UAAU,GACX,EAAE;IACD,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5B,UAAU,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CACjC,+BAoCA;AAED,2FAA2F;AAC3F,wBAAgB,KAAK,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,GAAG,CAAC,EAAE,SAAS,CAAA;CAAE,+BASxE"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { ChevronLeft, ChevronRight } from "lucide-react";
|
|
4
|
+
import { Button, Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@flowselections/core";
|
|
5
|
+
/**
|
|
6
|
+
* Tabel exact naar Verkooporders: eigen <table>, table-fixed, colgroup in px, min 900 px,
|
|
7
|
+
* kop 40 px/11 px hoofdletters/plakt, rij 60 px, cellen py-0 px-2 (kop en cel gelijk x).
|
|
8
|
+
* Onder 768 px: `mobileCard` als kaarten. Paginering als Verkooporders.
|
|
9
|
+
*/
|
|
10
|
+
export function DataTable({ columns, rows, rowKey, selectedIndex, onRowClick, footer, ariaLabel, mobileCard, empty, pageSizes = [10, 25, 50, 100], defaultPageSize = 25, paginate = true, }) {
|
|
11
|
+
const [page, setPage] = useState(1);
|
|
12
|
+
const [pageSize, setPageSize] = useState(defaultPageSize);
|
|
13
|
+
const total = rows.length;
|
|
14
|
+
const totalPages = paginate ? Math.max(1, Math.ceil(total / pageSize)) : 1;
|
|
15
|
+
const cur = Math.min(page, totalPages);
|
|
16
|
+
const start = paginate ? (cur - 1) * pageSize : 0;
|
|
17
|
+
const visible = paginate ? rows.slice(start, start + pageSize) : rows;
|
|
18
|
+
if (total === 0 && empty)
|
|
19
|
+
return _jsx(_Fragment, { children: empty });
|
|
20
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "w-full min-w-0 overflow-clip rounded-xl border border-border bg-card shadow-sm", children: [_jsx("div", { className: "hidden max-h-[calc(100dvh-7rem)] overflow-auto md:block xl:max-h-none xl:overflow-visible", children: _jsxs("table", { "aria-label": ariaLabel, className: "w-full min-w-[900px] table-fixed caption-bottom text-left text-sm [&_thead_th]:sticky [&_thead_th]:top-0 [&_thead_th]:z-10 [&_thead_th]:h-10 [&_thead_th]:bg-card [&_thead_th]:px-2 [&_thead_th]:text-[11px] [&_thead_th]:font-semibold [&_thead_th]:uppercase [&_thead_th]:tracking-wide [&_thead_th]:text-muted-foreground [&_tbody_tr]:transition-colors", children: [_jsx("colgroup", { children: columns.map((c) => (_jsx("col", { style: c.width != null ? { width: typeof c.width === "number" ? `${c.width}px` : c.width } : undefined }, c.key))) }), _jsx("thead", { className: "[&_tr]:border-b", children: _jsx("tr", { className: "border-b border-border", children: columns.map((c) => (_jsx("th", { scope: "col", className: "text-left align-middle", children: _jsxs("span", { className: "inline-flex items-center gap-1 truncate", children: [c.header, c.sortIndicator] }) }, c.key))) }) }), _jsx("tbody", { children: visible.map((r, j) => {
|
|
21
|
+
const i = start + j;
|
|
22
|
+
const selected = selectedIndex === i;
|
|
23
|
+
return (_jsx("tr", { "data-state": selected ? "selected" : undefined, "aria-selected": selected || undefined, onClick: onRowClick ? () => onRowClick(r, i) : undefined, style: { height: 60 }, className: "group border-b border-border last:border-0 hover:bg-muted/50 " + (onRowClick ? "cursor-pointer " : "") + (selected ? "bg-muted/60" : ""), children: columns.map((c, ci) => (_jsxs("td", { className: "relative truncate whitespace-nowrap px-2 py-0 align-middle text-foreground", children: [ci === 0 && selected && _jsx("span", { "aria-hidden": true, className: "absolute inset-y-0 left-0 w-[3px] bg-primary" }), c.cell(r, i)] }, c.key))) }, rowKey(r)));
|
|
24
|
+
}) })] }) }), _jsx("div", { className: "divide-y divide-border md:hidden", children: visible.map((r, j) => (_jsxs("div", { onClick: onRowClick ? () => onRowClick(r, start + j) : undefined, className: "relative p-4 " + (onRowClick ? "cursor-pointer active:bg-muted/50" : ""), children: [selectedIndex === start + j && _jsx("span", { "aria-hidden": true, className: "absolute inset-y-0 left-0 w-[3px] bg-primary" }), mobileCard ? mobileCard(r, start + j) : _jsx(MobileFallback, { columns: columns, row: r, index: start + j })] }, rowKey(r)))) }), footer && _jsx("div", { className: "border-t border-border px-4 py-2", children: footer })] }), paginate && (_jsx(Pagination, { page: cur, totalPages: totalPages, totalCount: total, pageSize: pageSize, pageSizes: pageSizes, onPage: setPage, onPageSize: (n) => {
|
|
25
|
+
setPageSize(n);
|
|
26
|
+
setPage(1);
|
|
27
|
+
} }))] }));
|
|
28
|
+
}
|
|
29
|
+
function MobileFallback({ columns, row, index }) {
|
|
30
|
+
return (_jsx("div", { className: "flex min-w-0 flex-col gap-1", children: columns.map((c) => (_jsx("div", { className: "min-w-0 truncate text-sm", children: c.cell(row, index) }, c.key))) }));
|
|
31
|
+
}
|
|
32
|
+
/** Paginering exact als Verkooporders. */
|
|
33
|
+
export function Pagination({ page, totalPages, totalCount, pageSize, pageSizes, onPage, onPageSize, }) {
|
|
34
|
+
return (_jsxs("nav", { "aria-label": "Paginering", className: "shrink-0 flex flex-wrap items-center justify-between gap-3 text-sm text-muted-foreground", children: [_jsx("div", { className: "tabular-nums", children: totalCount === 0 ? "Geen resultaten" : `${(page - 1) * pageSize + 1}–${Math.min(page * pageSize, totalCount)} van ${totalCount}` }), _jsxs("div", { className: "flex items-center gap-3", children: [_jsxs("div", { className: "hidden items-center gap-2 sm:flex", children: [_jsx("span", { children: "Per pagina" }), _jsxs(Select, { value: String(pageSize), onValueChange: (v) => onPageSize(Number(v)), children: [_jsx(SelectTrigger, { className: "h-8 w-20", "aria-label": "Resultaten per pagina", children: _jsx(SelectValue, {}) }), _jsx(SelectContent, { children: pageSizes.map((n) => (_jsx(SelectItem, { value: String(n), children: n }, n))) })] })] }), _jsxs("div", { className: "flex items-center gap-1", children: [_jsx(Button, { variant: "outline", size: "icon", className: "h-10 w-10 sm:h-8 sm:w-8", onClick: () => onPage(Math.max(1, page - 1)), disabled: page <= 1, "aria-label": "Vorige pagina", children: _jsx(ChevronLeft, { className: "h-4 w-4" }) }), _jsxs("div", { className: "px-2 text-foreground tabular-nums", "aria-current": "page", children: [page, " / ", totalPages] }), _jsx(Button, { variant: "outline", size: "icon", className: "h-10 w-10 sm:h-8 sm:w-8", onClick: () => onPage(Math.min(totalPages, page + 1)), disabled: page >= totalPages, "aria-label": "Volgende pagina", children: _jsx(ChevronRight, { className: "h-4 w-4" }) })] })] })] }));
|
|
35
|
+
}
|
|
36
|
+
/** Celtekst: regel 1 14 px, regel 2 12 px grijs, afkappen met volledige tekst in title. */
|
|
37
|
+
export function Cell2({ main, sub }) {
|
|
38
|
+
return (_jsxs("div", { className: "min-w-0 leading-tight", children: [_jsx("div", { className: "truncate text-sm text-foreground", title: typeof main === "string" ? main : undefined, children: main }), sub != null && sub !== "" && (_jsx("div", { className: "truncate text-xs text-muted-foreground", title: typeof sub === "string" ? sub : undefined, children: sub }))] }));
|
|
39
|
+
}
|
|
@@ -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,19 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export interface FilterChip {
|
|
3
|
+
key: string;
|
|
4
|
+
label: string;
|
|
5
|
+
icon?: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
/** Eén chip exact als FilterChip in Verkooporders; klik = wissen. */
|
|
8
|
+
export declare function FilterChipButton({ label, onClear, icon }: {
|
|
9
|
+
label: string;
|
|
10
|
+
onClear: () => void;
|
|
11
|
+
icon?: ReactNode;
|
|
12
|
+
}): import("react").JSX.Element;
|
|
13
|
+
/** Actieve filters op de werkbalkregel, met "Alles wissen" bij meer dan één. */
|
|
14
|
+
export declare function FilterChips({ chips, onRemove, onClearAll, }: {
|
|
15
|
+
chips: FilterChip[];
|
|
16
|
+
onRemove: (key: string) => void;
|
|
17
|
+
onClearAll?: () => void;
|
|
18
|
+
}): import("react").JSX.Element | null;
|
|
19
|
+
//# 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,qEAAqE;AACrE,wBAAgB,gBAAgB,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,IAAI,CAAC;IAAC,IAAI,CAAC,EAAE,SAAS,CAAA;CAAE,+BAalH;AAED,gFAAgF;AAChF,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,QAAQ,EACR,UAAU,GACX,EAAE;IACD,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB,sCAkBA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { X } from "lucide-react";
|
|
3
|
+
/** Eén chip exact als FilterChip in Verkooporders; klik = wissen. */
|
|
4
|
+
export function FilterChipButton({ label, onClear, icon }) {
|
|
5
|
+
return (_jsxs("button", { type: "button", onClick: onClear, "aria-label": `Filter ${label} wissen`, className: "inline-flex h-8 items-center gap-1.5 rounded-full border border-border bg-muted px-3 text-xs font-medium text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring [&_svg]:h-3.5 [&_svg]:w-3.5", children: [icon, label, _jsx(X, { "aria-hidden": true })] }));
|
|
6
|
+
}
|
|
7
|
+
/** Actieve filters op de werkbalkregel, met "Alles wissen" bij meer dan één. */
|
|
8
|
+
export function FilterChips({ chips, onRemove, onClearAll, }) {
|
|
9
|
+
if (chips.length === 0)
|
|
10
|
+
return null;
|
|
11
|
+
return (_jsxs(_Fragment, { children: [chips.map((c) => (_jsx(FilterChipButton, { label: c.label, icon: c.icon, onClear: () => onRemove(c.key) }, c.key))), chips.length > 1 && (_jsx("button", { type: "button", onClick: onClearAll ?? (() => chips.forEach((c) => onRemove(c.key))), className: "h-8 rounded-md px-2 text-xs font-medium text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", children: "Alles wissen" }))] }));
|
|
12
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
/** Zijpaneel met alle extra filters (desktop rechts, mobiel volledig scherm). Alleen weergave. */
|
|
3
|
+
export declare function FilterPanel({ open, onOpenChange, onClear, children, }: {
|
|
4
|
+
open: boolean;
|
|
5
|
+
onOpenChange: (o: boolean) => void;
|
|
6
|
+
onClear?: () => void;
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
}): import("react").JSX.Element;
|
|
9
|
+
/** Eén filtergroep met keuzeknoppen (één keuze, nogmaals klikken = wissen). */
|
|
10
|
+
export declare function FilterOptions<V extends string>({ title, value, options, onChange, }: {
|
|
11
|
+
title: string;
|
|
12
|
+
value: V | null;
|
|
13
|
+
options: {
|
|
14
|
+
value: V;
|
|
15
|
+
label: string;
|
|
16
|
+
}[];
|
|
17
|
+
onChange: (v: V | null) => void;
|
|
18
|
+
}): import("react").JSX.Element;
|
|
19
|
+
//# sourceMappingURL=FilterPanel.d.ts.map
|