@flowselections/baan-pick-schermen 1.0.5 → 1.0.6
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/package.json +1 -1
- package/dist-lib/components/TemplateModuleLogo.d.ts +0 -6
- package/dist-lib/components/TemplateModuleLogo.d.ts.map +0 -1
- package/dist-lib/components/TemplateModuleLogo.js +0 -4
- 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/dist-lib/components/TemplatePage.d.ts +0 -2
- package/dist-lib/components/TemplatePage.d.ts.map +0 -1
- package/dist-lib/components/TemplatePage.js +0 -4
- package/dist-lib/components/settings/MijnModuleSettingsCard.d.ts +0 -2
- package/dist-lib/components/settings/MijnModuleSettingsCard.d.ts.map +0 -1
- package/dist-lib/components/settings/MijnModuleSettingsCard.js +0 -42
- package/dist-lib/hooks/useMijnModuleData.d.ts +0 -13
- package/dist-lib/hooks/useMijnModuleData.d.ts.map +0 -1
- package/dist-lib/hooks/useMijnModuleData.js +0 -49
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TemplateModuleLogo.d.ts","sourceRoot":"","sources":["../../src/components/TemplateModuleLogo.tsx"],"names":[],"mappings":"AAQA,UAAU,uBAAuB;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,kBAAkB,CAAC,EAAE,SAAS,EAAE,EAAE,uBAAuB,+BAwBxE"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
export function TemplateModuleLogo({ className }) {
|
|
3
|
-
return (_jsxs("svg", { viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: className, "aria-hidden": "true", children: [_jsx("rect", { width: "40", height: "40", rx: "8", fill: "currentColor", opacity: "0.1" }), _jsx("text", { x: "50%", y: "50%", dominantBaseline: "middle", textAnchor: "middle", fontSize: "18", fontWeight: "600", fill: "currentColor", children: "M" })] }));
|
|
4
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TemplateModulePage.d.ts","sourceRoot":"","sources":["../../src/components/TemplateModulePage.tsx"],"names":[],"mappings":"AAsBA,wBAAgB,kBAAkB,gCAmFjC"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
// ============================================================================
|
|
3
|
-
// src/components/TemplateModulePage.tsx — EXAMPLE PAGE COMPONENT
|
|
4
|
-
// ============================================================================
|
|
5
|
-
// Pagina-componenten horen in src/components/, NIET alleen in src/routes/.
|
|
6
|
-
// src/routes/ wordt NIET naar npm gepubliceerd (zie tsconfig.build.json exclude).
|
|
7
|
-
//
|
|
8
|
-
// GEEN <Header /> hier — die zit in _authenticated.tsx via staticData.title
|
|
9
|
-
// ============================================================================
|
|
10
|
-
import { useState, useEffect } from "react";
|
|
11
|
-
import { useAuth, supabase, Button, Card, CardContent, CardHeader, CardTitle, toast, } from "@flowselections/core";
|
|
12
|
-
import { TemplateModuleLogo } from './TemplateModuleLogo.js';
|
|
13
|
-
export function TemplateModulePage() {
|
|
14
|
-
// Auth is guaranteed — this user is already logged in
|
|
15
|
-
const { user, isAdmin } = useAuth();
|
|
16
|
-
// Example state — replace with your own
|
|
17
|
-
const [items, setItems] = useState([]);
|
|
18
|
-
const [loading, setLoading] = useState(true);
|
|
19
|
-
useEffect(() => {
|
|
20
|
-
loadData();
|
|
21
|
-
}, []);
|
|
22
|
-
const loadData = async () => {
|
|
23
|
-
setLoading(true);
|
|
24
|
-
try {
|
|
25
|
-
// Example query — replace "products" with your table
|
|
26
|
-
const { data, error } = await supabase
|
|
27
|
-
.from("products")
|
|
28
|
-
.select("*")
|
|
29
|
-
.limit(10);
|
|
30
|
-
if (error)
|
|
31
|
-
throw error;
|
|
32
|
-
// ✅ Altijd Array.isArray bewaken op server-function data
|
|
33
|
-
// const safeItems = Array.isArray(data?.items) ? data.items : [];
|
|
34
|
-
setItems(Array.isArray(data) ? data : []);
|
|
35
|
-
}
|
|
36
|
-
catch {
|
|
37
|
-
toast.error("Fout bij het laden van gegevens");
|
|
38
|
-
}
|
|
39
|
-
finally {
|
|
40
|
-
setLoading(false);
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
return (_jsxs("main", { className: "p-6 space-y-6", children: [isAdmin && (_jsxs("div", { className: "text-sm text-muted-foreground", children: ["Ingelogd als admin: ", user?.email] })), _jsxs(Card, { children: [_jsx(CardHeader, { children: _jsx(CardTitle, { children: "Overzicht" }) }), _jsxs(CardContent, { children: [loading ? (_jsx("p", { className: "text-sm text-muted-foreground", children: "Laden..." })) : items.length === 0 ? (_jsx("p", { className: "text-sm text-muted-foreground", children: "Geen gegevens gevonden." })) : (_jsxs("p", { className: "text-sm", children: [items.length, " items geladen."] })), _jsx(Button, { onClick: loadData, className: "mt-4", disabled: loading, children: "Vernieuwen" })] })] }), _jsxs("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [_jsx(TemplateModuleLogo, { className: "w-6 h-6 text-primary" }), _jsx("span", { children: "SVG-component (voorkeur voor vector-logo's)" })] })] }));
|
|
44
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TemplatePage.d.ts","sourceRoot":"","sources":["../../src/components/TemplatePage.tsx"],"names":[],"mappings":"AAAA,wBAAgB,YAAY,gCAS3B"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
export function TemplatePage() {
|
|
3
|
-
return (_jsxs("div", { className: "p-6", children: [_jsx("h1", { className: "text-2xl font-semibold", children: "Module pagina" }), _jsx("p", { className: "text-muted-foreground mt-2", children: "Vervang dit component met de pagina's van jouw module." })] }));
|
|
4
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MijnModuleSettingsCard.d.ts","sourceRoot":"","sources":["../../../src/components/settings/MijnModuleSettingsCard.tsx"],"names":[],"mappings":"AAiCA,wBAAgB,sBAAsB,gCA+CrC"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
// ============================================================================
|
|
3
|
-
// src/components/settings/MijnModuleSettingsCard.tsx — EXAMPLE SETTINGS CARD
|
|
4
|
-
// ============================================================================
|
|
5
|
-
// This is an example of a settings card for your module.
|
|
6
|
-
// It appears on the main settings page when registered in src/index.ts.
|
|
7
|
-
//
|
|
8
|
-
// RULES:
|
|
9
|
-
// - Must return a <Card> as its root element
|
|
10
|
-
// - Handles its own data fetching — no props are passed by the core
|
|
11
|
-
// - Use the same Card primitives from @flowselections/core
|
|
12
|
-
//
|
|
13
|
-
// WHAT TO DO:
|
|
14
|
-
// - Rename this file to match your card's purpose
|
|
15
|
-
// - Add your real settings UI
|
|
16
|
-
// - Register it in src/index.ts under settingsCards
|
|
17
|
-
// - Delete this file entirely if your module has no settings
|
|
18
|
-
// ============================================================================
|
|
19
|
-
import { useState } from "react";
|
|
20
|
-
import { Card, CardContent, CardDescription, CardHeader, CardTitle, Button, Input, Label, toast, } from "@flowselections/core";
|
|
21
|
-
import { Settings2 } from "lucide-react";
|
|
22
|
-
export function MijnModuleSettingsCard() {
|
|
23
|
-
// Replace with your real settings state
|
|
24
|
-
const [setting, setSetting] = useState("");
|
|
25
|
-
const [saving, setSaving] = useState(false);
|
|
26
|
-
const handleSave = async () => {
|
|
27
|
-
setSaving(true);
|
|
28
|
-
try {
|
|
29
|
-
// Example: save to a table — replace with your real query
|
|
30
|
-
// const { error } = await supabase.from("my_settings").upsert({ ... });
|
|
31
|
-
// if (error) throw error;
|
|
32
|
-
toast.success("Instellingen opgeslagen");
|
|
33
|
-
}
|
|
34
|
-
catch {
|
|
35
|
-
toast.error("Fout bij het opslaan");
|
|
36
|
-
}
|
|
37
|
-
finally {
|
|
38
|
-
setSaving(false);
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
return (_jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Settings2, { className: "h-5 w-5 text-primary" }), _jsx(CardTitle, { children: "Module Instellingen" }), " "] }), _jsx(CardDescription, { children: "Beheer de instellingen voor deze module " })] }), _jsxs(CardContent, { className: "space-y-4", children: [_jsxs("div", { className: "space-y-2", children: [_jsx(Label, { htmlFor: "setting", children: "Instelling" }), _jsx(Input, { id: "setting", value: setting, onChange: (e) => setSetting(e.target.value), placeholder: "Waarde..." })] }), _jsx(Button, { onClick: handleSave, disabled: saving, children: saving ? "Opslaan..." : "Opslaan" })] })] }));
|
|
42
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
interface MijnItem {
|
|
2
|
-
id: string;
|
|
3
|
-
created_at: string;
|
|
4
|
-
[key: string]: unknown;
|
|
5
|
-
}
|
|
6
|
-
export declare function useMijnModuleData(): {
|
|
7
|
-
items: MijnItem[];
|
|
8
|
-
loading: boolean;
|
|
9
|
-
error: string | null;
|
|
10
|
-
reload: () => Promise<void>;
|
|
11
|
-
};
|
|
12
|
-
export {};
|
|
13
|
-
//# sourceMappingURL=useMijnModuleData.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useMijnModuleData.d.ts","sourceRoot":"","sources":["../../src/hooks/useMijnModuleData.ts"],"names":[],"mappings":"AAkBA,UAAU,QAAQ;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,wBAAgB,iBAAiB;;;;;EAkChC"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
// ============================================================================
|
|
2
|
-
// src/hooks/useMijnModuleData.ts — EXAMPLE DATA HOOK
|
|
3
|
-
// ============================================================================
|
|
4
|
-
// Put your data fetching logic in hooks like this, not directly in components.
|
|
5
|
-
// This keeps your pages clean and makes it easy to reuse data across pages.
|
|
6
|
-
//
|
|
7
|
-
// WHAT TO DO:
|
|
8
|
-
// - Rename to match your data (e.g. useProducts, useOrders, useSuppliers)
|
|
9
|
-
// - Replace the example query with your real Supabase query
|
|
10
|
-
// - Replace MijnItem with your actual table's row type
|
|
11
|
-
// - Import and use in your page components
|
|
12
|
-
// - Delete this file if you prefer a different pattern
|
|
13
|
-
// ============================================================================
|
|
14
|
-
import { useState, useEffect, useCallback } from "react";
|
|
15
|
-
import { supabase, toast } from "@flowselections/core";
|
|
16
|
-
export function useMijnModuleData() {
|
|
17
|
-
const [items, setItems] = useState([]);
|
|
18
|
-
const [loading, setLoading] = useState(true);
|
|
19
|
-
const [error, setError] = useState(null);
|
|
20
|
-
const load = useCallback(async () => {
|
|
21
|
-
setLoading(true);
|
|
22
|
-
setError(null);
|
|
23
|
-
try {
|
|
24
|
-
const { data, error } = await supabase
|
|
25
|
-
.from("products") // ← CHANGE THIS to your table
|
|
26
|
-
.select("*")
|
|
27
|
-
.order("created_at", { ascending: false });
|
|
28
|
-
if (error)
|
|
29
|
-
throw error;
|
|
30
|
-
setItems(data ?? []);
|
|
31
|
-
}
|
|
32
|
-
catch {
|
|
33
|
-
setError("Fout bij het laden van gegevens");
|
|
34
|
-
toast.error("Fout bij het laden van gegevens");
|
|
35
|
-
}
|
|
36
|
-
finally {
|
|
37
|
-
setLoading(false);
|
|
38
|
-
}
|
|
39
|
-
}, []);
|
|
40
|
-
useEffect(() => {
|
|
41
|
-
load();
|
|
42
|
-
}, [load]);
|
|
43
|
-
return {
|
|
44
|
-
items,
|
|
45
|
-
loading,
|
|
46
|
-
error,
|
|
47
|
-
reload: load,
|
|
48
|
-
};
|
|
49
|
-
}
|