@sikka/hawa 0.40.1-next → 0.41.1-next
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/accordion/index.js.map +1 -1
- package/dist/accordion/index.mjs.map +1 -1
- package/dist/alert/index.js +1 -1
- package/dist/alert/index.js.map +1 -1
- package/dist/alert/index.mjs +1 -1
- package/dist/alert/index.mjs.map +1 -1
- package/dist/appLayout/index.js +15 -15
- package/dist/appLayout/index.js.map +1 -1
- package/dist/appLayout/index.mjs +15 -15
- package/dist/appLayout/index.mjs.map +1 -1
- package/dist/appMenubar/index.js.map +1 -1
- package/dist/appMenubar/index.mjs.map +1 -1
- package/dist/appTabs/index.js +2 -2
- package/dist/appTabs/index.js.map +1 -1
- package/dist/appTabs/index.mjs +2 -2
- package/dist/appTabs/index.mjs.map +1 -1
- package/dist/appTopbar/index.js +5 -5
- package/dist/appTopbar/index.js.map +1 -1
- package/dist/appTopbar/index.mjs +5 -5
- package/dist/appTopbar/index.mjs.map +1 -1
- package/dist/avatar/index.js +1 -1
- package/dist/avatar/index.js.map +1 -1
- package/dist/avatar/index.mjs +1 -1
- package/dist/avatar/index.mjs.map +1 -1
- package/dist/backToTop/index.js +1 -1
- package/dist/backToTop/index.js.map +1 -1
- package/dist/backToTop/index.mjs +1 -1
- package/dist/backToTop/index.mjs.map +1 -1
- package/dist/badge/index.d.mts +1 -1
- package/dist/badge/index.d.ts +1 -1
- package/dist/badge/index.js +1 -1
- package/dist/badge/index.js.map +1 -1
- package/dist/badge/index.mjs +1 -1
- package/dist/badge/index.mjs.map +1 -1
- package/dist/blocks/auth/index.js +102 -17
- package/dist/blocks/auth/index.mjs +100 -15
- package/dist/blocks/feedback/index.js +20 -21
- package/dist/blocks/feedback/index.mjs +18 -20
- package/dist/blocks/index.js +150 -66
- package/dist/blocks/index.mjs +47 -49
- package/dist/blocks/misc/index.js +17 -19
- package/dist/blocks/misc/index.mjs +11 -11
- package/dist/blocks/pricing/index.js +23 -23
- package/dist/blocks/pricing/index.mjs +21 -21
- package/dist/button/index.js.map +1 -1
- package/dist/button/index.mjs.map +1 -1
- package/dist/calendar/index.js.map +1 -1
- package/dist/calendar/index.mjs.map +1 -1
- package/dist/card/index.js +1 -1
- package/dist/card/index.js.map +1 -1
- package/dist/card/index.mjs +1 -1
- package/dist/card/index.mjs.map +1 -1
- package/dist/carousel/index.d.mts +1 -1
- package/dist/carousel/index.d.ts +1 -1
- package/dist/carousel/index.js +7 -7
- package/dist/carousel/index.js.map +1 -1
- package/dist/carousel/index.mjs +7 -7
- package/dist/carousel/index.mjs.map +1 -1
- package/dist/checkbox/index.js +2 -2
- package/dist/checkbox/index.js.map +1 -1
- package/dist/checkbox/index.mjs +2 -2
- package/dist/checkbox/index.mjs.map +1 -1
- package/dist/{chunk-27G5FKOP.mjs → chunk-2GEXJLRC.mjs} +1 -1
- package/dist/{chunk-QSEQS7DS.mjs → chunk-7R25FOBM.mjs} +17 -17
- package/dist/{chunk-AJTYKC5R.mjs → chunk-CQYG77SY.mjs} +1 -1
- package/dist/{chunk-QZIENYTE.mjs → chunk-D7HDVJFT.mjs} +3 -3
- package/dist/{chunk-DYPGZ2IP.mjs → chunk-EBZECS2Z.mjs} +4 -4
- package/dist/{chunk-CTNKKP2O.mjs → chunk-FLMCWOQQ.mjs} +62 -62
- package/dist/{chunk-GU2DOJ7Q.mjs → chunk-FP6763YO.mjs} +89 -4
- package/dist/{chunk-RT2Q3SH7.mjs → chunk-I3AK6DXN.mjs} +3 -3
- package/dist/{chunk-CTZRVSTI.mjs → chunk-K5S7P5ZO.mjs} +4 -4
- package/dist/{chunk-GN7EIDTE.mjs → chunk-QNLA5TSV.mjs} +2 -2
- package/dist/codeBlock/index.js +5 -5
- package/dist/codeBlock/index.js.map +1 -1
- package/dist/codeBlock/index.mjs +5 -5
- package/dist/codeBlock/index.mjs.map +1 -1
- package/dist/colorPicker/index.js.map +1 -1
- package/dist/colorPicker/index.mjs.map +1 -1
- package/dist/combobox/index.js +7 -7
- package/dist/combobox/index.js.map +1 -1
- package/dist/combobox/index.mjs +7 -7
- package/dist/combobox/index.mjs.map +1 -1
- package/dist/command/index.js +5 -5
- package/dist/command/index.js.map +1 -1
- package/dist/command/index.mjs +5 -5
- package/dist/command/index.mjs.map +1 -1
- package/dist/dataTable/index.d.mts +6 -1
- package/dist/dataTable/index.d.ts +6 -1
- package/dist/dataTable/index.js +459 -245
- package/dist/dataTable/index.js.map +1 -1
- package/dist/dataTable/index.mjs +476 -262
- package/dist/dataTable/index.mjs.map +1 -1
- package/dist/datePicker/index.js.map +1 -1
- package/dist/datePicker/index.mjs.map +1 -1
- package/dist/destroyableCard/index.js +1 -1
- package/dist/destroyableCard/index.js.map +1 -1
- package/dist/destroyableCard/index.mjs +1 -1
- package/dist/destroyableCard/index.mjs.map +1 -1
- package/dist/dialog/index.js +4 -4
- package/dist/dialog/index.js.map +1 -1
- package/dist/dialog/index.mjs +4 -4
- package/dist/dialog/index.mjs.map +1 -1
- package/dist/docsLayout/index.js +92 -9
- package/dist/docsLayout/index.js.map +1 -1
- package/dist/docsLayout/index.mjs +92 -9
- package/dist/docsLayout/index.mjs.map +1 -1
- package/dist/docsSidebar/index.js +1 -1
- package/dist/docsSidebar/index.js.map +1 -1
- package/dist/docsSidebar/index.mjs +1 -1
- package/dist/docsSidebar/index.mjs.map +1 -1
- package/dist/dropdownMenu/index.js +3 -3
- package/dist/dropdownMenu/index.js.map +1 -1
- package/dist/dropdownMenu/index.mjs +3 -3
- package/dist/dropdownMenu/index.mjs.map +1 -1
- package/dist/elements/index.d.mts +12 -2
- package/dist/elements/index.d.ts +12 -2
- package/dist/elements/index.js +656 -493
- package/dist/elements/index.mjs +288 -210
- package/dist/fileDropzone/index.js +5 -5
- package/dist/fileDropzone/index.js.map +1 -1
- package/dist/fileDropzone/index.mjs +5 -5
- package/dist/fileDropzone/index.mjs.map +1 -1
- package/dist/glow/index.js.map +1 -1
- package/dist/glow/index.mjs.map +1 -1
- package/dist/hooks/index.d.mts +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/index.css +27 -127
- package/dist/index.d.mts +13 -3
- package/dist/index.d.ts +13 -3
- package/dist/index.js +732 -570
- package/dist/index.mjs +822 -660
- package/dist/input/index.js +3 -3
- package/dist/input/index.js.map +1 -1
- package/dist/input/index.mjs +3 -3
- package/dist/input/index.mjs.map +1 -1
- package/dist/interfaceSettings/index.js +4 -4
- package/dist/interfaceSettings/index.js.map +1 -1
- package/dist/interfaceSettings/index.mjs +4 -4
- package/dist/interfaceSettings/index.mjs.map +1 -1
- package/dist/label/index.js.map +1 -1
- package/dist/label/index.mjs.map +1 -1
- package/dist/layout/index.js +119 -36
- package/dist/layout/index.mjs +31 -31
- package/dist/loading/index.js.map +1 -1
- package/dist/loading/index.mjs.map +1 -1
- package/dist/logos/index.d.mts +5 -0
- package/dist/logos/index.d.ts +5 -0
- package/dist/logos/index.js +85 -0
- package/dist/logos/index.js.map +1 -1
- package/dist/logos/index.mjs +85 -0
- package/dist/logos/index.mjs.map +1 -1
- package/dist/navbar/index.js +12 -12
- package/dist/navbar/index.js.map +1 -1
- package/dist/navbar/index.mjs +12 -12
- package/dist/navbar/index.mjs.map +1 -1
- package/dist/navigationMenu/index.js +5 -5
- package/dist/navigationMenu/index.js.map +1 -1
- package/dist/navigationMenu/index.mjs +5 -5
- package/dist/navigationMenu/index.mjs.map +1 -1
- package/dist/pagination/index.js.map +1 -1
- package/dist/pagination/index.mjs.map +1 -1
- package/dist/passwordInput/index.js +3 -3
- package/dist/passwordInput/index.js.map +1 -1
- package/dist/passwordInput/index.mjs +3 -3
- package/dist/passwordInput/index.mjs.map +1 -1
- package/dist/phoneInput/index.js +4 -4
- package/dist/phoneInput/index.js.map +1 -1
- package/dist/phoneInput/index.mjs +4 -4
- package/dist/phoneInput/index.mjs.map +1 -1
- package/dist/progress/index.js.map +1 -1
- package/dist/progress/index.mjs.map +1 -1
- package/dist/progressCircle/index.js +1 -1
- package/dist/progressCircle/index.js.map +1 -1
- package/dist/progressCircle/index.mjs +1 -1
- package/dist/progressCircle/index.mjs.map +1 -1
- package/dist/radio/index.js +3 -3
- package/dist/radio/index.js.map +1 -1
- package/dist/radio/index.mjs +3 -3
- package/dist/radio/index.mjs.map +1 -1
- package/dist/scrollArea/index.js +2 -2
- package/dist/scrollArea/index.js.map +1 -1
- package/dist/scrollArea/index.mjs +2 -2
- package/dist/scrollArea/index.mjs.map +1 -1
- package/dist/scrollIndicator/index.js.map +1 -1
- package/dist/scrollIndicator/index.mjs.map +1 -1
- package/dist/select/index.js +2 -2
- package/dist/select/index.js.map +1 -1
- package/dist/select/index.mjs +2 -2
- package/dist/select/index.mjs.map +1 -1
- package/dist/separator/index.js.map +1 -1
- package/dist/separator/index.mjs.map +1 -1
- package/dist/sheet/index.js +1 -1
- package/dist/sheet/index.js.map +1 -1
- package/dist/sheet/index.mjs +1 -1
- package/dist/sheet/index.mjs.map +1 -1
- package/dist/sidebar/index.js +5 -5
- package/dist/sidebar/index.js.map +1 -1
- package/dist/sidebar/index.mjs +5 -5
- package/dist/sidebar/index.mjs.map +1 -1
- package/dist/signature/index.js.map +1 -1
- package/dist/signature/index.mjs.map +1 -1
- package/dist/simpleTable/index.js +5 -5
- package/dist/simpleTable/index.js.map +1 -1
- package/dist/simpleTable/index.mjs +5 -5
- package/dist/simpleTable/index.mjs.map +1 -1
- package/dist/slider/index.js.map +1 -1
- package/dist/slider/index.mjs.map +1 -1
- package/dist/sortButton/index.js.map +1 -1
- package/dist/sortButton/index.mjs.map +1 -1
- package/dist/splitButton/index.d.mts +27 -27
- package/dist/splitButton/index.d.ts +27 -27
- package/dist/splitButton/index.js +750 -750
- package/dist/splitButton/index.js.map +1 -1
- package/dist/splitButton/index.mjs +752 -752
- package/dist/splitButton/index.mjs.map +1 -1
- package/dist/stats/index.js +3 -5
- package/dist/stats/index.js.map +1 -1
- package/dist/stats/index.mjs +3 -5
- package/dist/stats/index.mjs.map +1 -1
- package/dist/switch/index.js +1 -1
- package/dist/switch/index.js.map +1 -1
- package/dist/switch/index.mjs +1 -1
- package/dist/switch/index.mjs.map +1 -1
- package/dist/table/index.js +4 -4
- package/dist/table/index.js.map +1 -1
- package/dist/table/index.mjs +4 -4
- package/dist/table/index.mjs.map +1 -1
- package/dist/tabs/index.js +2 -2
- package/dist/tabs/index.js.map +1 -1
- package/dist/tabs/index.mjs +2 -2
- package/dist/tabs/index.mjs.map +1 -1
- package/dist/textarea/index.js +1 -1
- package/dist/textarea/index.js.map +1 -1
- package/dist/textarea/index.mjs +1 -1
- package/dist/textarea/index.mjs.map +1 -1
- package/dist/toaster/index.js +1 -1
- package/dist/toaster/index.js.map +1 -1
- package/dist/toaster/index.mjs +1 -1
- package/dist/toaster/index.mjs.map +1 -1
- package/dist/tooltip/index.js.map +1 -1
- package/dist/tooltip/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/dataTable/index.js
CHANGED
@@ -36,7 +36,7 @@ __export(dataTable_exports, {
|
|
36
36
|
module.exports = __toCommonJS(dataTable_exports);
|
37
37
|
|
38
38
|
// elements/dataTable/DataTable.tsx
|
39
|
-
var
|
39
|
+
var React11 = __toESM(require("react"));
|
40
40
|
var import_react_table = require("@tanstack/react-table");
|
41
41
|
|
42
42
|
// util/index.ts
|
@@ -492,15 +492,151 @@ var Button = React5.forwardRef(
|
|
492
492
|
);
|
493
493
|
Button.displayName = "Button";
|
494
494
|
|
495
|
-
// elements/
|
495
|
+
// elements/checkbox/Checkbox.tsx
|
496
496
|
var React6 = __toESM(require("react"));
|
497
|
+
var CheckboxPrimitive = __toESM(require("@radix-ui/react-checkbox"));
|
498
|
+
var Checkbox = ({
|
499
|
+
id,
|
500
|
+
label,
|
501
|
+
sublabel,
|
502
|
+
helperText,
|
503
|
+
disabled,
|
504
|
+
size = "default",
|
505
|
+
radius = "inherit",
|
506
|
+
...props
|
507
|
+
}) => {
|
508
|
+
let labelLineHeightStyles = {
|
509
|
+
xs: sublabel || helperText ? 0.5 : 0.1,
|
510
|
+
sm: 0.6,
|
511
|
+
default: 1,
|
512
|
+
md: 0.8,
|
513
|
+
lg: 0.9,
|
514
|
+
xl: 1
|
515
|
+
};
|
516
|
+
return /* @__PURE__ */ React6.createElement(
|
517
|
+
"div",
|
518
|
+
{
|
519
|
+
className: cn(
|
520
|
+
"hawa-flex hawa-gap-2",
|
521
|
+
size === "default" ? "hawa-items-top" : "hawa-items-center"
|
522
|
+
)
|
523
|
+
},
|
524
|
+
/* @__PURE__ */ React6.createElement(
|
525
|
+
CheckboxElement,
|
526
|
+
{
|
527
|
+
...props,
|
528
|
+
size,
|
529
|
+
radius,
|
530
|
+
disabled,
|
531
|
+
id
|
532
|
+
}
|
533
|
+
),
|
534
|
+
(label || helperText) && /* @__PURE__ */ React6.createElement("div", { className: "hawa-grid hawa-gap-1.5" }, label && /* @__PURE__ */ React6.createElement(
|
535
|
+
"label",
|
536
|
+
{
|
537
|
+
htmlFor: id,
|
538
|
+
className: cn(
|
539
|
+
"hawa-w-fit hawa-select-none hawa-pt-0.5 hawa-text-sm hawa-font-medium",
|
540
|
+
disabled ? "hawa-cursor-not-allowed hawa-text-muted-foreground hawa-opacity-70" : "hawa-cursor-pointer"
|
541
|
+
),
|
542
|
+
style: {
|
543
|
+
// lineHeight: labelLineHeightStyles[size]
|
544
|
+
lineHeight: 1
|
545
|
+
}
|
546
|
+
},
|
547
|
+
label
|
548
|
+
), sublabel && /* @__PURE__ */ React6.createElement(
|
549
|
+
"label",
|
550
|
+
{
|
551
|
+
htmlFor: id,
|
552
|
+
className: cn(
|
553
|
+
"hawa-w-fit hawa-select-none hawa-text-sm hawa-text-muted-foreground",
|
554
|
+
disabled ? "hawa-cursor-not-allowed hawa-text-muted-foreground hawa-opacity-70" : "hawa-cursor-pointer"
|
555
|
+
)
|
556
|
+
},
|
557
|
+
sublabel
|
558
|
+
), helperText && !disabled && /* @__PURE__ */ React6.createElement(
|
559
|
+
"label",
|
560
|
+
{
|
561
|
+
htmlFor: id,
|
562
|
+
className: cn(
|
563
|
+
"hawa-w-fit hawa-select-none hawa-text-xs hawa-text-helper-color",
|
564
|
+
disabled && "hawa-cursor-not-allowed hawa-opacity-70"
|
565
|
+
)
|
566
|
+
},
|
567
|
+
helperText
|
568
|
+
))
|
569
|
+
);
|
570
|
+
};
|
571
|
+
var CheckboxElement = React6.forwardRef(({ radius = "inherit", size = "default", className, ...props }, ref) => {
|
572
|
+
let checkboxRadius = {
|
573
|
+
none: "hawa-rounded-none",
|
574
|
+
inherit: "hawa-rounded-sm",
|
575
|
+
full: "hawa-rounded-full"
|
576
|
+
};
|
577
|
+
let checkboxSizes = {
|
578
|
+
xs: "hawa-w-3 hawa-h-3",
|
579
|
+
sm: "hawa-w-6 hawa-h-6",
|
580
|
+
default: "hawa-icon",
|
581
|
+
md: "hawa-w-8 hawa-h-8",
|
582
|
+
lg: "hawa-w-10 hawa-h-10",
|
583
|
+
xl: "hawa-w-12 hawa-h-12"
|
584
|
+
};
|
585
|
+
let checkboxIndicatorSizes = {
|
586
|
+
xs: "0.5em",
|
587
|
+
default: "0.60em",
|
588
|
+
sm: "0.75em",
|
589
|
+
md: "0.875em",
|
590
|
+
lg: "1em",
|
591
|
+
xl: "1.25em"
|
592
|
+
};
|
593
|
+
return /* @__PURE__ */ React6.createElement(
|
594
|
+
CheckboxPrimitive.Root,
|
595
|
+
{
|
596
|
+
ref,
|
597
|
+
className: cn(
|
598
|
+
"hawa-peer hawa-shrink-0 hawa-border hawa-border-primary hawa-ring-offset-background focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-2 disabled:hawa-cursor-not-allowed disabled:hawa-opacity-50 data-[state=checked]:hawa-bg-primary data-[state=checked]:hawa-text-primary-foreground",
|
599
|
+
checkboxSizes[size],
|
600
|
+
checkboxRadius[radius],
|
601
|
+
className
|
602
|
+
),
|
603
|
+
...props
|
604
|
+
},
|
605
|
+
/* @__PURE__ */ React6.createElement(
|
606
|
+
CheckboxPrimitive.Indicator,
|
607
|
+
{
|
608
|
+
className: cn(
|
609
|
+
"hawa-flex hawa-items-center hawa-justify-center hawa-text-current"
|
610
|
+
)
|
611
|
+
},
|
612
|
+
/* @__PURE__ */ React6.createElement(
|
613
|
+
"svg",
|
614
|
+
{
|
615
|
+
"aria-label": "Check Mark",
|
616
|
+
stroke: "currentColor",
|
617
|
+
fill: "currentColor",
|
618
|
+
strokeWidth: "0",
|
619
|
+
viewBox: "0 0 512 512",
|
620
|
+
height: checkboxIndicatorSizes[size],
|
621
|
+
width: checkboxIndicatorSizes[size]
|
622
|
+
},
|
623
|
+
/* @__PURE__ */ React6.createElement("path", { d: "M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z" })
|
624
|
+
),
|
625
|
+
" "
|
626
|
+
)
|
627
|
+
);
|
628
|
+
});
|
629
|
+
CheckboxElement.displayName = CheckboxPrimitive.Root.displayName;
|
630
|
+
|
631
|
+
// elements/dropdownMenu/DropdownMenu.tsx
|
632
|
+
var React7 = __toESM(require("react"));
|
497
633
|
var import_react4 = require("@headlessui/react");
|
498
634
|
var DropdownMenuPrimitive = __toESM(require("@radix-ui/react-dropdown-menu"));
|
499
635
|
var DropdownMenuRoot = DropdownMenuPrimitive.Root;
|
500
636
|
var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
501
637
|
var DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
502
638
|
var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
503
|
-
var DropdownMenuSubTrigger =
|
639
|
+
var DropdownMenuSubTrigger = React7.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ React7.createElement(
|
504
640
|
DropdownMenuPrimitive.SubTrigger,
|
505
641
|
{
|
506
642
|
ref,
|
@@ -511,9 +647,9 @@ var DropdownMenuSubTrigger = React6.forwardRef(({ className, inset, children, ..
|
|
511
647
|
),
|
512
648
|
...props
|
513
649
|
},
|
514
|
-
/* @__PURE__ */
|
650
|
+
/* @__PURE__ */ React7.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-2" }, children),
|
515
651
|
" ",
|
516
|
-
/* @__PURE__ */
|
652
|
+
/* @__PURE__ */ React7.createElement(
|
517
653
|
"svg",
|
518
654
|
{
|
519
655
|
"aria-label": "Chevron Right Icon",
|
@@ -525,7 +661,7 @@ var DropdownMenuSubTrigger = React6.forwardRef(({ className, inset, children, ..
|
|
525
661
|
width: "1em",
|
526
662
|
className: cn(props.dir === "rtl" ? "hawa-rotate-180" : "")
|
527
663
|
},
|
528
|
-
/* @__PURE__ */
|
664
|
+
/* @__PURE__ */ React7.createElement(
|
529
665
|
"path",
|
530
666
|
{
|
531
667
|
fillRule: "evenodd",
|
@@ -535,7 +671,7 @@ var DropdownMenuSubTrigger = React6.forwardRef(({ className, inset, children, ..
|
|
535
671
|
)
|
536
672
|
));
|
537
673
|
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
538
|
-
var DropdownMenuSubContent =
|
674
|
+
var DropdownMenuSubContent = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React7.createElement(
|
539
675
|
DropdownMenuPrimitive.SubContent,
|
540
676
|
{
|
541
677
|
ref,
|
@@ -547,21 +683,21 @@ var DropdownMenuSubContent = React6.forwardRef(({ className, ...props }, ref) =>
|
|
547
683
|
}
|
548
684
|
));
|
549
685
|
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
550
|
-
var DropdownMenuContent =
|
686
|
+
var DropdownMenuContent = React7.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ React7.createElement(import_react4.Portal, null, /* @__PURE__ */ React7.createElement(
|
551
687
|
DropdownMenuPrimitive.Content,
|
552
688
|
{
|
553
689
|
ref,
|
554
690
|
sideOffset,
|
555
691
|
className: cn(
|
556
|
-
"hawa-z-50
|
692
|
+
"hawa-z-50 hawa-overflow-hidden hawa-rounded-md hawa-border hawa-bg-popover hawa-p-1 hawa-text-popover-foreground hawa-shadow-md data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=open]:hawa-fade-in-0 data-[state=closed]:hawa-zoom-out-95 data-[state=open]:hawa-zoom-in-95 data-[side=bottom]:hawa-slide-in-from-top-2 data-[side=left]:hawa-slide-in-from-right-2 data-[side=right]:hawa-slide-in-from-left-2 data-[side=top]:hawa-slide-in-from-bottom-2",
|
557
693
|
className
|
558
694
|
),
|
559
695
|
...props
|
560
696
|
}
|
561
697
|
)));
|
562
698
|
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
563
|
-
var DropdownMenuItem =
|
564
|
-
return /* @__PURE__ */
|
699
|
+
var DropdownMenuItem = React7.forwardRef(({ className, inset, badged, slug, LinkComponent = "a", ...props }, ref) => {
|
700
|
+
return /* @__PURE__ */ React7.createElement(LinkComponent, { href: slug }, /* @__PURE__ */ React7.createElement(
|
565
701
|
DropdownMenuPrimitive.Item,
|
566
702
|
{
|
567
703
|
disabled: props.disabled,
|
@@ -574,14 +710,14 @@ var DropdownMenuItem = React6.forwardRef(({ className, inset, badged, slug, Link
|
|
574
710
|
),
|
575
711
|
...props
|
576
712
|
},
|
577
|
-
/* @__PURE__ */
|
713
|
+
/* @__PURE__ */ React7.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-2" }, props.children),
|
578
714
|
props.end && props.end,
|
579
|
-
!props.end && props.shortcut && /* @__PURE__ */
|
580
|
-
!props.end && badged && /* @__PURE__ */
|
715
|
+
!props.end && props.shortcut && /* @__PURE__ */ React7.createElement(DropdownMenuShortcut, null, props.shortcut),
|
716
|
+
!props.end && badged && /* @__PURE__ */ React7.createElement("div", { className: "hawa-h-3 hawa-w-3 hawa-rounded-full hawa-bg-red-500" })
|
581
717
|
));
|
582
718
|
});
|
583
719
|
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
584
|
-
var DropdownMenuCheckboxItem =
|
720
|
+
var DropdownMenuCheckboxItem = React7.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ React7.createElement(
|
585
721
|
DropdownMenuPrimitive.CheckboxItem,
|
586
722
|
{
|
587
723
|
ref,
|
@@ -592,7 +728,7 @@ var DropdownMenuCheckboxItem = React6.forwardRef(({ className, children, checked
|
|
592
728
|
checked,
|
593
729
|
...props
|
594
730
|
},
|
595
|
-
/* @__PURE__ */
|
731
|
+
/* @__PURE__ */ React7.createElement("span", { className: "hawa-absolute hawa-left-2 hawa-flex hawa-h-3.5 hawa-w-3.5 hawa-items-center hawa-justify-center" }, /* @__PURE__ */ React7.createElement(DropdownMenuPrimitive.ItemIndicator, null, /* @__PURE__ */ React7.createElement(
|
596
732
|
"svg",
|
597
733
|
{
|
598
734
|
"aria-label": "Check Mark",
|
@@ -603,12 +739,12 @@ var DropdownMenuCheckboxItem = React6.forwardRef(({ className, children, checked
|
|
603
739
|
height: "0.60em",
|
604
740
|
width: "0.60em"
|
605
741
|
},
|
606
|
-
/* @__PURE__ */
|
742
|
+
/* @__PURE__ */ React7.createElement("path", { d: "M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z" })
|
607
743
|
), " ")),
|
608
744
|
children
|
609
745
|
));
|
610
746
|
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
611
|
-
var DropdownMenuRadioItem =
|
747
|
+
var DropdownMenuRadioItem = React7.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ React7.createElement(
|
612
748
|
DropdownMenuPrimitive.RadioItem,
|
613
749
|
{
|
614
750
|
ref,
|
@@ -618,7 +754,7 @@ var DropdownMenuRadioItem = React6.forwardRef(({ className, children, ...props }
|
|
618
754
|
),
|
619
755
|
...props
|
620
756
|
},
|
621
|
-
/* @__PURE__ */
|
757
|
+
/* @__PURE__ */ React7.createElement("span", { className: "hawa-absolute hawa-left-2 hawa-flex hawa-h-3.5 hawa-w-3.5 hawa-items-center hawa-justify-center" }, /* @__PURE__ */ React7.createElement(DropdownMenuPrimitive.ItemIndicator, null, /* @__PURE__ */ React7.createElement(
|
622
758
|
"svg",
|
623
759
|
{
|
624
760
|
xmlns: "http://www.w3.org/2000/svg",
|
@@ -633,12 +769,12 @@ var DropdownMenuRadioItem = React6.forwardRef(({ className, children, ...props }
|
|
633
769
|
strokeLinejoin: "round",
|
634
770
|
className: "hawa-h-2 hawa-w-2 hawa-fill-current"
|
635
771
|
},
|
636
|
-
/* @__PURE__ */
|
772
|
+
/* @__PURE__ */ React7.createElement("circle", { cx: "12", cy: "12", r: "10" })
|
637
773
|
))),
|
638
774
|
children
|
639
775
|
));
|
640
776
|
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
641
|
-
var DropdownMenuLabel =
|
777
|
+
var DropdownMenuLabel = React7.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ React7.createElement(
|
642
778
|
DropdownMenuPrimitive.Label,
|
643
779
|
{
|
644
780
|
ref,
|
@@ -651,7 +787,7 @@ var DropdownMenuLabel = React6.forwardRef(({ className, inset, ...props }, ref)
|
|
651
787
|
}
|
652
788
|
));
|
653
789
|
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
654
|
-
var DropdownMenuSeparator =
|
790
|
+
var DropdownMenuSeparator = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React7.createElement(
|
655
791
|
DropdownMenuPrimitive.Separator,
|
656
792
|
{
|
657
793
|
ref,
|
@@ -664,7 +800,7 @@ var DropdownMenuShortcut = ({
|
|
664
800
|
className,
|
665
801
|
...props
|
666
802
|
}) => {
|
667
|
-
return /* @__PURE__ */
|
803
|
+
return /* @__PURE__ */ React7.createElement(
|
668
804
|
"span",
|
669
805
|
{
|
670
806
|
className: cn(
|
@@ -706,10 +842,10 @@ var DropdownMenu = ({
|
|
706
842
|
default: "hawa-px-2 hawa-py-3 ",
|
707
843
|
sm: "hawa-text-xs hawa-px-1.5 hawa-py-1.5 "
|
708
844
|
};
|
709
|
-
let [values, setValues] =
|
845
|
+
let [values, setValues] = React7.useState(
|
710
846
|
items.map((item) => item.currentOption)
|
711
847
|
);
|
712
|
-
return /* @__PURE__ */
|
848
|
+
return /* @__PURE__ */ React7.createElement(
|
713
849
|
DropdownMenuRoot,
|
714
850
|
{
|
715
851
|
onOpenChange,
|
@@ -717,7 +853,7 @@ var DropdownMenu = ({
|
|
717
853
|
modal: false,
|
718
854
|
dir: direction
|
719
855
|
},
|
720
|
-
/* @__PURE__ */
|
856
|
+
/* @__PURE__ */ React7.createElement(
|
721
857
|
DropdownMenuTrigger,
|
722
858
|
{
|
723
859
|
asChild: true,
|
@@ -726,7 +862,7 @@ var DropdownMenu = ({
|
|
726
862
|
},
|
727
863
|
trigger
|
728
864
|
),
|
729
|
-
/* @__PURE__ */
|
865
|
+
/* @__PURE__ */ React7.createElement(import_react4.Portal, null, /* @__PURE__ */ React7.createElement(
|
730
866
|
DropdownMenuContent,
|
731
867
|
{
|
732
868
|
side,
|
@@ -748,7 +884,7 @@ var DropdownMenu = ({
|
|
748
884
|
var _a;
|
749
885
|
const ItemLinkComponent = item.slug ? LinkComponent : "a";
|
750
886
|
if (item.itemType === "separator") {
|
751
|
-
return /* @__PURE__ */
|
887
|
+
return /* @__PURE__ */ React7.createElement(
|
752
888
|
DropdownMenuSeparator,
|
753
889
|
{
|
754
890
|
key: index,
|
@@ -756,10 +892,10 @@ var DropdownMenu = ({
|
|
756
892
|
}
|
757
893
|
);
|
758
894
|
} else if (item.itemType === "label") {
|
759
|
-
return /* @__PURE__ */
|
895
|
+
return /* @__PURE__ */ React7.createElement(DropdownMenuLabel, { key: index }, item.label);
|
760
896
|
} else if (item.itemType === "radio") {
|
761
897
|
let dd = item.currentOption;
|
762
|
-
return /* @__PURE__ */
|
898
|
+
return /* @__PURE__ */ React7.createElement(DropdownMenuSub, { key: index }, /* @__PURE__ */ React7.createElement(
|
763
899
|
DropdownMenuSubTrigger,
|
764
900
|
{
|
765
901
|
dir: direction,
|
@@ -767,7 +903,7 @@ var DropdownMenu = ({
|
|
767
903
|
},
|
768
904
|
item.icon && item.icon,
|
769
905
|
item.label && item.label
|
770
|
-
), /* @__PURE__ */
|
906
|
+
), /* @__PURE__ */ React7.createElement(DropdownMenuSubContent, null, /* @__PURE__ */ React7.createElement(
|
771
907
|
DropdownMenuRadioGroup,
|
772
908
|
{
|
773
909
|
value: values[index],
|
@@ -781,12 +917,12 @@ var DropdownMenu = ({
|
|
781
917
|
}
|
782
918
|
}
|
783
919
|
},
|
784
|
-
(_a = item.options) == null ? void 0 : _a.map((opt, i) => /* @__PURE__ */
|
920
|
+
(_a = item.options) == null ? void 0 : _a.map((opt, i) => /* @__PURE__ */ React7.createElement(DropdownMenuRadioItem, { key: i, value: opt.value }, opt.label))
|
785
921
|
)));
|
786
922
|
} else if (item.itemType === "custom") {
|
787
|
-
return /* @__PURE__ */
|
923
|
+
return /* @__PURE__ */ React7.createElement("div", { key: index }, item.content);
|
788
924
|
} else {
|
789
|
-
return item.subitems ? /* @__PURE__ */
|
925
|
+
return item.subitems ? /* @__PURE__ */ React7.createElement(DropdownMenuSub, { key: index }, /* @__PURE__ */ React7.createElement(
|
790
926
|
DropdownMenuSubTrigger,
|
791
927
|
{
|
792
928
|
dir: direction,
|
@@ -794,9 +930,9 @@ var DropdownMenu = ({
|
|
794
930
|
},
|
795
931
|
item.icon && item.icon,
|
796
932
|
item.label && item.label
|
797
|
-
), /* @__PURE__ */
|
933
|
+
), /* @__PURE__ */ React7.createElement(import_react4.Portal, null, /* @__PURE__ */ React7.createElement(DropdownMenuSubContent, null, item.subitems.map((subitem, subIndex) => {
|
798
934
|
const SubitemLinkComponent = subitem.slug ? LinkComponent : "a";
|
799
|
-
return /* @__PURE__ */
|
935
|
+
return /* @__PURE__ */ React7.createElement(
|
800
936
|
DropdownMenuItem,
|
801
937
|
{
|
802
938
|
key: subIndex,
|
@@ -825,7 +961,7 @@ var DropdownMenu = ({
|
|
825
961
|
subitem.icon && subitem.icon,
|
826
962
|
subitem.label && subitem.label
|
827
963
|
);
|
828
|
-
})))) : /* @__PURE__ */
|
964
|
+
})))) : /* @__PURE__ */ React7.createElement(
|
829
965
|
DropdownMenuItem,
|
830
966
|
{
|
831
967
|
LinkComponent: ItemLinkComponent,
|
@@ -865,7 +1001,7 @@ var DropdownMenu = ({
|
|
865
1001
|
badged: item.badged,
|
866
1002
|
className: cn(
|
867
1003
|
sizeStyles[size],
|
868
|
-
!item.icon && !item.label ? "hawa-px-0 hawa-py-0 focus:hawa-bg-transparent
|
1004
|
+
!item.icon && !item.label ? "hawa-px-0 hawa-py-0 focus:hawa-bg-transparent" : "focus:hawa-bg-accent",
|
869
1005
|
item.presist && "focus:hawa-bg-transparent",
|
870
1006
|
classNames == null ? void 0 : classNames.item
|
871
1007
|
)
|
@@ -974,7 +1110,7 @@ var Input = (0, import_react6.forwardRef)(
|
|
974
1110
|
)
|
975
1111
|
},
|
976
1112
|
props.label && /* @__PURE__ */ import_react6.default.createElement(Label, { ...labelProps }, props.label),
|
977
|
-
/* @__PURE__ */ import_react6.default.createElement("div", { className: "hawa-flex hawa-flex-row hawa-w-full hawa-items-center
|
1113
|
+
/* @__PURE__ */ import_react6.default.createElement("div", { className: "hawa-flex hawa-flex-row hawa-w-full hawa-items-center" }, props.outsidePrefix && /* @__PURE__ */ import_react6.default.createElement(
|
978
1114
|
"span",
|
979
1115
|
{
|
980
1116
|
className: cn(
|
@@ -1040,7 +1176,7 @@ var Input = (0, import_react6.forwardRef)(
|
|
1040
1176
|
...inputProps,
|
1041
1177
|
className: cn(
|
1042
1178
|
defaultInputStyle,
|
1043
|
-
"
|
1179
|
+
"focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-0 dark:hawa-text-white",
|
1044
1180
|
{
|
1045
1181
|
"hawa-pe-9": props.endIcon,
|
1046
1182
|
"hawa-ps-9": props.startIcon,
|
@@ -1054,7 +1190,7 @@ var Input = (0, import_react6.forwardRef)(
|
|
1054
1190
|
"div",
|
1055
1191
|
{
|
1056
1192
|
className: cn(
|
1057
|
-
"hawa-absolute hawa-end-0 hawa-top-[47px] hawa-z-20 hawa-translate-y-1/2 hawa-rounded hawa-bg-background hawa-text-start
|
1193
|
+
"hawa-absolute hawa-end-0 hawa-top-[47px] hawa-z-20 hawa-translate-y-1/2 hawa-rounded hawa-bg-background hawa-text-start hawa-text-xs hawa-text-helper-color hawa-drop-shadow-md hawa-transition-all",
|
1058
1194
|
props.helperText ? "hawa-border hawa-p-1" : "hawa-border-none hawa-p-0"
|
1059
1195
|
)
|
1060
1196
|
},
|
@@ -1080,8 +1216,8 @@ var Input = (0, import_react6.forwardRef)(
|
|
1080
1216
|
);
|
1081
1217
|
|
1082
1218
|
// elements/table/Table.tsx
|
1083
|
-
var
|
1084
|
-
var Table =
|
1219
|
+
var React10 = __toESM(require("react"));
|
1220
|
+
var Table = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React10.createElement("div", { className: "hawa-relative hawa-w-full hawa-overflow-auto hawa-rounded hawa-border" }, /* @__PURE__ */ React10.createElement(
|
1085
1221
|
"table",
|
1086
1222
|
{
|
1087
1223
|
ref,
|
@@ -1089,7 +1225,7 @@ var Table = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
1089
1225
|
...props
|
1090
1226
|
}
|
1091
1227
|
)));
|
1092
|
-
var TableHeader =
|
1228
|
+
var TableHeader = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React10.createElement(
|
1093
1229
|
"thead",
|
1094
1230
|
{
|
1095
1231
|
ref,
|
@@ -1097,18 +1233,18 @@ var TableHeader = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
1097
1233
|
...props
|
1098
1234
|
}
|
1099
1235
|
));
|
1100
|
-
var TableHead =
|
1101
|
-
({ className, condensed, clickable, dir, ...props }, ref) => /* @__PURE__ */
|
1236
|
+
var TableHead = React10.forwardRef(
|
1237
|
+
({ className, condensed, clickable, dir, ...props }, ref) => /* @__PURE__ */ React10.createElement(
|
1102
1238
|
"th",
|
1103
1239
|
{
|
1104
1240
|
ref,
|
1105
1241
|
className: cn(
|
1106
|
-
"hawa-bg-muted/60 hawa-text-start hawa-align-middle hawa-font-medium hawa-text-muted-foreground dark:hawa-bg-muted/40 [&:has([role=checkbox])]:hawa-pr-0 [&:not(:last-child)&:not(:first-child)]:hawa-border-x",
|
1242
|
+
"hawa-bg-muted/60 hawa-text-nowrap hawa-text-start hawa-align-middle hawa-font-medium hawa-text-muted-foreground dark:hawa-bg-muted/40 [&:has([role=checkbox])]:hawa-pr-0 [&:not(:last-child)&:not(:first-child)]:hawa-border-x",
|
1107
1243
|
dir === "rtl" ? "[&:not(:last-child)]:hawa-border-l" : "[&:not(:last-child)]:hawa-border-r",
|
1108
1244
|
condensed ? "hawa-h-8" : "hawa-h-12",
|
1109
1245
|
clickable ? "hawa-px-1" : "hawa-px-4",
|
1110
1246
|
//First and last columns
|
1111
|
-
clickable ? "
|
1247
|
+
clickable ? "[&:not(:last-child)&:not(:first-child)]:hawa-p-1" : "hawa-px-4",
|
1112
1248
|
//Columns in between
|
1113
1249
|
className
|
1114
1250
|
),
|
@@ -1116,8 +1252,8 @@ var TableHead = React9.forwardRef(
|
|
1116
1252
|
}
|
1117
1253
|
)
|
1118
1254
|
);
|
1119
|
-
var TableBody =
|
1120
|
-
var TableFooter =
|
1255
|
+
var TableBody = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React10.createElement("tbody", { ref, className: cn("hawa-border-none", className), ...props }));
|
1256
|
+
var TableFooter = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React10.createElement(
|
1121
1257
|
"tfoot",
|
1122
1258
|
{
|
1123
1259
|
ref,
|
@@ -1128,7 +1264,7 @@ var TableFooter = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
1128
1264
|
...props
|
1129
1265
|
}
|
1130
1266
|
));
|
1131
|
-
var TableRow =
|
1267
|
+
var TableRow = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React10.createElement(
|
1132
1268
|
"tr",
|
1133
1269
|
{
|
1134
1270
|
ref,
|
@@ -1141,14 +1277,14 @@ var TableRow = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
1141
1277
|
...props
|
1142
1278
|
}
|
1143
1279
|
));
|
1144
|
-
var TableCell =
|
1280
|
+
var TableCell = React10.forwardRef(
|
1145
1281
|
({ className, enablePadding = true, padding = "default", ...props }, ref) => {
|
1146
1282
|
let paddingStyles = {
|
1147
1283
|
condensed: "hawa-p-0 hawa-px-4",
|
1148
1284
|
default: "hawa-p-4",
|
1149
1285
|
noPadding: "hawa-p-0"
|
1150
1286
|
};
|
1151
|
-
return /* @__PURE__ */
|
1287
|
+
return /* @__PURE__ */ React10.createElement(
|
1152
1288
|
"td",
|
1153
1289
|
{
|
1154
1290
|
ref,
|
@@ -1158,7 +1294,7 @@ var TableCell = React9.forwardRef(
|
|
1158
1294
|
// enablePadding ? "hawa-p-4" : "hawa-p-0",
|
1159
1295
|
// props.disablePadding ? "hawa-p-0" : "hawa-p-4",
|
1160
1296
|
// props.condensed ? "hawa-p-0 hawa-px-4" : "hawa-p-4",
|
1161
|
-
"hawa-align-middle [&:has([role=checkbox])]:hawa-pr-0
|
1297
|
+
"hawa-align-middle [&:has([role=checkbox])]:hawa-pr-0",
|
1162
1298
|
"[&:not(:last-child)&:not(:first-child)]:hawa-border-x",
|
1163
1299
|
// "[&:not(:last-child)]:hawa-border-r",
|
1164
1300
|
props.dir === "rtl" ? "[&:not(:last-child)]:hawa-border-l" : "[&:not(:last-child)]:hawa-border-r",
|
@@ -1169,7 +1305,7 @@ var TableCell = React9.forwardRef(
|
|
1169
1305
|
);
|
1170
1306
|
}
|
1171
1307
|
);
|
1172
|
-
var TableCaption =
|
1308
|
+
var TableCaption = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React10.createElement(
|
1173
1309
|
"caption",
|
1174
1310
|
{
|
1175
1311
|
ref,
|
@@ -1197,27 +1333,61 @@ var DataTable = ({
|
|
1197
1333
|
paginationPosition = "bottom",
|
1198
1334
|
translateFn,
|
1199
1335
|
enableHideColumns,
|
1336
|
+
enableSelection,
|
1200
1337
|
enableSearch,
|
1201
1338
|
enableGoTo,
|
1202
1339
|
...props
|
1203
1340
|
}) => {
|
1204
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
1205
|
-
const [sorting, setSorting] =
|
1341
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
1342
|
+
const [sorting, setSorting] = React11.useState(
|
1206
1343
|
props.defaultSort ? [{ id: props.defaultSort, desc: false }] : []
|
1207
1344
|
);
|
1208
|
-
const [columnFilters, setColumnFilters] =
|
1345
|
+
const [columnFilters, setColumnFilters] = React11.useState(
|
1209
1346
|
[]
|
1210
1347
|
);
|
1211
|
-
const [globalFilter, setGlobalFilter] =
|
1212
|
-
const [expanded, setExpanded] =
|
1213
|
-
const [columnVisibility, setColumnVisibility] =
|
1348
|
+
const [globalFilter, setGlobalFilter] = React11.useState("");
|
1349
|
+
const [expanded, setExpanded] = React11.useState({});
|
1350
|
+
const [columnVisibility, setColumnVisibility] = React11.useState(() => {
|
1214
1351
|
const savedVisibility = localStorage.getItem(LOCAL_STORAGE_KEY);
|
1215
1352
|
return savedVisibility ? JSON.parse(savedVisibility) : {};
|
1216
1353
|
});
|
1217
|
-
const [rowSelection, setRowSelection] =
|
1354
|
+
const [rowSelection, setRowSelection] = React11.useState({});
|
1355
|
+
let mainColumns = enableSelection ? [
|
1356
|
+
{
|
1357
|
+
id: "select",
|
1358
|
+
maxSize: 16,
|
1359
|
+
minSize: 16,
|
1360
|
+
size: 16,
|
1361
|
+
header: ({ table: table2 }) => /* @__PURE__ */ React11.createElement(
|
1362
|
+
Checkbox,
|
1363
|
+
{
|
1364
|
+
dir: props.direction,
|
1365
|
+
id: "select_all",
|
1366
|
+
"aria-label": "Select all",
|
1367
|
+
className: props.direction === "rtl" ? "hawa-ms-4" : "hawa-me-0",
|
1368
|
+
checked: table2.getIsAllPageRowsSelected() || table2.getIsSomePageRowsSelected() && "indeterminate",
|
1369
|
+
onCheckedChange: (value) => table2.toggleAllPageRowsSelected(!!value)
|
1370
|
+
}
|
1371
|
+
),
|
1372
|
+
cell: ({ row }) => /* @__PURE__ */ React11.createElement(
|
1373
|
+
Checkbox,
|
1374
|
+
{
|
1375
|
+
dir: props.direction,
|
1376
|
+
id: "select_row",
|
1377
|
+
className: props.direction === "rtl" ? "hawa-ms-4" : "hawa-me-4",
|
1378
|
+
checked: row.getIsSelected(),
|
1379
|
+
onCheckedChange: (value) => row.toggleSelected(!!value),
|
1380
|
+
"aria-label": "Select row"
|
1381
|
+
}
|
1382
|
+
),
|
1383
|
+
enableSorting: false,
|
1384
|
+
enableHiding: false
|
1385
|
+
},
|
1386
|
+
...columns
|
1387
|
+
] : columns;
|
1218
1388
|
const table = (0, import_react_table.useReactTable)({
|
1219
1389
|
data,
|
1220
|
-
columns,
|
1390
|
+
columns: mainColumns,
|
1221
1391
|
onExpandedChange: setExpanded,
|
1222
1392
|
getExpandedRowModel: (0, import_react_table.getExpandedRowModel)(),
|
1223
1393
|
onGlobalFilterChange: setGlobalFilter,
|
@@ -1243,10 +1413,10 @@ var DataTable = ({
|
|
1243
1413
|
label: `${item} / ${pageText}`,
|
1244
1414
|
value: item
|
1245
1415
|
}));
|
1246
|
-
|
1416
|
+
React11.useEffect(() => {
|
1247
1417
|
localStorage.setItem(LOCAL_STORAGE_KEY, JSON.stringify(columnVisibility));
|
1248
1418
|
}, [columnVisibility]);
|
1249
|
-
|
1419
|
+
React11.useEffect(() => {
|
1250
1420
|
setColumnVisibility((prev) => {
|
1251
1421
|
let newColumnVisibility = {};
|
1252
1422
|
columns.forEach((column) => {
|
@@ -1261,7 +1431,7 @@ var DataTable = ({
|
|
1261
1431
|
return newColumnVisibility;
|
1262
1432
|
});
|
1263
1433
|
}, [columns]);
|
1264
|
-
return /* @__PURE__ */
|
1434
|
+
return /* @__PURE__ */ React11.createElement("div", { className: "hawa-flex hawa-w-full hawa-flex-col hawa-gap-4" }, (enableSearch || enableHideColumns) && /* @__PURE__ */ React11.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-4" }, enableSearch && /* @__PURE__ */ React11.createElement(
|
1265
1435
|
Input,
|
1266
1436
|
{
|
1267
1437
|
inputProps: { title: "" },
|
@@ -1272,7 +1442,7 @@ var DataTable = ({
|
|
1272
1442
|
margin: "none",
|
1273
1443
|
className: "hawa-w-full md:hawa-max-w-sm",
|
1274
1444
|
endIconProps: { className: "!hawa-end-2" },
|
1275
|
-
endIcon: globalFilter ? /* @__PURE__ */
|
1445
|
+
endIcon: globalFilter ? /* @__PURE__ */ React11.createElement(
|
1276
1446
|
Button,
|
1277
1447
|
{
|
1278
1448
|
onClick: () => setGlobalFilter(""),
|
@@ -1280,7 +1450,7 @@ var DataTable = ({
|
|
1280
1450
|
size: "smallIcon",
|
1281
1451
|
"aria-label": "Clear Search"
|
1282
1452
|
},
|
1283
|
-
/* @__PURE__ */
|
1453
|
+
/* @__PURE__ */ React11.createElement(
|
1284
1454
|
"svg",
|
1285
1455
|
{
|
1286
1456
|
xmlns: "http://www.w3.org/2000/svg",
|
@@ -1294,43 +1464,45 @@ var DataTable = ({
|
|
1294
1464
|
strokeLinejoin: "round",
|
1295
1465
|
className: "hawa-icon hawa-text-muted-foreground"
|
1296
1466
|
},
|
1297
|
-
/* @__PURE__ */
|
1298
|
-
/* @__PURE__ */
|
1467
|
+
/* @__PURE__ */ React11.createElement("path", { d: "M18 6 6 18" }),
|
1468
|
+
/* @__PURE__ */ React11.createElement("path", { d: "m6 6 12 12" })
|
1299
1469
|
)
|
1300
1470
|
) : null
|
1301
1471
|
}
|
1302
|
-
), enableHideColumns && /* @__PURE__ */
|
1472
|
+
), enableHideColumns && /* @__PURE__ */ React11.createElement(DropdownMenuRoot, null, /* @__PURE__ */ React11.createElement(DropdownMenuTrigger, { asChild: true }, /* @__PURE__ */ React11.createElement(
|
1303
1473
|
Button,
|
1304
1474
|
{
|
1305
1475
|
variant: "outline",
|
1306
1476
|
className: "hawa-flex hawa-flex-row hawa-gap-2"
|
1307
1477
|
},
|
1308
1478
|
((_d = props.texts) == null ? void 0 : _d.columns) || "Columns",
|
1309
|
-
/* @__PURE__ */
|
1479
|
+
/* @__PURE__ */ React11.createElement(
|
1310
1480
|
"svg",
|
1311
1481
|
{
|
1312
|
-
|
1313
|
-
|
1314
|
-
|
1315
|
-
height: "24",
|
1316
|
-
viewBox: "0 0 24 24",
|
1482
|
+
width: "15",
|
1483
|
+
height: "15",
|
1484
|
+
viewBox: "0 0 15 15",
|
1317
1485
|
fill: "none",
|
1318
|
-
|
1319
|
-
strokeWidth: "2",
|
1320
|
-
strokeLinecap: "round",
|
1321
|
-
strokeLinejoin: "round",
|
1322
|
-
className: "hawa-icon hawa-rotate-90"
|
1486
|
+
xmlns: "http://www.w3.org/2000/svg"
|
1323
1487
|
},
|
1324
|
-
/* @__PURE__ */
|
1488
|
+
/* @__PURE__ */ React11.createElement(
|
1489
|
+
"path",
|
1490
|
+
{
|
1491
|
+
d: "M5.5 3C4.67157 3 4 3.67157 4 4.5C4 5.32843 4.67157 6 5.5 6C6.32843 6 7 5.32843 7 4.5C7 3.67157 6.32843 3 5.5 3ZM3 5C3.01671 5 3.03323 4.99918 3.04952 4.99758C3.28022 6.1399 4.28967 7 5.5 7C6.71033 7 7.71978 6.1399 7.95048 4.99758C7.96677 4.99918 7.98329 5 8 5H13.5C13.7761 5 14 4.77614 14 4.5C14 4.22386 13.7761 4 13.5 4H8C7.98329 4 7.96677 4.00082 7.95048 4.00242C7.71978 2.86009 6.71033 2 5.5 2C4.28967 2 3.28022 2.86009 3.04952 4.00242C3.03323 4.00082 3.01671 4 3 4H1.5C1.22386 4 1 4.22386 1 4.5C1 4.77614 1.22386 5 1.5 5H3ZM11.9505 10.9976C11.7198 12.1399 10.7103 13 9.5 13C8.28967 13 7.28022 12.1399 7.04952 10.9976C7.03323 10.9992 7.01671 11 7 11H1.5C1.22386 11 1 10.7761 1 10.5C1 10.2239 1.22386 10 1.5 10H7C7.01671 10 7.03323 10.0008 7.04952 10.0024C7.28022 8.8601 8.28967 8 9.5 8C10.7103 8 11.7198 8.8601 11.9505 10.0024C11.9668 10.0008 11.9833 10 12 10H13.5C13.7761 10 14 10.2239 14 10.5C14 10.7761 13.7761 11 13.5 11H12C11.9833 11 11.9668 10.9992 11.9505 10.9976ZM8 10.5C8 9.67157 8.67157 9 9.5 9C10.3284 9 11 9.67157 11 10.5C11 11.3284 10.3284 12 9.5 12C8.67157 12 8 11.3284 8 10.5Z",
|
1492
|
+
fill: "currentColor",
|
1493
|
+
"fill-rule": "evenodd",
|
1494
|
+
"clip-rule": "evenodd"
|
1495
|
+
}
|
1496
|
+
)
|
1325
1497
|
)
|
1326
|
-
)), /* @__PURE__ */
|
1498
|
+
)), /* @__PURE__ */ React11.createElement(
|
1327
1499
|
DropdownMenuContent,
|
1328
1500
|
{
|
1329
1501
|
align: props.direction === "rtl" ? "start" : "end"
|
1330
1502
|
},
|
1331
1503
|
table.getAllColumns().filter((column) => column.getCanHide()).map((column) => {
|
1332
1504
|
var _a2, _b2;
|
1333
|
-
return /* @__PURE__ */
|
1505
|
+
return /* @__PURE__ */ React11.createElement(
|
1334
1506
|
DropdownMenuCheckboxItem,
|
1335
1507
|
{
|
1336
1508
|
key: column.id,
|
@@ -1342,26 +1514,28 @@ var DataTable = ({
|
|
1342
1514
|
) : column.id
|
1343
1515
|
);
|
1344
1516
|
})
|
1345
|
-
))), props.isLoading ? /* @__PURE__ */
|
1517
|
+
))), props.isLoading ? /* @__PURE__ */ React11.createElement(Skeleton, { className: "hawa-h-[130px] hawa-w-full" }) : /* @__PURE__ */ React11.createElement(
|
1346
1518
|
"div",
|
1347
1519
|
{
|
1348
1520
|
className: cn(
|
1349
|
-
"hawa-flex hawa-w-full
|
1521
|
+
"hawa-flex hawa-w-full hawa-gap-4",
|
1350
1522
|
paginationPosition === "top" ? "hawa-flex-col-reverse" : "hawa-flex-col"
|
1351
1523
|
)
|
1352
1524
|
},
|
1353
|
-
/* @__PURE__ */
|
1525
|
+
/* @__PURE__ */ React11.createElement("div", { className: "hawa-rounded-md" }, /* @__PURE__ */ React11.createElement(Table, null, !props.hideHeader && table.getAllColumns().length > 0 && /* @__PURE__ */ React11.createElement(TableHeader, null, table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ React11.createElement(TableRow, { key: headerGroup.id }, headerGroup.headers.map((header) => {
|
1354
1526
|
var _a2;
|
1355
1527
|
let isSortable = (_a2 = header.column.columnDef.meta) == null ? void 0 : _a2.sortable;
|
1356
|
-
return /* @__PURE__ */
|
1528
|
+
return /* @__PURE__ */ React11.createElement(
|
1357
1529
|
TableHead,
|
1358
1530
|
{
|
1531
|
+
key: header.id,
|
1359
1532
|
dir: props.direction,
|
1360
1533
|
condensed: props.condensed,
|
1361
1534
|
clickable: Boolean(isSortable),
|
1362
|
-
key: header.id,
|
1363
1535
|
style: {
|
1364
|
-
maxWidth: header.column.columnDef.maxSize
|
1536
|
+
maxWidth: `${header.column.columnDef.maxSize}px !important`,
|
1537
|
+
minWidth: `${header.column.columnDef.minSize}px !important`,
|
1538
|
+
width: `${header.column.columnDef.size}px !important`
|
1365
1539
|
}
|
1366
1540
|
},
|
1367
1541
|
header.isPlaceholder ? null : (0, import_react_table.flexRender)(
|
@@ -1369,7 +1543,7 @@ var DataTable = ({
|
|
1369
1543
|
header.getContext()
|
1370
1544
|
)
|
1371
1545
|
);
|
1372
|
-
})))), /* @__PURE__ */
|
1546
|
+
})))), /* @__PURE__ */ React11.createElement(TableBody, null, ((_e = table.getRowModel().rows) == null ? void 0 : _e.length) ? table.getRowModel().rows.map((row) => /* @__PURE__ */ React11.createElement(
|
1373
1547
|
TableRow,
|
1374
1548
|
{
|
1375
1549
|
key: row.id,
|
@@ -1377,15 +1551,17 @@ var DataTable = ({
|
|
1377
1551
|
},
|
1378
1552
|
row.getVisibleCells().map((cell) => {
|
1379
1553
|
var _a2;
|
1380
|
-
return /* @__PURE__ */
|
1554
|
+
return /* @__PURE__ */ React11.createElement(
|
1381
1555
|
TableCell,
|
1382
1556
|
{
|
1557
|
+
key: cell.id,
|
1558
|
+
dir: props.direction,
|
1383
1559
|
style: {
|
1384
|
-
maxWidth: cell.column.columnDef.maxSize
|
1560
|
+
maxWidth: `${cell.column.columnDef.maxSize}px !important`,
|
1561
|
+
minWidth: `${cell.column.columnDef.minSize}px !important`,
|
1562
|
+
width: `${cell.column.columnDef.size}px !important`
|
1385
1563
|
},
|
1386
|
-
|
1387
|
-
padding: props.condensed ? "condensed" : (_a2 = cell.column.columnDef.meta) == null ? void 0 : _a2.padding,
|
1388
|
-
key: cell.id
|
1564
|
+
padding: props.condensed ? "condensed" : (_a2 = cell.column.columnDef.meta) == null ? void 0 : _a2.padding
|
1389
1565
|
},
|
1390
1566
|
(0, import_react_table.flexRender)(
|
1391
1567
|
cell.column.columnDef.cell,
|
@@ -1393,7 +1569,7 @@ var DataTable = ({
|
|
1393
1569
|
)
|
1394
1570
|
);
|
1395
1571
|
})
|
1396
|
-
)) : /* @__PURE__ */
|
1572
|
+
)) : /* @__PURE__ */ React11.createElement(TableRow, null, /* @__PURE__ */ React11.createElement(
|
1397
1573
|
TableCell,
|
1398
1574
|
{
|
1399
1575
|
colSpan: columns.length,
|
@@ -1401,169 +1577,207 @@ var DataTable = ({
|
|
1401
1577
|
},
|
1402
1578
|
(_f = props.texts) == null ? void 0 : _f.noData
|
1403
1579
|
))))),
|
1404
|
-
/* @__PURE__ */
|
1580
|
+
/* @__PURE__ */ React11.createElement(
|
1405
1581
|
"div",
|
1406
1582
|
{
|
1407
|
-
className: "text-muted-foreground text-sm",
|
1408
|
-
dir: props.direction
|
1409
|
-
},
|
1410
|
-
/* @__PURE__ */ React10.createElement("span", null, (_g = props.texts) == null ? void 0 : _g.total),
|
1411
|
-
" ",
|
1412
|
-
/* @__PURE__ */ React10.createElement("span", null, table.getFilteredRowModel().rows.length.toLocaleString())
|
1413
|
-
), /* @__PURE__ */ React10.createElement("div", { className: "hawa-flex hawa-w-fit hawa-flex-row hawa-items-center hawa-gap-2 " }, enableGoTo && /* @__PURE__ */ React10.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-justify-center hawa-gap-2" }, /* @__PURE__ */ React10.createElement("span", { className: "hawa-text-sm" }, (_h = props.texts) == null ? void 0 : _h.goTo), /* @__PURE__ */ React10.createElement(
|
1414
|
-
"input",
|
1415
|
-
{
|
1416
|
-
max: table.getPageCount(),
|
1417
|
-
min: 0,
|
1418
|
-
type: "number",
|
1419
|
-
defaultValue: table.getState().pagination.pageIndex + 1,
|
1420
|
-
onChange: (e) => {
|
1421
|
-
let page = Number(e.target.value) - 1;
|
1422
|
-
const max = table.getPageCount();
|
1423
|
-
if (!isNaN(page) && Number(page) > max) {
|
1424
|
-
page = max - 1;
|
1425
|
-
}
|
1426
|
-
table.setPageIndex(page);
|
1427
|
-
},
|
1428
|
-
className: "hawa-w-16 hawa-rounded hawa-border hawa-p-1 hawa-px-2 hawa-text-sm placeholder:hawa-text-muted-foreground"
|
1429
|
-
}
|
1430
|
-
)), /* @__PURE__ */ React10.createElement(
|
1431
|
-
DropdownMenu,
|
1432
|
-
{
|
1433
|
-
size: "sm",
|
1434
|
-
width: "sm",
|
1435
|
-
direction: props.direction,
|
1436
|
-
items: itemsPerPageOptions || [
|
1437
|
-
{ label: `10 / ${pageText}`, value: 10 },
|
1438
|
-
{ label: `20 / ${pageText}`, value: 20 },
|
1439
|
-
{ label: `30 / ${pageText}`, value: 30 },
|
1440
|
-
{ label: `40 / ${pageText}`, value: 40 },
|
1441
|
-
{ label: `50 / ${pageText}`, value: 50 }
|
1442
|
-
],
|
1443
|
-
trigger: /* @__PURE__ */ React10.createElement(
|
1444
|
-
Button,
|
1445
|
-
{
|
1446
|
-
variant: "outline",
|
1447
|
-
size: "icon",
|
1448
|
-
className: "hawa-h-fit hawa-w-fit hawa-p-0 hawa-px-2 hawa-py-1 "
|
1449
|
-
},
|
1450
|
-
`${table.getState().pagination.pageSize} / ${(_i = props.texts) == null ? void 0 : _i.page}`
|
1451
|
-
),
|
1452
|
-
onItemSelect: (e) => table.setPageSize(Number(e))
|
1453
|
-
}
|
1454
|
-
), table.getPageCount() > 1 && /* @__PURE__ */ React10.createElement(React10.Fragment, null, /* @__PURE__ */ React10.createElement("div", { className: "hawa-flex hawa-w-fit hawa-flex-row hawa-items-center hawa-gap-2 hawa-text-sm " }, /* @__PURE__ */ React10.createElement("span", { className: "hawa-flex hawa-items-center hawa-gap-1" }, /* @__PURE__ */ React10.createElement("div", null, (_j = props.texts) == null ? void 0 : _j.page), /* @__PURE__ */ React10.createElement("div", { className: "hawa-flex hawa-flex-row hawa-gap-1" }, /* @__PURE__ */ React10.createElement("span", { className: "hawa-font-bold" }, table.getState().pagination.pageIndex + 1), /* @__PURE__ */ React10.createElement("span", null, (_k = props.texts) == null ? void 0 : _k.of), /* @__PURE__ */ React10.createElement("span", { className: "hawa-font-bold" }, table.getPageCount())))), /* @__PURE__ */ React10.createElement(
|
1455
|
-
Button,
|
1456
|
-
{
|
1457
|
-
"aria-label": "Next Table Page",
|
1458
|
-
variant: "outline",
|
1459
|
-
size: "smallIcon",
|
1460
|
-
onClick: () => table.setPageIndex(0),
|
1461
|
-
disabled: !table.getCanPreviousPage(),
|
1462
1583
|
className: cn(
|
1463
|
-
|
1584
|
+
"hawa-flex hawa-justify-between hawa-gap-4 tablet:hawa-gap-0",
|
1585
|
+
props.showSelectionCount ? "hawa-flex-col tablet:hawa-flex-row" : "hawa-flex-col mobile:hawa-flex-row"
|
1464
1586
|
)
|
1465
1587
|
},
|
1466
|
-
/* @__PURE__ */
|
1467
|
-
|
1588
|
+
!props.showCount && /* @__PURE__ */ React11.createElement("div", { className: "hawa-flex hawa-w-fit hawa-flex-row hawa-items-center hawa-gap-2 hawa-text-sm hawa-text-muted-foreground" }),
|
1589
|
+
props.showCount || table.getFilteredSelectedRowModel().rows.length > 0 && props.showSelectionCount ? /* @__PURE__ */ React11.createElement("div", { className: "hawa-flex hawa-flex-row hawa-h-auto hawa-gap-4" }, /* @__PURE__ */ React11.createElement("div", { className: "hawa-flex hawa-flex-row hawa-h-auto hawa-items-center hawa-justify-between" }, props.showCount && /* @__PURE__ */ React11.createElement(
|
1590
|
+
"div",
|
1468
1591
|
{
|
1469
|
-
|
1470
|
-
|
1471
|
-
height: "20",
|
1472
|
-
viewBox: "0 0 24 24",
|
1473
|
-
fill: "none",
|
1474
|
-
stroke: "currentColor",
|
1475
|
-
strokeWidth: "2",
|
1476
|
-
strokeLinecap: "round",
|
1477
|
-
strokeLinejoin: "round"
|
1592
|
+
className: "hawa-text-muted-foreground hawa-text-sm",
|
1593
|
+
dir: props.direction
|
1478
1594
|
},
|
1479
|
-
/* @__PURE__ */
|
1480
|
-
|
1481
|
-
|
1482
|
-
|
1483
|
-
|
1484
|
-
|
1485
|
-
|
1486
|
-
|
1487
|
-
|
1488
|
-
|
1489
|
-
|
1490
|
-
|
1491
|
-
|
1595
|
+
/* @__PURE__ */ React11.createElement("span", null, (_g = props.texts) == null ? void 0 : _g.total),
|
1596
|
+
" ",
|
1597
|
+
/* @__PURE__ */ React11.createElement("span", null, table.getFilteredRowModel().rows.length.toLocaleString())
|
1598
|
+
), props.showCount && table.getFilteredSelectedRowModel().rows.length > 0 && props.showSelectionCount && /* @__PURE__ */ React11.createElement("div", { className: "hawa-w-[0.5px] hawa-mx-2 hawa-bg-red-500 hawa-h-full" }), table.getFilteredSelectedRowModel().rows.length > 0 && props.showSelectionCount && /* @__PURE__ */ React11.createElement(
|
1599
|
+
"div",
|
1600
|
+
{
|
1601
|
+
className: "hawa-text-muted-foreground hawa-text-sm",
|
1602
|
+
dir: props.direction
|
1603
|
+
},
|
1604
|
+
table.getFilteredSelectedRowModel().rows.length,
|
1605
|
+
" ",
|
1606
|
+
(_h = props.texts) == null ? void 0 : _h.of,
|
1607
|
+
" ",
|
1608
|
+
table.getFilteredRowModel().rows.length,
|
1609
|
+
" ",
|
1610
|
+
(_i = props.texts) == null ? void 0 : _i.selectedRows
|
1611
|
+
)), table.getFilteredSelectedRowModel().rows.length > 0 && /* @__PURE__ */ React11.createElement("div", { className: "" }, /* @__PURE__ */ React11.createElement(
|
1612
|
+
DropdownMenu,
|
1613
|
+
{
|
1614
|
+
size: "sm",
|
1615
|
+
width: "sm",
|
1616
|
+
direction: props.direction,
|
1617
|
+
items: (props.bulkActions || []).map((action) => ({
|
1618
|
+
...action,
|
1619
|
+
action: () => action.action(
|
1620
|
+
table.getFilteredSelectedRowModel().rows
|
1621
|
+
)
|
1622
|
+
})),
|
1623
|
+
trigger: /* @__PURE__ */ React11.createElement(Button, { size: "xs" }, ((_j = props.texts) == null ? void 0 : _j.bulkAction) || "Bulk Action")
|
1624
|
+
}
|
1625
|
+
))) : null,
|
1626
|
+
/* @__PURE__ */ React11.createElement("div", { className: "hawa-flex hawa-w-full hawa-flex-row hawa-items-center hawa-gap-2 hawa-bg--500 tablet:hawa-w-fit hawa-justify-between" }, enableGoTo && /* @__PURE__ */ React11.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-justify-center hawa-gap-2" }, /* @__PURE__ */ React11.createElement("span", { className: "hawa-text-sm" }, (_k = props.texts) == null ? void 0 : _k.goTo), /* @__PURE__ */ React11.createElement(
|
1627
|
+
"input",
|
1628
|
+
{
|
1629
|
+
max: table.getPageCount(),
|
1630
|
+
min: 0,
|
1631
|
+
type: "number",
|
1632
|
+
defaultValue: table.getState().pagination.pageIndex + 1,
|
1633
|
+
onChange: (e) => {
|
1634
|
+
let page = Number(e.target.value) - 1;
|
1635
|
+
const max = table.getPageCount();
|
1636
|
+
if (!isNaN(page) && Number(page) > max) {
|
1637
|
+
page = max - 1;
|
1638
|
+
}
|
1639
|
+
table.setPageIndex(page);
|
1640
|
+
},
|
1641
|
+
className: "hawa-w-16 hawa-rounded hawa-border hawa-p-1 hawa-px-2 hawa-text-sm placeholder:hawa-text-muted-foreground"
|
1642
|
+
}
|
1643
|
+
)), /* @__PURE__ */ React11.createElement(
|
1644
|
+
DropdownMenu,
|
1645
|
+
{
|
1646
|
+
size: "sm",
|
1647
|
+
width: "sm",
|
1648
|
+
direction: props.direction,
|
1649
|
+
items: itemsPerPageOptions || [
|
1650
|
+
{ label: `10 / ${pageText}`, value: 10 },
|
1651
|
+
{ label: `20 / ${pageText}`, value: 20 },
|
1652
|
+
{ label: `30 / ${pageText}`, value: 30 },
|
1653
|
+
{ label: `40 / ${pageText}`, value: 40 },
|
1654
|
+
{ label: `50 / ${pageText}`, value: 50 }
|
1655
|
+
],
|
1656
|
+
trigger: /* @__PURE__ */ React11.createElement(
|
1657
|
+
Button,
|
1658
|
+
{
|
1659
|
+
variant: "outline",
|
1660
|
+
size: "icon",
|
1661
|
+
className: "hawa-h-fit hawa-w-fit hawa-p-0 hawa-px-2 hawa-py-1 hawa-whitespace-nowrap"
|
1662
|
+
},
|
1663
|
+
`${table.getState().pagination.pageSize} / ${(_l = props.texts) == null ? void 0 : _l.page}`
|
1664
|
+
),
|
1665
|
+
onItemSelect: (e) => table.setPageSize(Number(e))
|
1666
|
+
}
|
1667
|
+
), table.getPageCount() > 1 && /* @__PURE__ */ React11.createElement("div", { className: "hawa-bg--500 hawa-flex hawa-flex-row hawa-gap-2" }, /* @__PURE__ */ React11.createElement("div", { className: "hawa-flex hawa-bg--500 hawa-w-fit hawa-flex-row hawa-items-center hawa-gap-2 hawa-text-sm" }, /* @__PURE__ */ React11.createElement("span", { className: "hawa-flex hawa-items-center hawa-gap-1" }, /* @__PURE__ */ React11.createElement("div", null, (_m = props.texts) == null ? void 0 : _m.page), /* @__PURE__ */ React11.createElement("div", { className: "hawa-flex hawa-flex-row hawa-gap-1" }, /* @__PURE__ */ React11.createElement("span", { className: "hawa-font-bold" }, table.getState().pagination.pageIndex + 1), /* @__PURE__ */ React11.createElement("span", null, (_n = props.texts) == null ? void 0 : _n.of), /* @__PURE__ */ React11.createElement("span", { className: "hawa-font-bold" }, table.getPageCount())))), /* @__PURE__ */ React11.createElement("div", { className: "hawa-flex hawa-flex-row hawa-gap-2 hawa-items-center hawa-bg--500" }, /* @__PURE__ */ React11.createElement(
|
1668
|
+
Button,
|
1669
|
+
{
|
1670
|
+
"aria-label": "Next Table Page",
|
1671
|
+
variant: "outline",
|
1672
|
+
size: "smallIcon",
|
1673
|
+
onClick: () => table.setPageIndex(0),
|
1674
|
+
disabled: !table.getCanPreviousPage(),
|
1675
|
+
className: cn(
|
1676
|
+
props.direction === "rtl" && "hawa-rotate-180"
|
1677
|
+
)
|
1678
|
+
},
|
1679
|
+
/* @__PURE__ */ React11.createElement(
|
1680
|
+
"svg",
|
1681
|
+
{
|
1682
|
+
xmlns: "http://www.w3.org/2000/svg",
|
1683
|
+
width: "20",
|
1684
|
+
height: "20",
|
1685
|
+
viewBox: "0 0 24 24",
|
1686
|
+
fill: "none",
|
1687
|
+
stroke: "currentColor",
|
1688
|
+
strokeWidth: "2",
|
1689
|
+
strokeLinecap: "round",
|
1690
|
+
strokeLinejoin: "round"
|
1691
|
+
},
|
1692
|
+
/* @__PURE__ */ React11.createElement("path", { d: "m11 17-5-5 5-5" }),
|
1693
|
+
/* @__PURE__ */ React11.createElement("path", { d: "m18 17-5-5 5-5" })
|
1492
1694
|
)
|
1493
|
-
|
1494
|
-
|
1495
|
-
"svg",
|
1695
|
+
), /* @__PURE__ */ React11.createElement(
|
1696
|
+
Button,
|
1496
1697
|
{
|
1497
|
-
|
1498
|
-
|
1499
|
-
|
1500
|
-
|
1501
|
-
|
1502
|
-
|
1503
|
-
|
1504
|
-
|
1505
|
-
strokeLinecap: "round",
|
1506
|
-
strokeLinejoin: "round"
|
1698
|
+
"aria-label": "Previous Table Page",
|
1699
|
+
variant: "outline",
|
1700
|
+
size: "smallIcon",
|
1701
|
+
onClick: () => table.previousPage(),
|
1702
|
+
disabled: !table.getCanPreviousPage(),
|
1703
|
+
className: cn(
|
1704
|
+
props.direction === "rtl" && "hawa-rotate-180"
|
1705
|
+
)
|
1507
1706
|
},
|
1508
|
-
/* @__PURE__ */
|
1509
|
-
|
1510
|
-
|
1511
|
-
|
1512
|
-
|
1513
|
-
|
1514
|
-
|
1515
|
-
|
1516
|
-
|
1517
|
-
|
1518
|
-
|
1519
|
-
|
1707
|
+
/* @__PURE__ */ React11.createElement(
|
1708
|
+
"svg",
|
1709
|
+
{
|
1710
|
+
xmlns: "http://www.w3.org/2000/svg",
|
1711
|
+
width: "20",
|
1712
|
+
height: "20",
|
1713
|
+
"aria-label": "Single Chevron Icon",
|
1714
|
+
viewBox: "0 0 24 24",
|
1715
|
+
fill: "none",
|
1716
|
+
stroke: "currentColor",
|
1717
|
+
strokeWidth: "2",
|
1718
|
+
strokeLinecap: "round",
|
1719
|
+
strokeLinejoin: "round"
|
1720
|
+
},
|
1721
|
+
/* @__PURE__ */ React11.createElement("path", { d: "m15 18-6-6 6-6" })
|
1520
1722
|
)
|
1521
|
-
|
1522
|
-
|
1523
|
-
"svg",
|
1723
|
+
), /* @__PURE__ */ React11.createElement(
|
1724
|
+
Button,
|
1524
1725
|
{
|
1525
|
-
|
1526
|
-
|
1527
|
-
|
1528
|
-
|
1529
|
-
|
1530
|
-
|
1531
|
-
|
1532
|
-
|
1533
|
-
strokeLinecap: "round",
|
1534
|
-
strokeLinejoin: "round"
|
1726
|
+
"aria-label": "Next Table Page",
|
1727
|
+
variant: "outline",
|
1728
|
+
size: "smallIcon",
|
1729
|
+
onClick: () => table.nextPage(),
|
1730
|
+
disabled: !table.getCanNextPage(),
|
1731
|
+
className: cn(
|
1732
|
+
props.direction === "ltr" && "hawa-rotate-180"
|
1733
|
+
)
|
1535
1734
|
},
|
1536
|
-
/* @__PURE__ */
|
1537
|
-
|
1538
|
-
|
1539
|
-
|
1540
|
-
|
1541
|
-
|
1542
|
-
|
1543
|
-
|
1544
|
-
|
1545
|
-
|
1546
|
-
|
1547
|
-
|
1735
|
+
/* @__PURE__ */ React11.createElement(
|
1736
|
+
"svg",
|
1737
|
+
{
|
1738
|
+
xmlns: "http://www.w3.org/2000/svg",
|
1739
|
+
width: "20",
|
1740
|
+
height: "20",
|
1741
|
+
"aria-label": "Single Chevron Icon",
|
1742
|
+
viewBox: "0 0 24 24",
|
1743
|
+
fill: "none",
|
1744
|
+
stroke: "currentColor",
|
1745
|
+
strokeWidth: "2",
|
1746
|
+
strokeLinecap: "round",
|
1747
|
+
strokeLinejoin: "round"
|
1748
|
+
},
|
1749
|
+
/* @__PURE__ */ React11.createElement("path", { d: "m15 18-6-6 6-6" })
|
1548
1750
|
)
|
1549
|
-
|
1550
|
-
|
1551
|
-
"svg",
|
1751
|
+
), /* @__PURE__ */ React11.createElement(
|
1752
|
+
Button,
|
1552
1753
|
{
|
1553
|
-
|
1554
|
-
|
1555
|
-
|
1556
|
-
|
1557
|
-
|
1558
|
-
|
1559
|
-
|
1560
|
-
|
1561
|
-
strokeLinejoin: "round"
|
1754
|
+
"aria-label": "Next Table Page",
|
1755
|
+
variant: "outline",
|
1756
|
+
size: "smallIcon",
|
1757
|
+
onClick: () => table.setPageIndex(table.getPageCount() - 1),
|
1758
|
+
disabled: !table.getCanNextPage(),
|
1759
|
+
className: cn(
|
1760
|
+
props.direction === "ltr" && "hawa-rotate-180"
|
1761
|
+
)
|
1562
1762
|
},
|
1563
|
-
/* @__PURE__ */
|
1564
|
-
|
1565
|
-
|
1566
|
-
|
1763
|
+
/* @__PURE__ */ React11.createElement(
|
1764
|
+
"svg",
|
1765
|
+
{
|
1766
|
+
xmlns: "http://www.w3.org/2000/svg",
|
1767
|
+
width: "20",
|
1768
|
+
height: "20",
|
1769
|
+
viewBox: "0 0 24 24",
|
1770
|
+
fill: "none",
|
1771
|
+
stroke: "currentColor",
|
1772
|
+
strokeWidth: "2",
|
1773
|
+
strokeLinecap: "round",
|
1774
|
+
strokeLinejoin: "round"
|
1775
|
+
},
|
1776
|
+
/* @__PURE__ */ React11.createElement("path", { d: "m11 17-5-5 5-5" }),
|
1777
|
+
/* @__PURE__ */ React11.createElement("path", { d: "m18 17-5-5 5-5" })
|
1778
|
+
)
|
1779
|
+
))))
|
1780
|
+
)
|
1567
1781
|
));
|
1568
1782
|
};
|
1569
1783
|
// Annotate the CommonJS export names for ESM import in node:
|