@optilogic/core 1.0.0-beta.3 → 1.0.0-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +346 -221
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +103 -7
- package/dist/index.d.ts +103 -7
- package/dist/index.js +291 -170
- package/dist/index.js.map +1 -1
- package/package.json +20 -20
- package/src/components/board.tsx +251 -0
- package/src/components/context-menu.tsx +1 -1
- package/src/components/data-grid/hooks/useKeyboardNavigation.ts +1 -1
- package/src/index.ts +13 -0
package/dist/index.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var clsx = require('clsx');
|
|
4
4
|
var tailwindMerge = require('tailwind-merge');
|
|
5
|
-
var
|
|
5
|
+
var React34 = require('react');
|
|
6
6
|
var reactSlot = require('@radix-ui/react-slot');
|
|
7
7
|
var classVarianceAuthority = require('class-variance-authority');
|
|
8
8
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -42,7 +42,7 @@ function _interopNamespace(e) {
|
|
|
42
42
|
return Object.freeze(n);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
var
|
|
45
|
+
var React34__namespace = /*#__PURE__*/_interopNamespace(React34);
|
|
46
46
|
var LabelPrimitive__namespace = /*#__PURE__*/_interopNamespace(LabelPrimitive);
|
|
47
47
|
var CheckboxPrimitive__namespace = /*#__PURE__*/_interopNamespace(CheckboxPrimitive);
|
|
48
48
|
var SwitchPrimitive__namespace = /*#__PURE__*/_interopNamespace(SwitchPrimitive);
|
|
@@ -86,7 +86,7 @@ var buttonVariants = classVarianceAuthority.cva(
|
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
);
|
|
89
|
-
var Button =
|
|
89
|
+
var Button = React34__namespace.forwardRef(
|
|
90
90
|
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
91
91
|
const Comp = asChild ? reactSlot.Slot : "button";
|
|
92
92
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -100,7 +100,7 @@ var Button = React33__namespace.forwardRef(
|
|
|
100
100
|
}
|
|
101
101
|
);
|
|
102
102
|
Button.displayName = "Button";
|
|
103
|
-
var Input =
|
|
103
|
+
var Input = React34__namespace.forwardRef(
|
|
104
104
|
({ className, type, ...props }, ref) => {
|
|
105
105
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
106
106
|
"input",
|
|
@@ -120,7 +120,7 @@ Input.displayName = "Input";
|
|
|
120
120
|
var labelVariants = classVarianceAuthority.cva(
|
|
121
121
|
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
|
122
122
|
);
|
|
123
|
-
var Label =
|
|
123
|
+
var Label = React34__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
124
124
|
LabelPrimitive__namespace.Root,
|
|
125
125
|
{
|
|
126
126
|
ref,
|
|
@@ -129,7 +129,7 @@ var Label = React33__namespace.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
129
129
|
}
|
|
130
130
|
));
|
|
131
131
|
Label.displayName = LabelPrimitive__namespace.Root.displayName;
|
|
132
|
-
var Textarea =
|
|
132
|
+
var Textarea = React34__namespace.forwardRef(
|
|
133
133
|
({ className, ...props }, ref) => {
|
|
134
134
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
135
135
|
"textarea",
|
|
@@ -168,7 +168,7 @@ var badgeVariants = classVarianceAuthority.cva(
|
|
|
168
168
|
function Badge({ className, variant, ...props }) {
|
|
169
169
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(badgeVariants({ variant }), className), ...props });
|
|
170
170
|
}
|
|
171
|
-
var Checkbox =
|
|
171
|
+
var Checkbox = React34__namespace.forwardRef(({ className, showBorder = true, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
172
172
|
CheckboxPrimitive__namespace.Root,
|
|
173
173
|
{
|
|
174
174
|
ref,
|
|
@@ -212,7 +212,7 @@ var Checkbox = React33__namespace.forwardRef(({ className, showBorder = true, ..
|
|
|
212
212
|
}
|
|
213
213
|
));
|
|
214
214
|
Checkbox.displayName = CheckboxPrimitive__namespace.Root.displayName;
|
|
215
|
-
var Switch =
|
|
215
|
+
var Switch = React34__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
216
216
|
SwitchPrimitive__namespace.Root,
|
|
217
217
|
{
|
|
218
218
|
className: cn(
|
|
@@ -248,7 +248,7 @@ var Switch = React33__namespace.forwardRef(({ className, ...props }, ref) => /*
|
|
|
248
248
|
}
|
|
249
249
|
));
|
|
250
250
|
Switch.displayName = SwitchPrimitive__namespace.Root.displayName;
|
|
251
|
-
var Progress =
|
|
251
|
+
var Progress = React34__namespace.forwardRef(({ className, value, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
252
252
|
ProgressPrimitive__namespace.Root,
|
|
253
253
|
{
|
|
254
254
|
ref,
|
|
@@ -267,7 +267,7 @@ var Progress = React33__namespace.forwardRef(({ className, value, ...props }, re
|
|
|
267
267
|
}
|
|
268
268
|
));
|
|
269
269
|
Progress.displayName = ProgressPrimitive__namespace.Root.displayName;
|
|
270
|
-
var Separator =
|
|
270
|
+
var Separator = React34__namespace.forwardRef(
|
|
271
271
|
({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
272
272
|
SeparatorPrimitive__namespace.Root,
|
|
273
273
|
{
|
|
@@ -296,7 +296,7 @@ function Skeleton({ className, ...props }) {
|
|
|
296
296
|
var Select = SelectPrimitive__namespace.Root;
|
|
297
297
|
var SelectGroup = SelectPrimitive__namespace.Group;
|
|
298
298
|
var SelectValue = SelectPrimitive__namespace.Value;
|
|
299
|
-
var SelectTrigger =
|
|
299
|
+
var SelectTrigger = React34__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
300
300
|
SelectPrimitive__namespace.Trigger,
|
|
301
301
|
{
|
|
302
302
|
ref,
|
|
@@ -312,7 +312,7 @@ var SelectTrigger = React33__namespace.forwardRef(({ className, children, ...pro
|
|
|
312
312
|
}
|
|
313
313
|
));
|
|
314
314
|
SelectTrigger.displayName = SelectPrimitive__namespace.Trigger.displayName;
|
|
315
|
-
var SelectScrollUpButton =
|
|
315
|
+
var SelectScrollUpButton = React34__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
316
316
|
SelectPrimitive__namespace.ScrollUpButton,
|
|
317
317
|
{
|
|
318
318
|
ref,
|
|
@@ -325,7 +325,7 @@ var SelectScrollUpButton = React33__namespace.forwardRef(({ className, ...props
|
|
|
325
325
|
}
|
|
326
326
|
));
|
|
327
327
|
SelectScrollUpButton.displayName = SelectPrimitive__namespace.ScrollUpButton.displayName;
|
|
328
|
-
var SelectScrollDownButton =
|
|
328
|
+
var SelectScrollDownButton = React34__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
329
329
|
SelectPrimitive__namespace.ScrollDownButton,
|
|
330
330
|
{
|
|
331
331
|
ref,
|
|
@@ -338,7 +338,7 @@ var SelectScrollDownButton = React33__namespace.forwardRef(({ className, ...prop
|
|
|
338
338
|
}
|
|
339
339
|
));
|
|
340
340
|
SelectScrollDownButton.displayName = SelectPrimitive__namespace.ScrollDownButton.displayName;
|
|
341
|
-
var SelectContent =
|
|
341
|
+
var SelectContent = React34__namespace.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
342
342
|
SelectPrimitive__namespace.Content,
|
|
343
343
|
{
|
|
344
344
|
ref,
|
|
@@ -366,7 +366,7 @@ var SelectContent = React33__namespace.forwardRef(({ className, children, positi
|
|
|
366
366
|
}
|
|
367
367
|
) }));
|
|
368
368
|
SelectContent.displayName = SelectPrimitive__namespace.Content.displayName;
|
|
369
|
-
var SelectLabel =
|
|
369
|
+
var SelectLabel = React34__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
370
370
|
SelectPrimitive__namespace.Label,
|
|
371
371
|
{
|
|
372
372
|
ref,
|
|
@@ -375,7 +375,7 @@ var SelectLabel = React33__namespace.forwardRef(({ className, ...props }, ref) =
|
|
|
375
375
|
}
|
|
376
376
|
));
|
|
377
377
|
SelectLabel.displayName = SelectPrimitive__namespace.Label.displayName;
|
|
378
|
-
var SelectItem =
|
|
378
|
+
var SelectItem = React34__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
379
379
|
SelectPrimitive__namespace.Item,
|
|
380
380
|
{
|
|
381
381
|
ref,
|
|
@@ -391,7 +391,7 @@ var SelectItem = React33__namespace.forwardRef(({ className, children, ...props
|
|
|
391
391
|
}
|
|
392
392
|
));
|
|
393
393
|
SelectItem.displayName = SelectPrimitive__namespace.Item.displayName;
|
|
394
|
-
var SelectSeparator =
|
|
394
|
+
var SelectSeparator = React34__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
395
395
|
SelectPrimitive__namespace.Separator,
|
|
396
396
|
{
|
|
397
397
|
ref,
|
|
@@ -401,7 +401,7 @@ var SelectSeparator = React33__namespace.forwardRef(({ className, ...props }, re
|
|
|
401
401
|
));
|
|
402
402
|
SelectSeparator.displayName = SelectPrimitive__namespace.Separator.displayName;
|
|
403
403
|
var Tabs = TabsPrimitive__namespace.Root;
|
|
404
|
-
var TabsList =
|
|
404
|
+
var TabsList = React34__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
405
405
|
TabsPrimitive__namespace.List,
|
|
406
406
|
{
|
|
407
407
|
ref,
|
|
@@ -415,7 +415,7 @@ var TabsList = React33__namespace.forwardRef(({ className, ...props }, ref) => /
|
|
|
415
415
|
}
|
|
416
416
|
));
|
|
417
417
|
TabsList.displayName = TabsPrimitive__namespace.List.displayName;
|
|
418
|
-
var TabsTrigger =
|
|
418
|
+
var TabsTrigger = React34__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
419
419
|
TabsPrimitive__namespace.Trigger,
|
|
420
420
|
{
|
|
421
421
|
ref,
|
|
@@ -442,7 +442,7 @@ var TabsTrigger = React33__namespace.forwardRef(({ className, ...props }, ref) =
|
|
|
442
442
|
}
|
|
443
443
|
));
|
|
444
444
|
TabsTrigger.displayName = TabsPrimitive__namespace.Trigger.displayName;
|
|
445
|
-
var TabsContent =
|
|
445
|
+
var TabsContent = React34__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
446
446
|
TabsPrimitive__namespace.Content,
|
|
447
447
|
{
|
|
448
448
|
ref,
|
|
@@ -525,7 +525,7 @@ var accordionContentInnerVariants = classVarianceAuthority.cva("pb-4 pt-0", {
|
|
|
525
525
|
}
|
|
526
526
|
});
|
|
527
527
|
var Accordion = AccordionPrimitive__namespace.Root;
|
|
528
|
-
var AccordionItem =
|
|
528
|
+
var AccordionItem = React34__namespace.forwardRef(({ className, variant, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
529
529
|
AccordionPrimitive__namespace.Item,
|
|
530
530
|
{
|
|
531
531
|
ref,
|
|
@@ -535,7 +535,7 @@ var AccordionItem = React33__namespace.forwardRef(({ className, variant, ...prop
|
|
|
535
535
|
}
|
|
536
536
|
));
|
|
537
537
|
AccordionItem.displayName = "AccordionItem";
|
|
538
|
-
var AccordionTrigger =
|
|
538
|
+
var AccordionTrigger = React34__namespace.forwardRef(({ className, children, variant, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(AccordionPrimitive__namespace.Header, { className: "flex", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
539
539
|
AccordionPrimitive__namespace.Trigger,
|
|
540
540
|
{
|
|
541
541
|
ref,
|
|
@@ -548,7 +548,7 @@ var AccordionTrigger = React33__namespace.forwardRef(({ className, children, var
|
|
|
548
548
|
}
|
|
549
549
|
) }));
|
|
550
550
|
AccordionTrigger.displayName = AccordionPrimitive__namespace.Trigger.displayName;
|
|
551
|
-
var AccordionContent =
|
|
551
|
+
var AccordionContent = React34__namespace.forwardRef(({ className, children, variant, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
552
552
|
AccordionPrimitive__namespace.Content,
|
|
553
553
|
{
|
|
554
554
|
ref,
|
|
@@ -562,7 +562,7 @@ var TooltipProvider = TooltipPrimitive__namespace.Provider;
|
|
|
562
562
|
var TooltipRoot = TooltipPrimitive__namespace.Root;
|
|
563
563
|
var TooltipTrigger = TooltipPrimitive__namespace.Trigger;
|
|
564
564
|
var TooltipPortal = TooltipPrimitive__namespace.Portal;
|
|
565
|
-
var TooltipContent =
|
|
565
|
+
var TooltipContent = React34__namespace.forwardRef(({ className, sideOffset = 6, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(TooltipPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
566
566
|
TooltipPrimitive__namespace.Content,
|
|
567
567
|
{
|
|
568
568
|
ref,
|
|
@@ -591,7 +591,7 @@ var TooltipContent = React33__namespace.forwardRef(({ className, sideOffset = 6,
|
|
|
591
591
|
}
|
|
592
592
|
) }));
|
|
593
593
|
TooltipContent.displayName = TooltipPrimitive__namespace.Content.displayName;
|
|
594
|
-
var TooltipArrow =
|
|
594
|
+
var TooltipArrow = React34__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
595
595
|
TooltipPrimitive__namespace.Arrow,
|
|
596
596
|
{
|
|
597
597
|
ref,
|
|
@@ -630,7 +630,7 @@ function Tooltip({
|
|
|
630
630
|
var Popover = PopoverPrimitive__namespace.Root;
|
|
631
631
|
var PopoverTrigger = PopoverPrimitive__namespace.Trigger;
|
|
632
632
|
var PopoverAnchor = PopoverPrimitive__namespace.Anchor;
|
|
633
|
-
var PopoverContent =
|
|
633
|
+
var PopoverContent = React34__namespace.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(PopoverPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
634
634
|
PopoverPrimitive__namespace.Content,
|
|
635
635
|
{
|
|
636
636
|
ref,
|
|
@@ -656,7 +656,7 @@ var DropdownMenuGroup = DropdownMenuPrimitive__namespace.Group;
|
|
|
656
656
|
var DropdownMenuPortal = DropdownMenuPrimitive__namespace.Portal;
|
|
657
657
|
var DropdownMenuSub = DropdownMenuPrimitive__namespace.Sub;
|
|
658
658
|
var DropdownMenuRadioGroup = DropdownMenuPrimitive__namespace.RadioGroup;
|
|
659
|
-
var DropdownMenuSubTrigger =
|
|
659
|
+
var DropdownMenuSubTrigger = React34__namespace.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
660
660
|
DropdownMenuPrimitive__namespace.SubTrigger,
|
|
661
661
|
{
|
|
662
662
|
ref,
|
|
@@ -675,7 +675,7 @@ var DropdownMenuSubTrigger = React33__namespace.forwardRef(({ className, inset,
|
|
|
675
675
|
}
|
|
676
676
|
));
|
|
677
677
|
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive__namespace.SubTrigger.displayName;
|
|
678
|
-
var DropdownMenuSubContent =
|
|
678
|
+
var DropdownMenuSubContent = React34__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
679
679
|
DropdownMenuPrimitive__namespace.SubContent,
|
|
680
680
|
{
|
|
681
681
|
ref,
|
|
@@ -692,7 +692,7 @@ var DropdownMenuSubContent = React33__namespace.forwardRef(({ className, ...prop
|
|
|
692
692
|
}
|
|
693
693
|
));
|
|
694
694
|
DropdownMenuSubContent.displayName = DropdownMenuPrimitive__namespace.SubContent.displayName;
|
|
695
|
-
var DropdownMenuContent =
|
|
695
|
+
var DropdownMenuContent = React34__namespace.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
696
696
|
DropdownMenuPrimitive__namespace.Content,
|
|
697
697
|
{
|
|
698
698
|
ref,
|
|
@@ -710,7 +710,7 @@ var DropdownMenuContent = React33__namespace.forwardRef(({ className, sideOffset
|
|
|
710
710
|
}
|
|
711
711
|
) }));
|
|
712
712
|
DropdownMenuContent.displayName = DropdownMenuPrimitive__namespace.Content.displayName;
|
|
713
|
-
var DropdownMenuItem =
|
|
713
|
+
var DropdownMenuItem = React34__namespace.forwardRef(({ className, inset, destructive, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
714
714
|
DropdownMenuPrimitive__namespace.Item,
|
|
715
715
|
{
|
|
716
716
|
ref,
|
|
@@ -726,7 +726,7 @@ var DropdownMenuItem = React33__namespace.forwardRef(({ className, inset, destru
|
|
|
726
726
|
}
|
|
727
727
|
));
|
|
728
728
|
DropdownMenuItem.displayName = DropdownMenuPrimitive__namespace.Item.displayName;
|
|
729
|
-
var DropdownMenuCheckboxItem =
|
|
729
|
+
var DropdownMenuCheckboxItem = React34__namespace.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
730
730
|
DropdownMenuPrimitive__namespace.CheckboxItem,
|
|
731
731
|
{
|
|
732
732
|
ref,
|
|
@@ -745,7 +745,7 @@ var DropdownMenuCheckboxItem = React33__namespace.forwardRef(({ className, child
|
|
|
745
745
|
}
|
|
746
746
|
));
|
|
747
747
|
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive__namespace.CheckboxItem.displayName;
|
|
748
|
-
var DropdownMenuRadioItem =
|
|
748
|
+
var DropdownMenuRadioItem = React34__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
749
749
|
DropdownMenuPrimitive__namespace.RadioItem,
|
|
750
750
|
{
|
|
751
751
|
ref,
|
|
@@ -763,7 +763,7 @@ var DropdownMenuRadioItem = React33__namespace.forwardRef(({ className, children
|
|
|
763
763
|
}
|
|
764
764
|
));
|
|
765
765
|
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive__namespace.RadioItem.displayName;
|
|
766
|
-
var DropdownMenuLabel =
|
|
766
|
+
var DropdownMenuLabel = React34__namespace.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
767
767
|
DropdownMenuPrimitive__namespace.Label,
|
|
768
768
|
{
|
|
769
769
|
ref,
|
|
@@ -776,7 +776,7 @@ var DropdownMenuLabel = React33__namespace.forwardRef(({ className, inset, ...pr
|
|
|
776
776
|
}
|
|
777
777
|
));
|
|
778
778
|
DropdownMenuLabel.displayName = DropdownMenuPrimitive__namespace.Label.displayName;
|
|
779
|
-
var DropdownMenuSeparator =
|
|
779
|
+
var DropdownMenuSeparator = React34__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
780
780
|
DropdownMenuPrimitive__namespace.Separator,
|
|
781
781
|
{
|
|
782
782
|
ref,
|
|
@@ -801,7 +801,7 @@ DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
|
801
801
|
var AlertDialog = AlertDialogPrimitive__namespace.Root;
|
|
802
802
|
var AlertDialogTrigger = AlertDialogPrimitive__namespace.Trigger;
|
|
803
803
|
var AlertDialogPortal = AlertDialogPrimitive__namespace.Portal;
|
|
804
|
-
var AlertDialogOverlay =
|
|
804
|
+
var AlertDialogOverlay = React34__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
805
805
|
AlertDialogPrimitive__namespace.Overlay,
|
|
806
806
|
{
|
|
807
807
|
className: cn(
|
|
@@ -815,7 +815,7 @@ var AlertDialogOverlay = React33__namespace.forwardRef(({ className, ...props },
|
|
|
815
815
|
}
|
|
816
816
|
));
|
|
817
817
|
AlertDialogOverlay.displayName = AlertDialogPrimitive__namespace.Overlay.displayName;
|
|
818
|
-
var AlertDialogContent =
|
|
818
|
+
var AlertDialogContent = React34__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(AlertDialogPortal, { children: [
|
|
819
819
|
/* @__PURE__ */ jsxRuntime.jsx(AlertDialogOverlay, {}),
|
|
820
820
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
821
821
|
AlertDialogPrimitive__namespace.Content,
|
|
@@ -858,7 +858,7 @@ var AlertDialogFooter = ({ className, ...props }) => /* @__PURE__ */ jsxRuntime.
|
|
|
858
858
|
}
|
|
859
859
|
);
|
|
860
860
|
AlertDialogFooter.displayName = "AlertDialogFooter";
|
|
861
|
-
var AlertDialogTitle =
|
|
861
|
+
var AlertDialogTitle = React34__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
862
862
|
AlertDialogPrimitive__namespace.Title,
|
|
863
863
|
{
|
|
864
864
|
ref,
|
|
@@ -867,7 +867,7 @@ var AlertDialogTitle = React33__namespace.forwardRef(({ className, ...props }, r
|
|
|
867
867
|
}
|
|
868
868
|
));
|
|
869
869
|
AlertDialogTitle.displayName = AlertDialogPrimitive__namespace.Title.displayName;
|
|
870
|
-
var AlertDialogDescription =
|
|
870
|
+
var AlertDialogDescription = React34__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
871
871
|
AlertDialogPrimitive__namespace.Description,
|
|
872
872
|
{
|
|
873
873
|
ref,
|
|
@@ -876,7 +876,7 @@ var AlertDialogDescription = React33__namespace.forwardRef(({ className, ...prop
|
|
|
876
876
|
}
|
|
877
877
|
));
|
|
878
878
|
AlertDialogDescription.displayName = AlertDialogPrimitive__namespace.Description.displayName;
|
|
879
|
-
var AlertDialogAction =
|
|
879
|
+
var AlertDialogAction = React34__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
880
880
|
AlertDialogPrimitive__namespace.Action,
|
|
881
881
|
{
|
|
882
882
|
ref,
|
|
@@ -885,7 +885,7 @@ var AlertDialogAction = React33__namespace.forwardRef(({ className, ...props },
|
|
|
885
885
|
}
|
|
886
886
|
));
|
|
887
887
|
AlertDialogAction.displayName = AlertDialogPrimitive__namespace.Action.displayName;
|
|
888
|
-
var AlertDialogCancel =
|
|
888
|
+
var AlertDialogCancel = React34__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
889
889
|
AlertDialogPrimitive__namespace.Cancel,
|
|
890
890
|
{
|
|
891
891
|
ref,
|
|
@@ -948,7 +948,7 @@ var cardVariants = classVarianceAuthority.cva(
|
|
|
948
948
|
}
|
|
949
949
|
}
|
|
950
950
|
);
|
|
951
|
-
var Card =
|
|
951
|
+
var Card = React34__namespace.forwardRef(
|
|
952
952
|
({
|
|
953
953
|
className,
|
|
954
954
|
size,
|
|
@@ -962,7 +962,7 @@ var Card = React33__namespace.forwardRef(
|
|
|
962
962
|
...props
|
|
963
963
|
}, ref) => {
|
|
964
964
|
const isInteractive = interactive || asButton || !!onClick;
|
|
965
|
-
const handleKeyDown =
|
|
965
|
+
const handleKeyDown = React34__namespace.useCallback(
|
|
966
966
|
(e) => {
|
|
967
967
|
if (isInteractive && (e.key === "Enter" || e.key === " ")) {
|
|
968
968
|
e.preventDefault();
|
|
@@ -994,7 +994,7 @@ var Card = React33__namespace.forwardRef(
|
|
|
994
994
|
}
|
|
995
995
|
);
|
|
996
996
|
Card.displayName = "Card";
|
|
997
|
-
var CardHeader =
|
|
997
|
+
var CardHeader = React34__namespace.forwardRef(
|
|
998
998
|
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
999
999
|
"div",
|
|
1000
1000
|
{
|
|
@@ -1005,7 +1005,7 @@ var CardHeader = React33__namespace.forwardRef(
|
|
|
1005
1005
|
)
|
|
1006
1006
|
);
|
|
1007
1007
|
CardHeader.displayName = "CardHeader";
|
|
1008
|
-
var CardTitle =
|
|
1008
|
+
var CardTitle = React34__namespace.forwardRef(
|
|
1009
1009
|
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1010
1010
|
"div",
|
|
1011
1011
|
{
|
|
@@ -1016,7 +1016,7 @@ var CardTitle = React33__namespace.forwardRef(
|
|
|
1016
1016
|
)
|
|
1017
1017
|
);
|
|
1018
1018
|
CardTitle.displayName = "CardTitle";
|
|
1019
|
-
var CardDescription =
|
|
1019
|
+
var CardDescription = React34__namespace.forwardRef(
|
|
1020
1020
|
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1021
1021
|
"div",
|
|
1022
1022
|
{
|
|
@@ -1027,11 +1027,11 @@ var CardDescription = React33__namespace.forwardRef(
|
|
|
1027
1027
|
)
|
|
1028
1028
|
);
|
|
1029
1029
|
CardDescription.displayName = "CardDescription";
|
|
1030
|
-
var CardContent =
|
|
1030
|
+
var CardContent = React34__namespace.forwardRef(
|
|
1031
1031
|
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("p-6 pt-0", className), ...props })
|
|
1032
1032
|
);
|
|
1033
1033
|
CardContent.displayName = "CardContent";
|
|
1034
|
-
var CardFooter =
|
|
1034
|
+
var CardFooter = React34__namespace.forwardRef(
|
|
1035
1035
|
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1036
1036
|
"div",
|
|
1037
1037
|
{
|
|
@@ -1068,17 +1068,17 @@ var cardImageVariants = classVarianceAuthority.cva("w-full object-cover", {
|
|
|
1068
1068
|
position: "top"
|
|
1069
1069
|
}
|
|
1070
1070
|
});
|
|
1071
|
-
var CardImage =
|
|
1071
|
+
var CardImage = React34__namespace.forwardRef(
|
|
1072
1072
|
({ className, aspectRatio, position, fallback, alt, src, onError, ...props }, ref) => {
|
|
1073
|
-
const [hasError, setHasError] =
|
|
1074
|
-
const handleError =
|
|
1073
|
+
const [hasError, setHasError] = React34__namespace.useState(false);
|
|
1074
|
+
const handleError = React34__namespace.useCallback(
|
|
1075
1075
|
(e) => {
|
|
1076
1076
|
setHasError(true);
|
|
1077
1077
|
onError?.(e);
|
|
1078
1078
|
},
|
|
1079
1079
|
[onError]
|
|
1080
1080
|
);
|
|
1081
|
-
|
|
1081
|
+
React34__namespace.useEffect(() => {
|
|
1082
1082
|
setHasError(false);
|
|
1083
1083
|
}, [src]);
|
|
1084
1084
|
if (hasError && fallback) {
|
|
@@ -1149,7 +1149,7 @@ var cardActionsVariants = classVarianceAuthority.cva(
|
|
|
1149
1149
|
}
|
|
1150
1150
|
}
|
|
1151
1151
|
);
|
|
1152
|
-
var CardActions =
|
|
1152
|
+
var CardActions = React34__namespace.forwardRef(
|
|
1153
1153
|
({ className, showOn, position, variant, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1154
1154
|
"div",
|
|
1155
1155
|
{
|
|
@@ -1161,7 +1161,7 @@ var CardActions = React33__namespace.forwardRef(
|
|
|
1161
1161
|
)
|
|
1162
1162
|
);
|
|
1163
1163
|
CardActions.displayName = "CardActions";
|
|
1164
|
-
var SelectableCard =
|
|
1164
|
+
var SelectableCard = React34__namespace.forwardRef(
|
|
1165
1165
|
({
|
|
1166
1166
|
className,
|
|
1167
1167
|
selected: controlledSelected,
|
|
@@ -1175,10 +1175,10 @@ var SelectableCard = React33__namespace.forwardRef(
|
|
|
1175
1175
|
hover = "border",
|
|
1176
1176
|
...props
|
|
1177
1177
|
}, ref) => {
|
|
1178
|
-
const [uncontrolledSelected, setUncontrolledSelected] =
|
|
1178
|
+
const [uncontrolledSelected, setUncontrolledSelected] = React34__namespace.useState(defaultSelected);
|
|
1179
1179
|
const isControlled = controlledSelected !== void 0;
|
|
1180
1180
|
const isSelected = isControlled ? controlledSelected : uncontrolledSelected;
|
|
1181
|
-
const handleClick =
|
|
1181
|
+
const handleClick = React34__namespace.useCallback(
|
|
1182
1182
|
(e) => {
|
|
1183
1183
|
if (disabled) return;
|
|
1184
1184
|
const newSelected = !isSelected;
|
|
@@ -1190,7 +1190,7 @@ var SelectableCard = React33__namespace.forwardRef(
|
|
|
1190
1190
|
},
|
|
1191
1191
|
[disabled, isSelected, isControlled, onSelectedChange, onClick]
|
|
1192
1192
|
);
|
|
1193
|
-
const handleCheckboxChange =
|
|
1193
|
+
const handleCheckboxChange = React34__namespace.useCallback(
|
|
1194
1194
|
(checked) => {
|
|
1195
1195
|
if (disabled) return;
|
|
1196
1196
|
const newSelected = checked === true;
|
|
@@ -1290,7 +1290,7 @@ var cardGridVariants = classVarianceAuthority.cva("grid", {
|
|
|
1290
1290
|
gap: "md"
|
|
1291
1291
|
}
|
|
1292
1292
|
});
|
|
1293
|
-
var CardGrid =
|
|
1293
|
+
var CardGrid = React34__namespace.forwardRef(
|
|
1294
1294
|
({ className, columns, gap, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1295
1295
|
"div",
|
|
1296
1296
|
{
|
|
@@ -1325,7 +1325,7 @@ var cardListVariants = classVarianceAuthority.cva("flex flex-col", {
|
|
|
1325
1325
|
divided: false
|
|
1326
1326
|
}
|
|
1327
1327
|
});
|
|
1328
|
-
var CardList =
|
|
1328
|
+
var CardList = React34__namespace.forwardRef(
|
|
1329
1329
|
({ className, gap, divided, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1330
1330
|
"div",
|
|
1331
1331
|
{
|
|
@@ -1336,7 +1336,128 @@ var CardList = React33__namespace.forwardRef(
|
|
|
1336
1336
|
)
|
|
1337
1337
|
);
|
|
1338
1338
|
CardList.displayName = "CardList";
|
|
1339
|
-
var
|
|
1339
|
+
var boardVariants = classVarianceAuthority.cva("text-card-foreground", {
|
|
1340
|
+
variants: {
|
|
1341
|
+
/**
|
|
1342
|
+
* Elevation (shadow depth) - similar to MUI Paper
|
|
1343
|
+
*/
|
|
1344
|
+
elevation: {
|
|
1345
|
+
none: "",
|
|
1346
|
+
sm: "shadow-sm",
|
|
1347
|
+
md: "shadow",
|
|
1348
|
+
lg: "shadow-lg",
|
|
1349
|
+
xl: "shadow-xl"
|
|
1350
|
+
},
|
|
1351
|
+
/**
|
|
1352
|
+
* Border style
|
|
1353
|
+
*/
|
|
1354
|
+
border: {
|
|
1355
|
+
none: "",
|
|
1356
|
+
default: "border",
|
|
1357
|
+
muted: "border border-muted"
|
|
1358
|
+
},
|
|
1359
|
+
/**
|
|
1360
|
+
* Padding size
|
|
1361
|
+
*/
|
|
1362
|
+
padding: {
|
|
1363
|
+
none: "",
|
|
1364
|
+
sm: "p-2",
|
|
1365
|
+
md: "p-4",
|
|
1366
|
+
lg: "p-6",
|
|
1367
|
+
xl: "p-8"
|
|
1368
|
+
},
|
|
1369
|
+
/**
|
|
1370
|
+
* Border radius
|
|
1371
|
+
*/
|
|
1372
|
+
radius: {
|
|
1373
|
+
none: "rounded-none",
|
|
1374
|
+
sm: "rounded-sm",
|
|
1375
|
+
md: "rounded-md",
|
|
1376
|
+
lg: "rounded-lg",
|
|
1377
|
+
xl: "rounded-xl",
|
|
1378
|
+
full: "rounded-full"
|
|
1379
|
+
},
|
|
1380
|
+
/**
|
|
1381
|
+
* Background color
|
|
1382
|
+
*/
|
|
1383
|
+
background: {
|
|
1384
|
+
default: "bg-card",
|
|
1385
|
+
muted: "bg-muted",
|
|
1386
|
+
transparent: "bg-transparent"
|
|
1387
|
+
},
|
|
1388
|
+
/**
|
|
1389
|
+
* Hover effect styles
|
|
1390
|
+
*/
|
|
1391
|
+
hover: {
|
|
1392
|
+
none: "",
|
|
1393
|
+
border: "transition-colors duration-200 hover:border-accent",
|
|
1394
|
+
elevate: "transition-shadow duration-200 hover:shadow-lg",
|
|
1395
|
+
"border-success": "transition-colors duration-200 hover:border-success",
|
|
1396
|
+
"border-warning": "transition-colors duration-200 hover:border-warning",
|
|
1397
|
+
"border-destructive": "transition-colors duration-200 hover:border-destructive"
|
|
1398
|
+
}
|
|
1399
|
+
},
|
|
1400
|
+
defaultVariants: {
|
|
1401
|
+
elevation: "none",
|
|
1402
|
+
border: "default",
|
|
1403
|
+
padding: "none",
|
|
1404
|
+
radius: "lg",
|
|
1405
|
+
background: "default",
|
|
1406
|
+
hover: "none"
|
|
1407
|
+
}
|
|
1408
|
+
});
|
|
1409
|
+
var Board = React34__namespace.forwardRef(
|
|
1410
|
+
({
|
|
1411
|
+
className,
|
|
1412
|
+
elevation,
|
|
1413
|
+
border,
|
|
1414
|
+
padding,
|
|
1415
|
+
radius,
|
|
1416
|
+
background,
|
|
1417
|
+
hover,
|
|
1418
|
+
hoverBorderClass,
|
|
1419
|
+
...props
|
|
1420
|
+
}, ref) => {
|
|
1421
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1422
|
+
"div",
|
|
1423
|
+
{
|
|
1424
|
+
ref,
|
|
1425
|
+
className: cn(
|
|
1426
|
+
boardVariants({
|
|
1427
|
+
elevation,
|
|
1428
|
+
border,
|
|
1429
|
+
padding,
|
|
1430
|
+
radius,
|
|
1431
|
+
background,
|
|
1432
|
+
hover
|
|
1433
|
+
}),
|
|
1434
|
+
// Custom hover border color overrides variant if provided
|
|
1435
|
+
hoverBorderClass && "transition-colors duration-200",
|
|
1436
|
+
hoverBorderClass,
|
|
1437
|
+
className
|
|
1438
|
+
),
|
|
1439
|
+
...props
|
|
1440
|
+
}
|
|
1441
|
+
);
|
|
1442
|
+
}
|
|
1443
|
+
);
|
|
1444
|
+
Board.displayName = "Board";
|
|
1445
|
+
var BoardHeader = React34__namespace.forwardRef(
|
|
1446
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1447
|
+
"div",
|
|
1448
|
+
{
|
|
1449
|
+
ref,
|
|
1450
|
+
className: cn("flex items-center p-4 border-b", className),
|
|
1451
|
+
...props
|
|
1452
|
+
}
|
|
1453
|
+
)
|
|
1454
|
+
);
|
|
1455
|
+
BoardHeader.displayName = "BoardHeader";
|
|
1456
|
+
var BoardContent = React34__namespace.forwardRef(
|
|
1457
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("p-4", className), ...props })
|
|
1458
|
+
);
|
|
1459
|
+
BoardContent.displayName = "BoardContent";
|
|
1460
|
+
var Table = React34__namespace.forwardRef(
|
|
1340
1461
|
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative w-full overflow-auto", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1341
1462
|
"table",
|
|
1342
1463
|
{
|
|
@@ -1347,11 +1468,11 @@ var Table = React33__namespace.forwardRef(
|
|
|
1347
1468
|
) })
|
|
1348
1469
|
);
|
|
1349
1470
|
Table.displayName = "Table";
|
|
1350
|
-
var TableHeader =
|
|
1471
|
+
var TableHeader = React34__namespace.forwardRef(
|
|
1351
1472
|
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("thead", { ref, className: cn("[&_tr]:border-b", className), ...props })
|
|
1352
1473
|
);
|
|
1353
1474
|
TableHeader.displayName = "TableHeader";
|
|
1354
|
-
var TableBody =
|
|
1475
|
+
var TableBody = React34__namespace.forwardRef(
|
|
1355
1476
|
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1356
1477
|
"tbody",
|
|
1357
1478
|
{
|
|
@@ -1362,7 +1483,7 @@ var TableBody = React33__namespace.forwardRef(
|
|
|
1362
1483
|
)
|
|
1363
1484
|
);
|
|
1364
1485
|
TableBody.displayName = "TableBody";
|
|
1365
|
-
var TableFooter =
|
|
1486
|
+
var TableFooter = React34__namespace.forwardRef(
|
|
1366
1487
|
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1367
1488
|
"tfoot",
|
|
1368
1489
|
{
|
|
@@ -1376,7 +1497,7 @@ var TableFooter = React33__namespace.forwardRef(
|
|
|
1376
1497
|
)
|
|
1377
1498
|
);
|
|
1378
1499
|
TableFooter.displayName = "TableFooter";
|
|
1379
|
-
var TableRow =
|
|
1500
|
+
var TableRow = React34__namespace.forwardRef(
|
|
1380
1501
|
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1381
1502
|
"tr",
|
|
1382
1503
|
{
|
|
@@ -1390,7 +1511,7 @@ var TableRow = React33__namespace.forwardRef(
|
|
|
1390
1511
|
)
|
|
1391
1512
|
);
|
|
1392
1513
|
TableRow.displayName = "TableRow";
|
|
1393
|
-
var TableHead =
|
|
1514
|
+
var TableHead = React34__namespace.forwardRef(
|
|
1394
1515
|
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1395
1516
|
"th",
|
|
1396
1517
|
{
|
|
@@ -1404,7 +1525,7 @@ var TableHead = React33__namespace.forwardRef(
|
|
|
1404
1525
|
)
|
|
1405
1526
|
);
|
|
1406
1527
|
TableHead.displayName = "TableHead";
|
|
1407
|
-
var TableCell =
|
|
1528
|
+
var TableCell = React34__namespace.forwardRef(
|
|
1408
1529
|
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1409
1530
|
"td",
|
|
1410
1531
|
{
|
|
@@ -1418,7 +1539,7 @@ var TableCell = React33__namespace.forwardRef(
|
|
|
1418
1539
|
)
|
|
1419
1540
|
);
|
|
1420
1541
|
TableCell.displayName = "TableCell";
|
|
1421
|
-
var TableCaption =
|
|
1542
|
+
var TableCaption = React34__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1422
1543
|
"caption",
|
|
1423
1544
|
{
|
|
1424
1545
|
ref,
|
|
@@ -1437,7 +1558,7 @@ function Modal({
|
|
|
1437
1558
|
zIndex = 50,
|
|
1438
1559
|
className
|
|
1439
1560
|
}) {
|
|
1440
|
-
|
|
1561
|
+
React34__namespace.useEffect(() => {
|
|
1441
1562
|
if (!isOpen) return;
|
|
1442
1563
|
const handleEscape = (e) => {
|
|
1443
1564
|
if (e.key === "Escape") {
|
|
@@ -1447,7 +1568,7 @@ function Modal({
|
|
|
1447
1568
|
window.addEventListener("keydown", handleEscape);
|
|
1448
1569
|
return () => window.removeEventListener("keydown", handleEscape);
|
|
1449
1570
|
}, [isOpen, onClose]);
|
|
1450
|
-
|
|
1571
|
+
React34__namespace.useEffect(() => {
|
|
1451
1572
|
if (isOpen) {
|
|
1452
1573
|
document.body.style.overflow = "hidden";
|
|
1453
1574
|
} else {
|
|
@@ -1562,12 +1683,12 @@ function ConfirmationModal({
|
|
|
1562
1683
|
] }) });
|
|
1563
1684
|
}
|
|
1564
1685
|
function useConfirmation() {
|
|
1565
|
-
const [state, setState] =
|
|
1686
|
+
const [state, setState] = React34__namespace.useState({
|
|
1566
1687
|
open: false,
|
|
1567
1688
|
title: "",
|
|
1568
1689
|
description: ""
|
|
1569
1690
|
});
|
|
1570
|
-
const confirm =
|
|
1691
|
+
const confirm = React34__namespace.useCallback(
|
|
1571
1692
|
(options) => {
|
|
1572
1693
|
return new Promise((resolve) => {
|
|
1573
1694
|
setState({
|
|
@@ -1579,15 +1700,15 @@ function useConfirmation() {
|
|
|
1579
1700
|
},
|
|
1580
1701
|
[]
|
|
1581
1702
|
);
|
|
1582
|
-
const handleConfirm =
|
|
1703
|
+
const handleConfirm = React34__namespace.useCallback(() => {
|
|
1583
1704
|
state.resolve?.(true);
|
|
1584
1705
|
setState((prev) => ({ ...prev, open: false }));
|
|
1585
1706
|
}, [state.resolve]);
|
|
1586
|
-
const handleCancel =
|
|
1707
|
+
const handleCancel = React34__namespace.useCallback(() => {
|
|
1587
1708
|
state.resolve?.(false);
|
|
1588
1709
|
setState((prev) => ({ ...prev, open: false }));
|
|
1589
1710
|
}, [state.resolve]);
|
|
1590
|
-
const handleOpenChange =
|
|
1711
|
+
const handleOpenChange = React34__namespace.useCallback(
|
|
1591
1712
|
(open) => {
|
|
1592
1713
|
if (!open) {
|
|
1593
1714
|
state.resolve?.(false);
|
|
@@ -1623,11 +1744,11 @@ function ResizeHandle({
|
|
|
1623
1744
|
ariaLabel,
|
|
1624
1745
|
className
|
|
1625
1746
|
}) {
|
|
1626
|
-
const [isDragging, setIsDragging] =
|
|
1627
|
-
const [isFocused, setIsFocused] =
|
|
1628
|
-
const startXRef =
|
|
1629
|
-
const handleRef =
|
|
1630
|
-
const handleMouseDown =
|
|
1747
|
+
const [isDragging, setIsDragging] = React34__namespace.useState(false);
|
|
1748
|
+
const [isFocused, setIsFocused] = React34__namespace.useState(false);
|
|
1749
|
+
const startXRef = React34__namespace.useRef(0);
|
|
1750
|
+
const handleRef = React34__namespace.useRef(null);
|
|
1751
|
+
const handleMouseDown = React34__namespace.useCallback(
|
|
1631
1752
|
(e) => {
|
|
1632
1753
|
if (!resizable) return;
|
|
1633
1754
|
e.preventDefault();
|
|
@@ -1638,7 +1759,7 @@ function ResizeHandle({
|
|
|
1638
1759
|
},
|
|
1639
1760
|
[resizable, onDragStart]
|
|
1640
1761
|
);
|
|
1641
|
-
const handleMouseMove =
|
|
1762
|
+
const handleMouseMove = React34__namespace.useCallback(
|
|
1642
1763
|
(e) => {
|
|
1643
1764
|
if (!isDragging) return;
|
|
1644
1765
|
const deltaX = e.clientX - startXRef.current;
|
|
@@ -1647,13 +1768,13 @@ function ResizeHandle({
|
|
|
1647
1768
|
},
|
|
1648
1769
|
[isDragging, onDrag]
|
|
1649
1770
|
);
|
|
1650
|
-
const handleMouseUp =
|
|
1771
|
+
const handleMouseUp = React34__namespace.useCallback(() => {
|
|
1651
1772
|
if (!isDragging) return;
|
|
1652
1773
|
setIsDragging(false);
|
|
1653
1774
|
document.body.style.userSelect = "";
|
|
1654
1775
|
onDragEnd?.();
|
|
1655
1776
|
}, [isDragging, onDragEnd]);
|
|
1656
|
-
const handleKeyDown =
|
|
1777
|
+
const handleKeyDown = React34__namespace.useCallback(
|
|
1657
1778
|
(e) => {
|
|
1658
1779
|
if (!resizable || !onKeyboardResize) return;
|
|
1659
1780
|
let direction = null;
|
|
@@ -1672,7 +1793,7 @@ function ResizeHandle({
|
|
|
1672
1793
|
},
|
|
1673
1794
|
[resizable, onKeyboardResize, orientation]
|
|
1674
1795
|
);
|
|
1675
|
-
|
|
1796
|
+
React34__namespace.useEffect(() => {
|
|
1676
1797
|
if (isDragging) {
|
|
1677
1798
|
window.addEventListener("mousemove", handleMouseMove);
|
|
1678
1799
|
window.addEventListener("mouseup", handleMouseUp);
|
|
@@ -1742,12 +1863,12 @@ function ResizablePanel({
|
|
|
1742
1863
|
className,
|
|
1743
1864
|
dataAttributes = {}
|
|
1744
1865
|
}) {
|
|
1745
|
-
const panelRef =
|
|
1746
|
-
const [isDragging, setIsDragging] =
|
|
1747
|
-
const [localWidth, setLocalWidth] =
|
|
1748
|
-
const [localOuterWidth, setLocalOuterWidth] =
|
|
1866
|
+
const panelRef = React34__namespace.useRef(null);
|
|
1867
|
+
const [isDragging, setIsDragging] = React34__namespace.useState(false);
|
|
1868
|
+
const [localWidth, setLocalWidth] = React34__namespace.useState(null);
|
|
1869
|
+
const [localOuterWidth, setLocalOuterWidth] = React34__namespace.useState(null);
|
|
1749
1870
|
const currentWidthVW = isExpanded ? (isDragging && localWidth !== null ? localWidth : expandedWidthVW) || collapsedSizeVW : collapsedSizeVW;
|
|
1750
|
-
const clampWidth =
|
|
1871
|
+
const clampWidth = React34__namespace.useCallback(
|
|
1751
1872
|
(width) => {
|
|
1752
1873
|
let effectiveMinWidth = minWidthVW;
|
|
1753
1874
|
let effectiveMaxWidth = maxWidthVW;
|
|
@@ -1760,11 +1881,11 @@ function ResizablePanel({
|
|
|
1760
1881
|
},
|
|
1761
1882
|
[minWidthVW, maxWidthVW, orientation, leftWidthVW, isOverlay]
|
|
1762
1883
|
);
|
|
1763
|
-
const handleDragStart =
|
|
1884
|
+
const handleDragStart = React34__namespace.useCallback(() => {
|
|
1764
1885
|
setIsDragging(true);
|
|
1765
1886
|
setLocalWidth(currentWidthVW);
|
|
1766
1887
|
}, [currentWidthVW]);
|
|
1767
|
-
const handleDrag =
|
|
1888
|
+
const handleDrag = React34__namespace.useCallback(
|
|
1768
1889
|
(deltaX) => {
|
|
1769
1890
|
if (!isExpanded || isOverlay) return;
|
|
1770
1891
|
const viewportWidth = window.innerWidth;
|
|
@@ -1783,14 +1904,14 @@ function ResizablePanel({
|
|
|
1783
1904
|
clampWidth
|
|
1784
1905
|
]
|
|
1785
1906
|
);
|
|
1786
|
-
const handleDragEnd =
|
|
1907
|
+
const handleDragEnd = React34__namespace.useCallback(() => {
|
|
1787
1908
|
if (localWidth !== null && onResize) {
|
|
1788
1909
|
onResize(localWidth);
|
|
1789
1910
|
}
|
|
1790
1911
|
setIsDragging(false);
|
|
1791
1912
|
setLocalWidth(null);
|
|
1792
1913
|
}, [localWidth, onResize]);
|
|
1793
|
-
const handleKeyboardResize =
|
|
1914
|
+
const handleKeyboardResize = React34__namespace.useCallback(
|
|
1794
1915
|
(direction) => {
|
|
1795
1916
|
if (!isExpanded || isOverlay || !onResize) return;
|
|
1796
1917
|
const step = 1;
|
|
@@ -1799,13 +1920,13 @@ function ResizablePanel({
|
|
|
1799
1920
|
},
|
|
1800
1921
|
[isExpanded, isOverlay, onResize, currentWidthVW, clampWidth]
|
|
1801
1922
|
);
|
|
1802
|
-
const handleOverlayDragStart =
|
|
1923
|
+
const handleOverlayDragStart = React34__namespace.useCallback(() => {
|
|
1803
1924
|
if (outerWidthVW) {
|
|
1804
1925
|
setIsDragging(true);
|
|
1805
1926
|
setLocalOuterWidth(outerWidthVW);
|
|
1806
1927
|
}
|
|
1807
1928
|
}, [outerWidthVW]);
|
|
1808
|
-
const handleOverlayDrag =
|
|
1929
|
+
const handleOverlayDrag = React34__namespace.useCallback(
|
|
1809
1930
|
(deltaX) => {
|
|
1810
1931
|
if (!isOverlay) return;
|
|
1811
1932
|
const viewportWidth = window.innerWidth;
|
|
@@ -1816,14 +1937,14 @@ function ResizablePanel({
|
|
|
1816
1937
|
},
|
|
1817
1938
|
[isOverlay, localOuterWidth, outerWidthVW]
|
|
1818
1939
|
);
|
|
1819
|
-
const handleOverlayDragEnd =
|
|
1940
|
+
const handleOverlayDragEnd = React34__namespace.useCallback(() => {
|
|
1820
1941
|
if (localOuterWidth !== null && onResizeOverlay) {
|
|
1821
1942
|
onResizeOverlay(localOuterWidth);
|
|
1822
1943
|
}
|
|
1823
1944
|
setIsDragging(false);
|
|
1824
1945
|
setLocalOuterWidth(null);
|
|
1825
1946
|
}, [localOuterWidth, onResizeOverlay]);
|
|
1826
|
-
|
|
1947
|
+
React34__namespace.useEffect(() => {
|
|
1827
1948
|
if (isOverlay && panelRef.current) {
|
|
1828
1949
|
const focusableElement = panelRef.current.querySelector(
|
|
1829
1950
|
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
@@ -1831,7 +1952,7 @@ function ResizablePanel({
|
|
|
1831
1952
|
focusableElement?.focus();
|
|
1832
1953
|
}
|
|
1833
1954
|
}, [isOverlay]);
|
|
1834
|
-
|
|
1955
|
+
React34__namespace.useEffect(() => {
|
|
1835
1956
|
if (!isOverlay) return;
|
|
1836
1957
|
const handleEscape = (e) => {
|
|
1837
1958
|
if (e.key === "Escape") {
|
|
@@ -2047,10 +2168,10 @@ var loadingSpinnerVariants = classVarianceAuthority.cva("rounded-full animate-sp
|
|
|
2047
2168
|
variant: "default"
|
|
2048
2169
|
}
|
|
2049
2170
|
});
|
|
2050
|
-
var LoadingSpinner =
|
|
2171
|
+
var LoadingSpinner = React34__namespace.forwardRef(
|
|
2051
2172
|
({ className, size, variant, label, showDots = false, ...props }, ref) => {
|
|
2052
|
-
const [dots, setDots] =
|
|
2053
|
-
|
|
2173
|
+
const [dots, setDots] = React34__namespace.useState("");
|
|
2174
|
+
React34__namespace.useEffect(() => {
|
|
2054
2175
|
if (!showDots || !label) return;
|
|
2055
2176
|
const interval = setInterval(() => {
|
|
2056
2177
|
setDots((prev) => prev.length >= 3 ? "" : prev + ".");
|
|
@@ -2147,12 +2268,12 @@ function Calendar({
|
|
|
2147
2268
|
const endMonth = props.endMonth ?? props.toDate;
|
|
2148
2269
|
const fromYear = startMonth?.getFullYear();
|
|
2149
2270
|
const toYear = endMonth?.getFullYear();
|
|
2150
|
-
const years =
|
|
2151
|
-
const [internalMonth, setInternalMonth] =
|
|
2271
|
+
const years = React34__namespace.useMemo(() => getYearRange(fromYear, toYear), [fromYear, toYear]);
|
|
2272
|
+
const [internalMonth, setInternalMonth] = React34__namespace.useState(
|
|
2152
2273
|
defaultMonth ?? /* @__PURE__ */ new Date()
|
|
2153
2274
|
);
|
|
2154
2275
|
const displayedMonth = controlledMonth ?? internalMonth;
|
|
2155
|
-
const handleMonthChange =
|
|
2276
|
+
const handleMonthChange = React34__namespace.useCallback(
|
|
2156
2277
|
(newMonth) => {
|
|
2157
2278
|
if (controlledMonth === void 0) {
|
|
2158
2279
|
setInternalMonth(newMonth);
|
|
@@ -2283,8 +2404,8 @@ function DatePicker({
|
|
|
2283
2404
|
matchTriggerWidth = false,
|
|
2284
2405
|
onOpenChange
|
|
2285
2406
|
}) {
|
|
2286
|
-
const [open, setOpen] =
|
|
2287
|
-
const [internalValue, setInternalValue] =
|
|
2407
|
+
const [open, setOpen] = React34__namespace.useState(false);
|
|
2408
|
+
const [internalValue, setInternalValue] = React34__namespace.useState(
|
|
2288
2409
|
defaultValue
|
|
2289
2410
|
);
|
|
2290
2411
|
const isControlled = value !== void 0;
|
|
@@ -2386,15 +2507,15 @@ function DatePickerInput({
|
|
|
2386
2507
|
onOpenChange,
|
|
2387
2508
|
size = "default"
|
|
2388
2509
|
}) {
|
|
2389
|
-
const [open, setOpen] =
|
|
2390
|
-
const [internalValue, setInternalValue] =
|
|
2510
|
+
const [open, setOpen] = React34__namespace.useState(false);
|
|
2511
|
+
const [internalValue, setInternalValue] = React34__namespace.useState(
|
|
2391
2512
|
defaultValue
|
|
2392
2513
|
);
|
|
2393
|
-
const [inputValue, setInputValue] =
|
|
2394
|
-
const inputRef =
|
|
2514
|
+
const [inputValue, setInputValue] = React34__namespace.useState("");
|
|
2515
|
+
const inputRef = React34__namespace.useRef(null);
|
|
2395
2516
|
const isControlled = value !== void 0;
|
|
2396
2517
|
const selectedDate = isControlled ? value : internalValue;
|
|
2397
|
-
|
|
2518
|
+
React34__namespace.useEffect(() => {
|
|
2398
2519
|
if (selectedDate) {
|
|
2399
2520
|
setInputValue(dateFns.format(selectedDate, dateFormat));
|
|
2400
2521
|
} else {
|
|
@@ -2555,11 +2676,11 @@ function FilterPopover({
|
|
|
2555
2676
|
onFilterChange
|
|
2556
2677
|
}) {
|
|
2557
2678
|
const filterType = column.filterType || "text";
|
|
2558
|
-
const [operator, setOperator] =
|
|
2679
|
+
const [operator, setOperator] = React34__namespace.useState(
|
|
2559
2680
|
filter?.operator || getDefaultOperator(filterType)
|
|
2560
2681
|
);
|
|
2561
|
-
const [value, setValue] =
|
|
2562
|
-
const [valueTo, setValueTo] =
|
|
2682
|
+
const [value, setValue] = React34__namespace.useState(filter?.value ?? "");
|
|
2683
|
+
const [valueTo, setValueTo] = React34__namespace.useState(filter?.valueTo ?? "");
|
|
2563
2684
|
function getDefaultOperator(type) {
|
|
2564
2685
|
switch (type) {
|
|
2565
2686
|
case "text":
|
|
@@ -2702,7 +2823,7 @@ function FilterPopover({
|
|
|
2702
2823
|
] })
|
|
2703
2824
|
] });
|
|
2704
2825
|
const renderDateFilter = () => {
|
|
2705
|
-
const dateValue =
|
|
2826
|
+
const dateValue = React34__namespace.useMemo(() => {
|
|
2706
2827
|
if (!value) return void 0;
|
|
2707
2828
|
if (value instanceof Date) return value;
|
|
2708
2829
|
if (typeof value === "string") {
|
|
@@ -2711,7 +2832,7 @@ function FilterPopover({
|
|
|
2711
2832
|
}
|
|
2712
2833
|
return void 0;
|
|
2713
2834
|
}, [value]);
|
|
2714
|
-
const dateToValue =
|
|
2835
|
+
const dateToValue = React34__namespace.useMemo(() => {
|
|
2715
2836
|
if (!valueTo) return void 0;
|
|
2716
2837
|
if (valueTo instanceof Date) return valueTo;
|
|
2717
2838
|
if (typeof valueTo === "string") {
|
|
@@ -2846,7 +2967,7 @@ function HeaderCell({
|
|
|
2846
2967
|
onResizeDoubleClick,
|
|
2847
2968
|
isResizing
|
|
2848
2969
|
}) {
|
|
2849
|
-
const [filterOpen, setFilterOpen] =
|
|
2970
|
+
const [filterOpen, setFilterOpen] = React34__namespace.useState(false);
|
|
2850
2971
|
const isSorted = sorting?.field === column.key;
|
|
2851
2972
|
const isFiltered = !!filter;
|
|
2852
2973
|
const isSortable = column.sortable && onSort;
|
|
@@ -3004,15 +3125,15 @@ function CellEditor({
|
|
|
3004
3125
|
className
|
|
3005
3126
|
}) {
|
|
3006
3127
|
const editorType = column.editorType || "text";
|
|
3007
|
-
const [internalValue, setInternalValue] =
|
|
3008
|
-
const [validationError, setValidationError] =
|
|
3128
|
+
const [internalValue, setInternalValue] = React34__namespace.useState(value);
|
|
3129
|
+
const [validationError, setValidationError] = React34__namespace.useState(
|
|
3009
3130
|
null
|
|
3010
3131
|
);
|
|
3011
|
-
const inputRef =
|
|
3012
|
-
const selectRef =
|
|
3132
|
+
const inputRef = React34__namespace.useRef(null);
|
|
3133
|
+
const selectRef = React34__namespace.useRef(null);
|
|
3013
3134
|
const currentValue = onChange ? value : internalValue;
|
|
3014
3135
|
const setValue = onChange || setInternalValue;
|
|
3015
|
-
const validate =
|
|
3136
|
+
const validate = React34__namespace.useCallback(
|
|
3016
3137
|
(val) => {
|
|
3017
3138
|
if (!column.validator) return true;
|
|
3018
3139
|
const result = column.validator(val, row);
|
|
@@ -3060,7 +3181,7 @@ function CellEditor({
|
|
|
3060
3181
|
}
|
|
3061
3182
|
handleCommit();
|
|
3062
3183
|
};
|
|
3063
|
-
|
|
3184
|
+
React34__namespace.useEffect(() => {
|
|
3064
3185
|
const timer = setTimeout(() => {
|
|
3065
3186
|
if (editorType === "select") {
|
|
3066
3187
|
selectRef.current?.focus();
|
|
@@ -3107,7 +3228,7 @@ function CellEditor({
|
|
|
3107
3228
|
}
|
|
3108
3229
|
);
|
|
3109
3230
|
const renderDateEditor = () => {
|
|
3110
|
-
const dateValue =
|
|
3231
|
+
const dateValue = React34__namespace.useMemo(() => {
|
|
3111
3232
|
if (!currentValue) return void 0;
|
|
3112
3233
|
if (currentValue instanceof Date) return currentValue;
|
|
3113
3234
|
if (typeof currentValue === "string") {
|
|
@@ -3295,7 +3416,7 @@ function useDataGridState(options) {
|
|
|
3295
3416
|
data,
|
|
3296
3417
|
getCellValue: getCellValue2
|
|
3297
3418
|
} = options;
|
|
3298
|
-
const isControlled =
|
|
3419
|
+
const isControlled = React34.useMemo(
|
|
3299
3420
|
() => ({
|
|
3300
3421
|
sorting: controlledSorting !== void 0,
|
|
3301
3422
|
filters: controlledFilters !== void 0,
|
|
@@ -3309,15 +3430,15 @@ function useDataGridState(options) {
|
|
|
3309
3430
|
controlledFocusedCell
|
|
3310
3431
|
]
|
|
3311
3432
|
);
|
|
3312
|
-
const [internalSorting, setInternalSorting] =
|
|
3313
|
-
const [internalFilters, setInternalFilters] =
|
|
3314
|
-
const [internalColumnWidths, setInternalColumnWidths] =
|
|
3315
|
-
const [internalFocusedCell, setInternalFocusedCell] =
|
|
3316
|
-
const [editingCell, setEditingCell] =
|
|
3433
|
+
const [internalSorting, setInternalSorting] = React34.useState(defaultSorting);
|
|
3434
|
+
const [internalFilters, setInternalFilters] = React34.useState(defaultFilters);
|
|
3435
|
+
const [internalColumnWidths, setInternalColumnWidths] = React34.useState(defaultColumnWidths);
|
|
3436
|
+
const [internalFocusedCell, setInternalFocusedCell] = React34.useState(null);
|
|
3437
|
+
const [editingCell, setEditingCell] = React34.useState(null);
|
|
3317
3438
|
const sorting = isControlled.sorting ? controlledSorting : internalSorting;
|
|
3318
3439
|
const filters = isControlled.filters ? controlledFilters : internalFilters;
|
|
3319
3440
|
const focusedCell = isControlled.focusedCell ? controlledFocusedCell : internalFocusedCell;
|
|
3320
|
-
const columnWidths =
|
|
3441
|
+
const columnWidths = React34.useMemo(() => {
|
|
3321
3442
|
const controlled = isControlled.columnWidths ? controlledColumnWidths : internalColumnWidths;
|
|
3322
3443
|
const result = {};
|
|
3323
3444
|
for (const column of columns) {
|
|
@@ -3325,8 +3446,8 @@ function useDataGridState(options) {
|
|
|
3325
3446
|
}
|
|
3326
3447
|
return result;
|
|
3327
3448
|
}, [isControlled.columnWidths, controlledColumnWidths, internalColumnWidths, columns]);
|
|
3328
|
-
const prevStateRef =
|
|
3329
|
-
const state =
|
|
3449
|
+
const prevStateRef = React34.useRef(null);
|
|
3450
|
+
const state = React34.useMemo(
|
|
3330
3451
|
() => ({
|
|
3331
3452
|
sorting,
|
|
3332
3453
|
filters,
|
|
@@ -3336,7 +3457,7 @@ function useDataGridState(options) {
|
|
|
3336
3457
|
}),
|
|
3337
3458
|
[sorting, filters, columnWidths, focusedCell, editingCell]
|
|
3338
3459
|
);
|
|
3339
|
-
|
|
3460
|
+
React34.useEffect(() => {
|
|
3340
3461
|
if (onStateChange) {
|
|
3341
3462
|
const currentState = {
|
|
3342
3463
|
sorting,
|
|
@@ -3351,7 +3472,7 @@ function useDataGridState(options) {
|
|
|
3351
3472
|
}
|
|
3352
3473
|
}
|
|
3353
3474
|
}, [sorting, filters, columnWidths, focusedCell, editingCell, onStateChange]);
|
|
3354
|
-
const setSorting =
|
|
3475
|
+
const setSorting = React34.useCallback(
|
|
3355
3476
|
(newSorting) => {
|
|
3356
3477
|
if (isControlled.sorting) {
|
|
3357
3478
|
onSortChange?.(newSorting);
|
|
@@ -3362,7 +3483,7 @@ function useDataGridState(options) {
|
|
|
3362
3483
|
},
|
|
3363
3484
|
[isControlled.sorting, onSortChange]
|
|
3364
3485
|
);
|
|
3365
|
-
const toggleSort =
|
|
3486
|
+
const toggleSort = React34.useCallback(
|
|
3366
3487
|
(columnKey) => {
|
|
3367
3488
|
const currentSort = sorting.find((s) => s.field === columnKey);
|
|
3368
3489
|
let newSorting;
|
|
@@ -3377,7 +3498,7 @@ function useDataGridState(options) {
|
|
|
3377
3498
|
},
|
|
3378
3499
|
[sorting, setSorting]
|
|
3379
3500
|
);
|
|
3380
|
-
const setFilters =
|
|
3501
|
+
const setFilters = React34.useCallback(
|
|
3381
3502
|
(newFilters) => {
|
|
3382
3503
|
if (isControlled.filters) {
|
|
3383
3504
|
onFilterChange?.(newFilters);
|
|
@@ -3388,7 +3509,7 @@ function useDataGridState(options) {
|
|
|
3388
3509
|
},
|
|
3389
3510
|
[isControlled.filters, onFilterChange]
|
|
3390
3511
|
);
|
|
3391
|
-
const setFilter =
|
|
3512
|
+
const setFilter = React34.useCallback(
|
|
3392
3513
|
(filter, columnKey) => {
|
|
3393
3514
|
const newFilters = filters.filter((f) => f.columnKey !== columnKey);
|
|
3394
3515
|
if (filter) {
|
|
@@ -3398,10 +3519,10 @@ function useDataGridState(options) {
|
|
|
3398
3519
|
},
|
|
3399
3520
|
[filters, setFilters]
|
|
3400
3521
|
);
|
|
3401
|
-
const clearFilters =
|
|
3522
|
+
const clearFilters = React34.useCallback(() => {
|
|
3402
3523
|
setFilters([]);
|
|
3403
3524
|
}, [setFilters]);
|
|
3404
|
-
const setColumnWidth =
|
|
3525
|
+
const setColumnWidth = React34.useCallback(
|
|
3405
3526
|
(columnKey, width) => {
|
|
3406
3527
|
if (isControlled.columnWidths) {
|
|
3407
3528
|
onColumnResize?.(columnKey, width);
|
|
@@ -3415,7 +3536,7 @@ function useDataGridState(options) {
|
|
|
3415
3536
|
},
|
|
3416
3537
|
[isControlled.columnWidths, onColumnResize]
|
|
3417
3538
|
);
|
|
3418
|
-
const setFocusedCell =
|
|
3539
|
+
const setFocusedCell = React34.useCallback(
|
|
3419
3540
|
(cell) => {
|
|
3420
3541
|
if (isControlled.focusedCell) {
|
|
3421
3542
|
onFocusedCellChange?.(cell);
|
|
@@ -3426,7 +3547,7 @@ function useDataGridState(options) {
|
|
|
3426
3547
|
},
|
|
3427
3548
|
[isControlled.focusedCell, onFocusedCellChange]
|
|
3428
3549
|
);
|
|
3429
|
-
const startEditing =
|
|
3550
|
+
const startEditing = React34.useCallback(
|
|
3430
3551
|
(rowIndex, columnKey) => {
|
|
3431
3552
|
if (onCellEditStart) {
|
|
3432
3553
|
const allowed = onCellEditStart(rowIndex, columnKey);
|
|
@@ -3447,10 +3568,10 @@ function useDataGridState(options) {
|
|
|
3447
3568
|
},
|
|
3448
3569
|
[columns, data, getCellValue2, onCellEditStart, setFocusedCell]
|
|
3449
3570
|
);
|
|
3450
|
-
const updateEditingValue =
|
|
3571
|
+
const updateEditingValue = React34.useCallback((value) => {
|
|
3451
3572
|
setEditingCell((prev) => prev ? { ...prev, value } : null);
|
|
3452
3573
|
}, []);
|
|
3453
|
-
const commitEdit =
|
|
3574
|
+
const commitEdit = React34.useCallback((valueOverride) => {
|
|
3454
3575
|
if (!editingCell) return;
|
|
3455
3576
|
const { rowIndex, columnKey, originalValue } = editingCell;
|
|
3456
3577
|
const value = valueOverride !== void 0 ? valueOverride : editingCell.value;
|
|
@@ -3467,7 +3588,7 @@ function useDataGridState(options) {
|
|
|
3467
3588
|
}
|
|
3468
3589
|
setEditingCell(null);
|
|
3469
3590
|
}, [editingCell, columns, data, onCellEdit]);
|
|
3470
|
-
const cancelEdit =
|
|
3591
|
+
const cancelEdit = React34.useCallback(() => {
|
|
3471
3592
|
if (editingCell) {
|
|
3472
3593
|
onCellEditCancel?.(editingCell.rowIndex, editingCell.columnKey);
|
|
3473
3594
|
}
|
|
@@ -3509,22 +3630,22 @@ function useKeyboardNavigation(options) {
|
|
|
3509
3630
|
onScrollToRow,
|
|
3510
3631
|
onScrollToColumn
|
|
3511
3632
|
} = options;
|
|
3512
|
-
const containerRef =
|
|
3633
|
+
const containerRef = React34.useRef(null);
|
|
3513
3634
|
const visibleColumns = getVisibleColumns(columns);
|
|
3514
|
-
const getColumnIndex =
|
|
3635
|
+
const getColumnIndex = React34.useCallback(
|
|
3515
3636
|
(columnKey) => {
|
|
3516
3637
|
return visibleColumns.findIndex((col) => col.key === columnKey);
|
|
3517
3638
|
},
|
|
3518
3639
|
[visibleColumns]
|
|
3519
3640
|
);
|
|
3520
|
-
const getColumnKey =
|
|
3641
|
+
const getColumnKey = React34.useCallback(
|
|
3521
3642
|
(index) => {
|
|
3522
3643
|
const column = visibleColumns[index];
|
|
3523
3644
|
return column ? column.key : null;
|
|
3524
3645
|
},
|
|
3525
3646
|
[visibleColumns]
|
|
3526
3647
|
);
|
|
3527
|
-
const navigateToCell =
|
|
3648
|
+
const navigateToCell = React34.useCallback(
|
|
3528
3649
|
(rowIndex, columnKey) => {
|
|
3529
3650
|
const clampedRow = Math.max(0, Math.min(rowIndex, rowCount - 1));
|
|
3530
3651
|
onFocusedCellChange({ rowIndex: clampedRow, columnKey });
|
|
@@ -3533,7 +3654,7 @@ function useKeyboardNavigation(options) {
|
|
|
3533
3654
|
},
|
|
3534
3655
|
[rowCount, onFocusedCellChange, onScrollToRow, onScrollToColumn]
|
|
3535
3656
|
);
|
|
3536
|
-
const moveFocus =
|
|
3657
|
+
const moveFocus = React34.useCallback(
|
|
3537
3658
|
(rowDelta, colDelta) => {
|
|
3538
3659
|
if (!focusedCell || visibleColumns.length === 0 || rowCount === 0) return;
|
|
3539
3660
|
const currentColIndex = getColumnIndex(focusedCell.columnKey);
|
|
@@ -3573,35 +3694,35 @@ function useKeyboardNavigation(options) {
|
|
|
3573
3694
|
navigateToCell
|
|
3574
3695
|
]
|
|
3575
3696
|
);
|
|
3576
|
-
const jumpToRowStart =
|
|
3697
|
+
const jumpToRowStart = React34.useCallback(() => {
|
|
3577
3698
|
if (!focusedCell || visibleColumns.length === 0) return;
|
|
3578
3699
|
const firstColumnKey = getColumnKey(0);
|
|
3579
3700
|
if (firstColumnKey) {
|
|
3580
3701
|
navigateToCell(focusedCell.rowIndex, firstColumnKey);
|
|
3581
3702
|
}
|
|
3582
3703
|
}, [focusedCell, visibleColumns.length, getColumnKey, navigateToCell]);
|
|
3583
|
-
const jumpToRowEnd =
|
|
3704
|
+
const jumpToRowEnd = React34.useCallback(() => {
|
|
3584
3705
|
if (!focusedCell || visibleColumns.length === 0) return;
|
|
3585
3706
|
const lastColumnKey = getColumnKey(visibleColumns.length - 1);
|
|
3586
3707
|
if (lastColumnKey) {
|
|
3587
3708
|
navigateToCell(focusedCell.rowIndex, lastColumnKey);
|
|
3588
3709
|
}
|
|
3589
3710
|
}, [focusedCell, visibleColumns.length, getColumnKey, navigateToCell]);
|
|
3590
|
-
const jumpToGridStart =
|
|
3711
|
+
const jumpToGridStart = React34.useCallback(() => {
|
|
3591
3712
|
if (visibleColumns.length === 0 || rowCount === 0) return;
|
|
3592
3713
|
const firstColumnKey = getColumnKey(0);
|
|
3593
3714
|
if (firstColumnKey) {
|
|
3594
3715
|
navigateToCell(0, firstColumnKey);
|
|
3595
3716
|
}
|
|
3596
3717
|
}, [visibleColumns.length, rowCount, getColumnKey, navigateToCell]);
|
|
3597
|
-
const jumpToGridEnd =
|
|
3718
|
+
const jumpToGridEnd = React34.useCallback(() => {
|
|
3598
3719
|
if (visibleColumns.length === 0 || rowCount === 0) return;
|
|
3599
3720
|
const lastColumnKey = getColumnKey(visibleColumns.length - 1);
|
|
3600
3721
|
if (lastColumnKey) {
|
|
3601
3722
|
navigateToCell(rowCount - 1, lastColumnKey);
|
|
3602
3723
|
}
|
|
3603
3724
|
}, [visibleColumns.length, rowCount, getColumnKey, navigateToCell]);
|
|
3604
|
-
const handleKeyDown =
|
|
3725
|
+
const handleKeyDown = React34.useCallback(
|
|
3605
3726
|
(event) => {
|
|
3606
3727
|
if (!enabled) return;
|
|
3607
3728
|
const { key, ctrlKey, metaKey, shiftKey } = event;
|
|
@@ -3704,7 +3825,7 @@ function useKeyboardNavigation(options) {
|
|
|
3704
3825
|
onFocusedCellChange
|
|
3705
3826
|
]
|
|
3706
3827
|
);
|
|
3707
|
-
const focusContainer =
|
|
3828
|
+
const focusContainer = React34.useCallback(() => {
|
|
3708
3829
|
containerRef.current?.focus();
|
|
3709
3830
|
}, []);
|
|
3710
3831
|
return {
|
|
@@ -3725,18 +3846,18 @@ function useColumnResize(options) {
|
|
|
3725
3846
|
onResizeStart,
|
|
3726
3847
|
onResizeEnd
|
|
3727
3848
|
} = options;
|
|
3728
|
-
const [isDragging, setIsDragging] =
|
|
3729
|
-
const startXRef =
|
|
3730
|
-
const startWidthRef =
|
|
3849
|
+
const [isDragging, setIsDragging] = React34.useState(false);
|
|
3850
|
+
const startXRef = React34.useRef(0);
|
|
3851
|
+
const startWidthRef = React34.useRef(0);
|
|
3731
3852
|
const minWidth = column.minWidth ?? DEFAULT_MIN_WIDTH;
|
|
3732
3853
|
const maxWidth = column.maxWidth ?? DEFAULT_MAX_WIDTH;
|
|
3733
|
-
const clampWidth =
|
|
3854
|
+
const clampWidth = React34.useCallback(
|
|
3734
3855
|
(width) => {
|
|
3735
3856
|
return Math.max(minWidth, Math.min(maxWidth, width));
|
|
3736
3857
|
},
|
|
3737
3858
|
[minWidth, maxWidth]
|
|
3738
3859
|
);
|
|
3739
|
-
const handleMouseDown =
|
|
3860
|
+
const handleMouseDown = React34.useCallback(
|
|
3740
3861
|
(event) => {
|
|
3741
3862
|
if (!enabled) return;
|
|
3742
3863
|
event.preventDefault();
|
|
@@ -3750,7 +3871,7 @@ function useColumnResize(options) {
|
|
|
3750
3871
|
},
|
|
3751
3872
|
[enabled, currentWidth, onResizeStart]
|
|
3752
3873
|
);
|
|
3753
|
-
const handleMouseMove =
|
|
3874
|
+
const handleMouseMove = React34.useCallback(
|
|
3754
3875
|
(event) => {
|
|
3755
3876
|
if (!isDragging) return;
|
|
3756
3877
|
const deltaX = event.clientX - startXRef.current;
|
|
@@ -3759,7 +3880,7 @@ function useColumnResize(options) {
|
|
|
3759
3880
|
},
|
|
3760
3881
|
[isDragging, clampWidth, onResize]
|
|
3761
3882
|
);
|
|
3762
|
-
const handleMouseUp =
|
|
3883
|
+
const handleMouseUp = React34.useCallback(() => {
|
|
3763
3884
|
if (!isDragging) return;
|
|
3764
3885
|
setIsDragging(false);
|
|
3765
3886
|
document.body.style.userSelect = "";
|
|
@@ -3767,7 +3888,7 @@ function useColumnResize(options) {
|
|
|
3767
3888
|
const finalWidth = clampWidth(currentWidth);
|
|
3768
3889
|
onResizeEnd?.(finalWidth);
|
|
3769
3890
|
}, [isDragging, currentWidth, clampWidth, onResizeEnd]);
|
|
3770
|
-
const handleDoubleClick =
|
|
3891
|
+
const handleDoubleClick = React34.useCallback(
|
|
3771
3892
|
(event) => {
|
|
3772
3893
|
if (!enabled) return;
|
|
3773
3894
|
event.preventDefault();
|
|
@@ -3779,7 +3900,7 @@ function useColumnResize(options) {
|
|
|
3779
3900
|
},
|
|
3780
3901
|
[enabled, column.width, clampWidth, onResize, onResizeEnd]
|
|
3781
3902
|
);
|
|
3782
|
-
|
|
3903
|
+
React34.useEffect(() => {
|
|
3783
3904
|
if (isDragging) {
|
|
3784
3905
|
window.addEventListener("mousemove", handleMouseMove);
|
|
3785
3906
|
window.addEventListener("mouseup", handleMouseUp);
|
|
@@ -3789,7 +3910,7 @@ function useColumnResize(options) {
|
|
|
3789
3910
|
};
|
|
3790
3911
|
}
|
|
3791
3912
|
}, [isDragging, handleMouseMove, handleMouseUp]);
|
|
3792
|
-
|
|
3913
|
+
React34.useEffect(() => {
|
|
3793
3914
|
return () => {
|
|
3794
3915
|
if (isDragging) {
|
|
3795
3916
|
document.body.style.userSelect = "";
|
|
@@ -3821,16 +3942,16 @@ function useColumnResizeManager(options) {
|
|
|
3821
3942
|
onColumnResizeStart,
|
|
3822
3943
|
onColumnResizeEnd
|
|
3823
3944
|
} = options;
|
|
3824
|
-
const [resizingColumn, setResizingColumn] =
|
|
3825
|
-
const startXRef =
|
|
3826
|
-
const startWidthRef =
|
|
3827
|
-
const getColumn =
|
|
3945
|
+
const [resizingColumn, setResizingColumn] = React34.useState(null);
|
|
3946
|
+
const startXRef = React34.useRef(0);
|
|
3947
|
+
const startWidthRef = React34.useRef(0);
|
|
3948
|
+
const getColumn = React34.useCallback(
|
|
3828
3949
|
(columnKey) => {
|
|
3829
3950
|
return columns.find((c) => c.key === columnKey);
|
|
3830
3951
|
},
|
|
3831
3952
|
[columns]
|
|
3832
3953
|
);
|
|
3833
|
-
const clampWidth =
|
|
3954
|
+
const clampWidth = React34.useCallback(
|
|
3834
3955
|
(columnKey, width) => {
|
|
3835
3956
|
const column = getColumn(columnKey);
|
|
3836
3957
|
const minWidth = column?.minWidth ?? DEFAULT_MIN_WIDTH;
|
|
@@ -3839,7 +3960,7 @@ function useColumnResizeManager(options) {
|
|
|
3839
3960
|
},
|
|
3840
3961
|
[getColumn]
|
|
3841
3962
|
);
|
|
3842
|
-
const handleMouseMove =
|
|
3963
|
+
const handleMouseMove = React34.useCallback(
|
|
3843
3964
|
(event) => {
|
|
3844
3965
|
if (!resizingColumn) return;
|
|
3845
3966
|
const deltaX = event.clientX - startXRef.current;
|
|
@@ -3851,7 +3972,7 @@ function useColumnResizeManager(options) {
|
|
|
3851
3972
|
},
|
|
3852
3973
|
[resizingColumn, clampWidth, onColumnResize]
|
|
3853
3974
|
);
|
|
3854
|
-
const handleMouseUp =
|
|
3975
|
+
const handleMouseUp = React34.useCallback(() => {
|
|
3855
3976
|
if (!resizingColumn) return;
|
|
3856
3977
|
const finalWidth = columnWidths[resizingColumn] ?? 200;
|
|
3857
3978
|
setResizingColumn(null);
|
|
@@ -3859,7 +3980,7 @@ function useColumnResizeManager(options) {
|
|
|
3859
3980
|
document.body.style.cursor = "";
|
|
3860
3981
|
onColumnResizeEnd?.(resizingColumn, finalWidth);
|
|
3861
3982
|
}, [resizingColumn, columnWidths, onColumnResizeEnd]);
|
|
3862
|
-
|
|
3983
|
+
React34.useEffect(() => {
|
|
3863
3984
|
if (resizingColumn) {
|
|
3864
3985
|
window.addEventListener("mousemove", handleMouseMove);
|
|
3865
3986
|
window.addEventListener("mouseup", handleMouseUp);
|
|
@@ -3869,7 +3990,7 @@ function useColumnResizeManager(options) {
|
|
|
3869
3990
|
};
|
|
3870
3991
|
}
|
|
3871
3992
|
}, [resizingColumn, handleMouseMove, handleMouseUp]);
|
|
3872
|
-
const getResizeProps =
|
|
3993
|
+
const getResizeProps = React34.useCallback(
|
|
3873
3994
|
(columnKey) => {
|
|
3874
3995
|
const column = getColumn(columnKey);
|
|
3875
3996
|
const isResizable = resizableColumns && column?.resizable !== false;
|
|
@@ -4155,15 +4276,15 @@ function DataGrid({
|
|
|
4155
4276
|
hasMore = false,
|
|
4156
4277
|
loadingMore = false
|
|
4157
4278
|
}) {
|
|
4158
|
-
const parentRef =
|
|
4159
|
-
const headerRef =
|
|
4160
|
-
const [headerHeight, setHeaderHeight] =
|
|
4161
|
-
const [hoveredCell, setHoveredCell] =
|
|
4162
|
-
const visibleColumns =
|
|
4279
|
+
const parentRef = React34__namespace.useRef(null);
|
|
4280
|
+
const headerRef = React34__namespace.useRef(null);
|
|
4281
|
+
const [headerHeight, setHeaderHeight] = React34__namespace.useState(40);
|
|
4282
|
+
const [hoveredCell, setHoveredCell] = React34__namespace.useState(null);
|
|
4283
|
+
const visibleColumns = React34__namespace.useMemo(
|
|
4163
4284
|
() => columns.filter((col) => !col.hidden),
|
|
4164
4285
|
[columns]
|
|
4165
4286
|
);
|
|
4166
|
-
const getCellValue2 =
|
|
4287
|
+
const getCellValue2 = React34__namespace.useCallback(
|
|
4167
4288
|
(row, column) => {
|
|
4168
4289
|
if (column.accessor) {
|
|
4169
4290
|
return column.accessor(row);
|
|
@@ -4192,7 +4313,7 @@ function DataGrid({
|
|
|
4192
4313
|
data,
|
|
4193
4314
|
getCellValue: getCellValue2
|
|
4194
4315
|
});
|
|
4195
|
-
const processedData =
|
|
4316
|
+
const processedData = React34__namespace.useMemo(() => {
|
|
4196
4317
|
let result = data;
|
|
4197
4318
|
if (enableInternalFiltering && !isControlled.filters && state.filters.length > 0) {
|
|
4198
4319
|
result = applyFilters(result, state.filters, visibleColumns);
|
|
@@ -4220,7 +4341,7 @@ function DataGrid({
|
|
|
4220
4341
|
onColumnResizeEnd
|
|
4221
4342
|
});
|
|
4222
4343
|
const shouldVirtualize = virtualized ?? processedData.length > 100;
|
|
4223
|
-
|
|
4344
|
+
React34__namespace.useLayoutEffect(() => {
|
|
4224
4345
|
if (headerRef.current && shouldVirtualize) {
|
|
4225
4346
|
setHeaderHeight(headerRef.current.offsetHeight);
|
|
4226
4347
|
}
|
|
@@ -4232,13 +4353,13 @@ function DataGrid({
|
|
|
4232
4353
|
overscan: DEFAULT_OVERSCAN,
|
|
4233
4354
|
enabled: shouldVirtualize
|
|
4234
4355
|
});
|
|
4235
|
-
const tableWidth =
|
|
4356
|
+
const tableWidth = React34__namespace.useMemo(() => {
|
|
4236
4357
|
return visibleColumns.reduce((acc, col) => {
|
|
4237
4358
|
const width = state.columnWidths[col.key] || col.width || estimateColumnWidth(col);
|
|
4238
4359
|
return acc + width;
|
|
4239
4360
|
}, 0);
|
|
4240
4361
|
}, [visibleColumns, state.columnWidths]);
|
|
4241
|
-
const visibleRowCount =
|
|
4362
|
+
const visibleRowCount = React34__namespace.useMemo(() => {
|
|
4242
4363
|
if (!parentRef.current) return 10;
|
|
4243
4364
|
return Math.floor(parentRef.current.clientHeight / DEFAULT_ROW_HEIGHT);
|
|
4244
4365
|
}, []);
|
|
@@ -4257,7 +4378,7 @@ function DataGrid({
|
|
|
4257
4378
|
rowVirtualizer.scrollToIndex(rowIndex, { align: "auto" });
|
|
4258
4379
|
}
|
|
4259
4380
|
});
|
|
4260
|
-
const handleBlur =
|
|
4381
|
+
const handleBlur = React34__namespace.useCallback(
|
|
4261
4382
|
(event) => {
|
|
4262
4383
|
const target = event.target;
|
|
4263
4384
|
const relatedTarget = event.relatedTarget;
|
|
@@ -4315,7 +4436,7 @@ function DataGrid({
|
|
|
4315
4436
|
},
|
|
4316
4437
|
[state.editingCell, actions]
|
|
4317
4438
|
);
|
|
4318
|
-
|
|
4439
|
+
React34__namespace.useEffect(() => {
|
|
4319
4440
|
if (!infiniteScroll || !hasMore || loadingMore || !parentRef.current) return;
|
|
4320
4441
|
const observer = new IntersectionObserver(
|
|
4321
4442
|
(entries) => {
|
|
@@ -4759,7 +4880,7 @@ function DataGrid({
|
|
|
4759
4880
|
);
|
|
4760
4881
|
}
|
|
4761
4882
|
function PaginationFooter({ pagination }) {
|
|
4762
|
-
const [goToPage, setGoToPage] =
|
|
4883
|
+
const [goToPage, setGoToPage] = React34__namespace.useState("");
|
|
4763
4884
|
const handleGoToPage = () => {
|
|
4764
4885
|
const page = parseInt(goToPage, 10);
|
|
4765
4886
|
if (!isNaN(page) && page >= 1 && page <= pagination.totalPages) {
|
|
@@ -4877,21 +4998,21 @@ function Autocomplete({
|
|
|
4877
4998
|
className,
|
|
4878
4999
|
clearable = false
|
|
4879
5000
|
}) {
|
|
4880
|
-
const [open, setOpen] =
|
|
4881
|
-
const [search, setSearch] =
|
|
4882
|
-
const inputRef =
|
|
4883
|
-
const selectedOption =
|
|
5001
|
+
const [open, setOpen] = React34__namespace.useState(false);
|
|
5002
|
+
const [search, setSearch] = React34__namespace.useState("");
|
|
5003
|
+
const inputRef = React34__namespace.useRef(null);
|
|
5004
|
+
const selectedOption = React34__namespace.useMemo(
|
|
4884
5005
|
() => options.find((opt) => opt.value === value),
|
|
4885
5006
|
[options, value]
|
|
4886
5007
|
);
|
|
4887
|
-
const filteredOptions =
|
|
5008
|
+
const filteredOptions = React34__namespace.useMemo(() => {
|
|
4888
5009
|
if (!search.trim()) return options;
|
|
4889
5010
|
const searchLower = search.toLowerCase();
|
|
4890
5011
|
return options.filter(
|
|
4891
5012
|
(opt) => opt.label.toLowerCase().includes(searchLower) || opt.description?.toLowerCase().includes(searchLower)
|
|
4892
5013
|
);
|
|
4893
5014
|
}, [options, search]);
|
|
4894
|
-
const groupedOptions =
|
|
5015
|
+
const groupedOptions = React34__namespace.useMemo(() => {
|
|
4895
5016
|
const groups = {};
|
|
4896
5017
|
const ungrouped = [];
|
|
4897
5018
|
filteredOptions.forEach((opt) => {
|
|
@@ -4905,7 +5026,7 @@ function Autocomplete({
|
|
|
4905
5026
|
return { groups, ungrouped };
|
|
4906
5027
|
}, [filteredOptions]);
|
|
4907
5028
|
const hasGroups = Object.keys(groupedOptions.groups).length > 0;
|
|
4908
|
-
const handleSelect =
|
|
5029
|
+
const handleSelect = React34__namespace.useCallback(
|
|
4909
5030
|
(optionValue) => {
|
|
4910
5031
|
onChange?.(optionValue);
|
|
4911
5032
|
setOpen(false);
|
|
@@ -4913,7 +5034,7 @@ function Autocomplete({
|
|
|
4913
5034
|
},
|
|
4914
5035
|
[onChange]
|
|
4915
5036
|
);
|
|
4916
|
-
const handleClear =
|
|
5037
|
+
const handleClear = React34__namespace.useCallback(
|
|
4917
5038
|
(e) => {
|
|
4918
5039
|
e.stopPropagation();
|
|
4919
5040
|
onChange?.(void 0);
|
|
@@ -4921,7 +5042,7 @@ function Autocomplete({
|
|
|
4921
5042
|
},
|
|
4922
5043
|
[onChange]
|
|
4923
5044
|
);
|
|
4924
|
-
|
|
5045
|
+
React34__namespace.useEffect(() => {
|
|
4925
5046
|
if (open) {
|
|
4926
5047
|
const timeout = setTimeout(() => {
|
|
4927
5048
|
inputRef.current?.focus();
|
|
@@ -4931,7 +5052,7 @@ function Autocomplete({
|
|
|
4931
5052
|
setSearch("");
|
|
4932
5053
|
}
|
|
4933
5054
|
}, [open]);
|
|
4934
|
-
const handleKeyDown =
|
|
5055
|
+
const handleKeyDown = React34__namespace.useCallback((e) => {
|
|
4935
5056
|
if (e.key === "Escape") {
|
|
4936
5057
|
setOpen(false);
|
|
4937
5058
|
}
|
|
@@ -5107,7 +5228,7 @@ var iconButtonVariants = classVarianceAuthority.cva(
|
|
|
5107
5228
|
}
|
|
5108
5229
|
}
|
|
5109
5230
|
);
|
|
5110
|
-
var IconButton =
|
|
5231
|
+
var IconButton = React34__namespace.forwardRef(
|
|
5111
5232
|
({ className, variant, size, isActive = false, icon, children, ...props }, ref) => {
|
|
5112
5233
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5113
5234
|
"button",
|
|
@@ -5131,7 +5252,7 @@ var IconButton = React33__namespace.forwardRef(
|
|
|
5131
5252
|
);
|
|
5132
5253
|
IconButton.displayName = "IconButton";
|
|
5133
5254
|
function CopyButton({ content, className, size = "md" }) {
|
|
5134
|
-
const [copied, setCopied] =
|
|
5255
|
+
const [copied, setCopied] = React34__namespace.useState(false);
|
|
5135
5256
|
const handleCopy = async () => {
|
|
5136
5257
|
try {
|
|
5137
5258
|
await navigator.clipboard.writeText(content);
|
|
@@ -5904,11 +6025,11 @@ function ThemePicker({
|
|
|
5904
6025
|
align = "end",
|
|
5905
6026
|
side = "bottom"
|
|
5906
6027
|
}) {
|
|
5907
|
-
const [open, setOpen] =
|
|
5908
|
-
const [selectedTheme, setSelectedTheme] =
|
|
6028
|
+
const [open, setOpen] = React34__namespace.useState(false);
|
|
6029
|
+
const [selectedTheme, setSelectedTheme] = React34__namespace.useState(
|
|
5909
6030
|
value || themes[0]
|
|
5910
6031
|
);
|
|
5911
|
-
|
|
6032
|
+
React34__namespace.useEffect(() => {
|
|
5912
6033
|
if (value) {
|
|
5913
6034
|
setSelectedTheme(value);
|
|
5914
6035
|
}
|
|
@@ -6018,19 +6139,19 @@ function getSafePosition(x, y, menuWidth, menuHeight) {
|
|
|
6018
6139
|
return { x: safeX, y: safeY };
|
|
6019
6140
|
}
|
|
6020
6141
|
function MenuItem({ item, onClose, depth = 0 }) {
|
|
6021
|
-
const [isSubmenuOpen, setIsSubmenuOpen] =
|
|
6022
|
-
const [submenuPosition, setSubmenuPosition] =
|
|
6023
|
-
const itemRef =
|
|
6024
|
-
const hoverTimeoutRef =
|
|
6142
|
+
const [isSubmenuOpen, setIsSubmenuOpen] = React34__namespace.useState(false);
|
|
6143
|
+
const [submenuPosition, setSubmenuPosition] = React34__namespace.useState(null);
|
|
6144
|
+
const itemRef = React34__namespace.useRef(null);
|
|
6145
|
+
const hoverTimeoutRef = React34__namespace.useRef(null);
|
|
6025
6146
|
const hasSubmenu = item.submenu && item.submenu.length > 0;
|
|
6026
|
-
|
|
6147
|
+
React34__namespace.useEffect(() => {
|
|
6027
6148
|
return () => {
|
|
6028
6149
|
if (hoverTimeoutRef.current) {
|
|
6029
6150
|
clearTimeout(hoverTimeoutRef.current);
|
|
6030
6151
|
}
|
|
6031
6152
|
};
|
|
6032
6153
|
}, []);
|
|
6033
|
-
const handleMouseEnter =
|
|
6154
|
+
const handleMouseEnter = React34__namespace.useCallback(() => {
|
|
6034
6155
|
if (hoverTimeoutRef.current) {
|
|
6035
6156
|
clearTimeout(hoverTimeoutRef.current);
|
|
6036
6157
|
}
|
|
@@ -6050,22 +6171,22 @@ function MenuItem({ item, onClose, depth = 0 }) {
|
|
|
6050
6171
|
setIsSubmenuOpen(true);
|
|
6051
6172
|
}
|
|
6052
6173
|
}, [hasSubmenu, item.submenu?.length]);
|
|
6053
|
-
const handleMouseLeave =
|
|
6174
|
+
const handleMouseLeave = React34__namespace.useCallback(() => {
|
|
6054
6175
|
hoverTimeoutRef.current = setTimeout(() => {
|
|
6055
6176
|
setIsSubmenuOpen(false);
|
|
6056
6177
|
}, 100);
|
|
6057
6178
|
}, []);
|
|
6058
|
-
const handleSubmenuMouseEnter =
|
|
6179
|
+
const handleSubmenuMouseEnter = React34__namespace.useCallback(() => {
|
|
6059
6180
|
if (hoverTimeoutRef.current) {
|
|
6060
6181
|
clearTimeout(hoverTimeoutRef.current);
|
|
6061
6182
|
}
|
|
6062
6183
|
}, []);
|
|
6063
|
-
const handleSubmenuMouseLeave =
|
|
6184
|
+
const handleSubmenuMouseLeave = React34__namespace.useCallback(() => {
|
|
6064
6185
|
hoverTimeoutRef.current = setTimeout(() => {
|
|
6065
6186
|
setIsSubmenuOpen(false);
|
|
6066
6187
|
}, 100);
|
|
6067
6188
|
}, []);
|
|
6068
|
-
const handleClick =
|
|
6189
|
+
const handleClick = React34__namespace.useCallback(() => {
|
|
6069
6190
|
if (item.disabled) return;
|
|
6070
6191
|
if (!hasSubmenu && item.action) {
|
|
6071
6192
|
item.action();
|
|
@@ -6145,12 +6266,12 @@ function ContextMenu({
|
|
|
6145
6266
|
anchorEl,
|
|
6146
6267
|
className
|
|
6147
6268
|
}) {
|
|
6148
|
-
const menuRef =
|
|
6149
|
-
const [menuPosition, setMenuPosition] =
|
|
6269
|
+
const menuRef = React34__namespace.useRef(null);
|
|
6270
|
+
const [menuPosition, setMenuPosition] = React34__namespace.useState({
|
|
6150
6271
|
x: 0,
|
|
6151
6272
|
y: 0
|
|
6152
6273
|
});
|
|
6153
|
-
|
|
6274
|
+
React34__namespace.useEffect(() => {
|
|
6154
6275
|
if (!isOpen) return;
|
|
6155
6276
|
let x = position.x;
|
|
6156
6277
|
let y = position.y;
|
|
@@ -6169,7 +6290,7 @@ function ContextMenu({
|
|
|
6169
6290
|
}
|
|
6170
6291
|
});
|
|
6171
6292
|
}, [isOpen, position, anchorEl]);
|
|
6172
|
-
|
|
6293
|
+
React34__namespace.useEffect(() => {
|
|
6173
6294
|
if (!isOpen) return;
|
|
6174
6295
|
const handleClickOutside = (e) => {
|
|
6175
6296
|
if (menuRef.current && !menuRef.current.contains(e.target)) {
|
|
@@ -6213,16 +6334,16 @@ function ContextMenu({
|
|
|
6213
6334
|
);
|
|
6214
6335
|
}
|
|
6215
6336
|
function useContextMenu() {
|
|
6216
|
-
const [isOpen, setIsOpen] =
|
|
6217
|
-
const [position, setPosition] =
|
|
6218
|
-
const [targetItem, setTargetItem] =
|
|
6219
|
-
const menuRef =
|
|
6220
|
-
const openMenu =
|
|
6337
|
+
const [isOpen, setIsOpen] = React34__namespace.useState(false);
|
|
6338
|
+
const [position, setPosition] = React34__namespace.useState({ x: 0, y: 0 });
|
|
6339
|
+
const [targetItem, setTargetItem] = React34__namespace.useState(null);
|
|
6340
|
+
const menuRef = React34__namespace.useRef(null);
|
|
6341
|
+
const openMenu = React34__namespace.useCallback((x, y, item) => {
|
|
6221
6342
|
setPosition({ x, y });
|
|
6222
6343
|
setTargetItem(item);
|
|
6223
6344
|
setIsOpen(true);
|
|
6224
6345
|
}, []);
|
|
6225
|
-
const closeMenu =
|
|
6346
|
+
const closeMenu = React34__namespace.useCallback(() => {
|
|
6226
6347
|
setIsOpen(false);
|
|
6227
6348
|
setTargetItem(null);
|
|
6228
6349
|
}, []);
|
|
@@ -6254,6 +6375,9 @@ exports.AlertDialogTitle = AlertDialogTitle;
|
|
|
6254
6375
|
exports.AlertDialogTrigger = AlertDialogTrigger;
|
|
6255
6376
|
exports.Autocomplete = Autocomplete;
|
|
6256
6377
|
exports.Badge = Badge;
|
|
6378
|
+
exports.Board = Board;
|
|
6379
|
+
exports.BoardContent = BoardContent;
|
|
6380
|
+
exports.BoardHeader = BoardHeader;
|
|
6257
6381
|
exports.Button = Button;
|
|
6258
6382
|
exports.CYBERPUNK_THEME = CYBERPUNK_THEME;
|
|
6259
6383
|
exports.Calendar = Calendar;
|
|
@@ -6362,6 +6486,7 @@ exports.applySorting = applySorting;
|
|
|
6362
6486
|
exports.applyTheme = applyTheme;
|
|
6363
6487
|
exports.areThemesEqual = areThemesEqual;
|
|
6364
6488
|
exports.badgeVariants = badgeVariants;
|
|
6489
|
+
exports.boardVariants = boardVariants;
|
|
6365
6490
|
exports.buttonVariants = buttonVariants;
|
|
6366
6491
|
exports.cardActionsVariants = cardActionsVariants;
|
|
6367
6492
|
exports.cardGridVariants = cardGridVariants;
|