@flowselections/pick-schermen-kwekers 1.0.14 → 1.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/README.md +24 -24
  2. package/dist-lib/components/PickstationsPage.d.ts.map +1 -1
  3. package/dist-lib/components/PickstationsPage.js +2 -1
  4. package/dist-lib/components/pick/ReferentiedataBanner.d.ts +6 -0
  5. package/dist-lib/components/pick/ReferentiedataBanner.d.ts.map +1 -0
  6. package/dist-lib/components/pick/ReferentiedataBanner.js +17 -0
  7. package/dist-lib/components/settings/ReferentiedataPickdocumentenCard.d.ts +2 -0
  8. package/dist-lib/components/settings/ReferentiedataPickdocumentenCard.d.ts.map +1 -0
  9. package/dist-lib/components/settings/ReferentiedataPickdocumentenCard.js +84 -0
  10. package/dist-lib/hooks/usePickReferenceData.d.ts +4 -0
  11. package/dist-lib/hooks/usePickReferenceData.d.ts.map +1 -0
  12. package/dist-lib/hooks/usePickReferenceData.js +10 -0
  13. package/dist-lib/index.d.ts +5 -0
  14. package/dist-lib/index.d.ts.map +1 -1
  15. package/dist-lib/index.js +6 -5
  16. package/dist-lib/integrations/supabase/auth-middleware.d.ts +236 -0
  17. package/dist-lib/integrations/supabase/auth-middleware.d.ts.map +1 -1
  18. package/dist-lib/integrations/supabase/client.d.ts +236 -0
  19. package/dist-lib/integrations/supabase/client.d.ts.map +1 -1
  20. package/dist-lib/integrations/supabase/client.server.d.ts +236 -0
  21. package/dist-lib/integrations/supabase/client.server.d.ts.map +1 -1
  22. package/dist-lib/integrations/supabase/types.d.ts +239 -0
  23. package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
  24. package/dist-lib/lib/layoutMaker/pakbonHtml.js +49 -49
  25. package/dist-lib/lib/layoutRenderer.js +17 -17
  26. package/dist-lib/lib/pickReferenceApi.d.ts +37 -0
  27. package/dist-lib/lib/pickReferenceApi.d.ts.map +1 -0
  28. package/dist-lib/lib/pickReferenceApi.js +98 -0
  29. package/package.json +1 -1
  30. package/dist-lib/components/TemplateModulePage.d.ts +0 -2
  31. package/dist-lib/components/TemplateModulePage.d.ts.map +0 -1
  32. package/dist-lib/components/TemplateModulePage.js +0 -44
package/README.md CHANGED
@@ -1,24 +1,24 @@
1
- # pick schermen kwekers
2
-
3
- blank project start
4
-
5
- This project was built with [Lovable](https://lovable.dev).
6
-
7
- ## Build with Lovable
8
-
9
- Continue developing this project in the [Lovable editor](https://lovable.dev/projects/f7462658-1d60-42f1-8e22-dbefe36f44ef).
10
-
11
- - **Ship faster**: describe what you want to build and Lovable handles the code.
12
- - **Stay in sync**: every change made in Lovable is committed straight to this repository.
13
- - **Full ownership**: this code is yours. Push to `main` on GitHub and your changes sync back into Lovable, ready for your next prompt.
14
-
15
- ## Development
16
-
17
- Prefer working locally? You need Node.js and npm — [install with nvm](https://github.com/nvm-sh/nvm#installing-and-updating).
18
-
19
- ```sh
20
- git clone <this-repository-url>
21
- cd <repository-name>
22
- npm i
23
- npm run dev
24
- ```
1
+ # pick schermen kwekers
2
+
3
+ blank project start
4
+
5
+ This project was built with [Lovable](https://lovable.dev).
6
+
7
+ ## Build with Lovable
8
+
9
+ Continue developing this project in the [Lovable editor](https://lovable.dev/projects/f7462658-1d60-42f1-8e22-dbefe36f44ef).
10
+
11
+ - **Ship faster**: describe what you want to build and Lovable handles the code.
12
+ - **Stay in sync**: every change made in Lovable is committed straight to this repository.
13
+ - **Full ownership**: this code is yours. Push to `main` on GitHub and your changes sync back into Lovable, ready for your next prompt.
14
+
15
+ ## Development
16
+
17
+ Prefer working locally? You need Node.js and npm — [install with nvm](https://github.com/nvm-sh/nvm#installing-and-updating).
18
+
19
+ ```sh
20
+ git clone <this-repository-url>
21
+ cd <repository-name>
22
+ npm i
23
+ npm run dev
24
+ ```
@@ -1 +1 @@
1
- {"version":3,"file":"PickstationsPage.d.ts","sourceRoot":"","sources":["../../src/components/PickstationsPage.tsx"],"names":[],"mappings":"AA+FA,wBAAgB,gBAAgB,gCAuL/B"}
1
+ {"version":3,"file":"PickstationsPage.d.ts","sourceRoot":"","sources":["../../src/components/PickstationsPage.tsx"],"names":[],"mappings":"AAiGA,wBAAgB,gBAAgB,gCA2L/B"}
@@ -6,6 +6,7 @@ import { AlertTriangle, Copy, ExternalLink, Loader2, Pencil, Plus, Printer, Tras
6
6
  import { pickApi } from "../lib/pickApi";
7
7
  import { usePickStations } from "../hooks/usePickConfig";
8
8
  import { useKoppelingVoorBron } from "../hooks/useKoppelingVoorBron";
9
+ import { ReferentiedataBanner } from "./pick/ReferentiedataBanner";
9
10
  const emptyDraft = { name: "", description: "", active: true };
10
11
  function publicUrl(slug) {
11
12
  const origin = typeof window !== "undefined" ? window.location.origin : "";
@@ -56,7 +57,7 @@ export function PickstationsPage() {
56
57
  toast.error(url);
57
58
  }
58
59
  };
59
- return (_jsxs("main", { className: "space-y-6 p-6", children: [_jsxs("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [_jsxs("div", { children: [_jsx("h1", { className: "text-2xl font-bold text-foreground", children: "Pickstations" }), _jsx("p", { className: "text-sm text-muted-foreground", children: "Beheer je pickstations en hun openbare link. Alle logica komt uit de Logistiek Engine." })] }), _jsxs(Button, { onClick: () => setDraft({ ...emptyDraft }), children: [_jsx(Plus, { className: "mr-2 h-4 w-4" }), " Nieuw pickstation"] })] }), isLoading ? (_jsxs("div", { className: "flex items-center gap-2 text-muted-foreground", children: [_jsx(Loader2, { className: "h-4 w-4 animate-spin" }), " Laden..."] })) : safeStations.length === 0 ? (_jsx("p", { className: "text-sm text-muted-foreground", children: "Nog geen pickstations." })) : (_jsx("div", { className: "grid gap-4 sm:grid-cols-2 xl:grid-cols-3", children: safeStations.map((station) => (_jsx(Card, { className: "border-2", children: _jsxs(CardContent, { className: "space-y-4 p-6", children: [_jsxs("div", { className: "flex items-start justify-between gap-2", children: [_jsxs("div", { children: [_jsx("h2", { className: "text-lg font-semibold text-foreground", children: station.name }), _jsx("p", { className: "text-sm text-muted-foreground", children: station.description })] }), _jsx("span", { className: "rounded-full px-2 py-1 text-xs font-medium " +
60
+ return (_jsxs("main", { className: "space-y-6 p-6", children: [_jsxs("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [_jsxs("div", { children: [_jsx("h1", { className: "text-2xl font-bold text-foreground", children: "Pickstations" }), _jsx("p", { className: "text-sm text-muted-foreground", children: "Beheer je pickstations en hun openbare link. Alle logica komt uit de Logistiek Engine." })] }), _jsxs(Button, { onClick: () => setDraft({ ...emptyDraft }), children: [_jsx(Plus, { className: "mr-2 h-4 w-4" }), " Nieuw pickstation"] })] }), _jsx(ReferentiedataBanner, {}), isLoading ? (_jsxs("div", { className: "flex items-center gap-2 text-muted-foreground", children: [_jsx(Loader2, { className: "h-4 w-4 animate-spin" }), " Laden..."] })) : safeStations.length === 0 ? (_jsx("p", { className: "text-sm text-muted-foreground", children: "Nog geen pickstations." })) : (_jsx("div", { className: "grid gap-4 sm:grid-cols-2 xl:grid-cols-3", children: safeStations.map((station) => (_jsx(Card, { className: "border-2", children: _jsxs(CardContent, { className: "space-y-4 p-6", children: [_jsxs("div", { className: "flex items-start justify-between gap-2", children: [_jsxs("div", { children: [_jsx("h2", { className: "text-lg font-semibold text-foreground", children: station.name }), _jsx("p", { className: "text-sm text-muted-foreground", children: station.description })] }), _jsx("span", { className: "rounded-full px-2 py-1 text-xs font-medium " +
60
61
  (station.active
61
62
  ? "bg-primary/10 text-primary"
62
63
  : "bg-muted text-muted-foreground"), children: station.active ? "Actief" : "Inactief" })] }), _jsx("code", { className: "block truncate rounded bg-muted px-2 py-1 text-xs text-muted-foreground", children: publicUrl(station.slug) }), _jsx(StationPrintplek, { station: station }), _jsxs("div", { className: "flex flex-wrap gap-2", children: [_jsx(Button, { className: "flex-1", asChild: true, children: _jsxs("a", { href: publicUrl(station.slug), target: "_blank", rel: "noreferrer", children: [_jsx(ExternalLink, { className: "mr-2 h-4 w-4" }), " Open pickstation"] }) }), _jsxs(Button, { variant: "outline", onClick: () => copyLink(station), children: [_jsx(Copy, { className: "mr-2 h-4 w-4" }), " Link kopi\u00EBren"] })] }), _jsxs("div", { className: "flex gap-2", children: [_jsxs(Button, { variant: "ghost", size: "sm", onClick: () => setDraft({
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Waarschuwing als verplichte referentiedata ontbreekt of uitgezet is.
3
+ * Rendert niets zodra alles aanwezig en actief is — geen groene bevestiging.
4
+ */
5
+ export declare function ReferentiedataBanner(): import("react").JSX.Element | null;
6
+ //# sourceMappingURL=ReferentiedataBanner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReferentiedataBanner.d.ts","sourceRoot":"","sources":["../../../src/components/pick/ReferentiedataBanner.tsx"],"names":[],"mappings":"AAMA;;;GAGG;AACH,wBAAgB,oBAAoB,uCA4BnC"}
@@ -0,0 +1,17 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Button } from "@flowselections/core";
3
+ import { Link } from "@tanstack/react-router";
4
+ import { AlertTriangle } from "lucide-react";
5
+ import { usePickReferenceData } from "../../hooks/usePickReferenceData";
6
+ import { referentieProblemen } from "../../lib/pickReferenceApi";
7
+ /**
8
+ * Waarschuwing als verplichte referentiedata ontbreekt of uitgezet is.
9
+ * Rendert niets zodra alles aanwezig en actief is — geen groene bevestiging.
10
+ */
11
+ export function ReferentiedataBanner() {
12
+ const { data } = usePickReferenceData();
13
+ const problemen = referentieProblemen(data);
14
+ if (problemen.length === 0)
15
+ return null;
16
+ return (_jsxs("div", { className: "space-y-3 rounded-lg border border-destructive/50 bg-destructive/5 p-4", children: [_jsxs("div", { className: "flex items-start gap-3", children: [_jsx(AlertTriangle, { className: "mt-0.5 h-5 w-5 shrink-0 text-destructive" }), _jsxs("div", { className: "space-y-1", children: [_jsx("h2", { className: "font-semibold text-destructive", children: "Referentiedata ontbreekt \u2014 er komt niets in de pickwachtrij" }), _jsx("ul", { className: "list-inside list-disc text-sm text-destructive", children: problemen.map((p) => (_jsx("li", { children: p }, p))) }), _jsx("p", { className: "text-sm text-muted-foreground", children: "De synchronisatie stopt hierop en pickstations blijven leeg." })] })] }), _jsx(Button, { variant: "outline", size: "sm", asChild: true, children: _jsx(Link, { to: "/instellingen", children: "Naar referentiedata-instellingen" }) })] }));
17
+ }
@@ -0,0 +1,2 @@
1
+ export declare function ReferentiedataPickdocumentenCard(): import("react").JSX.Element;
2
+ //# sourceMappingURL=ReferentiedataPickdocumentenCard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReferentiedataPickdocumentenCard.d.ts","sourceRoot":"","sources":["../../../src/components/settings/ReferentiedataPickdocumentenCard.tsx"],"names":[],"mappings":"AAwEA,wBAAgB,gCAAgC,gCAyT/C"}
@@ -0,0 +1,84 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useState } from "react";
3
+ import { useMutation, useQueryClient } from "@tanstack/react-query";
4
+ import { Button, Card, CardContent, CardDescription, CardHeader, CardTitle, Input, Label, Switch, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, toast, } from "@flowselections/core";
5
+ import { FileText, Loader2, Plus, RotateCcw } from "lucide-react";
6
+ import { pickReferenceApi } from "../../lib/pickReferenceApi";
7
+ import { usePickReferenceData, PICK_REFERENCE_QUERY_KEY } from "../../hooks/usePickReferenceData";
8
+ function NumberCell({ value, onSave, }) {
9
+ const [local, setLocal] = useState(String(value ?? 0));
10
+ return (_jsx(Input, { className: "h-8 w-20", inputMode: "numeric", value: local, onChange: (e) => setLocal(e.target.value), onBlur: () => {
11
+ const n = Number(local);
12
+ if (Number.isFinite(n) && n !== value)
13
+ onSave(n);
14
+ else
15
+ setLocal(String(value ?? 0));
16
+ } }));
17
+ }
18
+ function TextCell({ value, onSave, className, }) {
19
+ const [local, setLocal] = useState(value ?? "");
20
+ return (_jsx(Input, { className: "h-8 " + (className ?? ""), value: local, onChange: (e) => setLocal(e.target.value), onBlur: () => {
21
+ const v = local.trim();
22
+ if (v && v !== value)
23
+ onSave(v);
24
+ else
25
+ setLocal(value ?? "");
26
+ } }));
27
+ }
28
+ export function ReferentiedataPickdocumentenCard() {
29
+ const { data, isLoading } = usePickReferenceData();
30
+ const queryClient = useQueryClient();
31
+ const [nieuw, setNieuw] = useState(null);
32
+ const types = Array.isArray(data?.types) ? data.types : [];
33
+ const statussen = Array.isArray(data?.statussen) ? data.statussen : [];
34
+ const verplichteTypes = Array.isArray(data?.verplichte_types) ? data.verplichte_types : [];
35
+ const verplichteStatussen = Array.isArray(data?.verplichte_statussen)
36
+ ? data.verplichte_statussen
37
+ : [];
38
+ const invalidate = () => queryClient.invalidateQueries({ queryKey: PICK_REFERENCE_QUERY_KEY });
39
+ const saveType = useMutation({
40
+ mutationFn: ({ id, patch }) => pickReferenceApi.updateType(id, patch),
41
+ onSuccess: invalidate,
42
+ onError: (e) => toast.error(e instanceof Error ? e.message : "Opslaan mislukt."),
43
+ });
44
+ const saveStatus = useMutation({
45
+ mutationFn: ({ id, patch }) => pickReferenceApi.updateStatus(id, patch),
46
+ onSuccess: invalidate,
47
+ onError: (e) => toast.error(e instanceof Error ? e.message : "Opslaan mislukt."),
48
+ });
49
+ const addRow = useMutation({
50
+ mutationFn: async (d) => {
51
+ const row = { code: d.code.trim(), name: d.naam.trim() };
52
+ if (d.tabel === "types")
53
+ await pickReferenceApi.insertType(row);
54
+ else
55
+ await pickReferenceApi.insertStatus(row);
56
+ },
57
+ onSuccess: () => {
58
+ toast.success("Rij toegevoegd.");
59
+ setNieuw(null);
60
+ invalidate();
61
+ },
62
+ onError: (e) => toast.error(e instanceof Error ? e.message : "Toevoegen mislukt."),
63
+ });
64
+ const seed = useMutation({
65
+ mutationFn: pickReferenceApi.seed,
66
+ onSuccess: (r) => {
67
+ const totaal = r.statuses_toegevoegd + r.types_toegevoegd;
68
+ const tekst = `${r.statuses_toegevoegd} statussen toegevoegd, ${r.types_toegevoegd} types toegevoegd`;
69
+ if (totaal === 0)
70
+ toast.message("Alle standaardwaarden waren al aanwezig.", { description: tekst });
71
+ else
72
+ toast.success(tekst);
73
+ invalidate();
74
+ },
75
+ onError: (e) => toast.error(e instanceof Error ? e.message : "Herstellen mislukt."),
76
+ });
77
+ return (_jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(FileText, { className: "h-5 w-5 text-primary" }), _jsx(CardTitle, { children: "Referentiedata pickdocumenten" })] }), _jsx(CardDescription, { children: "De synchronisatie zoekt hardcoded op deze codes: zonder documenttype 'pakbon' komt er niets in de pickwachtrij. De kolom code is daarom niet te wijzigen." })] }), _jsxs(CardContent, { className: "space-y-8", children: [_jsx("div", { className: "flex flex-wrap gap-2", children: _jsxs(Button, { variant: "outline", onClick: () => seed.mutate(), disabled: seed.isPending, children: [seed.isPending ? (_jsx(Loader2, { className: "mr-2 h-4 w-4 animate-spin" })) : (_jsx(RotateCcw, { className: "mr-2 h-4 w-4" })), "Standaardwaarden herstellen"] }) }), isLoading ? (_jsxs("div", { className: "flex items-center gap-2 text-muted-foreground", children: [_jsx(Loader2, { className: "h-4 w-4 animate-spin" }), " Laden..."] })) : (_jsxs(_Fragment, { children: [_jsxs("section", { className: "space-y-3", children: [_jsxs("div", { className: "flex flex-wrap items-center justify-between gap-2", children: [_jsxs("h3", { className: "font-semibold text-foreground", children: ["Documenttypes (", types.length, ")"] }), _jsxs(Button, { variant: "ghost", size: "sm", onClick: () => setNieuw({ tabel: "types", code: "", naam: "" }), children: [_jsx(Plus, { className: "mr-2 h-4 w-4" }), " Type toevoegen"] })] }), _jsx("div", { className: "overflow-x-auto", children: _jsxs(Table, { children: [_jsx(TableHeader, { children: _jsxs(TableRow, { children: [_jsx(TableHead, { children: "Code" }), _jsx(TableHead, { children: "Naam" }), _jsx(TableHead, { children: "Kleur" }), _jsx(TableHead, { children: "Icoon" }), _jsx(TableHead, { children: "Prioriteit" }), _jsx(TableHead, { children: "Sortering" }), _jsx(TableHead, { children: "Actief" })] }) }), _jsx(TableBody, { children: types.map((t) => {
78
+ const verplicht = verplichteTypes.includes(t.code);
79
+ return (_jsxs(TableRow, { children: [_jsx(TableCell, { className: "font-mono text-xs", children: t.code }), _jsx(TableCell, { children: _jsx(TextCell, { value: t.name, className: "w-40", onSave: (name) => saveType.mutate({ id: t.id, patch: { name } }) }) }), _jsx(TableCell, { children: _jsx(TextCell, { value: t.color ?? "", className: "w-28 font-mono text-xs", onSave: (color) => saveType.mutate({ id: t.id, patch: { color } }) }) }), _jsx(TableCell, { children: _jsx(TextCell, { value: t.icon ?? "", className: "w-32", onSave: (icon) => saveType.mutate({ id: t.id, patch: { icon } }) }) }), _jsx(TableCell, { children: _jsx(NumberCell, { value: t.priority, onSave: (priority) => saveType.mutate({ id: t.id, patch: { priority } }) }) }), _jsx(TableCell, { children: _jsx(NumberCell, { value: t.sort_order, onSave: (sort_order) => saveType.mutate({ id: t.id, patch: { sort_order } }) }) }), _jsx(TableCell, { children: _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Switch, { checked: t.active, disabled: verplicht && t.active, onCheckedChange: (active) => saveType.mutate({ id: t.id, patch: { active } }) }), verplicht && (_jsx("span", { className: "text-xs text-muted-foreground", children: "Verplicht \u2014 kan niet uit" }))] }) })] }, t.id));
80
+ }) })] }) })] }), _jsxs("section", { className: "space-y-3", children: [_jsxs("div", { className: "flex flex-wrap items-center justify-between gap-2", children: [_jsxs("h3", { className: "font-semibold text-foreground", children: ["Documentstatussen (", statussen.length, ")"] }), _jsxs(Button, { variant: "ghost", size: "sm", onClick: () => setNieuw({ tabel: "statussen", code: "", naam: "" }), children: [_jsx(Plus, { className: "mr-2 h-4 w-4" }), " Status toevoegen"] })] }), _jsx("div", { className: "overflow-x-auto", children: _jsxs(Table, { children: [_jsx(TableHeader, { children: _jsxs(TableRow, { children: [_jsx(TableHead, { children: "Code" }), _jsx(TableHead, { children: "Naam" }), _jsx(TableHead, { children: "Kleur" }), _jsx(TableHead, { children: "Sortering" }), _jsx(TableHead, { children: "Open" }), _jsx(TableHead, { children: "Eindstatus" }), _jsx(TableHead, { children: "Actief" })] }) }), _jsx(TableBody, { children: statussen.map((s) => {
81
+ const verplicht = verplichteStatussen.includes(s.code);
82
+ return (_jsxs(TableRow, { children: [_jsx(TableCell, { className: "font-mono text-xs", children: s.code }), _jsx(TableCell, { children: _jsx(TextCell, { value: s.name, className: "w-40", onSave: (name) => saveStatus.mutate({ id: s.id, patch: { name } }) }) }), _jsx(TableCell, { children: _jsx(TextCell, { value: s.color ?? "", className: "w-28 font-mono text-xs", onSave: (color) => saveStatus.mutate({ id: s.id, patch: { color } }) }) }), _jsx(TableCell, { children: _jsx(NumberCell, { value: s.sort_order, onSave: (sort_order) => saveStatus.mutate({ id: s.id, patch: { sort_order } }) }) }), _jsx(TableCell, { children: _jsx(Switch, { checked: s.is_open, onCheckedChange: (is_open) => saveStatus.mutate({ id: s.id, patch: { is_open } }) }) }), _jsx(TableCell, { children: _jsx(Switch, { checked: s.is_terminal, onCheckedChange: (is_terminal) => saveStatus.mutate({ id: s.id, patch: { is_terminal } }) }) }), _jsx(TableCell, { children: _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Switch, { checked: s.active, disabled: verplicht && s.active, onCheckedChange: (active) => saveStatus.mutate({ id: s.id, patch: { active } }) }), verplicht && (_jsx("span", { className: "text-xs text-muted-foreground", children: "Verplicht \u2014 kan niet uit" }))] }) })] }, s.id));
83
+ }) })] }) })] })] })), nieuw && (_jsxs("div", { className: "space-y-3 rounded-md border p-4", children: [_jsxs("p", { className: "text-sm font-medium text-foreground", children: ["Nieuwe ", nieuw.tabel === "types" ? "documenttype" : "documentstatus"] }), _jsxs("div", { className: "grid gap-3 sm:grid-cols-2", children: [_jsxs("div", { className: "space-y-2", children: [_jsx(Label, { htmlFor: "ref-code", children: "Code" }), _jsx(Input, { id: "ref-code", value: nieuw.code, onChange: (e) => setNieuw({ ...nieuw, code: e.target.value }), placeholder: "bijv. wagenlijst" })] }), _jsxs("div", { className: "space-y-2", children: [_jsx(Label, { htmlFor: "ref-naam", children: "Naam" }), _jsx(Input, { id: "ref-naam", value: nieuw.naam, onChange: (e) => setNieuw({ ...nieuw, naam: e.target.value }) })] })] }), _jsxs("div", { className: "flex justify-end gap-2", children: [_jsx(Button, { variant: "outline", onClick: () => setNieuw(null), children: "Annuleren" }), _jsxs(Button, { disabled: !nieuw.code.trim() || !nieuw.naam.trim() || addRow.isPending, onClick: () => addRow.mutate(nieuw), children: [addRow.isPending && _jsx(Loader2, { className: "mr-2 h-4 w-4 animate-spin" }), " Toevoegen"] })] })] }))] })] }));
84
+ }
@@ -0,0 +1,4 @@
1
+ export declare const PICK_REFERENCE_QUERY_KEY: readonly ["pick", "referenceData"];
2
+ /** Eén bron voor de instellingenkaart en de waarschuwingsbanner. */
3
+ export declare function usePickReferenceData(): import("@tanstack/react-query").UseQueryResult<NoInfer<import("..").PickReferenceStatus>, Error>;
4
+ //# sourceMappingURL=usePickReferenceData.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePickReferenceData.d.ts","sourceRoot":"","sources":["../../src/hooks/usePickReferenceData.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,wBAAwB,oCAAqC,CAAC;AAE3E,oEAAoE;AACpE,wBAAgB,oBAAoB,qGAKnC"}
@@ -0,0 +1,10 @@
1
+ import { useQuery } from "@tanstack/react-query";
2
+ import { pickReferenceApi } from "../lib/pickReferenceApi";
3
+ export const PICK_REFERENCE_QUERY_KEY = ["pick", "referenceData"];
4
+ /** Eén bron voor de instellingenkaart en de waarschuwingsbanner. */
5
+ export function usePickReferenceData() {
6
+ return useQuery({
7
+ queryKey: PICK_REFERENCE_QUERY_KEY,
8
+ queryFn: pickReferenceApi.status,
9
+ });
10
+ }
@@ -16,5 +16,10 @@ export { PickScherm } from './components/pick/PickScherm';
16
16
  export { PickstationsPage } from './components/PickstationsPage';
17
17
  export { PickPublicPage } from './components/PickPublicPage';
18
18
  export { PublicPickRoute } from './components/pick/PublicPickRoute';
19
+ export { pickReferenceApi, referentieProblemen, VERPLICHTE_TYPE_CODES, VERPLICHTE_STATUS_CODES, } from './lib/pickReferenceApi';
20
+ export type { PickReferenceStatus } from './lib/pickReferenceApi';
21
+ export { usePickReferenceData, PICK_REFERENCE_QUERY_KEY } from './hooks/usePickReferenceData';
22
+ export { ReferentiedataPickdocumentenCard } from './components/settings/ReferentiedataPickdocumentenCard';
23
+ export { ReferentiedataBanner } from './components/pick/ReferentiedataBanner';
19
24
  export declare const pickSchermenModule: FlowModule;
20
25
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEvD,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAErE,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAOpE,eAAO,MAAM,kBAAkB,EAAE,UAYhC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAGvD,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAErE,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAC9F,OAAO,EAAE,gCAAgC,EAAE,MAAM,wDAAwD,CAAC;AAC1G,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAE9E,eAAO,MAAM,kBAAkB,EAAE,UAYhC,CAAC"}
package/dist-lib/index.js CHANGED
@@ -14,6 +14,7 @@
14
14
  // 4. Done! You don't need to touch any other file for registration.
15
15
  // ============================================================================
16
16
  import { Warehouse } from "lucide-react";
17
+ import { ReferentiedataPickdocumentenCard } from "./components/settings/ReferentiedataPickdocumentenCard";
17
18
  export * from './_core-safelist';
18
19
  export * from './components/TemplatePage';
19
20
  export { TemplateModuleLogo } from './components/TemplateModuleLogo';
@@ -31,10 +32,10 @@ export { PickScherm } from './components/pick/PickScherm';
31
32
  export { PickstationsPage } from './components/PickstationsPage';
32
33
  export { PickPublicPage } from './components/PickPublicPage';
33
34
  export { PublicPickRoute } from './components/pick/PublicPickRoute';
34
- // Import your settings cards here (delete if you have none)
35
- // import { MySettingsCard } from "./components/settings/MySettingsCard";
36
- // ⚠️ HERNOEM naar een unieke naam, bijv. floridayVerkoopModule
37
- // De naam 'myModule' veroorzaakt een duplicate identifier bij meerdere modules in één shell.
35
+ export { pickReferenceApi, referentieProblemen, VERPLICHTE_TYPE_CODES, VERPLICHTE_STATUS_CODES, } from './lib/pickReferenceApi';
36
+ export { usePickReferenceData, PICK_REFERENCE_QUERY_KEY } from './hooks/usePickReferenceData';
37
+ export { ReferentiedataPickdocumentenCard } from './components/settings/ReferentiedataPickdocumentenCard';
38
+ export { ReferentiedataBanner } from './components/pick/ReferentiedataBanner';
38
39
  export const pickSchermenModule = {
39
40
  id: "pick-schermen",
40
41
  name: "Pickstations",
@@ -44,5 +45,5 @@ export const pickSchermenModule = {
44
45
  href: "/pickstations",
45
46
  icon: Warehouse,
46
47
  },
47
- settingsCards: [],
48
+ settingsCards: [{ component: ReferentiedataPickdocumentenCard, order: 10 }],
48
49
  };
@@ -2,6 +2,18 @@ import type { Database } from './types';
2
2
  export declare const requireSupabaseAuth: import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
3
3
  supabase: import("@supabase/supabase-js").SupabaseClient<Database, "public", "public", {
4
4
  Tables: {
5
+ _banner_check: {
6
+ Row: {
7
+ inactief: import("./types").Json | null;
8
+ };
9
+ Insert: {
10
+ inactief?: import("./types").Json | null;
11
+ };
12
+ Update: {
13
+ inactief?: import("./types").Json | null;
14
+ };
15
+ Relationships: [];
16
+ };
5
17
  afhandeling_settings: {
6
18
  Row: {
7
19
  auto_print_delivery_note: boolean;
@@ -10691,6 +10703,222 @@ export declare const requireSupabaseAuth: import("@tanstack/start-client-core").
10691
10703
  };
10692
10704
  Relationships: [];
10693
10705
  };
10706
+ maps_addresses: {
10707
+ Row: {
10708
+ address_hash: string;
10709
+ created_at: string;
10710
+ error_reason: string | null;
10711
+ formatted_address: string | null;
10712
+ id: string;
10713
+ lat: number | null;
10714
+ lng: number | null;
10715
+ place_id: string | null;
10716
+ raw_address: string;
10717
+ resolved_at: string | null;
10718
+ status: string;
10719
+ updated_at: string;
10720
+ };
10721
+ Insert: {
10722
+ address_hash: string;
10723
+ created_at?: string;
10724
+ error_reason?: string | null;
10725
+ formatted_address?: string | null;
10726
+ id?: string;
10727
+ lat?: number | null;
10728
+ lng?: number | null;
10729
+ place_id?: string | null;
10730
+ raw_address: string;
10731
+ resolved_at?: string | null;
10732
+ status?: string;
10733
+ updated_at?: string;
10734
+ };
10735
+ Update: {
10736
+ address_hash?: string;
10737
+ created_at?: string;
10738
+ error_reason?: string | null;
10739
+ formatted_address?: string | null;
10740
+ id?: string;
10741
+ lat?: number | null;
10742
+ lng?: number | null;
10743
+ place_id?: string | null;
10744
+ raw_address?: string;
10745
+ resolved_at?: string | null;
10746
+ status?: string;
10747
+ updated_at?: string;
10748
+ };
10749
+ Relationships: [];
10750
+ };
10751
+ maps_request_queue: {
10752
+ Row: {
10753
+ attempts: number;
10754
+ created_at: string;
10755
+ destination_hash: string | null;
10756
+ id: string;
10757
+ kind: string;
10758
+ last_error: string | null;
10759
+ mode: string;
10760
+ origin_hash: string | null;
10761
+ processed_at: string | null;
10762
+ raw_destination: string | null;
10763
+ raw_origin: string | null;
10764
+ requested_by: string | null;
10765
+ status: string;
10766
+ updated_at: string;
10767
+ };
10768
+ Insert: {
10769
+ attempts?: number;
10770
+ created_at?: string;
10771
+ destination_hash?: string | null;
10772
+ id?: string;
10773
+ kind: string;
10774
+ last_error?: string | null;
10775
+ mode?: string;
10776
+ origin_hash?: string | null;
10777
+ processed_at?: string | null;
10778
+ raw_destination?: string | null;
10779
+ raw_origin?: string | null;
10780
+ requested_by?: string | null;
10781
+ status?: string;
10782
+ updated_at?: string;
10783
+ };
10784
+ Update: {
10785
+ attempts?: number;
10786
+ created_at?: string;
10787
+ destination_hash?: string | null;
10788
+ id?: string;
10789
+ kind?: string;
10790
+ last_error?: string | null;
10791
+ mode?: string;
10792
+ origin_hash?: string | null;
10793
+ processed_at?: string | null;
10794
+ raw_destination?: string | null;
10795
+ raw_origin?: string | null;
10796
+ requested_by?: string | null;
10797
+ status?: string;
10798
+ updated_at?: string;
10799
+ };
10800
+ Relationships: [];
10801
+ };
10802
+ maps_settings: {
10803
+ Row: {
10804
+ allow_estimate_fallback: boolean;
10805
+ cache_ttl_days: number;
10806
+ created_at: string;
10807
+ daily_call_limit: number;
10808
+ id: string;
10809
+ last_error: string | null;
10810
+ last_error_at: string | null;
10811
+ last_success_at: string | null;
10812
+ updated_at: string;
10813
+ };
10814
+ Insert: {
10815
+ allow_estimate_fallback?: boolean;
10816
+ cache_ttl_days?: number;
10817
+ created_at?: string;
10818
+ daily_call_limit?: number;
10819
+ id?: string;
10820
+ last_error?: string | null;
10821
+ last_error_at?: string | null;
10822
+ last_success_at?: string | null;
10823
+ updated_at?: string;
10824
+ };
10825
+ Update: {
10826
+ allow_estimate_fallback?: boolean;
10827
+ cache_ttl_days?: number;
10828
+ created_at?: string;
10829
+ daily_call_limit?: number;
10830
+ id?: string;
10831
+ last_error?: string | null;
10832
+ last_error_at?: string | null;
10833
+ last_success_at?: string | null;
10834
+ updated_at?: string;
10835
+ };
10836
+ Relationships: [];
10837
+ };
10838
+ maps_travel_times: {
10839
+ Row: {
10840
+ created_at: string;
10841
+ destination_id: string;
10842
+ distance_m: number | null;
10843
+ duration_sec: number;
10844
+ expires_at: string;
10845
+ id: string;
10846
+ mode: string;
10847
+ origin_id: string;
10848
+ source: string;
10849
+ updated_at: string;
10850
+ };
10851
+ Insert: {
10852
+ created_at?: string;
10853
+ destination_id: string;
10854
+ distance_m?: number | null;
10855
+ duration_sec: number;
10856
+ expires_at?: string;
10857
+ id?: string;
10858
+ mode?: string;
10859
+ origin_id: string;
10860
+ source?: string;
10861
+ updated_at?: string;
10862
+ };
10863
+ Update: {
10864
+ created_at?: string;
10865
+ destination_id?: string;
10866
+ distance_m?: number | null;
10867
+ duration_sec?: number;
10868
+ expires_at?: string;
10869
+ id?: string;
10870
+ mode?: string;
10871
+ origin_id?: string;
10872
+ source?: string;
10873
+ updated_at?: string;
10874
+ };
10875
+ Relationships: [{
10876
+ foreignKeyName: "maps_travel_times_destination_id_fkey";
10877
+ columns: ["destination_id"];
10878
+ isOneToOne: false;
10879
+ referencedRelation: "maps_addresses";
10880
+ referencedColumns: ["id"];
10881
+ }, {
10882
+ foreignKeyName: "maps_travel_times_origin_id_fkey";
10883
+ columns: ["origin_id"];
10884
+ isOneToOne: false;
10885
+ referencedRelation: "maps_addresses";
10886
+ referencedColumns: ["id"];
10887
+ }];
10888
+ };
10889
+ maps_usage_log: {
10890
+ Row: {
10891
+ cache_hits: number;
10892
+ call_type: string;
10893
+ created_at: string;
10894
+ day: string;
10895
+ detail: string | null;
10896
+ elements: number;
10897
+ id: string;
10898
+ outcome: string;
10899
+ };
10900
+ Insert: {
10901
+ cache_hits?: number;
10902
+ call_type: string;
10903
+ created_at?: string;
10904
+ day?: string;
10905
+ detail?: string | null;
10906
+ elements?: number;
10907
+ id?: string;
10908
+ outcome?: string;
10909
+ };
10910
+ Update: {
10911
+ cache_hits?: number;
10912
+ call_type?: string;
10913
+ created_at?: string;
10914
+ day?: string;
10915
+ detail?: string | null;
10916
+ elements?: number;
10917
+ id?: string;
10918
+ outcome?: string;
10919
+ };
10920
+ Relationships: [];
10921
+ };
10694
10922
  material_usage: {
10695
10923
  Row: {
10696
10924
  created_at: string;
@@ -22078,6 +22306,10 @@ export declare const requireSupabaseAuth: import("@tanstack/start-client-core").
22078
22306
  omschrijving: string;
22079
22307
  }[];
22080
22308
  };
22309
+ pick_reference_data_status: {
22310
+ Args: never;
22311
+ Returns: import("./types").Json;
22312
+ };
22081
22313
  pick_release_expired_locks: {
22082
22314
  Args: never;
22083
22315
  Returns: number;
@@ -22142,6 +22374,10 @@ export declare const requireSupabaseAuth: import("@tanstack/start-client-core").
22142
22374
  isSetofReturn: false;
22143
22375
  };
22144
22376
  };
22377
+ pick_seed_reference_data: {
22378
+ Args: never;
22379
+ Returns: import("./types").Json;
22380
+ };
22145
22381
  pick_set_station_print_plek: {
22146
22382
  Args: {
22147
22383
  _print_plek_id: string;