@flowselections/pick-schermen-kwekers 1.0.13 → 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.
- package/README.md +24 -24
- package/dist-lib/components/PickstationsPage.d.ts.map +1 -1
- package/dist-lib/components/PickstationsPage.js +2 -1
- package/dist-lib/components/pick/ReferentiedataBanner.d.ts +6 -0
- package/dist-lib/components/pick/ReferentiedataBanner.d.ts.map +1 -0
- package/dist-lib/components/pick/ReferentiedataBanner.js +17 -0
- package/dist-lib/components/settings/ReferentiedataPickdocumentenCard.d.ts +2 -0
- package/dist-lib/components/settings/ReferentiedataPickdocumentenCard.d.ts.map +1 -0
- package/dist-lib/components/settings/ReferentiedataPickdocumentenCard.js +84 -0
- package/dist-lib/hooks/usePickReferenceData.d.ts +4 -0
- package/dist-lib/hooks/usePickReferenceData.d.ts.map +1 -0
- package/dist-lib/hooks/usePickReferenceData.js +10 -0
- package/dist-lib/index.d.ts +5 -0
- package/dist-lib/index.d.ts.map +1 -1
- package/dist-lib/index.js +6 -5
- package/dist-lib/integrations/supabase/auth-middleware.d.ts +291 -1
- package/dist-lib/integrations/supabase/auth-middleware.d.ts.map +1 -1
- package/dist-lib/integrations/supabase/client.d.ts +291 -1
- package/dist-lib/integrations/supabase/client.d.ts.map +1 -1
- package/dist-lib/integrations/supabase/client.server.d.ts +291 -1
- package/dist-lib/integrations/supabase/client.server.d.ts.map +1 -1
- package/dist-lib/integrations/supabase/types.d.ts +297 -1
- package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
- package/dist-lib/lib/layoutMaker/pakbonHtml.js +49 -49
- package/dist-lib/lib/layoutRenderer.js +17 -17
- package/dist-lib/lib/pickReferenceApi.d.ts +37 -0
- package/dist-lib/lib/pickReferenceApi.d.ts.map +1 -0
- package/dist-lib/lib/pickReferenceApi.js +98 -0
- package/package.json +1 -1
- package/dist-lib/components/TemplateModulePage.d.ts +0 -2
- package/dist-lib/components/TemplateModulePage.d.ts.map +0 -1
- 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":"
|
|
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 @@
|
|
|
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
|
+
}
|
package/dist-lib/index.d.ts
CHANGED
|
@@ -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
|
package/dist-lib/index.d.ts.map
CHANGED
|
@@ -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;
|
|
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
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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
|
};
|