@flowselections/floriday-verkoop-module 1.0.7 → 1.0.8
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/verkoop/AnalyticsCards.js +2 -2
- package/dist-lib/components/verkoop/CreateOrderPage.d.ts +2 -0
- package/dist-lib/components/verkoop/CreateOrderPage.d.ts.map +1 -0
- package/dist-lib/components/verkoop/CreateOrderPage.js +221 -0
- package/dist-lib/components/verkoop/DiagnoseConnectionDialog.d.ts +5 -0
- package/dist-lib/components/verkoop/DiagnoseConnectionDialog.d.ts.map +1 -0
- package/dist-lib/components/verkoop/DiagnoseConnectionDialog.js +40 -0
- package/dist-lib/components/verkoop/SalesOrderDetailPage.d.ts +2 -0
- package/dist-lib/components/verkoop/SalesOrderDetailPage.d.ts.map +1 -0
- package/dist-lib/components/verkoop/SalesOrderDetailPage.js +14 -0
- package/dist-lib/components/verkoop/SalesOrderDetailView.d.ts +6 -0
- package/dist-lib/components/verkoop/SalesOrderDetailView.d.ts.map +1 -0
- package/dist-lib/components/verkoop/SalesOrderDetailView.js +213 -0
- package/dist-lib/components/verkoop/SalesOrdersFilterPanel.d.ts +9 -0
- package/dist-lib/components/verkoop/SalesOrdersFilterPanel.d.ts.map +1 -0
- package/dist-lib/components/verkoop/SalesOrdersFilterPanel.js +62 -0
- package/dist-lib/components/verkoop/SalesOrdersFilters.d.ts +13 -0
- package/dist-lib/components/verkoop/SalesOrdersFilters.d.ts.map +1 -1
- package/dist-lib/components/verkoop/SalesOrdersFilters.js +123 -23
- package/dist-lib/components/verkoop/SalesOrdersTable.d.ts +3 -2
- package/dist-lib/components/verkoop/SalesOrdersTable.d.ts.map +1 -1
- package/dist-lib/components/verkoop/SalesOrdersTable.js +3 -3
- package/dist-lib/components/verkoop/VerkoopOrdersPage.d.ts.map +1 -1
- package/dist-lib/components/verkoop/VerkoopOrdersPage.js +124 -33
- package/dist-lib/components/verkoop/WeekCalendar.d.ts +6 -0
- package/dist-lib/components/verkoop/WeekCalendar.d.ts.map +1 -0
- package/dist-lib/components/verkoop/WeekCalendar.js +101 -0
- package/dist-lib/index.d.ts +2 -0
- package/dist-lib/index.d.ts.map +1 -1
- package/dist-lib/index.js +2 -0
- package/dist-lib/integrations/supabase/auth-middleware.d.ts +5727 -653
- package/dist-lib/integrations/supabase/auth-middleware.d.ts.map +1 -1
- package/dist-lib/integrations/supabase/client.d.ts +5727 -653
- package/dist-lib/integrations/supabase/client.d.ts.map +1 -1
- package/dist-lib/integrations/supabase/client.server.d.ts +5727 -653
- package/dist-lib/integrations/supabase/client.server.d.ts.map +1 -1
- package/dist-lib/integrations/supabase/types.d.ts +5871 -653
- package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
- package/dist-lib/integrations/supabase/types.js +18 -1
- package/dist-lib/lib/floriday-sync.d.ts +32 -0
- package/dist-lib/lib/floriday-sync.d.ts.map +1 -0
- package/dist-lib/lib/floriday-sync.js +177 -0
- package/dist-lib/lib/salesorders-mapping.d.ts +85 -0
- package/dist-lib/lib/salesorders-mapping.d.ts.map +1 -0
- package/dist-lib/lib/salesorders-mapping.js +198 -0
- package/dist-lib/lib/salesorders.functions.d.ts +19941 -0
- package/dist-lib/lib/salesorders.functions.d.ts.map +1 -0
- package/dist-lib/lib/salesorders.functions.js +216 -0
- package/dist-lib/lib/tradeitems.functions.d.ts +6641 -0
- package/dist-lib/lib/tradeitems.functions.d.ts.map +1 -0
- package/dist-lib/lib/tradeitems.functions.js +60 -0
- package/dist-lib/lib/useSalesOrdersQuery.d.ts +6 -0
- package/dist-lib/lib/useSalesOrdersQuery.d.ts.map +1 -0
- package/dist-lib/lib/useSalesOrdersQuery.js +143 -0
- package/package.json +16 -3
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo, useState } from "react";
|
|
3
|
+
import { ChevronDown, ChevronLeft, ChevronRight } from "lucide-react";
|
|
4
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, } from "@flowselections/core";
|
|
5
|
+
const MONTHS_NL = [
|
|
6
|
+
"januari",
|
|
7
|
+
"februari",
|
|
8
|
+
"maart",
|
|
9
|
+
"april",
|
|
10
|
+
"mei",
|
|
11
|
+
"juni",
|
|
12
|
+
"juli",
|
|
13
|
+
"augustus",
|
|
14
|
+
"september",
|
|
15
|
+
"oktober",
|
|
16
|
+
"november",
|
|
17
|
+
"december",
|
|
18
|
+
];
|
|
19
|
+
const WEEKDAYS_NL = ["ma", "di", "wo", "do", "vr", "za", "zo"];
|
|
20
|
+
function isoWeekOf(date) {
|
|
21
|
+
const target = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()));
|
|
22
|
+
const dayNr = (target.getUTCDay() + 6) % 7;
|
|
23
|
+
target.setUTCDate(target.getUTCDate() - dayNr + 3);
|
|
24
|
+
const firstThursday = new Date(Date.UTC(target.getUTCFullYear(), 0, 4));
|
|
25
|
+
const week = 1 +
|
|
26
|
+
Math.round(((target.getTime() - firstThursday.getTime()) / 86400000 -
|
|
27
|
+
3 +
|
|
28
|
+
((firstThursday.getUTCDay() + 6) % 7)) /
|
|
29
|
+
7);
|
|
30
|
+
return { week, year: target.getUTCFullYear() };
|
|
31
|
+
}
|
|
32
|
+
function mondayOfIsoWeek(week, year) {
|
|
33
|
+
const jan4 = new Date(Date.UTC(year, 0, 4));
|
|
34
|
+
const dayNr = (jan4.getUTCDay() + 6) % 7;
|
|
35
|
+
const monday = new Date(jan4);
|
|
36
|
+
monday.setUTCDate(jan4.getUTCDate() - dayNr + (week - 1) * 7);
|
|
37
|
+
return monday;
|
|
38
|
+
}
|
|
39
|
+
export function WeekCalendar({ week, year, onSelect, }) {
|
|
40
|
+
// Visible month derived from selected week's Monday
|
|
41
|
+
const initialMonday = mondayOfIsoWeek(week, year);
|
|
42
|
+
const [viewMonth, setViewMonth] = useState(initialMonday.getUTCMonth());
|
|
43
|
+
const [viewYear, setViewYear] = useState(initialMonday.getUTCFullYear());
|
|
44
|
+
const years = useMemo(() => {
|
|
45
|
+
const arr = [];
|
|
46
|
+
for (let y = viewYear - 6; y <= viewYear + 6; y++)
|
|
47
|
+
arr.push(y);
|
|
48
|
+
return arr;
|
|
49
|
+
}, [viewYear]);
|
|
50
|
+
const shiftMonth = (delta) => {
|
|
51
|
+
let m = viewMonth + delta;
|
|
52
|
+
let y = viewYear;
|
|
53
|
+
if (m < 0) {
|
|
54
|
+
m = 11;
|
|
55
|
+
y -= 1;
|
|
56
|
+
}
|
|
57
|
+
else if (m > 11) {
|
|
58
|
+
m = 0;
|
|
59
|
+
y += 1;
|
|
60
|
+
}
|
|
61
|
+
setViewMonth(m);
|
|
62
|
+
setViewYear(y);
|
|
63
|
+
};
|
|
64
|
+
// Build 6-week grid starting from Monday on/before the 1st of viewMonth
|
|
65
|
+
const firstOfMonth = new Date(Date.UTC(viewYear, viewMonth, 1));
|
|
66
|
+
const firstDayNr = (firstOfMonth.getUTCDay() + 6) % 7;
|
|
67
|
+
const gridStart = new Date(firstOfMonth);
|
|
68
|
+
gridStart.setUTCDate(firstOfMonth.getUTCDate() - firstDayNr);
|
|
69
|
+
const weeks = [];
|
|
70
|
+
for (let w = 0; w < 6; w++) {
|
|
71
|
+
const days = [];
|
|
72
|
+
for (let d = 0; d < 7; d++) {
|
|
73
|
+
const day = new Date(gridStart);
|
|
74
|
+
day.setUTCDate(gridStart.getUTCDate() + w * 7 + d);
|
|
75
|
+
days.push(day);
|
|
76
|
+
}
|
|
77
|
+
weeks.push({ weekNum: isoWeekOf(days[0]).week, days });
|
|
78
|
+
}
|
|
79
|
+
return (_jsxs("div", { className: "w-[320px] select-none p-3 text-sm", children: [_jsxs("div", { className: "mb-3 flex items-center justify-between", children: [_jsxs("div", { className: "flex items-center gap-3 text-base font-medium text-primary", children: [_jsxs(DropdownMenu, { children: [_jsxs(DropdownMenuTrigger, { className: "inline-flex items-center gap-0.5 rounded hover:bg-accent px-1 py-0.5", children: [MONTHS_NL[viewMonth], _jsx(ChevronDown, { className: "h-4 w-4" })] }), _jsx(DropdownMenuContent, { align: "start", className: "max-h-72 overflow-auto", children: MONTHS_NL.map((m, i) => (_jsx(DropdownMenuItem, { onSelect: () => setViewMonth(i), children: m }, m))) })] }), _jsxs(DropdownMenu, { children: [_jsxs(DropdownMenuTrigger, { className: "inline-flex items-center gap-0.5 rounded hover:bg-accent px-1 py-0.5", children: [viewYear, _jsx(ChevronDown, { className: "h-4 w-4" })] }), _jsx(DropdownMenuContent, { align: "start", className: "max-h-72 overflow-auto", children: years.map((y) => (_jsx(DropdownMenuItem, { onSelect: () => setViewYear(y), children: y }, y))) })] })] }), _jsxs("div", { className: "flex items-center gap-1 text-primary", children: [_jsx("button", { type: "button", onClick: () => shiftMonth(-1), className: "inline-flex h-7 w-7 items-center justify-center rounded hover:bg-accent", "aria-label": "Vorige maand", children: _jsx(ChevronLeft, { className: "h-4 w-4" }) }), _jsx("button", { type: "button", onClick: () => shiftMonth(1), className: "inline-flex h-7 w-7 items-center justify-center rounded hover:bg-accent", "aria-label": "Volgende maand", children: _jsx(ChevronRight, { className: "h-4 w-4" }) })] })] }), _jsxs("div", { className: "grid grid-cols-[2rem_repeat(7,1fr)] text-center text-xs text-muted-foreground", children: [_jsx("div", {}), WEEKDAYS_NL.map((d) => (_jsx("div", { className: "py-1", children: d }, d)))] }), _jsx("div", { className: "mt-1 space-y-1", children: weeks.map(({ weekNum, days }) => {
|
|
80
|
+
const dayIso = isoWeekOf(days[0]);
|
|
81
|
+
const isSelectedWeek = dayIso.week === week && dayIso.year === year;
|
|
82
|
+
return (_jsxs("div", { className: "grid grid-cols-[2rem_repeat(7,1fr)] items-center text-center", children: [_jsx("div", { className: "text-xs text-muted-foreground", children: weekNum }), days.map((day, idx) => {
|
|
83
|
+
const inMonth = day.getUTCMonth() === viewMonth;
|
|
84
|
+
const isFirst = idx === 0;
|
|
85
|
+
const isLast = idx === 6;
|
|
86
|
+
return (_jsx("button", { type: "button", onClick: () => {
|
|
87
|
+
const iso = isoWeekOf(day);
|
|
88
|
+
onSelect(iso.week, iso.year);
|
|
89
|
+
}, className: [
|
|
90
|
+
"h-8 text-sm transition-colors",
|
|
91
|
+
isSelectedWeek
|
|
92
|
+
? "bg-primary text-primary-foreground font-medium"
|
|
93
|
+
: inMonth
|
|
94
|
+
? "text-foreground hover:bg-accent rounded"
|
|
95
|
+
: "text-muted-foreground hover:bg-accent rounded",
|
|
96
|
+
isSelectedWeek && isFirst ? "rounded-l-full" : "",
|
|
97
|
+
isSelectedWeek && isLast ? "rounded-r-full" : "",
|
|
98
|
+
].join(" "), children: day.getUTCDate() }, day.toISOString()));
|
|
99
|
+
})] }, `${dayIso.year}-${weekNum}-${days[0].toISOString()}`));
|
|
100
|
+
}) })] }));
|
|
101
|
+
}
|
package/dist-lib/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { FlowModule } from "@flowselections/core";
|
|
2
2
|
export * from "./_core-safelist";
|
|
3
3
|
export { VerkoopOrdersPage } from "./components/verkoop/VerkoopOrdersPage";
|
|
4
|
+
export { SalesOrderDetailPage } from "./components/verkoop/SalesOrderDetailPage";
|
|
5
|
+
export { CreateOrderPage } from "./components/verkoop/CreateOrderPage";
|
|
4
6
|
export declare const floridayVerkoopModule: FlowModule;
|
|
5
7
|
//# 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":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEvD,cAAc,kBAAkB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEvD,cAAc,kBAAkB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAC3E,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAEvE,eAAO,MAAM,qBAAqB,EAAE,UAiBnC,CAAC"}
|
package/dist-lib/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ShoppingCart, ListOrdered } from "lucide-react";
|
|
2
2
|
export * from "./_core-safelist";
|
|
3
3
|
export { VerkoopOrdersPage } from "./components/verkoop/VerkoopOrdersPage";
|
|
4
|
+
export { SalesOrderDetailPage } from "./components/verkoop/SalesOrderDetailPage";
|
|
5
|
+
export { CreateOrderPage } from "./components/verkoop/CreateOrderPage";
|
|
4
6
|
export const floridayVerkoopModule = {
|
|
5
7
|
id: "verkoop",
|
|
6
8
|
name: "Verkoop",
|