@j3m-quantum/ui 1.7.0 → 1.9.1
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 +100 -0
- package/dist/index.cjs +1597 -182
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +503 -1
- package/dist/index.d.ts +503 -1
- package/dist/index.js +1576 -183
- package/dist/index.js.map +1 -1
- package/dist/styles/index.css +2 -0
- package/package.json +15 -2
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as React27 from 'react';
|
|
2
2
|
import { useMemo } from 'react';
|
|
3
3
|
import { Slot } from '@radix-ui/react-slot';
|
|
4
4
|
import { cva } from 'class-variance-authority';
|
|
@@ -7,7 +7,7 @@ import { twMerge } from 'tailwind-merge';
|
|
|
7
7
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
8
8
|
import * as SeparatorPrimitive from '@radix-ui/react-separator';
|
|
9
9
|
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
10
|
-
import { SearchIcon, CheckIcon, CircleIcon, ChevronDownIcon, ChevronUpIcon, ChevronRightIcon, ChevronLeftIcon, ArrowLeft, ArrowRight, Check, Loader2Icon, OctagonXIcon, TriangleAlertIcon, InfoIcon, CircleCheckIcon, ChevronRight, MoreHorizontal, MoreHorizontalIcon, XIcon, GripVerticalIcon, PanelLeftIcon, ArrowDown, ArrowUp, ChevronsUpDown, EyeOff, ChevronsLeft, ChevronLeft, ChevronsRight, Settings2, FolderIcon, ShareIcon, TrashIcon, ChevronsUpDownIcon, SparklesIcon, BadgeCheckIcon, CreditCardIcon, BellIcon, LogOutIcon, X, Flag, Factory, Truck, MessageSquare, ChevronDown, Plus, Send, MessageSquarePlus, AlertTriangle, CheckCircle, Calendar as Calendar$1, User, Clock, CalendarX2, List, Columns, Grid2x2, Grid3x3, CalendarRange, Settings, Info, Moon, ArrowUpDown, CheckCircle2, XCircle
|
|
10
|
+
import { SearchIcon, CheckIcon, CircleIcon, ChevronDownIcon, ChevronUpIcon, ChevronRightIcon, ChevronLeftIcon, ArrowLeft, ArrowRight, Check, Loader2Icon, OctagonXIcon, TriangleAlertIcon, InfoIcon, CircleCheckIcon, ChevronRight, MoreHorizontal, MoreHorizontalIcon, XIcon, GripVerticalIcon, PanelLeftIcon, ArrowDown, ArrowUp, ChevronsUpDown, EyeOff, ChevronsLeft, ChevronLeft, ChevronsRight, Settings2, FolderIcon, ShareIcon, TrashIcon, ChevronsUpDownIcon, SparklesIcon, BadgeCheckIcon, CreditCardIcon, BellIcon, LogOutIcon, X, Flag, Factory, Truck, MessageSquare, ChevronDown, Plus, Send, MessageSquarePlus, AlertTriangle, CheckCircle, Calendar as Calendar$1, MapPin, Package, User, Clock, CalendarX2, List, Columns, Grid2x2, Grid3x3, CalendarRange, Settings, Info, Moon, ArrowUpDown, CheckCircle2, XCircle } from 'lucide-react';
|
|
11
11
|
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|
12
12
|
import * as SwitchPrimitive from '@radix-ui/react-switch';
|
|
13
13
|
import * as SliderPrimitive from '@radix-ui/react-slider';
|
|
@@ -39,16 +39,17 @@ import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
|
39
39
|
import * as HoverCardPrimitive from '@radix-ui/react-hover-card';
|
|
40
40
|
import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
|
|
41
41
|
import * as ResizablePrimitive from 'react-resizable-panels';
|
|
42
|
+
import { MapContainer, TileLayer, Marker, Popup, Tooltip, ZoomControl } from 'react-leaflet';
|
|
42
43
|
import { useReactTable, getPaginationRowModel, getFilteredRowModel, getSortedRowModel, getCoreRowModel, flexRender } from '@tanstack/react-table';
|
|
43
44
|
export { flexRender, getCoreRowModel, getFilteredRowModel, getPaginationRowModel, getSortedRowModel, useReactTable } from '@tanstack/react-table';
|
|
44
|
-
import { subMonths, subYears, subWeeks, subDays, addMonths, addYears, addWeeks,
|
|
45
|
+
import { addDays, isToday, subMonths, subYears, subWeeks, subDays, addMonths, addYears, addWeeks, format, startOfWeek, endOfWeek, startOfMonth, endOfMonth, startOfYear, endOfYear, isSameMonth, isSameWeek, isSameDay, isSameYear, isWithinInterval, parseISO, differenceInMinutes, eachDayOfInterval, differenceInDays, startOfDay, setMinutes, setHours, eachHourOfInterval, endOfDay, getHours, getMinutes, addMinutes, areIntervalsOverlapping } from 'date-fns';
|
|
45
46
|
export { areIntervalsOverlapping, format, getDay, isSameDay, isSameMonth, isToday, parseISO } from 'date-fns';
|
|
46
47
|
|
|
47
48
|
// src/hooks/use-mobile.ts
|
|
48
49
|
var MOBILE_BREAKPOINT = 768;
|
|
49
50
|
function useIsMobile() {
|
|
50
|
-
const [isMobile, setIsMobile] =
|
|
51
|
-
|
|
51
|
+
const [isMobile, setIsMobile] = React27.useState(void 0);
|
|
52
|
+
React27.useEffect(() => {
|
|
52
53
|
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
|
|
53
54
|
const onChange = () => {
|
|
54
55
|
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
@@ -89,7 +90,7 @@ var buttonVariants = cva(
|
|
|
89
90
|
}
|
|
90
91
|
}
|
|
91
92
|
);
|
|
92
|
-
var Button =
|
|
93
|
+
var Button = React27.forwardRef(
|
|
93
94
|
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
94
95
|
const Comp = asChild ? Slot : "button";
|
|
95
96
|
return /* @__PURE__ */ jsx(
|
|
@@ -453,7 +454,7 @@ function Slider({
|
|
|
453
454
|
max = 100,
|
|
454
455
|
...props
|
|
455
456
|
}) {
|
|
456
|
-
const _values =
|
|
457
|
+
const _values = React27.useMemo(
|
|
457
458
|
() => Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min, max],
|
|
458
459
|
[value, defaultValue, min, max]
|
|
459
460
|
);
|
|
@@ -739,7 +740,7 @@ function Toggle({
|
|
|
739
740
|
}
|
|
740
741
|
);
|
|
741
742
|
}
|
|
742
|
-
var ToggleGroupContext =
|
|
743
|
+
var ToggleGroupContext = React27.createContext({
|
|
743
744
|
size: "default",
|
|
744
745
|
variant: "default",
|
|
745
746
|
spacing: 0
|
|
@@ -776,7 +777,7 @@ function ToggleGroupItem({
|
|
|
776
777
|
size,
|
|
777
778
|
...props
|
|
778
779
|
}) {
|
|
779
|
-
const context =
|
|
780
|
+
const context = React27.useContext(ToggleGroupContext);
|
|
780
781
|
return /* @__PURE__ */ jsx(
|
|
781
782
|
ToggleGroupPrimitive.Item,
|
|
782
783
|
{
|
|
@@ -806,7 +807,7 @@ function ThemeSwitch({
|
|
|
806
807
|
className,
|
|
807
808
|
size = "default"
|
|
808
809
|
}) {
|
|
809
|
-
const [isChecked, setIsChecked] =
|
|
810
|
+
const [isChecked, setIsChecked] = React27.useState(defaultChecked);
|
|
810
811
|
const isControlled = checked !== void 0;
|
|
811
812
|
const currentChecked = isControlled ? checked : isChecked;
|
|
812
813
|
const handleClick = () => {
|
|
@@ -1226,7 +1227,7 @@ function Label2({
|
|
|
1226
1227
|
);
|
|
1227
1228
|
}
|
|
1228
1229
|
var Form = FormProvider;
|
|
1229
|
-
var FormFieldContext =
|
|
1230
|
+
var FormFieldContext = React27.createContext(
|
|
1230
1231
|
{}
|
|
1231
1232
|
);
|
|
1232
1233
|
var FormField = ({
|
|
@@ -1235,8 +1236,8 @@ var FormField = ({
|
|
|
1235
1236
|
return /* @__PURE__ */ jsx(FormFieldContext.Provider, { value: { name: props.name }, children: /* @__PURE__ */ jsx(Controller, { ...props }) });
|
|
1236
1237
|
};
|
|
1237
1238
|
var useFormField = () => {
|
|
1238
|
-
const fieldContext =
|
|
1239
|
-
const itemContext =
|
|
1239
|
+
const fieldContext = React27.useContext(FormFieldContext);
|
|
1240
|
+
const itemContext = React27.useContext(FormItemContext);
|
|
1240
1241
|
const { getFieldState } = useFormContext();
|
|
1241
1242
|
const formState = useFormState({ name: fieldContext.name });
|
|
1242
1243
|
const fieldState = getFieldState(fieldContext.name, formState);
|
|
@@ -1253,11 +1254,11 @@ var useFormField = () => {
|
|
|
1253
1254
|
...fieldState
|
|
1254
1255
|
};
|
|
1255
1256
|
};
|
|
1256
|
-
var FormItemContext =
|
|
1257
|
+
var FormItemContext = React27.createContext(
|
|
1257
1258
|
{}
|
|
1258
1259
|
);
|
|
1259
1260
|
function FormItem({ className, ...props }) {
|
|
1260
|
-
const id =
|
|
1261
|
+
const id = React27.useId();
|
|
1261
1262
|
return /* @__PURE__ */ jsx(FormItemContext.Provider, { value: { id }, children: /* @__PURE__ */ jsx(
|
|
1262
1263
|
"div",
|
|
1263
1264
|
{
|
|
@@ -2359,8 +2360,8 @@ function CalendarDayButton({
|
|
|
2359
2360
|
modifiers,
|
|
2360
2361
|
...props
|
|
2361
2362
|
}) {
|
|
2362
|
-
const ref =
|
|
2363
|
-
|
|
2363
|
+
const ref = React27.useRef(null);
|
|
2364
|
+
React27.useEffect(() => {
|
|
2364
2365
|
if (modifiers.focused) ref.current?.focus();
|
|
2365
2366
|
}, [modifiers.focused]);
|
|
2366
2367
|
return /* @__PURE__ */ jsx(
|
|
@@ -2381,9 +2382,9 @@ function CalendarDayButton({
|
|
|
2381
2382
|
}
|
|
2382
2383
|
);
|
|
2383
2384
|
}
|
|
2384
|
-
var CarouselContext =
|
|
2385
|
+
var CarouselContext = React27.createContext(null);
|
|
2385
2386
|
function useCarousel() {
|
|
2386
|
-
const context =
|
|
2387
|
+
const context = React27.useContext(CarouselContext);
|
|
2387
2388
|
if (!context) {
|
|
2388
2389
|
throw new Error("useCarousel must be used within a <Carousel />");
|
|
2389
2390
|
}
|
|
@@ -2405,20 +2406,20 @@ function Carousel({
|
|
|
2405
2406
|
},
|
|
2406
2407
|
plugins
|
|
2407
2408
|
);
|
|
2408
|
-
const [canScrollPrev, setCanScrollPrev] =
|
|
2409
|
-
const [canScrollNext, setCanScrollNext] =
|
|
2410
|
-
const onSelect =
|
|
2409
|
+
const [canScrollPrev, setCanScrollPrev] = React27.useState(false);
|
|
2410
|
+
const [canScrollNext, setCanScrollNext] = React27.useState(false);
|
|
2411
|
+
const onSelect = React27.useCallback((api2) => {
|
|
2411
2412
|
if (!api2) return;
|
|
2412
2413
|
setCanScrollPrev(api2.canScrollPrev());
|
|
2413
2414
|
setCanScrollNext(api2.canScrollNext());
|
|
2414
2415
|
}, []);
|
|
2415
|
-
const scrollPrev =
|
|
2416
|
+
const scrollPrev = React27.useCallback(() => {
|
|
2416
2417
|
api?.scrollPrev();
|
|
2417
2418
|
}, [api]);
|
|
2418
|
-
const scrollNext =
|
|
2419
|
+
const scrollNext = React27.useCallback(() => {
|
|
2419
2420
|
api?.scrollNext();
|
|
2420
2421
|
}, [api]);
|
|
2421
|
-
const handleKeyDown =
|
|
2422
|
+
const handleKeyDown = React27.useCallback(
|
|
2422
2423
|
(event) => {
|
|
2423
2424
|
if (event.key === "ArrowLeft") {
|
|
2424
2425
|
event.preventDefault();
|
|
@@ -2430,11 +2431,11 @@ function Carousel({
|
|
|
2430
2431
|
},
|
|
2431
2432
|
[scrollPrev, scrollNext]
|
|
2432
2433
|
);
|
|
2433
|
-
|
|
2434
|
+
React27.useEffect(() => {
|
|
2434
2435
|
if (!api || !setApi) return;
|
|
2435
2436
|
setApi(api);
|
|
2436
2437
|
}, [api, setApi]);
|
|
2437
|
-
|
|
2438
|
+
React27.useEffect(() => {
|
|
2438
2439
|
if (!api) return;
|
|
2439
2440
|
onSelect(api);
|
|
2440
2441
|
api.on("reInit", onSelect);
|
|
@@ -2567,9 +2568,9 @@ function CarouselNext({
|
|
|
2567
2568
|
);
|
|
2568
2569
|
}
|
|
2569
2570
|
var THEMES = { light: "", dark: ".dark" };
|
|
2570
|
-
var ChartContext =
|
|
2571
|
+
var ChartContext = React27.createContext(null);
|
|
2571
2572
|
function useChart() {
|
|
2572
|
-
const context =
|
|
2573
|
+
const context = React27.useContext(ChartContext);
|
|
2573
2574
|
if (!context) {
|
|
2574
2575
|
throw new Error("useChart must be used within a <ChartContainer />");
|
|
2575
2576
|
}
|
|
@@ -2582,7 +2583,7 @@ function ChartContainer({
|
|
|
2582
2583
|
config,
|
|
2583
2584
|
...props
|
|
2584
2585
|
}) {
|
|
2585
|
-
const uniqueId =
|
|
2586
|
+
const uniqueId = React27.useId();
|
|
2586
2587
|
const chartId = `chart-${id || uniqueId.replace(/:/g, "")}`;
|
|
2587
2588
|
return /* @__PURE__ */ jsx(ChartContext.Provider, { value: { config }, children: /* @__PURE__ */ jsxs(
|
|
2588
2589
|
"div",
|
|
@@ -2643,7 +2644,7 @@ function ChartTooltipContent({
|
|
|
2643
2644
|
labelKey
|
|
2644
2645
|
}) {
|
|
2645
2646
|
const { config } = useChart();
|
|
2646
|
-
const tooltipLabel =
|
|
2647
|
+
const tooltipLabel = React27.useMemo(() => {
|
|
2647
2648
|
if (hideLabel || !payload?.length) {
|
|
2648
2649
|
return null;
|
|
2649
2650
|
}
|
|
@@ -3445,8 +3446,8 @@ function TooltipContent({
|
|
|
3445
3446
|
) });
|
|
3446
3447
|
}
|
|
3447
3448
|
function useDetectTheme() {
|
|
3448
|
-
const [theme, setTheme] =
|
|
3449
|
-
|
|
3449
|
+
const [theme, setTheme] = React27.useState("light");
|
|
3450
|
+
React27.useEffect(() => {
|
|
3450
3451
|
const isDark = document.documentElement.classList.contains("dark");
|
|
3451
3452
|
setTheme(isDark ? "dark" : "light");
|
|
3452
3453
|
const observer = new MutationObserver((mutations) => {
|
|
@@ -4095,7 +4096,7 @@ function CommandShortcut({
|
|
|
4095
4096
|
}
|
|
4096
4097
|
);
|
|
4097
4098
|
}
|
|
4098
|
-
var SearchTrigger =
|
|
4099
|
+
var SearchTrigger = React27.forwardRef(
|
|
4099
4100
|
({
|
|
4100
4101
|
className,
|
|
4101
4102
|
placeholder = "Search...",
|
|
@@ -4131,7 +4132,7 @@ var SearchTrigger = React22.forwardRef(
|
|
|
4131
4132
|
);
|
|
4132
4133
|
SearchTrigger.displayName = "SearchTrigger";
|
|
4133
4134
|
function useSearchShortcut(onOpen, key = "k") {
|
|
4134
|
-
|
|
4135
|
+
React27.useEffect(() => {
|
|
4135
4136
|
const down = (e) => {
|
|
4136
4137
|
if (e.key.toLowerCase() === key.toLowerCase() && (e.metaKey || e.ctrlKey)) {
|
|
4137
4138
|
e.preventDefault();
|
|
@@ -5106,9 +5107,9 @@ var SIDEBAR_WIDTH = "16rem";
|
|
|
5106
5107
|
var SIDEBAR_WIDTH_MOBILE = "18rem";
|
|
5107
5108
|
var SIDEBAR_WIDTH_ICON = "3rem";
|
|
5108
5109
|
var SIDEBAR_KEYBOARD_SHORTCUT = "b";
|
|
5109
|
-
var SidebarContext =
|
|
5110
|
+
var SidebarContext = React27.createContext(null);
|
|
5110
5111
|
function useSidebar() {
|
|
5111
|
-
const context =
|
|
5112
|
+
const context = React27.useContext(SidebarContext);
|
|
5112
5113
|
if (!context) {
|
|
5113
5114
|
throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
5114
5115
|
}
|
|
@@ -5124,10 +5125,10 @@ function SidebarProvider({
|
|
|
5124
5125
|
...props
|
|
5125
5126
|
}) {
|
|
5126
5127
|
const isMobile = useIsMobile();
|
|
5127
|
-
const [openMobile, setOpenMobile] =
|
|
5128
|
-
const [_open, _setOpen] =
|
|
5128
|
+
const [openMobile, setOpenMobile] = React27.useState(false);
|
|
5129
|
+
const [_open, _setOpen] = React27.useState(defaultOpen);
|
|
5129
5130
|
const open = openProp ?? _open;
|
|
5130
|
-
const setOpen =
|
|
5131
|
+
const setOpen = React27.useCallback(
|
|
5131
5132
|
(value) => {
|
|
5132
5133
|
const openState = typeof value === "function" ? value(open) : value;
|
|
5133
5134
|
if (setOpenProp) {
|
|
@@ -5139,10 +5140,10 @@ function SidebarProvider({
|
|
|
5139
5140
|
},
|
|
5140
5141
|
[setOpenProp, open]
|
|
5141
5142
|
);
|
|
5142
|
-
const toggleSidebar =
|
|
5143
|
+
const toggleSidebar = React27.useCallback(() => {
|
|
5143
5144
|
return isMobile ? setOpenMobile((open2) => !open2) : setOpen((open2) => !open2);
|
|
5144
5145
|
}, [isMobile, setOpen, setOpenMobile]);
|
|
5145
|
-
|
|
5146
|
+
React27.useEffect(() => {
|
|
5146
5147
|
const handleKeyDown = (event) => {
|
|
5147
5148
|
if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
|
|
5148
5149
|
event.preventDefault();
|
|
@@ -5153,7 +5154,7 @@ function SidebarProvider({
|
|
|
5153
5154
|
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
5154
5155
|
}, [toggleSidebar]);
|
|
5155
5156
|
const state = open ? "expanded" : "collapsed";
|
|
5156
|
-
const contextValue =
|
|
5157
|
+
const contextValue = React27.useMemo(
|
|
5157
5158
|
() => ({
|
|
5158
5159
|
state,
|
|
5159
5160
|
open,
|
|
@@ -5611,7 +5612,7 @@ function SidebarMenuSkeleton({
|
|
|
5611
5612
|
showIcon = false,
|
|
5612
5613
|
...props
|
|
5613
5614
|
}) {
|
|
5614
|
-
const width =
|
|
5615
|
+
const width = React27.useMemo(() => {
|
|
5615
5616
|
return `${Math.floor(Math.random() * 40) + 50}%`;
|
|
5616
5617
|
}, []);
|
|
5617
5618
|
return /* @__PURE__ */ jsxs(
|
|
@@ -5754,7 +5755,7 @@ var sectionVariants = cva(
|
|
|
5754
5755
|
}
|
|
5755
5756
|
);
|
|
5756
5757
|
var isGlassVariant = (variant) => variant?.startsWith("glass-") ?? false;
|
|
5757
|
-
var Section =
|
|
5758
|
+
var Section = React27.forwardRef(
|
|
5758
5759
|
({ className, variant, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
5759
5760
|
"section",
|
|
5760
5761
|
{
|
|
@@ -5766,7 +5767,7 @@ var Section = React22.forwardRef(
|
|
|
5766
5767
|
)
|
|
5767
5768
|
);
|
|
5768
5769
|
Section.displayName = "Section";
|
|
5769
|
-
var SectionHeader =
|
|
5770
|
+
var SectionHeader = React27.forwardRef(
|
|
5770
5771
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
5771
5772
|
"div",
|
|
5772
5773
|
{
|
|
@@ -5781,7 +5782,7 @@ var SectionHeader = React22.forwardRef(
|
|
|
5781
5782
|
)
|
|
5782
5783
|
);
|
|
5783
5784
|
SectionHeader.displayName = "SectionHeader";
|
|
5784
|
-
var SectionTitle =
|
|
5785
|
+
var SectionTitle = React27.forwardRef(
|
|
5785
5786
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
5786
5787
|
"h2",
|
|
5787
5788
|
{
|
|
@@ -5795,7 +5796,7 @@ var SectionTitle = React22.forwardRef(
|
|
|
5795
5796
|
)
|
|
5796
5797
|
);
|
|
5797
5798
|
SectionTitle.displayName = "SectionTitle";
|
|
5798
|
-
var SectionDescription =
|
|
5799
|
+
var SectionDescription = React27.forwardRef(
|
|
5799
5800
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
5800
5801
|
"p",
|
|
5801
5802
|
{
|
|
@@ -5809,7 +5810,7 @@ var SectionDescription = React22.forwardRef(
|
|
|
5809
5810
|
)
|
|
5810
5811
|
);
|
|
5811
5812
|
SectionDescription.displayName = "SectionDescription";
|
|
5812
|
-
var SectionContent =
|
|
5813
|
+
var SectionContent = React27.forwardRef(
|
|
5813
5814
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
5814
5815
|
"div",
|
|
5815
5816
|
{
|
|
@@ -5823,7 +5824,7 @@ var SectionContent = React22.forwardRef(
|
|
|
5823
5824
|
)
|
|
5824
5825
|
);
|
|
5825
5826
|
SectionContent.displayName = "SectionContent";
|
|
5826
|
-
var SectionFooter =
|
|
5827
|
+
var SectionFooter = React27.forwardRef(
|
|
5827
5828
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
5828
5829
|
"div",
|
|
5829
5830
|
{
|
|
@@ -5839,6 +5840,89 @@ var SectionFooter = React22.forwardRef(
|
|
|
5839
5840
|
)
|
|
5840
5841
|
);
|
|
5841
5842
|
SectionFooter.displayName = "SectionFooter";
|
|
5843
|
+
function Map2({
|
|
5844
|
+
center,
|
|
5845
|
+
zoom = 13,
|
|
5846
|
+
className,
|
|
5847
|
+
children,
|
|
5848
|
+
...props
|
|
5849
|
+
}) {
|
|
5850
|
+
return /* @__PURE__ */ jsx(
|
|
5851
|
+
MapContainer,
|
|
5852
|
+
{
|
|
5853
|
+
center,
|
|
5854
|
+
zoom,
|
|
5855
|
+
className: cn(
|
|
5856
|
+
"w-full rounded-lg border border-border overflow-hidden",
|
|
5857
|
+
"[&_.leaflet-control-zoom]:border-border",
|
|
5858
|
+
"[&_.leaflet-control-zoom]:rounded-md",
|
|
5859
|
+
"[&_.leaflet-control-zoom]:shadow-sm",
|
|
5860
|
+
"[&_.leaflet-control-zoom-in]:rounded-t-md",
|
|
5861
|
+
"[&_.leaflet-control-zoom-in]:border-b",
|
|
5862
|
+
"[&_.leaflet-control-zoom-in]:border-border",
|
|
5863
|
+
"[&_.leaflet-control-zoom-out]:rounded-b-md",
|
|
5864
|
+
"[&_.leaflet-popup-content-wrapper]:rounded-lg",
|
|
5865
|
+
"[&_.leaflet-popup-content-wrapper]:shadow-lg",
|
|
5866
|
+
"[&_.leaflet-popup-content-wrapper]:border",
|
|
5867
|
+
"[&_.leaflet-popup-content-wrapper]:border-border",
|
|
5868
|
+
className
|
|
5869
|
+
),
|
|
5870
|
+
scrollWheelZoom: true,
|
|
5871
|
+
...props,
|
|
5872
|
+
children
|
|
5873
|
+
}
|
|
5874
|
+
);
|
|
5875
|
+
}
|
|
5876
|
+
var TILE_LAYERS = {
|
|
5877
|
+
default: {
|
|
5878
|
+
url: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
|
|
5879
|
+
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
|
|
5880
|
+
},
|
|
5881
|
+
dark: {
|
|
5882
|
+
url: "https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png",
|
|
5883
|
+
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors © <a href="https://carto.com/attributions">CARTO</a>'
|
|
5884
|
+
},
|
|
5885
|
+
satellite: {
|
|
5886
|
+
url: "https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}",
|
|
5887
|
+
attribution: "© Esri — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community"
|
|
5888
|
+
}
|
|
5889
|
+
};
|
|
5890
|
+
function MapTileLayer({
|
|
5891
|
+
variant = "default",
|
|
5892
|
+
...props
|
|
5893
|
+
}) {
|
|
5894
|
+
const layer = TILE_LAYERS[variant];
|
|
5895
|
+
return /* @__PURE__ */ jsx(
|
|
5896
|
+
TileLayer,
|
|
5897
|
+
{
|
|
5898
|
+
url: layer.url,
|
|
5899
|
+
attribution: layer.attribution,
|
|
5900
|
+
...props
|
|
5901
|
+
}
|
|
5902
|
+
);
|
|
5903
|
+
}
|
|
5904
|
+
function MapMarker({
|
|
5905
|
+
position,
|
|
5906
|
+
children,
|
|
5907
|
+
...props
|
|
5908
|
+
}) {
|
|
5909
|
+
return /* @__PURE__ */ jsx(Marker, { position, ...props, children });
|
|
5910
|
+
}
|
|
5911
|
+
function MapPopup({
|
|
5912
|
+
children,
|
|
5913
|
+
...props
|
|
5914
|
+
}) {
|
|
5915
|
+
return /* @__PURE__ */ jsx(Popup, { ...props, children: /* @__PURE__ */ jsx("div", { className: "text-sm", children }) });
|
|
5916
|
+
}
|
|
5917
|
+
function MapTooltip({
|
|
5918
|
+
children,
|
|
5919
|
+
...props
|
|
5920
|
+
}) {
|
|
5921
|
+
return /* @__PURE__ */ jsx(Tooltip, { ...props, children });
|
|
5922
|
+
}
|
|
5923
|
+
function MapZoomControl(props) {
|
|
5924
|
+
return /* @__PURE__ */ jsx(ZoomControl, { ...props });
|
|
5925
|
+
}
|
|
5842
5926
|
function DataTableColumnHeader({
|
|
5843
5927
|
column,
|
|
5844
5928
|
title,
|
|
@@ -6048,7 +6132,7 @@ function SiteHeader({
|
|
|
6048
6132
|
children: /* @__PURE__ */ jsxs("div", { className: "flex h-[var(--header-height,3.5rem)] w-full items-center gap-[var(--j3m-spacing-s)] px-[var(--j3m-spacing-m)]", children: [
|
|
6049
6133
|
trigger,
|
|
6050
6134
|
trigger && /* @__PURE__ */ jsx(Separator, { orientation: "vertical", className: "mr-[var(--j3m-spacing-s)] h-4" }),
|
|
6051
|
-
/* @__PURE__ */ jsx(Breadcrumb, { className: "hidden sm:block", children: /* @__PURE__ */ jsx(BreadcrumbList, { children: breadcrumbs.map((item, index) => /* @__PURE__ */ jsxs(
|
|
6135
|
+
/* @__PURE__ */ jsx(Breadcrumb, { className: "hidden sm:block", children: /* @__PURE__ */ jsx(BreadcrumbList, { children: breadcrumbs.map((item, index) => /* @__PURE__ */ jsxs(React27.Fragment, { children: [
|
|
6052
6136
|
index > 0 && /* @__PURE__ */ jsx(BreadcrumbSeparator, {}),
|
|
6053
6137
|
/* @__PURE__ */ jsx(BreadcrumbItem, { children: item.href ? /* @__PURE__ */ jsx(BreadcrumbLink, { href: item.href, children: item.label }) : /* @__PURE__ */ jsx(BreadcrumbPage, { children: item.label }) })
|
|
6054
6138
|
] }, index)) }) }),
|
|
@@ -6655,11 +6739,11 @@ function PlanningWeekCommentPopover({
|
|
|
6655
6739
|
open,
|
|
6656
6740
|
onOpenChange
|
|
6657
6741
|
}) {
|
|
6658
|
-
const [newCommentText, setNewCommentText] =
|
|
6659
|
-
const [selectedLocationId, setSelectedLocationId] =
|
|
6660
|
-
const [viewCommentsOpen, setViewCommentsOpen] =
|
|
6661
|
-
const [showAddForm, setShowAddForm] =
|
|
6662
|
-
const selectedLocation =
|
|
6742
|
+
const [newCommentText, setNewCommentText] = React27.useState("");
|
|
6743
|
+
const [selectedLocationId, setSelectedLocationId] = React27.useState("");
|
|
6744
|
+
const [viewCommentsOpen, setViewCommentsOpen] = React27.useState(true);
|
|
6745
|
+
const [showAddForm, setShowAddForm] = React27.useState(false);
|
|
6746
|
+
const selectedLocation = React27.useMemo(() => {
|
|
6663
6747
|
return locationOptions.find((opt) => opt.id === selectedLocationId);
|
|
6664
6748
|
}, [locationOptions, selectedLocationId]);
|
|
6665
6749
|
const handleSubmit = () => {
|
|
@@ -6703,8 +6787,8 @@ function PlanningWeekCommentPopover({
|
|
|
6703
6787
|
minute: "2-digit"
|
|
6704
6788
|
}).format(date);
|
|
6705
6789
|
};
|
|
6706
|
-
const prevOpenRef =
|
|
6707
|
-
|
|
6790
|
+
const prevOpenRef = React27.useRef(open);
|
|
6791
|
+
React27.useEffect(() => {
|
|
6708
6792
|
const wasOpen = prevOpenRef.current;
|
|
6709
6793
|
prevOpenRef.current = open;
|
|
6710
6794
|
if (wasOpen && !open) {
|
|
@@ -6727,7 +6811,7 @@ function PlanningWeekCommentPopover({
|
|
|
6727
6811
|
/* @__PURE__ */ jsx("h4", { className: "text-sm font-semibold", children: "Comments" }),
|
|
6728
6812
|
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: weekLabel })
|
|
6729
6813
|
] }),
|
|
6730
|
-
/* @__PURE__ */ jsxs("div", { className: "p-2 space-y-2
|
|
6814
|
+
/* @__PURE__ */ jsxs("div", { className: "p-2 space-y-2 h-fit overflow-y-auto", children: [
|
|
6731
6815
|
/* @__PURE__ */ jsxs(Collapsible, { open: viewCommentsOpen, onOpenChange: setViewCommentsOpen, children: [
|
|
6732
6816
|
/* @__PURE__ */ jsx(CollapsibleTrigger2, { asChild: true, children: /* @__PURE__ */ jsxs(Button, { variant: "ghost", size: "sm", className: "w-full justify-between h-8 px-2", children: [
|
|
6733
6817
|
/* @__PURE__ */ jsxs("span", { className: "text-xs font-medium", children: [
|
|
@@ -7058,22 +7142,22 @@ function PlanningTable({
|
|
|
7058
7142
|
stickySupplierColumn = true,
|
|
7059
7143
|
maxHeight = "600px"
|
|
7060
7144
|
} = config;
|
|
7061
|
-
const weeks =
|
|
7145
|
+
const weeks = React27.useMemo(
|
|
7062
7146
|
() => generateWeeks(startDate, weekCount),
|
|
7063
7147
|
[startDate, weekCount]
|
|
7064
7148
|
);
|
|
7065
|
-
const currentWeekKey =
|
|
7149
|
+
const currentWeekKey = React27.useMemo(() => {
|
|
7066
7150
|
const currentWeek = weeks.find((w) => w.isCurrentWeek);
|
|
7067
7151
|
return currentWeek ? getWeekKey(currentWeek.startDate) : null;
|
|
7068
7152
|
}, [weeks]);
|
|
7069
|
-
const columns =
|
|
7153
|
+
const columns = React27.useMemo(
|
|
7070
7154
|
() => generateColumns(weeks, config, suppliers),
|
|
7071
7155
|
[weeks, config, suppliers]
|
|
7072
7156
|
);
|
|
7073
|
-
const [sorting, setSorting] =
|
|
7074
|
-
const [columnFilters, setColumnFilters] =
|
|
7075
|
-
const [columnVisibility, setColumnVisibility] =
|
|
7076
|
-
const [rowSelection, setRowSelection] =
|
|
7157
|
+
const [sorting, setSorting] = React27.useState([]);
|
|
7158
|
+
const [columnFilters, setColumnFilters] = React27.useState([]);
|
|
7159
|
+
const [columnVisibility, setColumnVisibility] = React27.useState({});
|
|
7160
|
+
const [rowSelection, setRowSelection] = React27.useState({});
|
|
7077
7161
|
const table = useReactTable({
|
|
7078
7162
|
data: suppliers,
|
|
7079
7163
|
columns,
|
|
@@ -7280,10 +7364,10 @@ function DeliveryCommentPopover({
|
|
|
7280
7364
|
onAddComment,
|
|
7281
7365
|
deliveryLabel
|
|
7282
7366
|
}) {
|
|
7283
|
-
const [open, setOpen] =
|
|
7284
|
-
const [newCommentText, setNewCommentText] =
|
|
7285
|
-
const [viewCommentsOpen, setViewCommentsOpen] =
|
|
7286
|
-
const [showAddForm, setShowAddForm] =
|
|
7367
|
+
const [open, setOpen] = React27.useState(false);
|
|
7368
|
+
const [newCommentText, setNewCommentText] = React27.useState("");
|
|
7369
|
+
const [viewCommentsOpen, setViewCommentsOpen] = React27.useState(true);
|
|
7370
|
+
const [showAddForm, setShowAddForm] = React27.useState(false);
|
|
7287
7371
|
const handleSubmit = () => {
|
|
7288
7372
|
if (newCommentText.trim() && onAddComment) {
|
|
7289
7373
|
onAddComment(newCommentText.trim());
|
|
@@ -7310,8 +7394,8 @@ function DeliveryCommentPopover({
|
|
|
7310
7394
|
minute: "2-digit"
|
|
7311
7395
|
}).format(date);
|
|
7312
7396
|
};
|
|
7313
|
-
const prevOpenRef =
|
|
7314
|
-
|
|
7397
|
+
const prevOpenRef = React27.useRef(open);
|
|
7398
|
+
React27.useEffect(() => {
|
|
7315
7399
|
const wasOpen = prevOpenRef.current;
|
|
7316
7400
|
prevOpenRef.current = open;
|
|
7317
7401
|
if (wasOpen && !open) {
|
|
@@ -7333,7 +7417,7 @@ function DeliveryCommentPopover({
|
|
|
7333
7417
|
/* @__PURE__ */ jsx("h4", { className: "text-sm font-semibold", children: "Comments" }),
|
|
7334
7418
|
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: deliveryLabel })
|
|
7335
7419
|
] }),
|
|
7336
|
-
/* @__PURE__ */ jsxs("div", { className: "p-2 space-y-2
|
|
7420
|
+
/* @__PURE__ */ jsxs("div", { className: "p-2 space-y-2 h-fit overflow-y-auto", children: [
|
|
7337
7421
|
/* @__PURE__ */ jsxs(Collapsible, { open: viewCommentsOpen, onOpenChange: setViewCommentsOpen, children: [
|
|
7338
7422
|
/* @__PURE__ */ jsx(CollapsibleTrigger2, { asChild: true, children: /* @__PURE__ */ jsxs(Button, { variant: "ghost", size: "sm", className: "w-full justify-between h-8 px-2", children: [
|
|
7339
7423
|
/* @__PURE__ */ jsxs("span", { className: "text-xs font-medium", children: [
|
|
@@ -7423,8 +7507,8 @@ function ProductionCommentSection({
|
|
|
7423
7507
|
comments = [],
|
|
7424
7508
|
onAddComment
|
|
7425
7509
|
}) {
|
|
7426
|
-
const [showAddForm, setShowAddForm] =
|
|
7427
|
-
const [newComment, setNewComment] =
|
|
7510
|
+
const [showAddForm, setShowAddForm] = React27.useState(false);
|
|
7511
|
+
const [newComment, setNewComment] = React27.useState("");
|
|
7428
7512
|
const handleSubmit = () => {
|
|
7429
7513
|
if (newComment.trim() && onAddComment) {
|
|
7430
7514
|
onAddComment(newComment.trim());
|
|
@@ -7580,7 +7664,7 @@ function DeliveryDetailsView({
|
|
|
7580
7664
|
onAddComment
|
|
7581
7665
|
}) {
|
|
7582
7666
|
const elements = delivery.elements ?? [];
|
|
7583
|
-
const categorizedElements =
|
|
7667
|
+
const categorizedElements = React27.useMemo(() => {
|
|
7584
7668
|
const sent = [];
|
|
7585
7669
|
const notSent = [];
|
|
7586
7670
|
const moved = [];
|
|
@@ -7948,15 +8032,15 @@ function WeekDetailDialog({
|
|
|
7948
8032
|
}) {
|
|
7949
8033
|
const production = data?.production;
|
|
7950
8034
|
const initialProduced = production?.produced ?? 0;
|
|
7951
|
-
const [producedValue, setProducedValue] =
|
|
7952
|
-
const [hasChanges, setHasChanges] =
|
|
7953
|
-
const [selectedDelivery, setSelectedDelivery] =
|
|
7954
|
-
|
|
8035
|
+
const [producedValue, setProducedValue] = React27.useState(initialProduced.toString());
|
|
8036
|
+
const [hasChanges, setHasChanges] = React27.useState(false);
|
|
8037
|
+
const [selectedDelivery, setSelectedDelivery] = React27.useState(null);
|
|
8038
|
+
React27.useEffect(() => {
|
|
7955
8039
|
const newProduced = data?.production?.produced ?? 0;
|
|
7956
8040
|
setProducedValue(newProduced.toString());
|
|
7957
8041
|
setHasChanges(false);
|
|
7958
8042
|
}, [data]);
|
|
7959
|
-
|
|
8043
|
+
React27.useEffect(() => {
|
|
7960
8044
|
if (!open) {
|
|
7961
8045
|
setSelectedDelivery(null);
|
|
7962
8046
|
}
|
|
@@ -8178,13 +8262,13 @@ function CalibrationWeekCell({
|
|
|
8178
8262
|
onAddClick,
|
|
8179
8263
|
...props
|
|
8180
8264
|
}) {
|
|
8181
|
-
const inputRef =
|
|
8182
|
-
const [localValue, setLocalValue] =
|
|
8265
|
+
const inputRef = React27.useRef(null);
|
|
8266
|
+
const [localValue, setLocalValue] = React27.useState(
|
|
8183
8267
|
data.entered !== null ? String(data.entered) : ""
|
|
8184
8268
|
);
|
|
8185
|
-
const [isHovered, setIsHovered] =
|
|
8186
|
-
const [isEditing, setIsEditing] =
|
|
8187
|
-
|
|
8269
|
+
const [isHovered, setIsHovered] = React27.useState(false);
|
|
8270
|
+
const [isEditing, setIsEditing] = React27.useState(false);
|
|
8271
|
+
React27.useEffect(() => {
|
|
8188
8272
|
setLocalValue(data.entered !== null ? String(data.entered) : "");
|
|
8189
8273
|
}, [data.entered]);
|
|
8190
8274
|
const unitLabel = formatCalibrationUnit(unit);
|
|
@@ -8370,11 +8454,11 @@ function CommentPopover({
|
|
|
8370
8454
|
open,
|
|
8371
8455
|
onOpenChange
|
|
8372
8456
|
}) {
|
|
8373
|
-
const [newCommentText, setNewCommentText] =
|
|
8374
|
-
const [selectedPrefixId, setSelectedPrefixId] =
|
|
8375
|
-
const [viewCommentsOpen, setViewCommentsOpen] =
|
|
8376
|
-
const [showAddForm, setShowAddForm] =
|
|
8377
|
-
const selectedPrefixName =
|
|
8457
|
+
const [newCommentText, setNewCommentText] = React27.useState("");
|
|
8458
|
+
const [selectedPrefixId, setSelectedPrefixId] = React27.useState("");
|
|
8459
|
+
const [viewCommentsOpen, setViewCommentsOpen] = React27.useState(true);
|
|
8460
|
+
const [showAddForm, setShowAddForm] = React27.useState(false);
|
|
8461
|
+
const selectedPrefixName = React27.useMemo(() => {
|
|
8378
8462
|
const prefix = availablePrefixes.find((p) => p.id === selectedPrefixId);
|
|
8379
8463
|
return prefix?.name ?? "";
|
|
8380
8464
|
}, [availablePrefixes, selectedPrefixId]);
|
|
@@ -8406,8 +8490,8 @@ function CommentPopover({
|
|
|
8406
8490
|
minute: "2-digit"
|
|
8407
8491
|
}).format(date);
|
|
8408
8492
|
};
|
|
8409
|
-
const prevOpenRef =
|
|
8410
|
-
|
|
8493
|
+
const prevOpenRef = React27.useRef(open);
|
|
8494
|
+
React27.useEffect(() => {
|
|
8411
8495
|
const wasOpen = prevOpenRef.current;
|
|
8412
8496
|
prevOpenRef.current = open;
|
|
8413
8497
|
if (wasOpen && !open) {
|
|
@@ -8430,7 +8514,7 @@ function CommentPopover({
|
|
|
8430
8514
|
/* @__PURE__ */ jsx("h4", { className: "text-sm font-semibold", children: "Comments" }),
|
|
8431
8515
|
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: weekLabel })
|
|
8432
8516
|
] }),
|
|
8433
|
-
/* @__PURE__ */ jsxs("div", { className: "p-2 space-y-2
|
|
8517
|
+
/* @__PURE__ */ jsxs("div", { className: "p-2 space-y-2 h-fit overflow-y-auto", children: [
|
|
8434
8518
|
/* @__PURE__ */ jsxs(Collapsible, { open: viewCommentsOpen, onOpenChange: setViewCommentsOpen, children: [
|
|
8435
8519
|
/* @__PURE__ */ jsx(CollapsibleTrigger2, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
8436
8520
|
Button,
|
|
@@ -8636,7 +8720,7 @@ function CalibrationTable({
|
|
|
8636
8720
|
onAddComment,
|
|
8637
8721
|
onAddEarlierWeek
|
|
8638
8722
|
} = config;
|
|
8639
|
-
const calculatedStartDate =
|
|
8723
|
+
const calculatedStartDate = React27.useMemo(() => {
|
|
8640
8724
|
if (startDate) return startDate;
|
|
8641
8725
|
let earliest = null;
|
|
8642
8726
|
for (const prefix of prefixes) {
|
|
@@ -8657,31 +8741,31 @@ function CalibrationTable({
|
|
|
8657
8741
|
}
|
|
8658
8742
|
return earliest ?? /* @__PURE__ */ new Date();
|
|
8659
8743
|
}, [startDate, prefixes]);
|
|
8660
|
-
const [additionalWeeks, setAdditionalWeeks] =
|
|
8661
|
-
const weeks =
|
|
8744
|
+
const [additionalWeeks, setAdditionalWeeks] = React27.useState(0);
|
|
8745
|
+
const weeks = React27.useMemo(() => {
|
|
8662
8746
|
const start = new Date(calculatedStartDate);
|
|
8663
8747
|
start.setDate(start.getDate() - additionalWeeks * 7);
|
|
8664
8748
|
return generateWeeks(start, weekCount + additionalWeeks);
|
|
8665
8749
|
}, [calculatedStartDate, weekCount, additionalWeeks]);
|
|
8666
|
-
|
|
8750
|
+
React27.useMemo(() => {
|
|
8667
8751
|
const currentWeek = weeks.find((w) => w.isCurrentWeek);
|
|
8668
8752
|
return currentWeek ? getWeekKey(currentWeek.startDate) : null;
|
|
8669
8753
|
}, [weeks]);
|
|
8670
|
-
const [currentPage, setCurrentPage] =
|
|
8671
|
-
const [pageSize, setPageSize] =
|
|
8672
|
-
const [searchQuery, setSearchQuery] =
|
|
8673
|
-
const filteredPrefixes =
|
|
8754
|
+
const [currentPage, setCurrentPage] = React27.useState(0);
|
|
8755
|
+
const [pageSize, setPageSize] = React27.useState(defaultPageSize);
|
|
8756
|
+
const [searchQuery, setSearchQuery] = React27.useState("");
|
|
8757
|
+
const filteredPrefixes = React27.useMemo(() => {
|
|
8674
8758
|
if (!searchQuery) return prefixes;
|
|
8675
8759
|
const query = searchQuery.toLowerCase();
|
|
8676
8760
|
return prefixes.filter(
|
|
8677
8761
|
(p) => p.name.toLowerCase().includes(query) || p.typeCode.toLowerCase().includes(query)
|
|
8678
8762
|
);
|
|
8679
8763
|
}, [prefixes, searchQuery]);
|
|
8680
|
-
const paginatedPrefixes =
|
|
8764
|
+
const paginatedPrefixes = React27.useMemo(() => {
|
|
8681
8765
|
const start = currentPage * pageSize;
|
|
8682
8766
|
return filteredPrefixes.slice(start, start + pageSize);
|
|
8683
8767
|
}, [filteredPrefixes, currentPage, pageSize]);
|
|
8684
|
-
|
|
8768
|
+
React27.useMemo(
|
|
8685
8769
|
() => canSubmitCalibration(prefixes),
|
|
8686
8770
|
[prefixes]
|
|
8687
8771
|
);
|
|
@@ -8705,7 +8789,7 @@ function CalibrationTable({
|
|
|
8705
8789
|
}
|
|
8706
8790
|
return allComments;
|
|
8707
8791
|
};
|
|
8708
|
-
const availablePrefixes =
|
|
8792
|
+
const availablePrefixes = React27.useMemo(
|
|
8709
8793
|
() => prefixes.map((p) => ({ id: p.id, name: p.name })),
|
|
8710
8794
|
[prefixes]
|
|
8711
8795
|
);
|
|
@@ -8942,14 +9026,14 @@ function CommentDialog({
|
|
|
8942
9026
|
open,
|
|
8943
9027
|
onOpenChange
|
|
8944
9028
|
}) {
|
|
8945
|
-
const [selectedPrefixId, setSelectedPrefixId] =
|
|
8946
|
-
const [selectedWeekKey, setSelectedWeekKey] =
|
|
8947
|
-
const [commentText, setCommentText] =
|
|
8948
|
-
const currentWeek =
|
|
9029
|
+
const [selectedPrefixId, setSelectedPrefixId] = React27.useState("");
|
|
9030
|
+
const [selectedWeekKey, setSelectedWeekKey] = React27.useState("");
|
|
9031
|
+
const [commentText, setCommentText] = React27.useState("");
|
|
9032
|
+
const currentWeek = React27.useMemo(
|
|
8949
9033
|
() => weeks.find((w) => w.isCurrentWeek),
|
|
8950
9034
|
[weeks]
|
|
8951
9035
|
);
|
|
8952
|
-
|
|
9036
|
+
React27.useEffect(() => {
|
|
8953
9037
|
if (open) {
|
|
8954
9038
|
setSelectedPrefixId(prefixes[0]?.id ?? "");
|
|
8955
9039
|
setSelectedWeekKey(currentWeek ? getWeekKey(currentWeek.startDate) : weeks[0] ? getWeekKey(weeks[0].startDate) : "");
|
|
@@ -9120,6 +9204,1315 @@ function SubmitCalibrationBar({
|
|
|
9120
9204
|
);
|
|
9121
9205
|
}
|
|
9122
9206
|
|
|
9207
|
+
// src/blocks/supplier-weekly-loading/types.ts
|
|
9208
|
+
function getLoadingElementStatusLabel(status) {
|
|
9209
|
+
switch (status) {
|
|
9210
|
+
case "loaded":
|
|
9211
|
+
return "Loaded";
|
|
9212
|
+
case "missing":
|
|
9213
|
+
return "Missing";
|
|
9214
|
+
case "moved":
|
|
9215
|
+
return "Moved to another delivery";
|
|
9216
|
+
case "addon":
|
|
9217
|
+
return "Add-on";
|
|
9218
|
+
default:
|
|
9219
|
+
return status;
|
|
9220
|
+
}
|
|
9221
|
+
}
|
|
9222
|
+
function getLoadingDeliveryStatusLabel(status) {
|
|
9223
|
+
switch (status) {
|
|
9224
|
+
case "planned":
|
|
9225
|
+
return "Planned";
|
|
9226
|
+
case "in_progress":
|
|
9227
|
+
return "In Progress";
|
|
9228
|
+
case "loaded":
|
|
9229
|
+
return "Loaded";
|
|
9230
|
+
case "shipped":
|
|
9231
|
+
return "Shipped";
|
|
9232
|
+
case "delivered":
|
|
9233
|
+
return "Delivered";
|
|
9234
|
+
case "cancelled":
|
|
9235
|
+
return "Cancelled";
|
|
9236
|
+
default:
|
|
9237
|
+
return status;
|
|
9238
|
+
}
|
|
9239
|
+
}
|
|
9240
|
+
function getDeliveryVisualState(delivery) {
|
|
9241
|
+
if (delivery.status === "shipped" || delivery.status === "delivered") {
|
|
9242
|
+
return "sent";
|
|
9243
|
+
}
|
|
9244
|
+
if (delivery.isReadyToUnload) {
|
|
9245
|
+
return "ready";
|
|
9246
|
+
}
|
|
9247
|
+
return "normal";
|
|
9248
|
+
}
|
|
9249
|
+
function getLoadingISOWeek(date) {
|
|
9250
|
+
const d = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()));
|
|
9251
|
+
const dayNum = d.getUTCDay() || 7;
|
|
9252
|
+
d.setUTCDate(d.getUTCDate() + 4 - dayNum);
|
|
9253
|
+
const yearStart = new Date(Date.UTC(d.getUTCFullYear(), 0, 1));
|
|
9254
|
+
return Math.ceil(((d.getTime() - yearStart.getTime()) / 864e5 + 1) / 7);
|
|
9255
|
+
}
|
|
9256
|
+
function getLoadingWeekKey(date) {
|
|
9257
|
+
const year = date.getFullYear();
|
|
9258
|
+
const weekNumber = getLoadingISOWeek(date);
|
|
9259
|
+
return `${year}-W${weekNumber.toString().padStart(2, "0")}`;
|
|
9260
|
+
}
|
|
9261
|
+
function generateLoadingWeek(date) {
|
|
9262
|
+
const monday = new Date(date);
|
|
9263
|
+
const day = monday.getDay();
|
|
9264
|
+
const diff = monday.getDate() - day + (day === 0 ? -6 : 1);
|
|
9265
|
+
monday.setDate(diff);
|
|
9266
|
+
monday.setHours(0, 0, 0, 0);
|
|
9267
|
+
const friday = new Date(monday);
|
|
9268
|
+
friday.setDate(monday.getDate() + 4);
|
|
9269
|
+
const today = /* @__PURE__ */ new Date();
|
|
9270
|
+
today.setHours(0, 0, 0, 0);
|
|
9271
|
+
const isCurrentWeek = monday <= today && today <= friday;
|
|
9272
|
+
const formatDate2 = (d) => {
|
|
9273
|
+
return d.toLocaleDateString("en-US", { month: "short", day: "numeric" });
|
|
9274
|
+
};
|
|
9275
|
+
return {
|
|
9276
|
+
weekKey: getLoadingWeekKey(monday),
|
|
9277
|
+
label: `W${getLoadingISOWeek(monday).toString().padStart(2, "0")}`,
|
|
9278
|
+
startDate: monday,
|
|
9279
|
+
endDate: friday,
|
|
9280
|
+
dateRange: `${formatDate2(monday)} - ${formatDate2(friday)}`,
|
|
9281
|
+
isCurrentWeek
|
|
9282
|
+
};
|
|
9283
|
+
}
|
|
9284
|
+
function groupDeliveriesByDay(deliveries) {
|
|
9285
|
+
const grouped = /* @__PURE__ */ new Map();
|
|
9286
|
+
for (let i = 1; i <= 5; i++) {
|
|
9287
|
+
grouped.set(i, []);
|
|
9288
|
+
}
|
|
9289
|
+
for (const delivery of deliveries) {
|
|
9290
|
+
const dayOfWeek = delivery.date.getDay();
|
|
9291
|
+
if (dayOfWeek >= 1 && dayOfWeek <= 5) {
|
|
9292
|
+
const dayDeliveries = grouped.get(dayOfWeek) ?? [];
|
|
9293
|
+
dayDeliveries.push(delivery);
|
|
9294
|
+
grouped.set(dayOfWeek, dayDeliveries);
|
|
9295
|
+
}
|
|
9296
|
+
}
|
|
9297
|
+
return grouped;
|
|
9298
|
+
}
|
|
9299
|
+
function getDayLabel(dayOfWeek) {
|
|
9300
|
+
const labels = {
|
|
9301
|
+
1: "Monday",
|
|
9302
|
+
2: "Tuesday",
|
|
9303
|
+
3: "Wednesday",
|
|
9304
|
+
4: "Thursday",
|
|
9305
|
+
5: "Friday"
|
|
9306
|
+
};
|
|
9307
|
+
return labels[dayOfWeek] ?? "";
|
|
9308
|
+
}
|
|
9309
|
+
function getShortDayLabel(dayOfWeek) {
|
|
9310
|
+
const labels = {
|
|
9311
|
+
1: "Mon",
|
|
9312
|
+
2: "Tue",
|
|
9313
|
+
3: "Wed",
|
|
9314
|
+
4: "Thu",
|
|
9315
|
+
5: "Fri"
|
|
9316
|
+
};
|
|
9317
|
+
return labels[dayOfWeek] ?? "";
|
|
9318
|
+
}
|
|
9319
|
+
function extractPrefixes(deliveries) {
|
|
9320
|
+
const prefixMap = /* @__PURE__ */ new Map();
|
|
9321
|
+
for (const delivery of deliveries) {
|
|
9322
|
+
const prefixCode = delivery.prefixScope ?? "GENERAL";
|
|
9323
|
+
if (!prefixMap.has(prefixCode)) {
|
|
9324
|
+
prefixMap.set(prefixCode, {
|
|
9325
|
+
id: prefixCode,
|
|
9326
|
+
name: prefixCode === "GENERAL" ? "General" : prefixCode,
|
|
9327
|
+
typeCode: prefixCode,
|
|
9328
|
+
supplierId: delivery.supplierId,
|
|
9329
|
+
supplierName: delivery.supplierName,
|
|
9330
|
+
totalDeliveries: 0,
|
|
9331
|
+
sentDeliveries: 0,
|
|
9332
|
+
hasRisk: false
|
|
9333
|
+
});
|
|
9334
|
+
}
|
|
9335
|
+
const prefix = prefixMap.get(prefixCode);
|
|
9336
|
+
prefix.totalDeliveries += 1;
|
|
9337
|
+
if (delivery.status === "shipped" || delivery.status === "delivered") {
|
|
9338
|
+
prefix.sentDeliveries += 1;
|
|
9339
|
+
}
|
|
9340
|
+
if (delivery.hasProductionRisk) {
|
|
9341
|
+
prefix.hasRisk = true;
|
|
9342
|
+
}
|
|
9343
|
+
}
|
|
9344
|
+
return Array.from(prefixMap.values());
|
|
9345
|
+
}
|
|
9346
|
+
function groupDeliveriesByPrefixAndDay(deliveries) {
|
|
9347
|
+
const grouped = /* @__PURE__ */ new Map();
|
|
9348
|
+
for (const delivery of deliveries) {
|
|
9349
|
+
const prefixCode = delivery.prefixScope ?? "GENERAL";
|
|
9350
|
+
const dayOfWeek = delivery.date.getDay();
|
|
9351
|
+
if (dayOfWeek < 1 || dayOfWeek > 5) continue;
|
|
9352
|
+
if (!grouped.has(prefixCode)) {
|
|
9353
|
+
const dayMap2 = /* @__PURE__ */ new Map();
|
|
9354
|
+
for (let i = 1; i <= 5; i++) {
|
|
9355
|
+
dayMap2.set(i, []);
|
|
9356
|
+
}
|
|
9357
|
+
grouped.set(prefixCode, dayMap2);
|
|
9358
|
+
}
|
|
9359
|
+
const dayMap = grouped.get(prefixCode);
|
|
9360
|
+
const dayDeliveries = dayMap.get(dayOfWeek) ?? [];
|
|
9361
|
+
dayDeliveries.push(delivery);
|
|
9362
|
+
dayMap.set(dayOfWeek, dayDeliveries);
|
|
9363
|
+
}
|
|
9364
|
+
return grouped;
|
|
9365
|
+
}
|
|
9366
|
+
function getLeftStrokeStyles(state, hasRisk, isHovered) {
|
|
9367
|
+
if (hasRisk) {
|
|
9368
|
+
return {
|
|
9369
|
+
stroke: "border-l-[3px] border-l-red-500",
|
|
9370
|
+
content: "text-foreground",
|
|
9371
|
+
progressBg: "bg-red-500",
|
|
9372
|
+
iconColor: "text-red-600 dark:text-red-400"
|
|
9373
|
+
};
|
|
9374
|
+
}
|
|
9375
|
+
switch (state) {
|
|
9376
|
+
case "sent":
|
|
9377
|
+
return {
|
|
9378
|
+
stroke: "border-l-[3px] border-l-green-500/50",
|
|
9379
|
+
content: "text-muted-foreground/60",
|
|
9380
|
+
progressBg: "bg-green-500",
|
|
9381
|
+
iconColor: "text-green-600 dark:text-green-400"
|
|
9382
|
+
};
|
|
9383
|
+
case "ready":
|
|
9384
|
+
return {
|
|
9385
|
+
stroke: "border-l-[3px] border-l-green-500",
|
|
9386
|
+
content: "text-foreground",
|
|
9387
|
+
progressBg: "bg-green-500",
|
|
9388
|
+
iconColor: "text-green-600 dark:text-green-400"
|
|
9389
|
+
};
|
|
9390
|
+
default:
|
|
9391
|
+
return {
|
|
9392
|
+
stroke: isHovered ? "border-l-[3px] border-l-primary/50" : "border-l-[3px] border-l-border",
|
|
9393
|
+
content: "text-foreground",
|
|
9394
|
+
progressBg: "bg-primary",
|
|
9395
|
+
iconColor: "text-muted-foreground"
|
|
9396
|
+
};
|
|
9397
|
+
}
|
|
9398
|
+
}
|
|
9399
|
+
function DeliveryBadge({
|
|
9400
|
+
delivery,
|
|
9401
|
+
onClick,
|
|
9402
|
+
className
|
|
9403
|
+
}) {
|
|
9404
|
+
const [isHovered, setIsHovered] = React27.useState(false);
|
|
9405
|
+
const hasComments = delivery.comments.length > 0;
|
|
9406
|
+
const visualState = getDeliveryVisualState(delivery);
|
|
9407
|
+
const styles = getLeftStrokeStyles(visualState, delivery.hasProductionRisk ?? false, isHovered);
|
|
9408
|
+
const prefixTitle = React27.useMemo(() => {
|
|
9409
|
+
const prefixSet = /* @__PURE__ */ new Set();
|
|
9410
|
+
if (delivery.elements && delivery.elements.length > 0) {
|
|
9411
|
+
for (const element of delivery.elements) {
|
|
9412
|
+
if (element.prefix) {
|
|
9413
|
+
prefixSet.add(element.prefix);
|
|
9414
|
+
}
|
|
9415
|
+
}
|
|
9416
|
+
}
|
|
9417
|
+
if (prefixSet.size === 0 && delivery.prefixScope) {
|
|
9418
|
+
prefixSet.add(delivery.prefixScope);
|
|
9419
|
+
}
|
|
9420
|
+
const prefixes = Array.from(prefixSet);
|
|
9421
|
+
if (prefixes.length === 0) {
|
|
9422
|
+
return delivery.label;
|
|
9423
|
+
}
|
|
9424
|
+
if (prefixes.length > 3) {
|
|
9425
|
+
return `${prefixes.slice(0, 3).join(" \xB7 ")} \xB7 +${prefixes.length - 3}`;
|
|
9426
|
+
}
|
|
9427
|
+
return prefixes.join(" \xB7 ");
|
|
9428
|
+
}, [delivery]);
|
|
9429
|
+
const productionProgress = React27.useMemo(() => {
|
|
9430
|
+
if (delivery.producedTons !== void 0 && delivery.totalTons !== void 0 && delivery.totalTons > 0) {
|
|
9431
|
+
return Math.min(delivery.producedTons / delivery.totalTons * 100, 100);
|
|
9432
|
+
}
|
|
9433
|
+
if (delivery.producedCount !== void 0 && delivery.totalCount !== void 0 && delivery.totalCount > 0) {
|
|
9434
|
+
return Math.min(delivery.producedCount / delivery.totalCount * 100, 100);
|
|
9435
|
+
}
|
|
9436
|
+
if (delivery.loadedCount !== void 0 && delivery.totalCount !== void 0 && delivery.totalCount > 0) {
|
|
9437
|
+
return Math.min(delivery.loadedCount / delivery.totalCount * 100, 100);
|
|
9438
|
+
}
|
|
9439
|
+
return 0;
|
|
9440
|
+
}, [delivery]);
|
|
9441
|
+
const productionDisplay = React27.useMemo(() => {
|
|
9442
|
+
if (delivery.producedTons !== void 0 && delivery.totalTons !== void 0) {
|
|
9443
|
+
return `${delivery.producedTons}/${delivery.totalTons}t`;
|
|
9444
|
+
}
|
|
9445
|
+
if (delivery.producedCount !== void 0 && delivery.totalCount !== void 0) {
|
|
9446
|
+
return `${delivery.producedCount}/${delivery.totalCount}`;
|
|
9447
|
+
}
|
|
9448
|
+
if (delivery.loadedCount !== void 0 && delivery.totalCount !== void 0) {
|
|
9449
|
+
return `${delivery.loadedCount}/${delivery.totalCount}`;
|
|
9450
|
+
}
|
|
9451
|
+
return null;
|
|
9452
|
+
}, [delivery]);
|
|
9453
|
+
const handleClick = (e) => {
|
|
9454
|
+
e.stopPropagation();
|
|
9455
|
+
onClick?.();
|
|
9456
|
+
};
|
|
9457
|
+
const handleKeyDown = (e) => {
|
|
9458
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
9459
|
+
e.preventDefault();
|
|
9460
|
+
e.stopPropagation();
|
|
9461
|
+
onClick?.();
|
|
9462
|
+
}
|
|
9463
|
+
};
|
|
9464
|
+
return /* @__PURE__ */ jsxs(
|
|
9465
|
+
"button",
|
|
9466
|
+
{
|
|
9467
|
+
type: "button",
|
|
9468
|
+
onClick: handleClick,
|
|
9469
|
+
onKeyDown: handleKeyDown,
|
|
9470
|
+
onMouseEnter: () => setIsHovered(true),
|
|
9471
|
+
onMouseLeave: () => setIsHovered(false),
|
|
9472
|
+
className: cn(
|
|
9473
|
+
// Position relative for comment dot
|
|
9474
|
+
"relative",
|
|
9475
|
+
// Full-width in cell, 90° corners
|
|
9476
|
+
"w-full rounded-none",
|
|
9477
|
+
// Sizing using Quantum tokens:
|
|
9478
|
+
// - h-[80px] card height
|
|
9479
|
+
// - px-6 = 24px horizontal (j3m.spacing.l)
|
|
9480
|
+
// - py-4 = 16px vertical (j3m.spacing.m)
|
|
9481
|
+
"h-[80px] px-6 py-4",
|
|
9482
|
+
// Layout
|
|
9483
|
+
"flex items-center",
|
|
9484
|
+
// Card base: white background, complete border
|
|
9485
|
+
"bg-background border border-border",
|
|
9486
|
+
// Left stroke for status
|
|
9487
|
+
styles.stroke,
|
|
9488
|
+
// Interactive states
|
|
9489
|
+
"cursor-pointer transition-all duration-200 ease-out",
|
|
9490
|
+
"hover:-translate-y-0.5 hover:shadow-[var(--j3m-shadow-md)]",
|
|
9491
|
+
"active:translate-y-0 active:shadow-sm",
|
|
9492
|
+
// Focus state
|
|
9493
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-1",
|
|
9494
|
+
// Greyed out for sent state
|
|
9495
|
+
visualState === "sent" && "opacity-60",
|
|
9496
|
+
className
|
|
9497
|
+
),
|
|
9498
|
+
children: [
|
|
9499
|
+
hasComments && /* @__PURE__ */ jsx(
|
|
9500
|
+
"span",
|
|
9501
|
+
{
|
|
9502
|
+
className: "absolute -top-1 -right-1 h-3 w-3 rounded-full bg-primary ring-2 ring-background",
|
|
9503
|
+
"aria-label": "Has comments"
|
|
9504
|
+
}
|
|
9505
|
+
),
|
|
9506
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col justify-center gap-3 min-w-0 flex-1 overflow-hidden", children: [
|
|
9507
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 overflow-hidden", children: [
|
|
9508
|
+
/* @__PURE__ */ jsx("span", { className: cn("text-sm font-semibold truncate", styles.content), children: prefixTitle }),
|
|
9509
|
+
visualState === "sent" && /* @__PURE__ */ jsx(Check, { className: "h-4 w-4 text-green-600 dark:text-green-400 shrink-0" }),
|
|
9510
|
+
delivery.hasProductionRisk && /* @__PURE__ */ jsx(AlertTriangle, { className: "h-4 w-4 text-red-500 shrink-0" }),
|
|
9511
|
+
delivery.supplierName && /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground truncate ml-auto", children: delivery.supplierName })
|
|
9512
|
+
] }),
|
|
9513
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
9514
|
+
/* @__PURE__ */ jsx(Factory, { className: cn("h-3.5 w-3.5 shrink-0", styles.iconColor) }),
|
|
9515
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1 h-1.5 bg-black/10 dark:bg-white/10 rounded-full overflow-hidden", children: /* @__PURE__ */ jsx(
|
|
9516
|
+
"div",
|
|
9517
|
+
{
|
|
9518
|
+
className: cn("h-full rounded-full transition-all", styles.progressBg),
|
|
9519
|
+
style: { width: `${productionProgress}%` }
|
|
9520
|
+
}
|
|
9521
|
+
) }),
|
|
9522
|
+
productionDisplay && /* @__PURE__ */ jsx("span", { className: cn(
|
|
9523
|
+
"text-xs tabular-nums font-medium shrink-0",
|
|
9524
|
+
delivery.isReadyToUnload ? "text-green-600 dark:text-green-400" : delivery.hasProductionRisk ? "text-red-600 dark:text-red-400" : "text-muted-foreground"
|
|
9525
|
+
), children: productionDisplay })
|
|
9526
|
+
] })
|
|
9527
|
+
] })
|
|
9528
|
+
]
|
|
9529
|
+
}
|
|
9530
|
+
);
|
|
9531
|
+
}
|
|
9532
|
+
function WeeklyLoadingView({
|
|
9533
|
+
week,
|
|
9534
|
+
deliveries,
|
|
9535
|
+
onDeliveryClick,
|
|
9536
|
+
onWeekChange,
|
|
9537
|
+
onDayCommentClick,
|
|
9538
|
+
showNavigation = true,
|
|
9539
|
+
className
|
|
9540
|
+
}) {
|
|
9541
|
+
const weekDays = React27.useMemo(() => {
|
|
9542
|
+
const days = [];
|
|
9543
|
+
for (let i = 0; i < 5; i++) {
|
|
9544
|
+
const date = addDays(week.startDate, i);
|
|
9545
|
+
days.push({
|
|
9546
|
+
date,
|
|
9547
|
+
dayOfWeek: i + 1,
|
|
9548
|
+
isToday: isToday(date)
|
|
9549
|
+
});
|
|
9550
|
+
}
|
|
9551
|
+
return days;
|
|
9552
|
+
}, [week.startDate]);
|
|
9553
|
+
const deliveriesByDay = React27.useMemo(() => {
|
|
9554
|
+
const grouped = /* @__PURE__ */ new Map();
|
|
9555
|
+
for (let i = 1; i <= 5; i++) {
|
|
9556
|
+
grouped.set(i, []);
|
|
9557
|
+
}
|
|
9558
|
+
for (const delivery of deliveries) {
|
|
9559
|
+
const dayOfWeek = delivery.date.getDay();
|
|
9560
|
+
if (dayOfWeek >= 1 && dayOfWeek <= 5) {
|
|
9561
|
+
const dayDeliveries = grouped.get(dayOfWeek) ?? [];
|
|
9562
|
+
dayDeliveries.push(delivery);
|
|
9563
|
+
grouped.set(dayOfWeek, dayDeliveries);
|
|
9564
|
+
}
|
|
9565
|
+
}
|
|
9566
|
+
return grouped;
|
|
9567
|
+
}, [deliveries]);
|
|
9568
|
+
const commentCountByDay = React27.useMemo(() => {
|
|
9569
|
+
const counts = /* @__PURE__ */ new Map();
|
|
9570
|
+
for (let i = 1; i <= 5; i++) {
|
|
9571
|
+
counts.set(i, 0);
|
|
9572
|
+
}
|
|
9573
|
+
for (const delivery of deliveries) {
|
|
9574
|
+
const dayOfWeek = delivery.date.getDay();
|
|
9575
|
+
if (dayOfWeek >= 1 && dayOfWeek <= 5) {
|
|
9576
|
+
const current = counts.get(dayOfWeek) ?? 0;
|
|
9577
|
+
counts.set(dayOfWeek, current + delivery.comments.length);
|
|
9578
|
+
}
|
|
9579
|
+
}
|
|
9580
|
+
return counts;
|
|
9581
|
+
}, [deliveries]);
|
|
9582
|
+
const totalDeliveries = deliveries.length;
|
|
9583
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col", className), children: [
|
|
9584
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4 border-b border-border p-4 lg:flex-row lg:items-center lg:justify-between", children: [
|
|
9585
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4", children: [
|
|
9586
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
9587
|
+
/* @__PURE__ */ jsx("span", { className: cn(
|
|
9588
|
+
"text-2xl font-bold tabular-nums",
|
|
9589
|
+
week.isCurrentWeek && "text-primary"
|
|
9590
|
+
), children: week.label }),
|
|
9591
|
+
week.isCurrentWeek && /* @__PURE__ */ jsxs("span", { className: "relative flex h-2.5 w-2.5", children: [
|
|
9592
|
+
/* @__PURE__ */ jsx("span", { className: "animate-ping absolute inline-flex h-full w-full rounded-full bg-primary opacity-75" }),
|
|
9593
|
+
/* @__PURE__ */ jsx("span", { className: "relative inline-flex rounded-full h-2.5 w-2.5 bg-primary" })
|
|
9594
|
+
] })
|
|
9595
|
+
] }),
|
|
9596
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col", children: [
|
|
9597
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium", children: week.dateRange }),
|
|
9598
|
+
/* @__PURE__ */ jsxs("span", { className: "text-xs text-muted-foreground", children: [
|
|
9599
|
+
totalDeliveries,
|
|
9600
|
+
" ",
|
|
9601
|
+
totalDeliveries === 1 ? "delivery" : "deliveries"
|
|
9602
|
+
] })
|
|
9603
|
+
] })
|
|
9604
|
+
] }),
|
|
9605
|
+
showNavigation && onWeekChange && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
9606
|
+
/* @__PURE__ */ jsxs(
|
|
9607
|
+
Button,
|
|
9608
|
+
{
|
|
9609
|
+
variant: "outline",
|
|
9610
|
+
size: "icon",
|
|
9611
|
+
className: "h-8 w-8",
|
|
9612
|
+
onClick: () => onWeekChange("prev"),
|
|
9613
|
+
children: [
|
|
9614
|
+
/* @__PURE__ */ jsx(ChevronLeft, { className: "h-4 w-4" }),
|
|
9615
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Previous week" })
|
|
9616
|
+
]
|
|
9617
|
+
}
|
|
9618
|
+
),
|
|
9619
|
+
/* @__PURE__ */ jsx(
|
|
9620
|
+
Button,
|
|
9621
|
+
{
|
|
9622
|
+
variant: "outline",
|
|
9623
|
+
size: "sm",
|
|
9624
|
+
onClick: () => {
|
|
9625
|
+
},
|
|
9626
|
+
children: "Today"
|
|
9627
|
+
}
|
|
9628
|
+
),
|
|
9629
|
+
/* @__PURE__ */ jsxs(
|
|
9630
|
+
Button,
|
|
9631
|
+
{
|
|
9632
|
+
variant: "outline",
|
|
9633
|
+
size: "icon",
|
|
9634
|
+
className: "h-8 w-8",
|
|
9635
|
+
onClick: () => onWeekChange("next"),
|
|
9636
|
+
children: [
|
|
9637
|
+
/* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4" }),
|
|
9638
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Next week" })
|
|
9639
|
+
]
|
|
9640
|
+
}
|
|
9641
|
+
)
|
|
9642
|
+
] })
|
|
9643
|
+
] }),
|
|
9644
|
+
/* @__PURE__ */ jsxs(ScrollArea, { className: "flex-1", children: [
|
|
9645
|
+
/* @__PURE__ */ jsxs("div", { className: "hidden sm:block", children: [
|
|
9646
|
+
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-5 border-b border-border bg-muted/30", children: weekDays.map(({ date, dayOfWeek, isToday: dayIsToday }) => {
|
|
9647
|
+
const dayCommentCount = commentCountByDay.get(dayOfWeek) ?? 0;
|
|
9648
|
+
return /* @__PURE__ */ jsxs(
|
|
9649
|
+
"div",
|
|
9650
|
+
{
|
|
9651
|
+
className: cn(
|
|
9652
|
+
// Relative for positioning comment button
|
|
9653
|
+
"relative",
|
|
9654
|
+
// Compact padding: py-2 px-3 (j3m.spacing.xs / j3m.spacing.s)
|
|
9655
|
+
"flex items-center justify-center gap-2 py-2 px-3",
|
|
9656
|
+
dayIsToday && "bg-primary/5"
|
|
9657
|
+
),
|
|
9658
|
+
children: [
|
|
9659
|
+
/* @__PURE__ */ jsx("span", { className: cn(
|
|
9660
|
+
"text-xs font-medium uppercase tracking-wide",
|
|
9661
|
+
dayIsToday ? "text-primary" : "text-muted-foreground"
|
|
9662
|
+
), children: getShortDayLabel(dayOfWeek) }),
|
|
9663
|
+
/* @__PURE__ */ jsx("span", { className: cn(
|
|
9664
|
+
"text-base font-semibold tabular-nums",
|
|
9665
|
+
dayIsToday ? "text-primary" : "text-foreground"
|
|
9666
|
+
), children: date.getDate() }),
|
|
9667
|
+
/* @__PURE__ */ jsxs(
|
|
9668
|
+
Button,
|
|
9669
|
+
{
|
|
9670
|
+
variant: "ghost",
|
|
9671
|
+
size: "icon",
|
|
9672
|
+
className: cn(
|
|
9673
|
+
"absolute top-1 right-1 h-7 w-7",
|
|
9674
|
+
dayCommentCount > 0 && "text-primary"
|
|
9675
|
+
),
|
|
9676
|
+
onClick: (e) => {
|
|
9677
|
+
e.stopPropagation();
|
|
9678
|
+
onDayCommentClick?.(dayOfWeek, date);
|
|
9679
|
+
},
|
|
9680
|
+
children: [
|
|
9681
|
+
/* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
9682
|
+
/* @__PURE__ */ jsx(MessageSquare, { className: "h-4 w-4" }),
|
|
9683
|
+
dayCommentCount > 0 && /* @__PURE__ */ jsx("span", { className: "absolute -top-1 -right-1 h-2 w-2 rounded-full bg-primary" })
|
|
9684
|
+
] }),
|
|
9685
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: dayCommentCount > 0 ? `${dayCommentCount} comments on ${getShortDayLabel(dayOfWeek)}` : `Add comment for ${getShortDayLabel(dayOfWeek)}` })
|
|
9686
|
+
]
|
|
9687
|
+
}
|
|
9688
|
+
)
|
|
9689
|
+
]
|
|
9690
|
+
},
|
|
9691
|
+
dayOfWeek
|
|
9692
|
+
);
|
|
9693
|
+
}) }),
|
|
9694
|
+
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-5", children: weekDays.map(({ dayOfWeek, isToday: dayIsToday }) => {
|
|
9695
|
+
const dayDeliveries = deliveriesByDay.get(dayOfWeek) ?? [];
|
|
9696
|
+
return /* @__PURE__ */ jsx(
|
|
9697
|
+
"div",
|
|
9698
|
+
{
|
|
9699
|
+
className: cn(
|
|
9700
|
+
// Column padding: p-3 = 12px (j3m.spacing.s)
|
|
9701
|
+
"flex flex-col p-3",
|
|
9702
|
+
dayIsToday && "bg-primary/5"
|
|
9703
|
+
),
|
|
9704
|
+
children: /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-3", children: dayDeliveries.length > 0 ? dayDeliveries.map((delivery) => /* @__PURE__ */ jsx(
|
|
9705
|
+
DeliveryBadge,
|
|
9706
|
+
{
|
|
9707
|
+
delivery,
|
|
9708
|
+
onClick: () => onDeliveryClick?.(delivery)
|
|
9709
|
+
},
|
|
9710
|
+
delivery.id
|
|
9711
|
+
)) : /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center py-6 text-sm text-muted-foreground/40", children: "\u2014" }) })
|
|
9712
|
+
},
|
|
9713
|
+
dayOfWeek
|
|
9714
|
+
);
|
|
9715
|
+
}) })
|
|
9716
|
+
] }),
|
|
9717
|
+
/* @__PURE__ */ jsx("div", { className: "sm:hidden divide-y divide-border", children: weekDays.map(({ date, dayOfWeek, isToday: dayIsToday }) => {
|
|
9718
|
+
const dayDeliveries = deliveriesByDay.get(dayOfWeek) ?? [];
|
|
9719
|
+
const dayCommentCount = commentCountByDay.get(dayOfWeek) ?? 0;
|
|
9720
|
+
return /* @__PURE__ */ jsxs(
|
|
9721
|
+
"div",
|
|
9722
|
+
{
|
|
9723
|
+
className: cn(
|
|
9724
|
+
dayIsToday && "bg-primary/5"
|
|
9725
|
+
),
|
|
9726
|
+
children: [
|
|
9727
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-4 py-2", children: [
|
|
9728
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
9729
|
+
/* @__PURE__ */ jsx("span", { className: cn(
|
|
9730
|
+
"text-xs font-medium uppercase",
|
|
9731
|
+
dayIsToday ? "text-primary" : "text-muted-foreground"
|
|
9732
|
+
), children: getShortDayLabel(dayOfWeek) }),
|
|
9733
|
+
/* @__PURE__ */ jsx("span", { className: cn(
|
|
9734
|
+
"text-base font-semibold tabular-nums",
|
|
9735
|
+
dayIsToday ? "text-primary" : "text-foreground"
|
|
9736
|
+
), children: date.getDate() }),
|
|
9737
|
+
dayIsToday && /* @__PURE__ */ jsx("span", { className: "text-xs text-primary font-medium", children: "Today" })
|
|
9738
|
+
] }),
|
|
9739
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
9740
|
+
/* @__PURE__ */ jsxs("span", { className: "text-xs text-muted-foreground", children: [
|
|
9741
|
+
dayDeliveries.length,
|
|
9742
|
+
" ",
|
|
9743
|
+
dayDeliveries.length === 1 ? "delivery" : "deliveries"
|
|
9744
|
+
] }),
|
|
9745
|
+
/* @__PURE__ */ jsxs(
|
|
9746
|
+
Button,
|
|
9747
|
+
{
|
|
9748
|
+
variant: "ghost",
|
|
9749
|
+
size: "icon",
|
|
9750
|
+
className: cn(
|
|
9751
|
+
"h-7 w-7",
|
|
9752
|
+
dayCommentCount > 0 && "text-primary"
|
|
9753
|
+
),
|
|
9754
|
+
onClick: (e) => {
|
|
9755
|
+
e.stopPropagation();
|
|
9756
|
+
onDayCommentClick?.(dayOfWeek, date);
|
|
9757
|
+
},
|
|
9758
|
+
children: [
|
|
9759
|
+
/* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
9760
|
+
/* @__PURE__ */ jsx(MessageSquare, { className: "h-4 w-4" }),
|
|
9761
|
+
dayCommentCount > 0 && /* @__PURE__ */ jsx("span", { className: "absolute -top-1 -right-1 h-2 w-2 rounded-full bg-primary" })
|
|
9762
|
+
] }),
|
|
9763
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Comments" })
|
|
9764
|
+
]
|
|
9765
|
+
}
|
|
9766
|
+
)
|
|
9767
|
+
] })
|
|
9768
|
+
] }),
|
|
9769
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-col gap-3 p-3 pt-0", children: dayDeliveries.length > 0 ? dayDeliveries.map((delivery) => /* @__PURE__ */ jsx(
|
|
9770
|
+
DeliveryBadge,
|
|
9771
|
+
{
|
|
9772
|
+
delivery,
|
|
9773
|
+
onClick: () => onDeliveryClick?.(delivery)
|
|
9774
|
+
},
|
|
9775
|
+
delivery.id
|
|
9776
|
+
)) : /* @__PURE__ */ jsx("div", { className: "text-sm text-muted-foreground/40 py-4 text-center", children: "\u2014" }) })
|
|
9777
|
+
]
|
|
9778
|
+
},
|
|
9779
|
+
dayOfWeek
|
|
9780
|
+
);
|
|
9781
|
+
}) })
|
|
9782
|
+
] })
|
|
9783
|
+
] });
|
|
9784
|
+
}
|
|
9785
|
+
function getStatusBadgeVariant2(status) {
|
|
9786
|
+
switch (status) {
|
|
9787
|
+
case "shipped":
|
|
9788
|
+
case "delivered":
|
|
9789
|
+
return "default";
|
|
9790
|
+
case "loaded":
|
|
9791
|
+
case "in_progress":
|
|
9792
|
+
return "secondary";
|
|
9793
|
+
case "cancelled":
|
|
9794
|
+
return "destructive";
|
|
9795
|
+
case "planned":
|
|
9796
|
+
default:
|
|
9797
|
+
return "outline";
|
|
9798
|
+
}
|
|
9799
|
+
}
|
|
9800
|
+
function getStatusBadgeClasses2(status) {
|
|
9801
|
+
switch (status) {
|
|
9802
|
+
case "shipped":
|
|
9803
|
+
case "delivered":
|
|
9804
|
+
return "border-green-500 text-green-600 bg-green-50 dark:bg-green-950/50";
|
|
9805
|
+
case "loaded":
|
|
9806
|
+
return "border-blue-500 text-blue-600 bg-blue-50 dark:bg-blue-950/50";
|
|
9807
|
+
case "in_progress":
|
|
9808
|
+
return "border-amber-500 text-amber-600 bg-amber-50 dark:bg-amber-950/50";
|
|
9809
|
+
case "cancelled":
|
|
9810
|
+
return "";
|
|
9811
|
+
case "planned":
|
|
9812
|
+
default:
|
|
9813
|
+
return "border-muted-foreground/50 text-muted-foreground";
|
|
9814
|
+
}
|
|
9815
|
+
}
|
|
9816
|
+
function getElementStatusBadgeClasses(status) {
|
|
9817
|
+
switch (status) {
|
|
9818
|
+
case "loaded":
|
|
9819
|
+
return "border-green-500 text-green-600 bg-green-50 dark:bg-green-950/50";
|
|
9820
|
+
case "missing":
|
|
9821
|
+
return "border-muted-foreground/50 text-muted-foreground bg-muted/50";
|
|
9822
|
+
case "moved":
|
|
9823
|
+
return "border-blue-500 text-blue-600 bg-blue-50 dark:bg-blue-950/50";
|
|
9824
|
+
case "addon":
|
|
9825
|
+
return "border-purple-500 text-purple-600 bg-purple-50 dark:bg-purple-950/50";
|
|
9826
|
+
default:
|
|
9827
|
+
return "border-muted-foreground/50 text-muted-foreground";
|
|
9828
|
+
}
|
|
9829
|
+
}
|
|
9830
|
+
function getElementRowBg(status) {
|
|
9831
|
+
switch (status) {
|
|
9832
|
+
case "loaded":
|
|
9833
|
+
return "bg-green-50/30 dark:bg-green-950/10";
|
|
9834
|
+
case "missing":
|
|
9835
|
+
return "bg-muted/30";
|
|
9836
|
+
case "moved":
|
|
9837
|
+
return "bg-blue-50/30 dark:bg-blue-950/10";
|
|
9838
|
+
case "addon":
|
|
9839
|
+
return "bg-purple-50/30 dark:bg-purple-950/10";
|
|
9840
|
+
default:
|
|
9841
|
+
return "";
|
|
9842
|
+
}
|
|
9843
|
+
}
|
|
9844
|
+
function AddCommentDialog({
|
|
9845
|
+
open,
|
|
9846
|
+
onOpenChange,
|
|
9847
|
+
delivery,
|
|
9848
|
+
weekId,
|
|
9849
|
+
onAddComment
|
|
9850
|
+
}) {
|
|
9851
|
+
const [commentText, setCommentText] = React27.useState("");
|
|
9852
|
+
const handleSubmit = () => {
|
|
9853
|
+
if (commentText.trim() && onAddComment) {
|
|
9854
|
+
onAddComment({
|
|
9855
|
+
author: "Current User",
|
|
9856
|
+
// Would come from auth context in real app
|
|
9857
|
+
text: commentText.trim(),
|
|
9858
|
+
context: "pre_unloading",
|
|
9859
|
+
weekId,
|
|
9860
|
+
deliveryId: delivery.id,
|
|
9861
|
+
supplierId: delivery.supplierId,
|
|
9862
|
+
supplierName: delivery.supplierName,
|
|
9863
|
+
prefixId: delivery.prefixScope,
|
|
9864
|
+
prefixName: delivery.prefixScope
|
|
9865
|
+
});
|
|
9866
|
+
setCommentText("");
|
|
9867
|
+
onOpenChange(false);
|
|
9868
|
+
}
|
|
9869
|
+
};
|
|
9870
|
+
const handleKeyDown = (e) => {
|
|
9871
|
+
if (e.key === "Enter" && (e.metaKey || e.ctrlKey)) {
|
|
9872
|
+
e.preventDefault();
|
|
9873
|
+
handleSubmit();
|
|
9874
|
+
}
|
|
9875
|
+
};
|
|
9876
|
+
React27.useEffect(() => {
|
|
9877
|
+
if (!open) {
|
|
9878
|
+
setCommentText("");
|
|
9879
|
+
}
|
|
9880
|
+
}, [open]);
|
|
9881
|
+
return /* @__PURE__ */ jsx(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs(DialogContent, { className: "sm:max-w-md", children: [
|
|
9882
|
+
/* @__PURE__ */ jsxs(DialogHeader, { children: [
|
|
9883
|
+
/* @__PURE__ */ jsx(DialogTitle, { children: "Add pre-unloading note" }),
|
|
9884
|
+
/* @__PURE__ */ jsxs(DialogDescription, { children: [
|
|
9885
|
+
"Add a note for ",
|
|
9886
|
+
/* @__PURE__ */ jsx("strong", { children: delivery.label }),
|
|
9887
|
+
" (",
|
|
9888
|
+
delivery.supplierName,
|
|
9889
|
+
delivery.prefixScope && ` \u2022 ${delivery.prefixScope}`,
|
|
9890
|
+
")."
|
|
9891
|
+
] })
|
|
9892
|
+
] }),
|
|
9893
|
+
/* @__PURE__ */ jsx("div", { className: "space-y-4 py-2", children: /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
9894
|
+
/* @__PURE__ */ jsx(Label2, { htmlFor: "comment-text", className: "text-sm font-medium", children: "Note" }),
|
|
9895
|
+
/* @__PURE__ */ jsx(
|
|
9896
|
+
Textarea,
|
|
9897
|
+
{
|
|
9898
|
+
id: "comment-text",
|
|
9899
|
+
placeholder: "Add a note before unloading...",
|
|
9900
|
+
value: commentText,
|
|
9901
|
+
onChange: (e) => setCommentText(e.target.value),
|
|
9902
|
+
onKeyDown: handleKeyDown,
|
|
9903
|
+
className: "min-h-[120px] text-base resize-none",
|
|
9904
|
+
autoFocus: true
|
|
9905
|
+
}
|
|
9906
|
+
),
|
|
9907
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "\u2318+Enter to save" })
|
|
9908
|
+
] }) }),
|
|
9909
|
+
/* @__PURE__ */ jsxs(DialogFooter, { className: "gap-2 sm:gap-0", children: [
|
|
9910
|
+
/* @__PURE__ */ jsx(
|
|
9911
|
+
Button,
|
|
9912
|
+
{
|
|
9913
|
+
variant: "ghost",
|
|
9914
|
+
onClick: () => onOpenChange(false),
|
|
9915
|
+
children: "Cancel"
|
|
9916
|
+
}
|
|
9917
|
+
),
|
|
9918
|
+
/* @__PURE__ */ jsxs(
|
|
9919
|
+
Button,
|
|
9920
|
+
{
|
|
9921
|
+
onClick: handleSubmit,
|
|
9922
|
+
disabled: !commentText.trim(),
|
|
9923
|
+
className: "gap-1.5",
|
|
9924
|
+
children: [
|
|
9925
|
+
/* @__PURE__ */ jsx(Send, { className: "h-4 w-4" }),
|
|
9926
|
+
"Save note"
|
|
9927
|
+
]
|
|
9928
|
+
}
|
|
9929
|
+
)
|
|
9930
|
+
] })
|
|
9931
|
+
] }) });
|
|
9932
|
+
}
|
|
9933
|
+
function CommentsSection({
|
|
9934
|
+
comments,
|
|
9935
|
+
delivery,
|
|
9936
|
+
weekId,
|
|
9937
|
+
onAddComment
|
|
9938
|
+
}) {
|
|
9939
|
+
const [viewCommentsOpen, setViewCommentsOpen] = React27.useState(true);
|
|
9940
|
+
const [addDialogOpen, setAddDialogOpen] = React27.useState(false);
|
|
9941
|
+
const formatDate2 = (date) => {
|
|
9942
|
+
return new Intl.DateTimeFormat("en-US", {
|
|
9943
|
+
month: "short",
|
|
9944
|
+
day: "numeric",
|
|
9945
|
+
hour: "numeric",
|
|
9946
|
+
minute: "2-digit"
|
|
9947
|
+
}).format(date);
|
|
9948
|
+
};
|
|
9949
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
9950
|
+
/* @__PURE__ */ jsxs("section", { className: "space-y-3", children: [
|
|
9951
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
9952
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
9953
|
+
/* @__PURE__ */ jsx(MessageSquare, { className: "h-4 w-4 text-muted-foreground" }),
|
|
9954
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-semibold", children: "Notes before unloading" }),
|
|
9955
|
+
comments.length > 0 && /* @__PURE__ */ jsx(Badge, { variant: "secondary", className: "text-[10px] h-5", children: comments.length })
|
|
9956
|
+
] }),
|
|
9957
|
+
/* @__PURE__ */ jsxs(
|
|
9958
|
+
Button,
|
|
9959
|
+
{
|
|
9960
|
+
variant: "outline",
|
|
9961
|
+
size: "sm",
|
|
9962
|
+
className: "gap-1.5 h-9",
|
|
9963
|
+
onClick: () => setAddDialogOpen(true),
|
|
9964
|
+
children: [
|
|
9965
|
+
/* @__PURE__ */ jsx(Plus, { className: "h-4 w-4" }),
|
|
9966
|
+
"Add note"
|
|
9967
|
+
]
|
|
9968
|
+
}
|
|
9969
|
+
)
|
|
9970
|
+
] }),
|
|
9971
|
+
comments.length > 0 ? /* @__PURE__ */ jsxs(Collapsible, { open: viewCommentsOpen, onOpenChange: setViewCommentsOpen, children: [
|
|
9972
|
+
/* @__PURE__ */ jsx(CollapsibleTrigger2, { asChild: true, children: /* @__PURE__ */ jsxs(Button, { variant: "ghost", size: "sm", className: "w-full justify-between h-8 px-2", children: [
|
|
9973
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs font-medium", children: viewCommentsOpen ? "Hide comments" : "Show comments" }),
|
|
9974
|
+
/* @__PURE__ */ jsx(ChevronDown, { className: cn(
|
|
9975
|
+
"h-4 w-4 transition-transform duration-200",
|
|
9976
|
+
viewCommentsOpen && "rotate-180"
|
|
9977
|
+
) })
|
|
9978
|
+
] }) }),
|
|
9979
|
+
/* @__PURE__ */ jsx(CollapsibleContent2, { className: "space-y-2 pt-2", children: comments.map((comment) => /* @__PURE__ */ jsxs("div", { className: "rounded-lg bg-muted/50 p-3 space-y-1", children: [
|
|
9980
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
9981
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
9982
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs font-medium", children: comment.author }),
|
|
9983
|
+
comment.supplierName && /* @__PURE__ */ jsx(Badge, { variant: "outline", className: "text-[9px] px-1.5 py-0 h-4", children: comment.prefixName ? `${comment.supplierName} - ${comment.prefixName}` : comment.supplierName })
|
|
9984
|
+
] }),
|
|
9985
|
+
/* @__PURE__ */ jsx("span", { className: "text-[10px] text-muted-foreground", children: formatDate2(comment.createdAt) })
|
|
9986
|
+
] }),
|
|
9987
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm", children: comment.text })
|
|
9988
|
+
] }, comment.id)) })
|
|
9989
|
+
] }) : /* @__PURE__ */ jsx("div", { className: "rounded-lg border border-dashed p-4 text-center text-sm text-muted-foreground", children: "No pre-unloading notes yet. Add notes before confirming the load." })
|
|
9990
|
+
] }),
|
|
9991
|
+
/* @__PURE__ */ jsx(
|
|
9992
|
+
AddCommentDialog,
|
|
9993
|
+
{
|
|
9994
|
+
open: addDialogOpen,
|
|
9995
|
+
onOpenChange: setAddDialogOpen,
|
|
9996
|
+
delivery,
|
|
9997
|
+
weekId,
|
|
9998
|
+
onAddComment
|
|
9999
|
+
}
|
|
10000
|
+
)
|
|
10001
|
+
] });
|
|
10002
|
+
}
|
|
10003
|
+
function getDeliveryHeaderStyles(state, hasRisk) {
|
|
10004
|
+
if (hasRisk) {
|
|
10005
|
+
return {
|
|
10006
|
+
iconBg: "bg-red-100 dark:bg-red-950/50",
|
|
10007
|
+
iconColor: "text-red-600 dark:text-red-400"
|
|
10008
|
+
};
|
|
10009
|
+
}
|
|
10010
|
+
switch (state) {
|
|
10011
|
+
case "sent":
|
|
10012
|
+
return {
|
|
10013
|
+
iconBg: "bg-green-100 dark:bg-green-950/50",
|
|
10014
|
+
iconColor: "text-green-600 dark:text-green-400"
|
|
10015
|
+
};
|
|
10016
|
+
case "ready":
|
|
10017
|
+
return {
|
|
10018
|
+
iconBg: "bg-green-100 dark:bg-green-950/50",
|
|
10019
|
+
iconColor: "text-green-600 dark:text-green-400"
|
|
10020
|
+
};
|
|
10021
|
+
default:
|
|
10022
|
+
return {
|
|
10023
|
+
iconBg: "bg-muted",
|
|
10024
|
+
iconColor: "text-muted-foreground"
|
|
10025
|
+
};
|
|
10026
|
+
}
|
|
10027
|
+
}
|
|
10028
|
+
function DeliveryDetailPage({
|
|
10029
|
+
delivery,
|
|
10030
|
+
week,
|
|
10031
|
+
suppliers,
|
|
10032
|
+
userRole,
|
|
10033
|
+
currentSupplierId,
|
|
10034
|
+
onBack,
|
|
10035
|
+
onAddComment,
|
|
10036
|
+
onConfirmLoad
|
|
10037
|
+
}) {
|
|
10038
|
+
const visualState = getDeliveryVisualState(delivery);
|
|
10039
|
+
const headerStyles = getDeliveryHeaderStyles(visualState, delivery.hasProductionRisk ?? false);
|
|
10040
|
+
const loadedCount = delivery.loadedCount ?? delivery.elements.filter((e) => e.status === "loaded").length;
|
|
10041
|
+
const totalCount = delivery.totalCount ?? delivery.elements.length;
|
|
10042
|
+
const loadedPercent = totalCount > 0 ? Math.round(loadedCount / totalCount * 100) : 0;
|
|
10043
|
+
const producedCount = delivery.producedCount ?? loadedCount;
|
|
10044
|
+
const producedPercent = totalCount > 0 ? Math.round(producedCount / totalCount * 100) : 0;
|
|
10045
|
+
const elementsByStatus = React27.useMemo(() => {
|
|
10046
|
+
const loaded = delivery.elements.filter((e) => e.status === "loaded");
|
|
10047
|
+
const missing = delivery.elements.filter((e) => e.status === "missing");
|
|
10048
|
+
const moved = delivery.elements.filter((e) => e.status === "moved");
|
|
10049
|
+
const addons = delivery.elements.filter((e) => e.status === "addon");
|
|
10050
|
+
return { loaded, missing, moved, addons };
|
|
10051
|
+
}, [delivery.elements]);
|
|
10052
|
+
const preUnloadingComments = delivery.comments.filter((c) => c.context === "pre_unloading");
|
|
10053
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col h-full", children: [
|
|
10054
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center gap-2 px-4 py-3 border-b bg-background sticky top-0 z-10", children: /* @__PURE__ */ jsxs(
|
|
10055
|
+
Button,
|
|
10056
|
+
{
|
|
10057
|
+
variant: "ghost",
|
|
10058
|
+
size: "sm",
|
|
10059
|
+
className: "gap-1 -ml-2",
|
|
10060
|
+
onClick: onBack,
|
|
10061
|
+
children: [
|
|
10062
|
+
/* @__PURE__ */ jsx(ChevronLeft, { className: "h-4 w-4" }),
|
|
10063
|
+
"Back"
|
|
10064
|
+
]
|
|
10065
|
+
}
|
|
10066
|
+
) }),
|
|
10067
|
+
/* @__PURE__ */ jsx(ScrollArea, { className: "flex-1", children: /* @__PURE__ */ jsxs("div", { className: "px-4 pb-6 space-y-6", children: [
|
|
10068
|
+
/* @__PURE__ */ jsxs("section", { className: "pt-4 space-y-4", children: [
|
|
10069
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-3", children: [
|
|
10070
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
|
|
10071
|
+
/* @__PURE__ */ jsx("div", { className: cn(
|
|
10072
|
+
"flex items-center justify-center h-12 w-12 rounded-xl shrink-0",
|
|
10073
|
+
headerStyles.iconBg
|
|
10074
|
+
), children: /* @__PURE__ */ jsx(Truck, { className: cn("h-6 w-6", headerStyles.iconColor) }) }),
|
|
10075
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
10076
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
10077
|
+
/* @__PURE__ */ jsx("h1", { className: "text-lg font-semibold", children: delivery.label }),
|
|
10078
|
+
visualState === "sent" && /* @__PURE__ */ jsx(Check, { className: "h-5 w-5 text-green-600 dark:text-green-400" }),
|
|
10079
|
+
delivery.hasProductionRisk && /* @__PURE__ */ jsx(AlertTriangle, { className: "h-5 w-5 text-red-500" })
|
|
10080
|
+
] }),
|
|
10081
|
+
/* @__PURE__ */ jsxs("p", { className: "text-sm text-muted-foreground", children: [
|
|
10082
|
+
delivery.supplierName,
|
|
10083
|
+
delivery.prefixScope && ` \u2022 ${delivery.prefixScope}`
|
|
10084
|
+
] })
|
|
10085
|
+
] })
|
|
10086
|
+
] }),
|
|
10087
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col items-end gap-1.5", children: [
|
|
10088
|
+
/* @__PURE__ */ jsx(
|
|
10089
|
+
Badge,
|
|
10090
|
+
{
|
|
10091
|
+
variant: getStatusBadgeVariant2(delivery.status),
|
|
10092
|
+
className: cn("shrink-0", getStatusBadgeClasses2(delivery.status)),
|
|
10093
|
+
children: getLoadingDeliveryStatusLabel(delivery.status)
|
|
10094
|
+
}
|
|
10095
|
+
),
|
|
10096
|
+
delivery.isReadyToUnload && /* @__PURE__ */ jsx(
|
|
10097
|
+
Badge,
|
|
10098
|
+
{
|
|
10099
|
+
variant: "outline",
|
|
10100
|
+
className: "bg-green-100 dark:bg-green-900/50 border-green-300 dark:border-green-700 text-green-700 dark:text-green-300",
|
|
10101
|
+
children: "Ready to unload"
|
|
10102
|
+
}
|
|
10103
|
+
)
|
|
10104
|
+
] })
|
|
10105
|
+
] }),
|
|
10106
|
+
delivery.hasProductionRisk && /* @__PURE__ */ jsxs("div", { className: "rounded-lg border-l-2 border-l-red-500 bg-red-50/50 dark:bg-red-950/30 p-3", children: [
|
|
10107
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
10108
|
+
/* @__PURE__ */ jsx(AlertTriangle, { className: "h-4 w-4 text-red-600 dark:text-red-400 shrink-0" }),
|
|
10109
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium text-red-700 dark:text-red-400", children: "Production delay risk" })
|
|
10110
|
+
] }),
|
|
10111
|
+
delivery.riskReason && /* @__PURE__ */ jsx("p", { className: "text-sm text-red-600 dark:text-red-400 mt-1 ml-6", children: delivery.riskReason })
|
|
10112
|
+
] }),
|
|
10113
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-4 text-sm text-muted-foreground", children: [
|
|
10114
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
10115
|
+
/* @__PURE__ */ jsx(Calendar$1, { className: "h-4 w-4" }),
|
|
10116
|
+
/* @__PURE__ */ jsx("span", { children: delivery.date.toLocaleDateString("en-US", {
|
|
10117
|
+
weekday: "short",
|
|
10118
|
+
month: "short",
|
|
10119
|
+
day: "numeric"
|
|
10120
|
+
}) })
|
|
10121
|
+
] }),
|
|
10122
|
+
delivery.destination && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
10123
|
+
/* @__PURE__ */ jsx(MapPin, { className: "h-4 w-4" }),
|
|
10124
|
+
/* @__PURE__ */ jsx("span", { children: delivery.destination })
|
|
10125
|
+
] })
|
|
10126
|
+
] }),
|
|
10127
|
+
/* @__PURE__ */ jsxs("div", { className: "rounded-lg bg-muted/50 p-4 space-y-3", children: [
|
|
10128
|
+
(delivery.producedCount !== void 0 || delivery.producedTons !== void 0) && /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
10129
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
10130
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium", children: "Production" }),
|
|
10131
|
+
/* @__PURE__ */ jsxs("span", { className: cn(
|
|
10132
|
+
"text-sm font-semibold tabular-nums",
|
|
10133
|
+
delivery.isReadyToUnload ? "text-green-600 dark:text-green-400" : delivery.hasProductionRisk ? "text-red-600 dark:text-red-400" : ""
|
|
10134
|
+
), children: [
|
|
10135
|
+
delivery.producedTons !== void 0 && delivery.totalTons !== void 0 ? `${delivery.producedTons} / ${delivery.totalTons} tons` : `Produced ${producedCount} / ${totalCount}`,
|
|
10136
|
+
delivery.isReadyToUnload && " \u2713"
|
|
10137
|
+
] })
|
|
10138
|
+
] }),
|
|
10139
|
+
/* @__PURE__ */ jsx("div", { className: "h-2 bg-black/10 dark:bg-white/10 rounded-full overflow-hidden", children: /* @__PURE__ */ jsx(
|
|
10140
|
+
"div",
|
|
10141
|
+
{
|
|
10142
|
+
className: cn(
|
|
10143
|
+
"h-full rounded-full transition-all",
|
|
10144
|
+
delivery.isReadyToUnload ? "bg-green-500" : delivery.hasProductionRisk ? "bg-red-500" : "bg-amber-500"
|
|
10145
|
+
),
|
|
10146
|
+
style: { width: `${producedPercent}%` }
|
|
10147
|
+
}
|
|
10148
|
+
) })
|
|
10149
|
+
] }),
|
|
10150
|
+
/* @__PURE__ */ jsx(Separator, { className: "my-2" }),
|
|
10151
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
10152
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
10153
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium", children: "Loading Progress" }),
|
|
10154
|
+
/* @__PURE__ */ jsxs("span", { className: "text-sm font-semibold tabular-nums", children: [
|
|
10155
|
+
"Loaded ",
|
|
10156
|
+
loadedCount,
|
|
10157
|
+
" / ",
|
|
10158
|
+
totalCount
|
|
10159
|
+
] })
|
|
10160
|
+
] }),
|
|
10161
|
+
/* @__PURE__ */ jsx("div", { className: "h-2 bg-black/10 dark:bg-white/10 rounded-full overflow-hidden", children: /* @__PURE__ */ jsx(
|
|
10162
|
+
"div",
|
|
10163
|
+
{
|
|
10164
|
+
className: cn(
|
|
10165
|
+
"h-full rounded-full transition-all",
|
|
10166
|
+
loadedPercent === 100 ? "bg-green-500" : "bg-primary"
|
|
10167
|
+
),
|
|
10168
|
+
style: { width: `${loadedPercent}%` }
|
|
10169
|
+
}
|
|
10170
|
+
) }),
|
|
10171
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 flex-wrap text-xs", children: [
|
|
10172
|
+
elementsByStatus.loaded.length > 0 && /* @__PURE__ */ jsxs("span", { className: "text-green-600 dark:text-green-400", children: [
|
|
10173
|
+
elementsByStatus.loaded.length,
|
|
10174
|
+
" Loaded"
|
|
10175
|
+
] }),
|
|
10176
|
+
elementsByStatus.missing.length > 0 && /* @__PURE__ */ jsxs("span", { className: "text-muted-foreground", children: [
|
|
10177
|
+
elementsByStatus.missing.length,
|
|
10178
|
+
" Missing"
|
|
10179
|
+
] }),
|
|
10180
|
+
elementsByStatus.moved.length > 0 && /* @__PURE__ */ jsxs("span", { className: "text-blue-600 dark:text-blue-400", children: [
|
|
10181
|
+
elementsByStatus.moved.length,
|
|
10182
|
+
" Moved"
|
|
10183
|
+
] }),
|
|
10184
|
+
elementsByStatus.addons.length > 0 && /* @__PURE__ */ jsxs("span", { className: "text-purple-600 dark:text-purple-400", children: [
|
|
10185
|
+
elementsByStatus.addons.length,
|
|
10186
|
+
" Add-on"
|
|
10187
|
+
] })
|
|
10188
|
+
] })
|
|
10189
|
+
] })
|
|
10190
|
+
] })
|
|
10191
|
+
] }),
|
|
10192
|
+
delivery.elements.length > 0 && /* @__PURE__ */ jsxs("section", { className: "space-y-3", children: [
|
|
10193
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
10194
|
+
/* @__PURE__ */ jsx(Package, { className: "h-4 w-4 text-muted-foreground" }),
|
|
10195
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-semibold", children: "Elements to Unload" }),
|
|
10196
|
+
/* @__PURE__ */ jsxs("span", { className: "text-xs text-muted-foreground ml-auto", children: [
|
|
10197
|
+
delivery.elements.length,
|
|
10198
|
+
" total"
|
|
10199
|
+
] })
|
|
10200
|
+
] }),
|
|
10201
|
+
/* @__PURE__ */ jsx("div", { className: "rounded-lg border overflow-hidden", children: /* @__PURE__ */ jsxs(Table, { children: [
|
|
10202
|
+
/* @__PURE__ */ jsx(TableHeader, { children: /* @__PURE__ */ jsxs(TableRow, { className: "bg-sidebar hover:bg-sidebar", children: [
|
|
10203
|
+
/* @__PURE__ */ jsx(TableHead, { className: "font-semibold", children: "Prefix" }),
|
|
10204
|
+
/* @__PURE__ */ jsx(TableHead, { className: "font-semibold", children: "Type" }),
|
|
10205
|
+
/* @__PURE__ */ jsx(TableHead, { className: "font-semibold text-right", children: "Weight" }),
|
|
10206
|
+
/* @__PURE__ */ jsx(TableHead, { className: "font-semibold text-right", children: "Size (m\xB2)" }),
|
|
10207
|
+
/* @__PURE__ */ jsx(TableHead, { className: "font-semibold text-center", children: "Status" })
|
|
10208
|
+
] }) }),
|
|
10209
|
+
/* @__PURE__ */ jsx(TableBody, { children: delivery.elements.map((element) => /* @__PURE__ */ jsxs(
|
|
10210
|
+
TableRow,
|
|
10211
|
+
{
|
|
10212
|
+
className: getElementRowBg(element.status),
|
|
10213
|
+
children: [
|
|
10214
|
+
/* @__PURE__ */ jsx(TableCell, { className: "font-medium", children: element.prefix }),
|
|
10215
|
+
/* @__PURE__ */ jsx(TableCell, { children: element.type }),
|
|
10216
|
+
/* @__PURE__ */ jsx(TableCell, { className: "text-right tabular-nums", children: element.weight ? /* @__PURE__ */ jsxs("span", { children: [
|
|
10217
|
+
element.weight,
|
|
10218
|
+
" ",
|
|
10219
|
+
element.weightUnit || "kg"
|
|
10220
|
+
] }) : "\u2014" }),
|
|
10221
|
+
/* @__PURE__ */ jsx(TableCell, { className: "text-right tabular-nums", children: element.sizeSqm ?? "\u2014" }),
|
|
10222
|
+
/* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-1", children: [
|
|
10223
|
+
/* @__PURE__ */ jsx(
|
|
10224
|
+
Badge,
|
|
10225
|
+
{
|
|
10226
|
+
variant: "outline",
|
|
10227
|
+
className: cn(
|
|
10228
|
+
"text-[10px] h-5",
|
|
10229
|
+
getElementStatusBadgeClasses(element.status)
|
|
10230
|
+
),
|
|
10231
|
+
children: getLoadingElementStatusLabel(element.status)
|
|
10232
|
+
}
|
|
10233
|
+
),
|
|
10234
|
+
element.status === "moved" && element.actualDeliveryLabel && /* @__PURE__ */ jsxs("span", { className: "text-[9px] text-blue-600 dark:text-blue-400", children: [
|
|
10235
|
+
"\u2192 ",
|
|
10236
|
+
element.actualDeliveryLabel
|
|
10237
|
+
] }),
|
|
10238
|
+
element.status === "addon" && element.originalDeliveryLabel && /* @__PURE__ */ jsxs("span", { className: "text-[9px] text-purple-600 dark:text-purple-400", children: [
|
|
10239
|
+
"from ",
|
|
10240
|
+
element.originalDeliveryLabel
|
|
10241
|
+
] })
|
|
10242
|
+
] }) })
|
|
10243
|
+
]
|
|
10244
|
+
},
|
|
10245
|
+
element.id
|
|
10246
|
+
)) })
|
|
10247
|
+
] }) })
|
|
10248
|
+
] }),
|
|
10249
|
+
/* @__PURE__ */ jsx(
|
|
10250
|
+
CommentsSection,
|
|
10251
|
+
{
|
|
10252
|
+
comments: preUnloadingComments,
|
|
10253
|
+
delivery,
|
|
10254
|
+
weekId: week.weekKey,
|
|
10255
|
+
onAddComment
|
|
10256
|
+
}
|
|
10257
|
+
),
|
|
10258
|
+
onConfirmLoad && /* @__PURE__ */ jsxs("section", { className: "pt-4", children: [
|
|
10259
|
+
/* @__PURE__ */ jsx(
|
|
10260
|
+
Button,
|
|
10261
|
+
{
|
|
10262
|
+
className: "w-full h-12 text-base",
|
|
10263
|
+
onClick: () => onConfirmLoad(delivery.id),
|
|
10264
|
+
children: "Start Loading"
|
|
10265
|
+
}
|
|
10266
|
+
),
|
|
10267
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground text-center mt-2", children: "Comments are saved independently." })
|
|
10268
|
+
] })
|
|
10269
|
+
] }) })
|
|
10270
|
+
] });
|
|
10271
|
+
}
|
|
10272
|
+
function SupplierWeeklyLoading({
|
|
10273
|
+
week,
|
|
10274
|
+
deliveries,
|
|
10275
|
+
suppliers,
|
|
10276
|
+
userRole,
|
|
10277
|
+
currentSupplierId,
|
|
10278
|
+
onDeliveryClick,
|
|
10279
|
+
onBack,
|
|
10280
|
+
onAddComment,
|
|
10281
|
+
onConfirmLoad,
|
|
10282
|
+
onWeekChange,
|
|
10283
|
+
showNavigation = true,
|
|
10284
|
+
bordered = true,
|
|
10285
|
+
className
|
|
10286
|
+
}) {
|
|
10287
|
+
const [selectedDelivery, setSelectedDelivery] = React27.useState(null);
|
|
10288
|
+
const [sheetOpen, setSheetOpen] = React27.useState(false);
|
|
10289
|
+
const handleDeliveryClick = (delivery) => {
|
|
10290
|
+
setSelectedDelivery(delivery);
|
|
10291
|
+
setSheetOpen(true);
|
|
10292
|
+
onDeliveryClick?.(delivery);
|
|
10293
|
+
};
|
|
10294
|
+
const handleSheetClose = () => {
|
|
10295
|
+
setSheetOpen(false);
|
|
10296
|
+
setTimeout(() => setSelectedDelivery(null), 200);
|
|
10297
|
+
onBack?.();
|
|
10298
|
+
};
|
|
10299
|
+
const Wrapper = bordered ? Card : "div";
|
|
10300
|
+
const Content14 = bordered ? CardContent : "div";
|
|
10301
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
10302
|
+
/* @__PURE__ */ jsx(
|
|
10303
|
+
Wrapper,
|
|
10304
|
+
{
|
|
10305
|
+
className: cn(
|
|
10306
|
+
"flex flex-col overflow-hidden",
|
|
10307
|
+
// Removed fixed min-height - content-driven sizing
|
|
10308
|
+
!bordered && "border border-border bg-card rounded-lg",
|
|
10309
|
+
className
|
|
10310
|
+
),
|
|
10311
|
+
children: /* @__PURE__ */ jsx(Content14, { className: cn("flex-1 overflow-hidden p-0", !bordered && ""), children: /* @__PURE__ */ jsx(
|
|
10312
|
+
WeeklyLoadingView,
|
|
10313
|
+
{
|
|
10314
|
+
week,
|
|
10315
|
+
deliveries,
|
|
10316
|
+
onDeliveryClick: handleDeliveryClick,
|
|
10317
|
+
onWeekChange,
|
|
10318
|
+
showNavigation
|
|
10319
|
+
}
|
|
10320
|
+
) })
|
|
10321
|
+
}
|
|
10322
|
+
),
|
|
10323
|
+
/* @__PURE__ */ jsx(Sheet, { open: sheetOpen, onOpenChange: (open) => !open && handleSheetClose(), children: /* @__PURE__ */ jsxs(
|
|
10324
|
+
SheetContent,
|
|
10325
|
+
{
|
|
10326
|
+
side: "right",
|
|
10327
|
+
className: "w-full sm:max-w-lg p-0 overflow-hidden",
|
|
10328
|
+
children: [
|
|
10329
|
+
/* @__PURE__ */ jsx(SheetHeader, { className: "sr-only", children: /* @__PURE__ */ jsx(SheetTitle, { children: selectedDelivery?.label ?? "Delivery Details" }) }),
|
|
10330
|
+
selectedDelivery && /* @__PURE__ */ jsx(
|
|
10331
|
+
DeliveryDetailPage,
|
|
10332
|
+
{
|
|
10333
|
+
delivery: selectedDelivery,
|
|
10334
|
+
week,
|
|
10335
|
+
suppliers,
|
|
10336
|
+
userRole,
|
|
10337
|
+
currentSupplierId,
|
|
10338
|
+
onBack: handleSheetClose,
|
|
10339
|
+
onAddComment,
|
|
10340
|
+
onConfirmLoad
|
|
10341
|
+
}
|
|
10342
|
+
)
|
|
10343
|
+
]
|
|
10344
|
+
}
|
|
10345
|
+
) })
|
|
10346
|
+
] });
|
|
10347
|
+
}
|
|
10348
|
+
function getStatusBadgeVariant3(status) {
|
|
10349
|
+
switch (status) {
|
|
10350
|
+
case "shipped":
|
|
10351
|
+
case "delivered":
|
|
10352
|
+
return "default";
|
|
10353
|
+
case "loaded":
|
|
10354
|
+
case "in_progress":
|
|
10355
|
+
return "secondary";
|
|
10356
|
+
case "cancelled":
|
|
10357
|
+
return "destructive";
|
|
10358
|
+
case "planned":
|
|
10359
|
+
default:
|
|
10360
|
+
return "outline";
|
|
10361
|
+
}
|
|
10362
|
+
}
|
|
10363
|
+
function getStatusBadgeClasses3(status) {
|
|
10364
|
+
switch (status) {
|
|
10365
|
+
case "shipped":
|
|
10366
|
+
case "delivered":
|
|
10367
|
+
return "border-green-500 text-green-600 bg-green-50 dark:bg-green-950/50";
|
|
10368
|
+
case "loaded":
|
|
10369
|
+
return "border-blue-500 text-blue-600 bg-blue-50 dark:bg-blue-950/50";
|
|
10370
|
+
case "in_progress":
|
|
10371
|
+
return "border-amber-500 text-amber-600 bg-amber-50 dark:bg-amber-950/50";
|
|
10372
|
+
case "cancelled":
|
|
10373
|
+
return "";
|
|
10374
|
+
case "planned":
|
|
10375
|
+
default:
|
|
10376
|
+
return "border-muted-foreground/50 text-muted-foreground";
|
|
10377
|
+
}
|
|
10378
|
+
}
|
|
10379
|
+
function getLeftStrokeStyles2(state, hasRisk, isHovered) {
|
|
10380
|
+
if (hasRisk) {
|
|
10381
|
+
return {
|
|
10382
|
+
stroke: "border-l-2 border-l-red-500",
|
|
10383
|
+
iconColor: "text-muted-foreground"
|
|
10384
|
+
};
|
|
10385
|
+
}
|
|
10386
|
+
switch (state) {
|
|
10387
|
+
case "sent":
|
|
10388
|
+
return {
|
|
10389
|
+
stroke: "border-l-2 border-l-green-500/50",
|
|
10390
|
+
iconColor: "text-muted-foreground/40"
|
|
10391
|
+
};
|
|
10392
|
+
case "ready":
|
|
10393
|
+
return {
|
|
10394
|
+
stroke: "border-l-2 border-l-green-500",
|
|
10395
|
+
iconColor: "text-muted-foreground"
|
|
10396
|
+
};
|
|
10397
|
+
default:
|
|
10398
|
+
return {
|
|
10399
|
+
stroke: isHovered ? "border-l-2 border-l-border" : "border-l-2 border-l-transparent",
|
|
10400
|
+
iconColor: "text-muted-foreground"
|
|
10401
|
+
};
|
|
10402
|
+
}
|
|
10403
|
+
}
|
|
10404
|
+
function DeliveryCard({
|
|
10405
|
+
delivery,
|
|
10406
|
+
onTap,
|
|
10407
|
+
className
|
|
10408
|
+
}) {
|
|
10409
|
+
const [isHovered, setIsHovered] = React27.useState(false);
|
|
10410
|
+
const hasComments = delivery.comments.length > 0;
|
|
10411
|
+
const visualState = getDeliveryVisualState(delivery);
|
|
10412
|
+
const styles = getLeftStrokeStyles2(visualState, delivery.hasProductionRisk ?? false, isHovered);
|
|
10413
|
+
const productionDisplay = React27.useMemo(() => {
|
|
10414
|
+
if (delivery.producedTons !== void 0 && delivery.totalTons !== void 0) {
|
|
10415
|
+
return `${delivery.producedTons} / ${delivery.totalTons}t produced`;
|
|
10416
|
+
}
|
|
10417
|
+
if (delivery.producedCount !== void 0 && delivery.totalCount !== void 0) {
|
|
10418
|
+
return `${delivery.producedCount} / ${delivery.totalCount} produced`;
|
|
10419
|
+
}
|
|
10420
|
+
if (delivery.loadedCount !== void 0 && delivery.totalCount !== void 0) {
|
|
10421
|
+
return `Loaded ${delivery.loadedCount} / ${delivery.totalCount}`;
|
|
10422
|
+
}
|
|
10423
|
+
return null;
|
|
10424
|
+
}, [delivery]);
|
|
10425
|
+
const handleClick = () => {
|
|
10426
|
+
onTap?.();
|
|
10427
|
+
};
|
|
10428
|
+
const handleKeyDown = (e) => {
|
|
10429
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
10430
|
+
e.preventDefault();
|
|
10431
|
+
onTap?.();
|
|
10432
|
+
}
|
|
10433
|
+
};
|
|
10434
|
+
return /* @__PURE__ */ jsx(
|
|
10435
|
+
"div",
|
|
10436
|
+
{
|
|
10437
|
+
role: "button",
|
|
10438
|
+
tabIndex: 0,
|
|
10439
|
+
onClick: handleClick,
|
|
10440
|
+
onKeyDown: handleKeyDown,
|
|
10441
|
+
onMouseEnter: () => setIsHovered(true),
|
|
10442
|
+
onMouseLeave: () => setIsHovered(false),
|
|
10443
|
+
className: cn(
|
|
10444
|
+
// Full-width, 90° corners (j3m.radius.none)
|
|
10445
|
+
"w-full rounded-none",
|
|
10446
|
+
// Touch-friendly sizing - 56px min-height for iPad
|
|
10447
|
+
"min-h-[56px] p-4",
|
|
10448
|
+
// Card styling: white background, standard border
|
|
10449
|
+
"bg-background border border-border",
|
|
10450
|
+
// Left stroke for status (j3m.stroke.m = 2px)
|
|
10451
|
+
styles.stroke,
|
|
10452
|
+
// Hover/tap state - lift effect like Calibration
|
|
10453
|
+
"cursor-pointer transition-all duration-200 ease-out",
|
|
10454
|
+
"hover:-translate-y-0.5 hover:shadow-[var(--j3m-shadow-md)]",
|
|
10455
|
+
"active:translate-y-0 active:shadow-sm",
|
|
10456
|
+
// Focus state
|
|
10457
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary",
|
|
10458
|
+
// Greyed out for sent state
|
|
10459
|
+
visualState === "sent" && "opacity-60",
|
|
10460
|
+
className
|
|
10461
|
+
),
|
|
10462
|
+
children: /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-3", children: [
|
|
10463
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3 min-w-0 flex-1", children: [
|
|
10464
|
+
/* @__PURE__ */ jsx("div", { className: cn(
|
|
10465
|
+
"flex items-center justify-center h-10 w-10 rounded-md shrink-0 bg-muted/50"
|
|
10466
|
+
), children: /* @__PURE__ */ jsx(Truck, { className: cn("h-5 w-5", styles.iconColor) }) }),
|
|
10467
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1 min-w-0", children: [
|
|
10468
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
10469
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-semibold truncate", children: delivery.label }),
|
|
10470
|
+
visualState === "sent" && /* @__PURE__ */ jsx(Check, { className: "h-4 w-4 text-green-600 dark:text-green-400 shrink-0" }),
|
|
10471
|
+
visualState === "ready" && /* @__PURE__ */ jsx(
|
|
10472
|
+
Badge,
|
|
10473
|
+
{
|
|
10474
|
+
variant: "outline",
|
|
10475
|
+
className: "text-[9px] px-1.5 py-0 h-4 bg-green-100 dark:bg-green-900/50 border-green-300 dark:border-green-700 text-green-700 dark:text-green-300",
|
|
10476
|
+
children: "Ready"
|
|
10477
|
+
}
|
|
10478
|
+
),
|
|
10479
|
+
delivery.hasProductionRisk && /* @__PURE__ */ jsx(AlertTriangle, { className: "h-4 w-4 text-red-500 shrink-0" }),
|
|
10480
|
+
hasComments && /* @__PURE__ */ jsxs("div", { className: "relative shrink-0", children: [
|
|
10481
|
+
/* @__PURE__ */ jsx(MessageSquare, { className: "h-3.5 w-3.5 text-muted-foreground" }),
|
|
10482
|
+
/* @__PURE__ */ jsx("span", { className: "absolute -top-0.5 -right-0.5 h-2 w-2 rounded-full bg-primary" })
|
|
10483
|
+
] })
|
|
10484
|
+
] }),
|
|
10485
|
+
/* @__PURE__ */ jsxs("span", { className: "text-xs text-muted-foreground truncate", children: [
|
|
10486
|
+
delivery.supplierName,
|
|
10487
|
+
delivery.prefixScope && ` \u2022 ${delivery.prefixScope}`
|
|
10488
|
+
] }),
|
|
10489
|
+
productionDisplay && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5 text-xs", children: [
|
|
10490
|
+
/* @__PURE__ */ jsx(Package, { className: "h-3 w-3 text-muted-foreground" }),
|
|
10491
|
+
/* @__PURE__ */ jsxs("span", { className: cn(
|
|
10492
|
+
delivery.isReadyToUnload ? "text-green-600 dark:text-green-400 font-medium" : delivery.hasProductionRisk ? "text-red-600 dark:text-red-400" : "text-muted-foreground"
|
|
10493
|
+
), children: [
|
|
10494
|
+
delivery.isReadyToUnload ? "\u2713 " : "",
|
|
10495
|
+
productionDisplay
|
|
10496
|
+
] })
|
|
10497
|
+
] })
|
|
10498
|
+
] })
|
|
10499
|
+
] }),
|
|
10500
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 shrink-0", children: [
|
|
10501
|
+
/* @__PURE__ */ jsx(
|
|
10502
|
+
Badge,
|
|
10503
|
+
{
|
|
10504
|
+
variant: getStatusBadgeVariant3(delivery.status),
|
|
10505
|
+
className: cn("text-[10px] h-5", getStatusBadgeClasses3(delivery.status)),
|
|
10506
|
+
children: getLoadingDeliveryStatusLabel(delivery.status)
|
|
10507
|
+
}
|
|
10508
|
+
),
|
|
10509
|
+
/* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4 text-muted-foreground" })
|
|
10510
|
+
] })
|
|
10511
|
+
] })
|
|
10512
|
+
}
|
|
10513
|
+
);
|
|
10514
|
+
}
|
|
10515
|
+
|
|
9123
10516
|
// src/components/event-calendar/types.ts
|
|
9124
10517
|
var DEFAULT_WORKING_HOURS = {
|
|
9125
10518
|
0: { from: 0, to: 0 },
|
|
@@ -9182,7 +10575,7 @@ var BADGE_VARIANT_LABELS = {
|
|
|
9182
10575
|
colored: "Colored",
|
|
9183
10576
|
mixed: "Mixed"
|
|
9184
10577
|
};
|
|
9185
|
-
var CalendarContext =
|
|
10578
|
+
var CalendarContext = React27.createContext(null);
|
|
9186
10579
|
function EventCalendarProvider({
|
|
9187
10580
|
children,
|
|
9188
10581
|
events: initialEvents = [],
|
|
@@ -9197,38 +10590,38 @@ function EventCalendarProvider({
|
|
|
9197
10590
|
onEventUpdate,
|
|
9198
10591
|
onEventDelete
|
|
9199
10592
|
}) {
|
|
9200
|
-
const [selectedDate, setSelectedDate] =
|
|
9201
|
-
const [selectedUserId, setSelectedUserId] =
|
|
9202
|
-
const [events, setEventsState] =
|
|
9203
|
-
const [users] =
|
|
9204
|
-
const [badgeVariant, setBadgeVariant] =
|
|
9205
|
-
const [view, setView] =
|
|
9206
|
-
const [workingHours, setWorkingHours] =
|
|
9207
|
-
const [visibleHours, setVisibleHours] =
|
|
9208
|
-
|
|
10593
|
+
const [selectedDate, setSelectedDate] = React27.useState(defaultDate);
|
|
10594
|
+
const [selectedUserId, setSelectedUserId] = React27.useState(defaultUserId);
|
|
10595
|
+
const [events, setEventsState] = React27.useState(initialEvents);
|
|
10596
|
+
const [users] = React27.useState(initialUsers);
|
|
10597
|
+
const [badgeVariant, setBadgeVariant] = React27.useState(defaultBadgeVariant);
|
|
10598
|
+
const [view, setView] = React27.useState(defaultView);
|
|
10599
|
+
const [workingHours, setWorkingHours] = React27.useState(defaultWorkingHours);
|
|
10600
|
+
const [visibleHours, setVisibleHours] = React27.useState(defaultVisibleHours);
|
|
10601
|
+
React27.useEffect(() => {
|
|
9209
10602
|
setEventsState(initialEvents);
|
|
9210
10603
|
}, [initialEvents]);
|
|
9211
|
-
const setEvents =
|
|
10604
|
+
const setEvents = React27.useCallback((newEvents) => {
|
|
9212
10605
|
setEventsState(newEvents);
|
|
9213
10606
|
}, []);
|
|
9214
|
-
const addEvent =
|
|
10607
|
+
const addEvent = React27.useCallback((event) => {
|
|
9215
10608
|
setEventsState((prev) => [...prev, event]);
|
|
9216
10609
|
onEventAdd?.(event);
|
|
9217
10610
|
}, [onEventAdd]);
|
|
9218
|
-
const updateEvent =
|
|
10611
|
+
const updateEvent = React27.useCallback((event) => {
|
|
9219
10612
|
setEventsState(
|
|
9220
10613
|
(prev) => prev.map((e) => e.id === event.id ? event : e)
|
|
9221
10614
|
);
|
|
9222
10615
|
onEventUpdate?.(event);
|
|
9223
10616
|
}, [onEventUpdate]);
|
|
9224
|
-
const deleteEvent =
|
|
10617
|
+
const deleteEvent = React27.useCallback((eventId) => {
|
|
9225
10618
|
setEventsState((prev) => prev.filter((e) => e.id !== eventId));
|
|
9226
10619
|
onEventDelete?.(eventId);
|
|
9227
10620
|
}, [onEventDelete]);
|
|
9228
|
-
const goToToday =
|
|
10621
|
+
const goToToday = React27.useCallback(() => {
|
|
9229
10622
|
setSelectedDate(/* @__PURE__ */ new Date());
|
|
9230
10623
|
}, []);
|
|
9231
|
-
const goToPrevious =
|
|
10624
|
+
const goToPrevious = React27.useCallback(() => {
|
|
9232
10625
|
setSelectedDate((current) => {
|
|
9233
10626
|
switch (view) {
|
|
9234
10627
|
case "day":
|
|
@@ -9246,7 +10639,7 @@ function EventCalendarProvider({
|
|
|
9246
10639
|
}
|
|
9247
10640
|
});
|
|
9248
10641
|
}, [view]);
|
|
9249
|
-
const goToNext =
|
|
10642
|
+
const goToNext = React27.useCallback(() => {
|
|
9250
10643
|
setSelectedDate((current) => {
|
|
9251
10644
|
switch (view) {
|
|
9252
10645
|
case "day":
|
|
@@ -9264,7 +10657,7 @@ function EventCalendarProvider({
|
|
|
9264
10657
|
}
|
|
9265
10658
|
});
|
|
9266
10659
|
}, [view]);
|
|
9267
|
-
const contextValue =
|
|
10660
|
+
const contextValue = React27.useMemo(
|
|
9268
10661
|
() => ({
|
|
9269
10662
|
// State
|
|
9270
10663
|
selectedDate,
|
|
@@ -9311,7 +10704,7 @@ function EventCalendarProvider({
|
|
|
9311
10704
|
return /* @__PURE__ */ jsx(CalendarContext.Provider, { value: contextValue, children });
|
|
9312
10705
|
}
|
|
9313
10706
|
function useEventCalendar() {
|
|
9314
|
-
const context =
|
|
10707
|
+
const context = React27.useContext(CalendarContext);
|
|
9315
10708
|
if (!context) {
|
|
9316
10709
|
throw new Error("useEventCalendar must be used within an EventCalendarProvider");
|
|
9317
10710
|
}
|
|
@@ -9319,14 +10712,14 @@ function useEventCalendar() {
|
|
|
9319
10712
|
}
|
|
9320
10713
|
function useFilteredEvents() {
|
|
9321
10714
|
const { events, selectedUserId } = useEventCalendar();
|
|
9322
|
-
return
|
|
10715
|
+
return React27.useMemo(() => {
|
|
9323
10716
|
if (!selectedUserId) return events;
|
|
9324
10717
|
return events.filter((event) => event.user.id === selectedUserId);
|
|
9325
10718
|
}, [events, selectedUserId]);
|
|
9326
10719
|
}
|
|
9327
10720
|
function useEventsInRange(startDate, endDate) {
|
|
9328
10721
|
const filteredEvents = useFilteredEvents();
|
|
9329
|
-
return
|
|
10722
|
+
return React27.useMemo(() => {
|
|
9330
10723
|
return filteredEvents.filter((event) => {
|
|
9331
10724
|
const eventStart = new Date(event.startDate);
|
|
9332
10725
|
const eventEnd = new Date(event.endDate);
|
|
@@ -9884,8 +11277,8 @@ function MoreEvents({ count, onClick, className }) {
|
|
|
9884
11277
|
);
|
|
9885
11278
|
}
|
|
9886
11279
|
function TimeIndicator({ className }) {
|
|
9887
|
-
const [now, setNow] =
|
|
9888
|
-
|
|
11280
|
+
const [now, setNow] = React27.useState(/* @__PURE__ */ new Date());
|
|
11281
|
+
React27.useEffect(() => {
|
|
9889
11282
|
const interval = setInterval(() => setNow(/* @__PURE__ */ new Date()), 6e4);
|
|
9890
11283
|
return () => clearInterval(interval);
|
|
9891
11284
|
}, []);
|
|
@@ -9922,24 +11315,24 @@ function DateBadge({ date, className }) {
|
|
|
9922
11315
|
}
|
|
9923
11316
|
);
|
|
9924
11317
|
}
|
|
9925
|
-
var DragContext =
|
|
11318
|
+
var DragContext = React27.createContext(null);
|
|
9926
11319
|
function DragProvider({
|
|
9927
11320
|
children,
|
|
9928
11321
|
snapMinutes = 15,
|
|
9929
11322
|
onDragStart,
|
|
9930
11323
|
onDragEnd
|
|
9931
11324
|
}) {
|
|
9932
|
-
const [draggedEvent, setDraggedEventState] =
|
|
9933
|
-
const [isDragging, setIsDragging] =
|
|
11325
|
+
const [draggedEvent, setDraggedEventState] = React27.useState(null);
|
|
11326
|
+
const [isDragging, setIsDragging] = React27.useState(false);
|
|
9934
11327
|
const { updateEvent } = useEventCalendar();
|
|
9935
|
-
const setDraggedEvent =
|
|
11328
|
+
const setDraggedEvent = React27.useCallback((event) => {
|
|
9936
11329
|
setDraggedEventState(event);
|
|
9937
11330
|
setIsDragging(!!event);
|
|
9938
11331
|
if (event) {
|
|
9939
11332
|
onDragStart?.(event);
|
|
9940
11333
|
}
|
|
9941
11334
|
}, [onDragStart]);
|
|
9942
|
-
const handleDrop =
|
|
11335
|
+
const handleDrop = React27.useCallback((newStartDate) => {
|
|
9943
11336
|
if (!draggedEvent) return;
|
|
9944
11337
|
const snappedDate = snapToInterval(newStartDate, snapMinutes);
|
|
9945
11338
|
const { startDate, endDate } = calculateDropDates(draggedEvent, snappedDate);
|
|
@@ -9952,7 +11345,7 @@ function DragProvider({
|
|
|
9952
11345
|
onDragEnd?.(updatedEvent, new Date(startDate), new Date(endDate));
|
|
9953
11346
|
setDraggedEvent(null);
|
|
9954
11347
|
}, [draggedEvent, snapMinutes, updateEvent, onDragEnd, setDraggedEvent]);
|
|
9955
|
-
const contextValue =
|
|
11348
|
+
const contextValue = React27.useMemo(
|
|
9956
11349
|
() => ({
|
|
9957
11350
|
draggedEvent,
|
|
9958
11351
|
setDraggedEvent,
|
|
@@ -9963,7 +11356,7 @@ function DragProvider({
|
|
|
9963
11356
|
return /* @__PURE__ */ jsx(DragContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(DragDropHandler, { onDrop: handleDrop, children }) });
|
|
9964
11357
|
}
|
|
9965
11358
|
function useDrag() {
|
|
9966
|
-
const context =
|
|
11359
|
+
const context = React27.useContext(DragContext);
|
|
9967
11360
|
if (!context) {
|
|
9968
11361
|
throw new Error("useDrag must be used within a DragProvider");
|
|
9969
11362
|
}
|
|
@@ -10008,7 +11401,7 @@ function DroppableZone({
|
|
|
10008
11401
|
}) {
|
|
10009
11402
|
const { draggedEvent, setDraggedEvent } = useDrag();
|
|
10010
11403
|
const { updateEvent } = useEventCalendar();
|
|
10011
|
-
const [isOver, setIsOver] =
|
|
11404
|
+
const [isOver, setIsOver] = React27.useState(false);
|
|
10012
11405
|
const handleDragOver = (e) => {
|
|
10013
11406
|
e.preventDefault();
|
|
10014
11407
|
e.dataTransfer.dropEffect = "move";
|
|
@@ -10046,23 +11439,23 @@ function DroppableZone({
|
|
|
10046
11439
|
function useDroppable({ date, hour, minute = 0, onDrop }) {
|
|
10047
11440
|
const { draggedEvent, setDraggedEvent } = useDrag();
|
|
10048
11441
|
const { updateEvent } = useEventCalendar();
|
|
10049
|
-
const [isOver, setIsOver] =
|
|
10050
|
-
const dropTargetDate =
|
|
11442
|
+
const [isOver, setIsOver] = React27.useState(false);
|
|
11443
|
+
const dropTargetDate = React27.useMemo(() => {
|
|
10051
11444
|
const targetDate = new Date(date);
|
|
10052
11445
|
if (hour !== void 0) {
|
|
10053
11446
|
targetDate.setHours(hour, minute, 0, 0);
|
|
10054
11447
|
}
|
|
10055
11448
|
return targetDate;
|
|
10056
11449
|
}, [date, hour, minute]);
|
|
10057
|
-
const handleDragOver =
|
|
11450
|
+
const handleDragOver = React27.useCallback((e) => {
|
|
10058
11451
|
e.preventDefault();
|
|
10059
11452
|
e.dataTransfer.dropEffect = "move";
|
|
10060
11453
|
if (!isOver) setIsOver(true);
|
|
10061
11454
|
}, [isOver]);
|
|
10062
|
-
const handleDragLeave =
|
|
11455
|
+
const handleDragLeave = React27.useCallback(() => {
|
|
10063
11456
|
setIsOver(false);
|
|
10064
11457
|
}, []);
|
|
10065
|
-
const handleDrop =
|
|
11458
|
+
const handleDrop = React27.useCallback((e) => {
|
|
10066
11459
|
e.preventDefault();
|
|
10067
11460
|
setIsOver(false);
|
|
10068
11461
|
if (!draggedEvent) return;
|
|
@@ -10089,13 +11482,13 @@ function useDroppable({ date, hour, minute = 0, onDrop }) {
|
|
|
10089
11482
|
function useDraggable(event, disabled = false) {
|
|
10090
11483
|
const { setDraggedEvent, draggedEvent } = useDrag();
|
|
10091
11484
|
const isDragged = draggedEvent?.id === event.id;
|
|
10092
|
-
const handleDragStart =
|
|
11485
|
+
const handleDragStart = React27.useCallback((e) => {
|
|
10093
11486
|
if (disabled) return;
|
|
10094
11487
|
e.dataTransfer.effectAllowed = "move";
|
|
10095
11488
|
e.dataTransfer.setData("text/plain", event.id);
|
|
10096
11489
|
setDraggedEvent(event);
|
|
10097
11490
|
}, [disabled, event, setDraggedEvent]);
|
|
10098
|
-
const handleDragEnd =
|
|
11491
|
+
const handleDragEnd = React27.useCallback(() => {
|
|
10099
11492
|
setDraggedEvent(null);
|
|
10100
11493
|
}, [setDraggedEvent]);
|
|
10101
11494
|
return {
|
|
@@ -10136,15 +11529,15 @@ function MonthView({
|
|
|
10136
11529
|
}) {
|
|
10137
11530
|
const { selectedDate, badgeVariant, setSelectedDate, setView } = useEventCalendar();
|
|
10138
11531
|
const filteredEvents = useFilteredEvents();
|
|
10139
|
-
const { singleDayEvents, multiDayEvents } =
|
|
11532
|
+
const { singleDayEvents, multiDayEvents } = React27.useMemo(
|
|
10140
11533
|
() => splitEventsByDuration(filteredEvents),
|
|
10141
11534
|
[filteredEvents]
|
|
10142
11535
|
);
|
|
10143
|
-
const cells =
|
|
11536
|
+
const cells = React27.useMemo(
|
|
10144
11537
|
() => getCalendarCells(selectedDate),
|
|
10145
11538
|
[selectedDate]
|
|
10146
11539
|
);
|
|
10147
|
-
const eventPositions =
|
|
11540
|
+
const eventPositions = React27.useMemo(
|
|
10148
11541
|
() => calculateMonthEventPositions(multiDayEvents, singleDayEvents, selectedDate),
|
|
10149
11542
|
[multiDayEvents, singleDayEvents, selectedDate]
|
|
10150
11543
|
);
|
|
@@ -10326,7 +11719,7 @@ function WeekView({
|
|
|
10326
11719
|
visibleHours
|
|
10327
11720
|
} = useEventCalendar();
|
|
10328
11721
|
const filteredEvents = useFilteredEvents();
|
|
10329
|
-
const { singleDayEvents, multiDayEvents } =
|
|
11722
|
+
const { singleDayEvents, multiDayEvents } = React27.useMemo(
|
|
10330
11723
|
() => splitEventsByDuration(filteredEvents),
|
|
10331
11724
|
[filteredEvents]
|
|
10332
11725
|
);
|
|
@@ -10532,8 +11925,8 @@ function CalendarTimeline({
|
|
|
10532
11925
|
firstVisibleHour,
|
|
10533
11926
|
lastVisibleHour
|
|
10534
11927
|
}) {
|
|
10535
|
-
const [currentTime, setCurrentTime] =
|
|
10536
|
-
|
|
11928
|
+
const [currentTime, setCurrentTime] = React27.useState(/* @__PURE__ */ new Date());
|
|
11929
|
+
React27.useEffect(() => {
|
|
10537
11930
|
const interval = setInterval(() => {
|
|
10538
11931
|
setCurrentTime(/* @__PURE__ */ new Date());
|
|
10539
11932
|
}, 6e4);
|
|
@@ -10616,7 +12009,7 @@ function DayView({
|
|
|
10616
12009
|
visibleHours
|
|
10617
12010
|
} = useEventCalendar();
|
|
10618
12011
|
const filteredEvents = useFilteredEvents();
|
|
10619
|
-
const { singleDayEvents, multiDayEvents } =
|
|
12012
|
+
const { singleDayEvents, multiDayEvents } = React27.useMemo(
|
|
10620
12013
|
() => splitEventsByDuration(filteredEvents),
|
|
10621
12014
|
[filteredEvents]
|
|
10622
12015
|
);
|
|
@@ -10624,7 +12017,7 @@ function DayView({
|
|
|
10624
12017
|
visibleHours,
|
|
10625
12018
|
singleDayEvents
|
|
10626
12019
|
);
|
|
10627
|
-
const currentEvents =
|
|
12020
|
+
const currentEvents = React27.useMemo(() => {
|
|
10628
12021
|
if (!isToday(selectedDate)) return [];
|
|
10629
12022
|
return getCurrentEvents(singleDayEvents);
|
|
10630
12023
|
}, [singleDayEvents, selectedDate]);
|
|
@@ -10848,8 +12241,8 @@ function CalendarTimeline2({
|
|
|
10848
12241
|
firstVisibleHour,
|
|
10849
12242
|
lastVisibleHour
|
|
10850
12243
|
}) {
|
|
10851
|
-
const [currentTime, setCurrentTime] =
|
|
10852
|
-
|
|
12244
|
+
const [currentTime, setCurrentTime] = React27.useState(/* @__PURE__ */ new Date());
|
|
12245
|
+
React27.useEffect(() => {
|
|
10853
12246
|
const interval = setInterval(() => {
|
|
10854
12247
|
setCurrentTime(/* @__PURE__ */ new Date());
|
|
10855
12248
|
}, 6e4);
|
|
@@ -10883,7 +12276,7 @@ function YearView({
|
|
|
10883
12276
|
}) {
|
|
10884
12277
|
const { selectedDate, setSelectedDate, setView } = useEventCalendar();
|
|
10885
12278
|
const filteredEvents = useFilteredEvents();
|
|
10886
|
-
const months =
|
|
12279
|
+
const months = React27.useMemo(() => {
|
|
10887
12280
|
const yearStart = startOfYear(selectedDate);
|
|
10888
12281
|
return Array.from({ length: 12 }, (_, i) => addMonths(yearStart, i));
|
|
10889
12282
|
}, [selectedDate]);
|
|
@@ -11006,11 +12399,11 @@ function AgendaView({
|
|
|
11006
12399
|
}) {
|
|
11007
12400
|
const { selectedDate, setSelectedDate, setView } = useEventCalendar();
|
|
11008
12401
|
const filteredEvents = useFilteredEvents();
|
|
11009
|
-
const { singleDayEvents, multiDayEvents } =
|
|
12402
|
+
const { singleDayEvents, multiDayEvents } = React27.useMemo(
|
|
11010
12403
|
() => splitEventsByDuration(filteredEvents),
|
|
11011
12404
|
[filteredEvents]
|
|
11012
12405
|
);
|
|
11013
|
-
const eventsByDay =
|
|
12406
|
+
const eventsByDay = React27.useMemo(() => {
|
|
11014
12407
|
const allDates = /* @__PURE__ */ new Map();
|
|
11015
12408
|
singleDayEvents.forEach((event) => {
|
|
11016
12409
|
const eventDate = parseISO(event.startDate);
|
|
@@ -11475,16 +12868,16 @@ function EventDialog({
|
|
|
11475
12868
|
defaultUserId
|
|
11476
12869
|
}) {
|
|
11477
12870
|
const { addEvent, updateEvent, deleteEvent, users } = useEventCalendar();
|
|
11478
|
-
const [title, setTitle] =
|
|
11479
|
-
const [description, setDescription] =
|
|
11480
|
-
const [startDate, setStartDate] =
|
|
11481
|
-
const [startTime, setStartTime] =
|
|
11482
|
-
const [endDate, setEndDate] =
|
|
11483
|
-
const [endTime, setEndTime] =
|
|
11484
|
-
const [color, setColor] =
|
|
11485
|
-
const [userId, setUserId] =
|
|
11486
|
-
const [isSubmitting, setIsSubmitting] =
|
|
11487
|
-
|
|
12871
|
+
const [title, setTitle] = React27.useState("");
|
|
12872
|
+
const [description, setDescription] = React27.useState("");
|
|
12873
|
+
const [startDate, setStartDate] = React27.useState("");
|
|
12874
|
+
const [startTime, setStartTime] = React27.useState("");
|
|
12875
|
+
const [endDate, setEndDate] = React27.useState("");
|
|
12876
|
+
const [endTime, setEndTime] = React27.useState("");
|
|
12877
|
+
const [color, setColor] = React27.useState("blue");
|
|
12878
|
+
const [userId, setUserId] = React27.useState("");
|
|
12879
|
+
const [isSubmitting, setIsSubmitting] = React27.useState(false);
|
|
12880
|
+
React27.useEffect(() => {
|
|
11488
12881
|
if (open) {
|
|
11489
12882
|
if (mode === "edit" && event) {
|
|
11490
12883
|
const start = parseISO(event.startDate);
|
|
@@ -11707,7 +13100,7 @@ function QuickAddEvent({
|
|
|
11707
13100
|
onOpenDialog,
|
|
11708
13101
|
onClose
|
|
11709
13102
|
}) {
|
|
11710
|
-
const [title, setTitle] =
|
|
13103
|
+
const [title, setTitle] = React27.useState("");
|
|
11711
13104
|
const { users } = useEventCalendar();
|
|
11712
13105
|
const handleSubmit = (e) => {
|
|
11713
13106
|
e.preventDefault();
|
|
@@ -11774,8 +13167,8 @@ var HOUR_OPTIONS = Array.from({ length: 25 }, (_, i) => {
|
|
|
11774
13167
|
});
|
|
11775
13168
|
function ChangeVisibleHoursInput() {
|
|
11776
13169
|
const { visibleHours, setVisibleHours } = useEventCalendar();
|
|
11777
|
-
const [from, setFrom] =
|
|
11778
|
-
const [to, setTo] =
|
|
13170
|
+
const [from, setFrom] = React27.useState(visibleHours.from);
|
|
13171
|
+
const [to, setTo] = React27.useState(visibleHours.to);
|
|
11779
13172
|
const handleApply = () => {
|
|
11780
13173
|
const toHour = to === 0 ? 24 : to;
|
|
11781
13174
|
setVisibleHours({ from, to: toHour });
|
|
@@ -11821,7 +13214,7 @@ var HOUR_OPTIONS2 = Array.from({ length: 25 }, (_, i) => {
|
|
|
11821
13214
|
});
|
|
11822
13215
|
function ChangeWorkingHoursInput() {
|
|
11823
13216
|
const { workingHours, setWorkingHours } = useEventCalendar();
|
|
11824
|
-
const [localWorkingHours, setLocalWorkingHours] =
|
|
13217
|
+
const [localWorkingHours, setLocalWorkingHours] = React27.useState({
|
|
11825
13218
|
...workingHours
|
|
11826
13219
|
});
|
|
11827
13220
|
const handleToggleDay = (dayId) => {
|
|
@@ -11970,8 +13363,8 @@ function CalendarSettingsButton({
|
|
|
11970
13363
|
);
|
|
11971
13364
|
}
|
|
11972
13365
|
function useMediaQuery(query) {
|
|
11973
|
-
const [matches, setMatches] =
|
|
11974
|
-
|
|
13366
|
+
const [matches, setMatches] = React27.useState(false);
|
|
13367
|
+
React27.useEffect(() => {
|
|
11975
13368
|
const media = window.matchMedia(query);
|
|
11976
13369
|
setMatches(media.matches);
|
|
11977
13370
|
const listener = (event) => {
|
|
@@ -12023,11 +13416,11 @@ function BigCalendarInner({
|
|
|
12023
13416
|
maxEventsPerDay
|
|
12024
13417
|
}) {
|
|
12025
13418
|
const { view, setView } = useEventCalendar();
|
|
12026
|
-
const [dialogOpen, setDialogOpen] =
|
|
12027
|
-
const [settingsDialogOpen, setSettingsDialogOpen] =
|
|
12028
|
-
const [selectedEvent, setSelectedEvent] =
|
|
12029
|
-
const [dialogMode, setDialogMode] =
|
|
12030
|
-
const [defaultDate, setDefaultDate] =
|
|
13419
|
+
const [dialogOpen, setDialogOpen] = React27.useState(false);
|
|
13420
|
+
const [settingsDialogOpen, setSettingsDialogOpen] = React27.useState(false);
|
|
13421
|
+
const [selectedEvent, setSelectedEvent] = React27.useState(null);
|
|
13422
|
+
const [dialogMode, setDialogMode] = React27.useState("add");
|
|
13423
|
+
const [defaultDate, setDefaultDate] = React27.useState(/* @__PURE__ */ new Date());
|
|
12031
13424
|
const isMobile = useMediaQuery("(max-width: 768px)");
|
|
12032
13425
|
const isCompact = compact === "auto" ? isMobile : compact;
|
|
12033
13426
|
const handleAddClick = () => {
|
|
@@ -12186,6 +13579,6 @@ function CalendarView({
|
|
|
12186
13579
|
}
|
|
12187
13580
|
}
|
|
12188
13581
|
|
|
12189
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AgendaView, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AspectRatio, Avatar, AvatarFallback, AvatarImage, BADGE_VARIANT_LABELS, Badge, BigCalendar, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, Calendar, CalendarContext, CalendarDayButton, CalendarHeader, CalendarHeaderCompact, CalendarSettingsButton, CalendarSettingsContent, CalendarSettingsDialog, CalibrationTable, CalibrationWeekCell, CalibrationWeekHeader, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, ChangeBadgeVariantInput, ChangeVisibleHoursInput, ChangeWorkingHoursInput, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Checkbox, CircularProgress, Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, CommentButton, CommentDialog, CommentPopover, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, DEFAULT_VISIBLE_HOURS, DEFAULT_WORKING_HOURS, DataTableColumnHeader, DataTablePagination, DataTableViewOptions, DateBadge, DayView, DeliveryIndicator, DeliveryIndicators, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DragContext, DragProvider, DraggableEvent, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, DroppableZone, EVENT_COLORS, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, EventBadge, EventCalendarProvider, EventDialog, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, HoverCard, HoverCardContent, HoverCardTrigger, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, Item6 as Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle, Kbd, KbdGroup, Label2 as Label, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, MonthView, MoreEvents, NativeSelect, NativeSelectOptGroup, NativeSelectOption, NavMain, NavProjects, NavSecondary, NavUser, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, NetBadge, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, PlanningTable, PlanningTableToolbar, PlanningWeekCommentPopover, PlayerCanvas, PlayerCanvasActionButton, PlayerCanvasControls, PlayerCanvasDivider, PlayerCanvasInfo, PlayerCanvasLabel, PlayerCanvasPlayButton, PlayerCanvasProgress, PlayerCanvasSkipButton, PlayerCanvasTitle, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Progress, QuickAddEvent, RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, RowHeaderCell, ScrollArea, ScrollBar, SearchForm, SearchTrigger, Section, SectionContent, SectionDescription, SectionFooter, SectionHeader, SectionTitle, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetBody, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, SiteHeader, Skeleton, Slider, Spinner, SubmitCalibrationBar, SupplierCell, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, ThemeSwitch, TimeIndicator, Toaster, Toggle, ToggleGroup, ToggleGroupItem, ToolBarCanvas, ToolBarCanvasButton, ToolBarCanvasDivider, ToolBarCanvasGroup, Tooltip2 as Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, UserAvatarsDropdown, VIEW_LABELS, WeekCell, WeekDetailDialog, WeekHeader, WeekView, YearView, badgeVariants, buttonGroupVariants, buttonVariants, calculateCalibrationCells, calculateDropDates, calculateMonthEventPositions, canSubmitCalibration, cardVariants, createDefaultEvent, deliveryIndicatorVariants, formatCalibrationUnit, formatDateRange2 as formatDateRange, formatProductionUnit, formatTime, generateColumns, generateEventId, generateLocationOptions, generateWeekColumns, generateWeeks, getCalendarCells, getCommentLocationLabel, getCurrentEvents, getDayHours, getElementShipmentStatus, getEventBlockStyle, getEventDuration, getEventDurationMinutes, getEventsCount, getEventsForDate, getEventsInRange, getHeaderLabel, getISOWeek, getMonthCellEvents, getMonthDays, getShipmentStatusLabel, getSupplierColumn, getTimeHeight, getTimePosition, getViewDateRange, getVisibleHours, getWeekDayNames, getWeekDays, getWeekKey, getYearMonths, groupEvents, isMultiDayEvent, isWorkingHour, navigateDate, navigationMenuTriggerStyle, playerCanvasPlayButtonVariants, playerCanvasSkipButtonVariants, rangeText, sectionVariants, snapToInterval, sortEvents, splitEventsByDuration, toggleVariants, toolBarCanvasButtonVariants, useDrag, useDraggable, useDroppable, useEventCalendar, useEventsInRange, useFilteredEvents, useFormField, useIsMobile, useSearchShortcut, useSidebar };
|
|
13582
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AgendaView, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AspectRatio, Avatar, AvatarFallback, AvatarImage, BADGE_VARIANT_LABELS, Badge, BigCalendar, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, Calendar, CalendarContext, CalendarDayButton, CalendarHeader, CalendarHeaderCompact, CalendarSettingsButton, CalendarSettingsContent, CalendarSettingsDialog, CalibrationTable, CalibrationWeekCell, CalibrationWeekHeader, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, ChangeBadgeVariantInput, ChangeVisibleHoursInput, ChangeWorkingHoursInput, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Checkbox, CircularProgress, Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, CommentButton, CommentDialog, CommentPopover, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, DEFAULT_VISIBLE_HOURS, DEFAULT_WORKING_HOURS, DataTableColumnHeader, DataTablePagination, DataTableViewOptions, DateBadge, DayView, DeliveryBadge, DeliveryCard, DeliveryDetailPage, DeliveryIndicator, DeliveryIndicators, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DragContext, DragProvider, DraggableEvent, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, DroppableZone, EVENT_COLORS, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, EventBadge, EventCalendarProvider, EventDialog, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, HoverCard, HoverCardContent, HoverCardTrigger, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, Item6 as Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle, Kbd, KbdGroup, Label2 as Label, Map2 as Map, MapMarker, MapPopup, MapTileLayer, MapTooltip, MapZoomControl, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, MonthView, MoreEvents, NativeSelect, NativeSelectOptGroup, NativeSelectOption, NavMain, NavProjects, NavSecondary, NavUser, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, NetBadge, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, PlanningTable, PlanningTableToolbar, PlanningWeekCommentPopover, PlayerCanvas, PlayerCanvasActionButton, PlayerCanvasControls, PlayerCanvasDivider, PlayerCanvasInfo, PlayerCanvasLabel, PlayerCanvasPlayButton, PlayerCanvasProgress, PlayerCanvasSkipButton, PlayerCanvasTitle, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Progress, QuickAddEvent, RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, RowHeaderCell, ScrollArea, ScrollBar, SearchForm, SearchTrigger, Section, SectionContent, SectionDescription, SectionFooter, SectionHeader, SectionTitle, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetBody, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, SiteHeader, Skeleton, Slider, Spinner, SubmitCalibrationBar, SupplierCell, SupplierWeeklyLoading, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, ThemeSwitch, TimeIndicator, Toaster, Toggle, ToggleGroup, ToggleGroupItem, ToolBarCanvas, ToolBarCanvasButton, ToolBarCanvasDivider, ToolBarCanvasGroup, Tooltip2 as Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, UserAvatarsDropdown, VIEW_LABELS, WeekCell, WeekDetailDialog, WeekHeader, WeekView, WeeklyLoadingView, YearView, badgeVariants, buttonGroupVariants, buttonVariants, calculateCalibrationCells, calculateDropDates, calculateMonthEventPositions, canSubmitCalibration, cardVariants, createDefaultEvent, deliveryIndicatorVariants, extractPrefixes, formatCalibrationUnit, formatDateRange2 as formatDateRange, formatProductionUnit, formatTime, generateColumns, generateEventId, generateLoadingWeek, generateLocationOptions, generateWeekColumns, generateWeeks, getCalendarCells, getCommentLocationLabel, getCurrentEvents, getDayHours, getDayLabel, getDeliveryVisualState, getElementShipmentStatus, getEventBlockStyle, getEventDuration, getEventDurationMinutes, getEventsCount, getEventsForDate, getEventsInRange, getHeaderLabel, getISOWeek, getLoadingDeliveryStatusLabel, getLoadingElementStatusLabel, getLoadingISOWeek, getLoadingWeekKey, getMonthCellEvents, getMonthDays, getShipmentStatusLabel, getShortDayLabel, getSupplierColumn, getTimeHeight, getTimePosition, getViewDateRange, getVisibleHours, getWeekDayNames, getWeekDays, getWeekKey, getYearMonths, groupDeliveriesByDay, groupDeliveriesByPrefixAndDay, groupEvents, isMultiDayEvent, isWorkingHour, navigateDate, navigationMenuTriggerStyle, playerCanvasPlayButtonVariants, playerCanvasSkipButtonVariants, rangeText, sectionVariants, snapToInterval, sortEvents, splitEventsByDuration, toggleVariants, toolBarCanvasButtonVariants, useDrag, useDraggable, useDroppable, useEventCalendar, useEventsInRange, useFilteredEvents, useFormField, useIsMobile, useSearchShortcut, useSidebar };
|
|
12190
13583
|
//# sourceMappingURL=index.js.map
|
|
12191
13584
|
//# sourceMappingURL=index.js.map
|