@flowselections/floriday-afhandeling-module 1.0.100 → 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 +59 -46
- package/dist-lib/components/afhandeling/DagDetailDialog.d.ts.map +1 -1
- package/dist-lib/components/afhandeling/DagDetailDialog.js +27 -11
- package/dist-lib/components/afhandeling/LeveringenPage.d.ts.map +1 -1
- package/dist-lib/components/afhandeling/LeveringenPage.js +105 -6
- 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 +3 -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 +15 -3
- 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 +69 -19
- 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 +29 -7
- package/dist-lib/components/fs-ui/DataTable.d.ts.map +1 -1
- package/dist-lib/components/fs-ui/DataTable.js +36 -11
- package/dist-lib/components/fs-ui/FilterChips.d.ts +9 -2
- package/dist-lib/components/fs-ui/FilterChips.d.ts.map +1 -1
- package/dist-lib/components/fs-ui/FilterChips.js +8 -4
- 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/InlineAlert.d.ts +8 -2
- package/dist-lib/components/fs-ui/InlineAlert.d.ts.map +1 -1
- package/dist-lib/components/fs-ui/InlineAlert.js +19 -7
- package/dist-lib/components/fs-ui/KpiRow.js +1 -1
- package/dist-lib/components/fs-ui/PageHeader.d.ts +8 -2
- package/dist-lib/components/fs-ui/PageHeader.d.ts.map +1 -1
- package/dist-lib/components/fs-ui/PageHeader.js +7 -3
- 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 +4 -2
- package/dist-lib/components/fs-ui/PillTabs.d.ts.map +1 -1
- package/dist-lib/components/fs-ui/PillTabs.js +25 -10
- package/dist-lib/components/fs-ui/SearchInput.d.ts +1 -1
- package/dist-lib/components/fs-ui/SearchInput.d.ts.map +1 -1
- package/dist-lib/components/fs-ui/SearchInput.js +16 -9
- package/dist-lib/components/fs-ui/Toolbar.d.ts +6 -1
- package/dist-lib/components/fs-ui/Toolbar.d.ts.map +1 -1
- package/dist-lib/components/fs-ui/Toolbar.js +8 -2
- package/dist-lib/components/fs-ui/UpdatedAt.d.ts +7 -2
- package/dist-lib/components/fs-ui/UpdatedAt.d.ts.map +1 -1
- package/dist-lib/components/fs-ui/UpdatedAt.js +9 -4
- 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 +85 -0
- package/dist-lib/integrations/supabase/types.d.ts.map +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/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/moduleDefinition.d.ts.map +1 -1
- package/dist-lib/moduleDefinition.js +2 -0
- package/package.json +1 -1
|
@@ -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
|
}
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
2
|
export interface DataColumn<T> {
|
|
3
3
|
key: string;
|
|
4
4
|
header: ReactNode;
|
|
5
|
-
/** Vaste breedte (
|
|
6
|
-
width?: string;
|
|
5
|
+
/** Vaste breedte in px (colgroup); laat één kolom leeg voor de rest. */
|
|
6
|
+
width?: number | string;
|
|
7
7
|
cell: (row: T, index: number) => ReactNode;
|
|
8
|
+
/** Alleen bij de kolom waarop gesorteerd wordt. */
|
|
9
|
+
sortIndicator?: ReactNode;
|
|
8
10
|
}
|
|
9
11
|
/**
|
|
10
|
-
* Tabel
|
|
11
|
-
*
|
|
12
|
-
*
|
|
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.
|
|
13
15
|
*/
|
|
14
|
-
export declare function DataTable<T>({ columns, rows, rowKey, selectedIndex, onRowClick, footer, ariaLabel, }: {
|
|
16
|
+
export declare function DataTable<T>({ columns, rows, rowKey, selectedIndex, onRowClick, footer, ariaLabel, mobileCard, empty, pageSizes, defaultPageSize, paginate, }: {
|
|
15
17
|
columns: DataColumn<T>[];
|
|
16
18
|
rows: T[];
|
|
17
19
|
rowKey: (row: T) => string;
|
|
@@ -19,5 +21,25 @@ export declare function DataTable<T>({ columns, rows, rowKey, selectedIndex, onR
|
|
|
19
21
|
onRowClick?: (row: T, index: number) => void;
|
|
20
22
|
footer?: ReactNode;
|
|
21
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;
|
|
22
44
|
}): import("react").JSX.Element;
|
|
23
45
|
//# sourceMappingURL=DataTable.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTable.d.ts","sourceRoot":"","sources":["../../../src/components/fs-ui/DataTable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
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"}
|
|
@@ -1,14 +1,39 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
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";
|
|
2
5
|
/**
|
|
3
|
-
* Tabel
|
|
4
|
-
*
|
|
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.
|
|
6
9
|
*/
|
|
7
|
-
export function DataTable({ columns, rows, rowKey, selectedIndex, onRowClick, footer, ariaLabel, }) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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 }))] }));
|
|
14
39
|
}
|
|
@@ -4,9 +4,16 @@ export interface FilterChip {
|
|
|
4
4
|
label: string;
|
|
5
5
|
icon?: ReactNode;
|
|
6
6
|
}
|
|
7
|
-
/**
|
|
8
|
-
export declare function
|
|
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, }: {
|
|
9
15
|
chips: FilterChip[];
|
|
10
16
|
onRemove: (key: string) => void;
|
|
17
|
+
onClearAll?: () => void;
|
|
11
18
|
}): import("react").JSX.Element | null;
|
|
12
19
|
//# sourceMappingURL=FilterChips.d.ts.map
|
|
@@ -1 +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,
|
|
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"}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { X } from "lucide-react";
|
|
3
|
-
/**
|
|
4
|
-
export function
|
|
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, }) {
|
|
5
9
|
if (chips.length === 0)
|
|
6
10
|
return null;
|
|
7
|
-
return (
|
|
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" }))] }));
|
|
8
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterPanel.d.ts","sourceRoot":"","sources":["../../../src/components/fs-ui/FilterPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,kGAAkG;AAClG,wBAAgB,WAAW,CAAC,EAC1B,IAAI,EACJ,YAAY,EACZ,OAAO,EACP,QAAQ,GACT,EAAE;IACD,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACnC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,EAAE,SAAS,CAAC;CACrB,+BAmBA;AAED,+EAA+E;AAC/E,wBAAgB,aAAa,CAAC,CAAC,SAAS,MAAM,EAAE,EAC9C,KAAK,EACL,KAAK,EACL,OAAO,EACP,QAAQ,GACT,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC;IAChB,OAAO,EAAE;QAAE,KAAK,EAAE,CAAC,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACvC,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,GAAG,IAAI,KAAK,IAAI,CAAC;CACjC,+BAyBA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button, Dialog, DialogContent, DialogDescription, DialogTitle } from "@flowselections/core";
|
|
3
|
+
/** Zijpaneel met alle extra filters (desktop rechts, mobiel volledig scherm). Alleen weergave. */
|
|
4
|
+
export function FilterPanel({ open, onOpenChange, onClear, children, }) {
|
|
5
|
+
return (_jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: _jsxs(DialogContent, { className: "!left-auto !right-0 !top-0 !translate-x-0 !translate-y-0 flex h-[100dvh] !max-h-[100dvh] flex-col gap-0 rounded-none border-y-0 border-r-0 p-0 sm:rounded-l-xl", style: { width: "min(24rem, 100vw)", maxWidth: "100vw" }, children: [_jsxs("div", { className: "border-b border-border px-5 py-4", children: [_jsx(DialogTitle, { className: "text-base font-semibold", children: "Filters" }), _jsx(DialogDescription, { className: "text-xs text-muted-foreground", children: "Kies wat je in de lijst wilt zien." })] }), _jsx("div", { className: "flex-1 space-y-5 overflow-y-auto px-5 py-4", children: children }), _jsxs("div", { className: "flex items-center justify-between gap-2 border-t border-border px-5 py-3", children: [onClear ? _jsx(Button, { variant: "ghost", size: "sm", onClick: onClear, children: "Alles wissen" }) : _jsx("span", {}), _jsx(Button, { size: "sm", onClick: () => onOpenChange(false), children: "Klaar" })] })] }) }));
|
|
6
|
+
}
|
|
7
|
+
/** Eén filtergroep met keuzeknoppen (één keuze, nogmaals klikken = wissen). */
|
|
8
|
+
export function FilterOptions({ title, value, options, onChange, }) {
|
|
9
|
+
return (_jsxs("fieldset", { children: [_jsx("legend", { className: "mb-2 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground", children: title }), _jsx("div", { className: "flex flex-wrap gap-2", children: options.map((o) => {
|
|
10
|
+
const on = value === o.value;
|
|
11
|
+
return (_jsx("button", { type: "button", "aria-pressed": on, onClick: () => onChange(on ? null : o.value), className: "inline-flex h-9 items-center rounded-full border px-3 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring " +
|
|
12
|
+
(on ? "border-primary bg-primary/10 text-foreground" : "border-border bg-card text-muted-foreground hover:text-foreground"), children: o.label }, o.value));
|
|
13
|
+
}) })] }));
|
|
14
|
+
}
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* Eén melding op één regel (NoticeBar-stijl); details klappen uit.
|
|
4
|
+
* Nooit lijsten van items in de regel zelf: die horen in `details`.
|
|
5
|
+
*/
|
|
3
6
|
export declare function InlineAlert({ tone, title, children, action, details, }: {
|
|
4
7
|
tone?: "warning" | "error" | "info";
|
|
5
8
|
title?: string;
|
|
6
9
|
children?: ReactNode;
|
|
7
10
|
action?: ReactNode;
|
|
8
|
-
/** Alleen tonen aan beheerders; ingeklapt onder "Details". */
|
|
9
11
|
details?: ReactNode;
|
|
10
12
|
}): import("react").JSX.Element;
|
|
13
|
+
/** Meldingen direct onder de kop: hooguit 2 zichtbaar, de rest als "+ n meldingen". */
|
|
14
|
+
export declare function NoticeStack({ children }: {
|
|
15
|
+
children: ReactNode[];
|
|
16
|
+
}): import("react").JSX.Element | null;
|
|
11
17
|
//# sourceMappingURL=InlineAlert.d.ts.map
|
|
@@ -1 +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
|
|
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;;;GAGG;AACH,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,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB,+BAiCA;AAED,uFAAuF;AACvF,wBAAgB,WAAW,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,EAAE,CAAA;CAAE,sCAmBlE"}
|
|
@@ -1,15 +1,27 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from "react";
|
|
3
|
-
import { AlertTriangle, Info, XCircle } from "lucide-react";
|
|
4
|
-
/**
|
|
3
|
+
import { AlertTriangle, ChevronDown, Info, XCircle } from "lucide-react";
|
|
4
|
+
/**
|
|
5
|
+
* Eén melding op één regel (NoticeBar-stijl); details klappen uit.
|
|
6
|
+
* Nooit lijsten van items in de regel zelf: die horen in `details`.
|
|
7
|
+
*/
|
|
5
8
|
export function InlineAlert({ tone = "warning", title, children, action, details, }) {
|
|
6
9
|
const [open, setOpen] = useState(false);
|
|
7
10
|
const Icon = tone === "error" ? XCircle : tone === "info" ? Info : AlertTriangle;
|
|
8
11
|
const box = tone === "error"
|
|
9
|
-
? "border-destructive/30 bg-destructive/5"
|
|
12
|
+
? "border-destructive/30 bg-destructive/5 text-foreground"
|
|
10
13
|
: tone === "info"
|
|
11
|
-
? "border-border bg-muted/50"
|
|
12
|
-
: "border-
|
|
13
|
-
const ic = tone === "error" ? "text-destructive" :
|
|
14
|
-
return (_jsxs("div", { role: tone === "error" ? "alert" : "status", className: "
|
|
14
|
+
? "border-border bg-muted/50 text-foreground"
|
|
15
|
+
: "border-border bg-warning-soft text-warning-soft-foreground";
|
|
16
|
+
const ic = tone === "error" ? "text-destructive" : "";
|
|
17
|
+
return (_jsxs("div", { role: tone === "error" ? "alert" : "status", className: "shrink-0 rounded-lg border text-sm " + box, children: [_jsxs("div", { className: "flex min-h-9 items-center gap-2 px-3 py-2", children: [_jsx(Icon, { className: "h-4 w-4 shrink-0 " + ic, "aria-hidden": true }), title && _jsx("span", { className: "shrink-0 font-medium", children: title }), children && _jsx("span", { className: "min-w-0 flex-1 truncate opacity-80", children: children }), !children && _jsx("span", { className: "flex-1" }), action && _jsx("span", { className: "shrink-0", children: action }), details && (_jsx("button", { type: "button", "aria-expanded": open, "aria-label": open ? "Details verbergen" : "Details tonen", onClick: () => setOpen((o) => !o), className: "inline-flex h-6 w-6 shrink-0 items-center justify-center rounded focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", children: _jsx(ChevronDown, { className: "h-4 w-4 transition-transform " + (open ? "rotate-180" : ""), "aria-hidden": true }) }))] }), details && open && _jsx("div", { className: "break-words border-t border-border/60 px-3 py-2 pl-9 text-xs", children: details })] }));
|
|
18
|
+
}
|
|
19
|
+
/** Meldingen direct onder de kop: hooguit 2 zichtbaar, de rest als "+ n meldingen". */
|
|
20
|
+
export function NoticeStack({ children }) {
|
|
21
|
+
const [all, setAll] = useState(false);
|
|
22
|
+
const items = children.filter(Boolean);
|
|
23
|
+
if (items.length === 0)
|
|
24
|
+
return null;
|
|
25
|
+
const shown = all ? items : items.slice(0, 2);
|
|
26
|
+
return (_jsxs("div", { className: "flex shrink-0 flex-col gap-2", children: [shown, items.length > 2 && (_jsx("button", { type: "button", onClick: () => setAll((a) => !a), className: "self-start rounded px-1 text-xs font-medium text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", children: all ? "Minder meldingen" : `+ ${items.length - 2} ${items.length - 2 === 1 ? "melding" : "meldingen"}` }))] }));
|
|
15
27
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
/** 4 tegels naast elkaar; mobiel een veegbare rij (snap per tegel, ~78% breed). */
|
|
3
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 }));
|
|
4
|
+
return (_jsx("div", { className: "-mx-4 flex snap-x snap-mandatory scroll-px-4 gap-3 overflow-x-auto px-4 pb-1 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden 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
5
|
}
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
|
-
/**
|
|
3
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Paginakop exact naar Verkooporders: h1 + daaronder alleen "Bijgewerkt".
|
|
4
|
+
* Rechts: periodekiezer, secundaire knoppen, één primaire knop. Alleen weergave.
|
|
5
|
+
* `description` wordt bewust niet meer getoond (vaste regel: geen beschrijvingsregel).
|
|
6
|
+
*/
|
|
7
|
+
export declare function PageHeader({ title, updatedAt, period, actions, }: {
|
|
4
8
|
title: string;
|
|
9
|
+
/** Genegeerd; blijft alleen voor bestaande aanroepen. */
|
|
5
10
|
description?: ReactNode;
|
|
6
11
|
updatedAt?: ReactNode;
|
|
12
|
+
period?: ReactNode;
|
|
7
13
|
actions?: ReactNode;
|
|
8
14
|
}): import("react").JSX.Element;
|
|
9
15
|
//# sourceMappingURL=PageHeader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageHeader.d.ts","sourceRoot":"","sources":["../../../src/components/fs-ui/PageHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC
|
|
1
|
+
{"version":3,"file":"PageHeader.d.ts","sourceRoot":"","sources":["../../../src/components/fs-ui/PageHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,SAAS,EACT,MAAM,EACN,OAAO,GACR,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,yDAAyD;IACzD,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB,+BAmBA"}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
/**
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Paginakop exact naar Verkooporders: h1 + daaronder alleen "Bijgewerkt".
|
|
4
|
+
* Rechts: periodekiezer, secundaire knoppen, één primaire knop. Alleen weergave.
|
|
5
|
+
* `description` wordt bewust niet meer getoond (vaste regel: geen beschrijvingsregel).
|
|
6
|
+
*/
|
|
7
|
+
export function PageHeader({ title, updatedAt, period, actions, }) {
|
|
8
|
+
return (_jsxs("header", { className: "shrink-0 grid grid-cols-[minmax(0,1fr)_auto] items-center gap-3 sm:flex sm:flex-wrap sm:justify-between", children: [_jsx("div", { className: "flex min-w-0 items-center gap-3", children: _jsxs("div", { className: "min-w-0", children: [_jsx("h1", { className: "truncate text-xl font-bold leading-tight sm:text-2xl tracking-tight text-foreground", children: title }), _jsx("p", { className: "flex flex-wrap items-center gap-x-2 text-xs text-muted-foreground", "aria-live": "polite", children: updatedAt })] }) }), (period || actions) && (_jsxs("div", { className: "contents sm:flex sm:flex-wrap sm:items-center sm:gap-2", children: [period && _jsx("div", { className: "order-last col-span-2 sm:order-none sm:col-span-1", children: period }), actions && _jsx("div", { className: "flex items-center gap-2", children: actions })] }))] }));
|
|
5
9
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Periodekiezer in de kop: pijl links, label ("Week 45 - 2026" of "wo 4 nov"), pijl rechts. */
|
|
2
|
+
export declare function PeriodPicker({ label, onPrev, onNext, onToday, todayLabel, isCurrent, }: {
|
|
3
|
+
label: string;
|
|
4
|
+
onPrev: () => void;
|
|
5
|
+
onNext: () => void;
|
|
6
|
+
onToday?: () => void;
|
|
7
|
+
todayLabel?: string;
|
|
8
|
+
isCurrent?: boolean;
|
|
9
|
+
}): import("react").JSX.Element;
|
|
10
|
+
//# sourceMappingURL=PeriodPicker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PeriodPicker.d.ts","sourceRoot":"","sources":["../../../src/components/fs-ui/PeriodPicker.tsx"],"names":[],"mappings":"AAGA,gGAAgG;AAChG,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,MAAM,EACN,MAAM,EACN,OAAO,EACP,UAAsB,EACtB,SAAS,GACV,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,+BAmBA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ChevronLeft, ChevronRight } from "lucide-react";
|
|
3
|
+
import { Button } from "@flowselections/core";
|
|
4
|
+
/** Periodekiezer in de kop: pijl links, label ("Week 45 - 2026" of "wo 4 nov"), pijl rechts. */
|
|
5
|
+
export function PeriodPicker({ label, onPrev, onNext, onToday, todayLabel = "Vandaag", isCurrent, }) {
|
|
6
|
+
return (_jsxs("div", { className: "flex items-center gap-1", children: [_jsx(Button, { variant: "outline", size: "icon", className: "h-10 w-10 sm:h-9 sm:w-9", onClick: onPrev, "aria-label": "Vorige periode", children: _jsx(ChevronLeft, { className: "h-4 w-4" }) }), _jsx("span", { className: "min-w-[8.5rem] px-2 text-center text-sm font-medium tabular-nums text-foreground", "aria-live": "polite", children: label }), _jsx(Button, { variant: "outline", size: "icon", className: "h-10 w-10 sm:h-9 sm:w-9", onClick: onNext, "aria-label": "Volgende periode", children: _jsx(ChevronRight, { className: "h-4 w-4" }) }), onToday && !isCurrent && (_jsx(Button, { variant: "ghost", size: "sm", onClick: onToday, children: todayLabel }))] }));
|
|
7
|
+
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
2
|
export interface PillTab<T extends string> {
|
|
3
3
|
value: T;
|
|
4
|
+
/** Hooguit twee woorden. */
|
|
4
5
|
label: string;
|
|
5
6
|
icon?: ReactNode;
|
|
6
7
|
count?: number | null;
|
|
8
|
+
hint?: string;
|
|
7
9
|
}
|
|
8
|
-
/** Tabbladen als
|
|
10
|
+
/** Tabbladen exact als StatusTabs in Verkooporders: altijd één regel, scrollen met vervaging. */
|
|
9
11
|
export declare function PillTabs<T extends string>({ tabs, value, onChange, ariaLabel, }: {
|
|
10
12
|
tabs: PillTab<T>[];
|
|
11
13
|
value: T;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PillTabs.d.ts","sourceRoot":"","sources":["../../../src/components/fs-ui/PillTabs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"PillTabs.d.ts","sourceRoot":"","sources":["../../../src/components/fs-ui/PillTabs.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA2B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEhE,MAAM,WAAW,OAAO,CAAC,CAAC,SAAS,MAAM;IACvC,KAAK,EAAE,CAAC,CAAC;IACT,4BAA4B;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,iGAAiG;AACjG,wBAAgB,QAAQ,CAAC,CAAC,SAAS,MAAM,EAAE,EACzC,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,SAAS,GACV,EAAE;IACD,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;IACnB,KAAK,EAAE,CAAC,CAAC;IACT,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,+BA6DA"}
|