@flowselections/floriday-voorraad 1.0.49 → 1.0.51
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/voorraad/CollapsibleText.d.ts.map +1 -1
- package/dist-lib/components/voorraad/CollapsibleText.js +14 -11
- package/dist-lib/components/voorraad/StockMutationHistoryCard.d.ts.map +1 -1
- package/dist-lib/components/voorraad/StockMutationHistoryCard.js +17 -16
- package/dist-lib/integrations/supabase/auth-middleware.d.ts +360 -0
- package/dist-lib/integrations/supabase/auth-middleware.d.ts.map +1 -1
- package/dist-lib/integrations/supabase/client.d.ts +2 -30680
- package/dist-lib/integrations/supabase/client.d.ts.map +1 -1
- package/dist-lib/integrations/supabase/client.js +4 -27
- package/dist-lib/integrations/supabase/client.server.d.ts +360 -0
- package/dist-lib/integrations/supabase/client.server.d.ts.map +1 -1
- package/dist-lib/integrations/supabase/types.d.ts +372 -0
- package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
- package/dist-lib/lib/floricode-required-features.functions.d.ts +360 -0
- package/dist-lib/lib/floricode-required-features.functions.d.ts.map +1 -1
- package/dist-lib/lib/floriday-customer-offer.functions.d.ts +360 -0
- package/dist-lib/lib/floriday-customer-offer.functions.d.ts.map +1 -1
- package/dist-lib/lib/floriday-env.functions.d.ts +720 -0
- package/dist-lib/lib/floriday-env.functions.d.ts.map +1 -1
- package/dist-lib/lib/floriday-gateway.functions.d.ts +2160 -0
- package/dist-lib/lib/floriday-gateway.functions.d.ts.map +1 -1
- package/dist-lib/lib/floriday-vbn-required.functions.d.ts +720 -0
- package/dist-lib/lib/floriday-vbn-required.functions.d.ts.map +1 -1
- package/dist-lib/lib/floriday-warehouse.functions.d.ts +1080 -0
- package/dist-lib/lib/floriday-warehouse.functions.d.ts.map +1 -1
- package/dist-lib/lib/floriday-writes.functions.d.ts +720 -0
- package/dist-lib/lib/floriday-writes.functions.d.ts.map +1 -1
- package/dist-lib/lib/inventory-settings.functions.d.ts +720 -0
- package/dist-lib/lib/inventory-settings.functions.d.ts.map +1 -1
- package/dist-lib/lib/stock-sync.functions.d.ts +720 -0
- package/dist-lib/lib/stock-sync.functions.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CollapsibleText.d.ts","sourceRoot":"","sources":["../../../src/components/voorraad/CollapsibleText.tsx"],"names":[],"mappings":"AAOA,UAAU,KAAK;IACb,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAChC,gEAAgE;IAChE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,eAAe,CAAC,EAAE,IAAI,EAAE,KAAS,EAAE,SAAS,EAAE,EAAE,KAAK,+
|
|
1
|
+
{"version":3,"file":"CollapsibleText.d.ts","sourceRoot":"","sources":["../../../src/components/voorraad/CollapsibleText.tsx"],"names":[],"mappings":"AAOA,UAAU,KAAK;IACb,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAChC,gEAAgE;IAChE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,eAAe,CAAC,EAAE,IAAI,EAAE,KAAS,EAAE,SAAS,EAAE,EAAE,KAAK,+BA8DpE"}
|
|
@@ -3,30 +3,33 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
3
3
|
* Lange tekstvelden die meer dan ~5 regels beslaan kunnen worden ingeklapt.
|
|
4
4
|
* Kortere tekst wordt gewoon volledig getoond, zonder knop.
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
6
|
+
import { useLayoutEffect, useRef, useState } from "react";
|
|
7
7
|
import { ChevronDown, ChevronUp } from "lucide-react";
|
|
8
8
|
export function CollapsibleText({ text, lines = 5, className }) {
|
|
9
9
|
const value = (text ?? "").trim();
|
|
10
|
-
const
|
|
10
|
+
const containerRef = useRef(null);
|
|
11
|
+
const measureRef = useRef(null);
|
|
11
12
|
const [expanded, setExpanded] = useState(false);
|
|
12
13
|
const [overflowing, setOverflowing] = useState(false);
|
|
13
|
-
|
|
14
|
-
const
|
|
15
|
-
|
|
14
|
+
useLayoutEffect(() => {
|
|
15
|
+
const container = containerRef.current;
|
|
16
|
+
const measure = measureRef.current;
|
|
17
|
+
if (!container || !measure)
|
|
16
18
|
return;
|
|
17
19
|
const check = () => {
|
|
18
|
-
|
|
19
|
-
if (!
|
|
20
|
-
|
|
20
|
+
const lineHeight = Number.parseFloat(getComputedStyle(measure).lineHeight);
|
|
21
|
+
if (!Number.isFinite(lineHeight))
|
|
22
|
+
return;
|
|
23
|
+
setOverflowing(measure.scrollHeight > lineHeight * lines + 1);
|
|
21
24
|
};
|
|
22
25
|
check();
|
|
23
26
|
if (typeof ResizeObserver !== "undefined") {
|
|
24
27
|
const ro = new ResizeObserver(check);
|
|
25
|
-
ro.observe(
|
|
28
|
+
ro.observe(container);
|
|
26
29
|
return () => ro.disconnect();
|
|
27
30
|
}
|
|
28
|
-
}, [value,
|
|
31
|
+
}, [value, lines]);
|
|
29
32
|
if (!value)
|
|
30
33
|
return _jsx("span", { className: "text-muted-foreground", children: "\u2014" });
|
|
31
|
-
return (_jsxs("div", { className: className
|
|
34
|
+
return (_jsxs("div", { ref: containerRef, className: `relative min-w-0 ${className ?? ""}`, children: [_jsx("p", { ref: measureRef, "aria-hidden": "true", className: "pointer-events-none invisible absolute inset-x-0 top-0 break-words", children: value }), _jsx("p", { className: "break-words", style: expanded ? undefined : { WebkitLineClamp: lines, display: "-webkit-box", WebkitBoxOrient: "vertical", overflow: "hidden" }, children: value }), (overflowing || expanded) && (_jsx("button", { type: "button", onClick: () => setExpanded((v) => !v), className: "mt-1 inline-flex items-center gap-1 text-xs font-medium text-primary hover:underline", children: expanded ? (_jsxs(_Fragment, { children: [_jsx(ChevronUp, { className: "h-3.5 w-3.5" }), " Inklappen"] })) : (_jsxs(_Fragment, { children: [_jsx(ChevronDown, { className: "h-3.5 w-3.5" }), " Meer tonen"] })) }))] }));
|
|
32
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StockMutationHistoryCard.d.ts","sourceRoot":"","sources":["../../../src/components/voorraad/StockMutationHistoryCard.tsx"],"names":[],"mappings":"AAWA,UAAU,KAAK;IACb,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AA8CD,wBAAgB,wBAAwB,CAAC,EAAE,YAAY,EAAE,SAAS,EAAE,EAAE,KAAK,+
|
|
1
|
+
{"version":3,"file":"StockMutationHistoryCard.d.ts","sourceRoot":"","sources":["../../../src/components/voorraad/StockMutationHistoryCard.tsx"],"names":[],"mappings":"AAWA,UAAU,KAAK;IACb,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AA8CD,wBAAgB,wBAAwB,CAAC,EAAE,YAAY,EAAE,SAAS,EAAE,EAAE,KAAK,+BAyN1E"}
|
|
@@ -1,12 +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
|
/**
|
|
3
3
|
* Afboekgeschiedenis: wanneer is er voorraad bij- of afgeboekt en waarom.
|
|
4
4
|
* Leest public.stock_mutation_log op de sleutel van dit artikel (inclusief
|
|
5
5
|
* de groepssleutel wanneer het artikel via een groep wordt afgeboekt).
|
|
6
6
|
*/
|
|
7
7
|
import { useEffect, useState } from "react";
|
|
8
|
-
import { Card, CardContent, Badge } from "@flowselections/core";
|
|
9
|
-
import { Loader2, History } from "lucide-react";
|
|
8
|
+
import { Card, CardContent, Badge, Button } from "@flowselections/core";
|
|
9
|
+
import { ChevronDown, ChevronUp, Loader2, History } from "lucide-react";
|
|
10
10
|
import { supabase } from "../../integrations/supabase/client";
|
|
11
11
|
import { CollapsibleText } from "./CollapsibleText";
|
|
12
12
|
const TYPE_LABEL = {
|
|
@@ -42,6 +42,7 @@ function formatMoment(v) {
|
|
|
42
42
|
export function StockMutationHistoryCard({ tradeItemKey, productId }) {
|
|
43
43
|
const [rows, setRows] = useState(null);
|
|
44
44
|
const [error, setError] = useState(null);
|
|
45
|
+
const [expanded, setExpanded] = useState(false);
|
|
45
46
|
useEffect(() => {
|
|
46
47
|
let cancelled = false;
|
|
47
48
|
const load = async () => {
|
|
@@ -119,17 +120,17 @@ export function StockMutationHistoryCard({ tradeItemKey, productId }) {
|
|
|
119
120
|
supabase.removeChannel(channel);
|
|
120
121
|
};
|
|
121
122
|
}, [tradeItemKey, productId]);
|
|
122
|
-
return (_jsxs(Card, { children: [_jsxs("div", { className: "grid grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-3 px-6 py-4", children: [_jsx("span", { className: "flex h-7 w-7 items-center justify-center rounded-full border border-primary/40 bg-primary/10 text-primary", children: _jsx(History, { className: "h-4 w-4" }) }), _jsx("span", { className: "font-medium", children: "Afboekgeschiedenis" }), _jsx("span", { className: "text-xs text-muted-foreground tabular-nums", children: rows ? `${rows.length} mutatie${rows.length === 1 ? "" : "s"}` : "" })] }), _jsxs(CardContent, { className: "pt-0", children: [error && (_jsxs("div", { className: "text-sm text-destructive", children: ["Kon voorraadmutaties niet laden: ", error] })), !rows && !error && (_jsxs("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [_jsx(Loader2, { className: "h-4 w-4 animate-spin" }), " Mutaties laden\u2026"] })), rows && rows.length === 0 && !error && (_jsx("div", { className: "text-sm text-muted-foreground", children: "Nog geen voorraadmutaties voor dit artikel." })), rows && rows.length > 0 && (
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
123
|
+
return (_jsxs(Card, { children: [_jsxs("div", { className: "grid grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-3 px-6 py-4", children: [_jsx("span", { className: "flex h-7 w-7 items-center justify-center rounded-full border border-primary/40 bg-primary/10 text-primary", children: _jsx(History, { className: "h-4 w-4" }) }), _jsx("span", { className: "font-medium", children: "Afboekgeschiedenis" }), _jsx("span", { className: "text-xs text-muted-foreground tabular-nums", children: rows ? `${rows.length} mutatie${rows.length === 1 ? "" : "s"}` : "" })] }), _jsxs(CardContent, { className: "pt-0", children: [error && (_jsxs("div", { className: "text-sm text-destructive", children: ["Kon voorraadmutaties niet laden: ", error] })), !rows && !error && (_jsxs("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [_jsx(Loader2, { className: "h-4 w-4 animate-spin" }), " Mutaties laden\u2026"] })), rows && rows.length === 0 && !error && (_jsx("div", { className: "text-sm text-muted-foreground", children: "Nog geen voorraadmutaties voor dit artikel." })), rows && rows.length > 0 && (_jsxs("div", { className: "overflow-x-auto rounded-md border", children: [_jsxs("table", { className: "w-full text-sm", children: [_jsx("thead", { className: "bg-muted/50 text-xs uppercase text-muted-foreground", children: _jsxs("tr", { children: [_jsx("th", { className: "px-3 py-2 text-left", children: "Wanneer" }), _jsx("th", { className: "px-3 py-2 text-left", children: "Soort" }), _jsx("th", { className: "px-3 py-2 text-right", children: "Aantal" }), _jsx("th", { className: "px-3 py-2 text-left", children: "Van \u2192 naar" }), _jsx("th", { className: "px-3 py-2 text-left", children: "Order" }), _jsx("th", { className: "px-3 py-2 text-left", children: "Reden" })] }) }), _jsx("tbody", { children: (expanded ? rows : rows.slice(0, 5)).map((r) => {
|
|
124
|
+
const meta = TYPE_LABEL[r.mutation_type] ?? {
|
|
125
|
+
label: r.mutation_type || "Onbekend",
|
|
126
|
+
tone: "bg-slate-100 text-slate-700 border-slate-200",
|
|
127
|
+
};
|
|
128
|
+
const physChanged = r.physical_before !== null &&
|
|
129
|
+
r.physical_after !== null &&
|
|
130
|
+
r.physical_before !== r.physical_after;
|
|
131
|
+
const resChanged = r.reserved_before !== null &&
|
|
132
|
+
r.reserved_after !== null &&
|
|
133
|
+
r.reserved_before !== r.reserved_after;
|
|
134
|
+
return (_jsxs("tr", { className: "border-t align-top", children: [_jsx("td", { className: "whitespace-nowrap px-3 py-2", children: formatMoment(r.created_at) }), _jsx("td", { className: "px-3 py-2", children: _jsx(Badge, { variant: "outline", className: `border ${meta.tone}`, children: meta.label }) }), _jsxs("td", { className: `px-3 py-2 text-right tabular-nums font-medium ${r.qty_delta < 0 ? "text-rose-700" : r.qty_delta > 0 ? "text-emerald-700" : ""}`, children: [r.qty_delta > 0 ? "+" : "", r.qty_delta] }), _jsxs("td", { className: "whitespace-nowrap px-3 py-2 tabular-nums text-muted-foreground", children: [physChanged && (_jsxs("div", { children: ["Liggend ", r.physical_before, " \u2192 ", r.physical_after] })), resChanged && (_jsxs("div", { children: ["Gereserveerd ", r.reserved_before, " \u2192 ", r.reserved_after] })), !physChanged && !resChanged && _jsx("span", { children: "\u2014" })] }), _jsx("td", { className: "whitespace-nowrap px-3 py-2", children: r.order_id ? (_jsx("a", { href: `/floriday-verkoop/verkooporders/${r.order_id}`, className: "text-primary hover:underline", children: r.order_number ?? "Order" })) : (_jsx("span", { className: "text-muted-foreground", children: "\u2014" })) }), _jsx("td", { className: "px-3 py-2 text-muted-foreground", children: _jsx(CollapsibleText, { text: r.reason }) })] }, r.id));
|
|
135
|
+
}) })] }), rows.length > 5 && (_jsx("div", { className: "flex justify-center border-t bg-muted/20 px-3 py-2", children: _jsx(Button, { type: "button", variant: "ghost", size: "sm", onClick: () => setExpanded((current) => !current), className: "gap-1.5", children: expanded ? (_jsxs(_Fragment, { children: [_jsx(ChevronUp, { className: "h-4 w-4" }), " Inklappen"] })) : (_jsxs(_Fragment, { children: [_jsx(ChevronDown, { className: "h-4 w-4" }), " Meer tonen (", rows.length - 5, ")"] })) }) }))] }))] })] }));
|
|
135
136
|
}
|