@prediktif/ui 0.1.21 → 0.1.22
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.d.mts +33 -1
- package/dist/index.d.ts +33 -1
- package/dist/index.js +494 -341
- package/dist/index.mjs +458 -311
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -61,6 +61,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
61
61
|
var index_exports = {};
|
|
62
62
|
__export(index_exports, {
|
|
63
63
|
AppSidebar: () => AppSidebar,
|
|
64
|
+
AvatarUser: () => AvatarUser,
|
|
64
65
|
DataTable: () => DataTable,
|
|
65
66
|
DataTableContentBody: () => DataTableContentBody,
|
|
66
67
|
DataTableContentHeader: () => DataTableContentHeader,
|
|
@@ -73,10 +74,15 @@ __export(index_exports, {
|
|
|
73
74
|
DataTableHeaderSearch: () => DataTableHeaderSearch,
|
|
74
75
|
DataTableHeaderSort: () => DataTableHeaderSort,
|
|
75
76
|
DataTableHeaderToggle: () => DataTableHeaderToggle,
|
|
77
|
+
EmailLabel: () => EmailLabel,
|
|
78
|
+
EmailVerified: () => EmailVerified,
|
|
76
79
|
HeaderTabs: () => HeaderTabs,
|
|
77
80
|
HeaderTitle: () => HeaderTitle,
|
|
81
|
+
JoinedLabel: () => JoinedLabel,
|
|
78
82
|
RowActions: () => RowActions,
|
|
79
83
|
StateEmpty: () => StateEmpty,
|
|
84
|
+
UserRole: () => UserRole,
|
|
85
|
+
UserStatus: () => UserStatus,
|
|
80
86
|
exportToCSV: () => exportToCSV,
|
|
81
87
|
exportToPDF: () => exportToPDF,
|
|
82
88
|
exportToXLSX: () => exportToXLSX,
|
|
@@ -1530,26 +1536,167 @@ var AppSidebar = (0, import_react.memo)(function AppSidebar2({
|
|
|
1530
1536
|
] });
|
|
1531
1537
|
});
|
|
1532
1538
|
|
|
1539
|
+
// src/components/composed/columns/avatar-user.tsx
|
|
1540
|
+
var import_react2 = require("react");
|
|
1541
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1542
|
+
function getInitials(name) {
|
|
1543
|
+
if (name) {
|
|
1544
|
+
return name.split(" ").map((w) => w[0]).join("").slice(0, 2).toUpperCase();
|
|
1545
|
+
}
|
|
1546
|
+
return "U";
|
|
1547
|
+
}
|
|
1548
|
+
var AvatarUser = (0, import_react2.memo)(function AvatarUser2({
|
|
1549
|
+
name,
|
|
1550
|
+
image
|
|
1551
|
+
}) {
|
|
1552
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
1553
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Avatar, { size: "sm", children: [
|
|
1554
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(AvatarImage, { src: image != null ? image : void 0, alt: name != null ? name : void 0 }),
|
|
1555
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(AvatarFallback, { children: getInitials(name) })
|
|
1556
|
+
] }),
|
|
1557
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "text-xs font-medium", children: name })
|
|
1558
|
+
] });
|
|
1559
|
+
});
|
|
1560
|
+
|
|
1561
|
+
// src/components/composed/columns/email-label.tsx
|
|
1562
|
+
var import_react3 = require("react");
|
|
1563
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1564
|
+
var EmailLabel = (0, import_react3.memo)(function EmailLabel2({ email }) {
|
|
1565
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "text-xs font-mono", children: email });
|
|
1566
|
+
});
|
|
1567
|
+
|
|
1568
|
+
// src/components/composed/columns/email-verified.tsx
|
|
1569
|
+
var import_lucide_react6 = require("lucide-react");
|
|
1570
|
+
var import_react4 = require("react");
|
|
1571
|
+
|
|
1572
|
+
// src/components/ui/badge.tsx
|
|
1573
|
+
var import_merge_props3 = require("@base-ui/react/merge-props");
|
|
1574
|
+
var import_use_render3 = require("@base-ui/react/use-render");
|
|
1575
|
+
var import_class_variance_authority3 = require("class-variance-authority");
|
|
1576
|
+
var import_cn12 = require("cn");
|
|
1577
|
+
var badgeVariants = (0, import_class_variance_authority3.cva)(
|
|
1578
|
+
"group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-[0.625rem] font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-2.5!",
|
|
1579
|
+
{
|
|
1580
|
+
variants: {
|
|
1581
|
+
variant: {
|
|
1582
|
+
default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80",
|
|
1583
|
+
secondary: "bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",
|
|
1584
|
+
destructive: "bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",
|
|
1585
|
+
outline: "border-border bg-input/20 text-foreground dark:bg-input/30 [a]:hover:bg-muted [a]:hover:text-muted-foreground",
|
|
1586
|
+
ghost: "hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",
|
|
1587
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
1588
|
+
}
|
|
1589
|
+
},
|
|
1590
|
+
defaultVariants: {
|
|
1591
|
+
variant: "default"
|
|
1592
|
+
}
|
|
1593
|
+
}
|
|
1594
|
+
);
|
|
1595
|
+
function Badge(_a) {
|
|
1596
|
+
var _b = _a, {
|
|
1597
|
+
className,
|
|
1598
|
+
variant = "default",
|
|
1599
|
+
render
|
|
1600
|
+
} = _b, props = __objRest(_b, [
|
|
1601
|
+
"className",
|
|
1602
|
+
"variant",
|
|
1603
|
+
"render"
|
|
1604
|
+
]);
|
|
1605
|
+
return (0, import_use_render3.useRender)({
|
|
1606
|
+
defaultTagName: "span",
|
|
1607
|
+
props: (0, import_merge_props3.mergeProps)(
|
|
1608
|
+
{
|
|
1609
|
+
className: (0, import_cn12.cn)(badgeVariants({ variant }), className)
|
|
1610
|
+
},
|
|
1611
|
+
props
|
|
1612
|
+
),
|
|
1613
|
+
render,
|
|
1614
|
+
state: {
|
|
1615
|
+
slot: "badge",
|
|
1616
|
+
variant
|
|
1617
|
+
}
|
|
1618
|
+
});
|
|
1619
|
+
}
|
|
1620
|
+
|
|
1621
|
+
// src/components/composed/columns/email-verified.tsx
|
|
1622
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1623
|
+
var EmailVerified = (0, import_react4.memo)(function EmailVerified2({
|
|
1624
|
+
verified
|
|
1625
|
+
}) {
|
|
1626
|
+
return verified ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Badge, { variant: "default", children: [
|
|
1627
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react6.BadgeCheck, { "data-icon": "inline-start" }),
|
|
1628
|
+
"Verified"
|
|
1629
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Badge, { variant: "destructive", children: [
|
|
1630
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react6.BadgeCheck, { "data-icon": "inline-start" }),
|
|
1631
|
+
"Unverified"
|
|
1632
|
+
] });
|
|
1633
|
+
});
|
|
1634
|
+
|
|
1635
|
+
// src/components/composed/columns/joined-label.tsx
|
|
1636
|
+
var import_react5 = require("react");
|
|
1637
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1638
|
+
var JoinedLabel = (0, import_react5.memo)(function JoinedLabel2({
|
|
1639
|
+
joined,
|
|
1640
|
+
locale = "id-ID"
|
|
1641
|
+
}) {
|
|
1642
|
+
if (!joined) return null;
|
|
1643
|
+
const date = typeof joined === "string" ? new Date(joined) : joined;
|
|
1644
|
+
if (Number.isNaN(date.getTime())) return null;
|
|
1645
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "text-xs font-mono", children: new Intl.DateTimeFormat(locale, {
|
|
1646
|
+
day: "numeric",
|
|
1647
|
+
month: "long",
|
|
1648
|
+
year: "numeric"
|
|
1649
|
+
}).format(date) });
|
|
1650
|
+
});
|
|
1651
|
+
|
|
1652
|
+
// src/components/composed/columns/user-role.tsx
|
|
1653
|
+
var import_lucide_react7 = require("lucide-react");
|
|
1654
|
+
var import_react6 = require("react");
|
|
1655
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1656
|
+
var UserRole = (0, import_react6.memo)(function UserRole2({ role }) {
|
|
1657
|
+
const isAdmin = role === "admin";
|
|
1658
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Badge, { variant: "outline", className: "capitalize", children: [
|
|
1659
|
+
isAdmin ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react7.UserStarIcon, { "data-icon": "inline-start" }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react7.UserIcon, { "data-icon": "inline-start" }),
|
|
1660
|
+
role
|
|
1661
|
+
] });
|
|
1662
|
+
});
|
|
1663
|
+
|
|
1664
|
+
// src/components/composed/columns/user-status.tsx
|
|
1665
|
+
var import_lucide_react8 = require("lucide-react");
|
|
1666
|
+
var import_react7 = require("react");
|
|
1667
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1668
|
+
var UserStatus = (0, import_react7.memo)(function UserStatus2({
|
|
1669
|
+
status
|
|
1670
|
+
}) {
|
|
1671
|
+
return status ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Badge, { variant: "destructive", children: [
|
|
1672
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.BadgeCheck, { "data-icon": "inline-start" }),
|
|
1673
|
+
"Inactive"
|
|
1674
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Badge, { variant: "default", children: [
|
|
1675
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.BadgeCheck, { "data-icon": "inline-start" }),
|
|
1676
|
+
"Active"
|
|
1677
|
+
] });
|
|
1678
|
+
});
|
|
1679
|
+
|
|
1533
1680
|
// src/components/composed/data-table/data-table.tsx
|
|
1534
1681
|
var import_react_table4 = require("@tanstack/react-table");
|
|
1535
|
-
var
|
|
1682
|
+
var import_lucide_react21 = require("lucide-react");
|
|
1536
1683
|
var import_navigation3 = require("next/navigation");
|
|
1537
|
-
var
|
|
1684
|
+
var import_react12 = require("react");
|
|
1538
1685
|
|
|
1539
1686
|
// src/components/composed/state-empty.tsx
|
|
1540
|
-
var
|
|
1687
|
+
var import_react8 = require("react");
|
|
1541
1688
|
|
|
1542
1689
|
// src/components/ui/empty.tsx
|
|
1543
|
-
var
|
|
1544
|
-
var
|
|
1545
|
-
var
|
|
1690
|
+
var import_class_variance_authority4 = require("class-variance-authority");
|
|
1691
|
+
var import_cn13 = require("cn");
|
|
1692
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1546
1693
|
function Empty(_a) {
|
|
1547
1694
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1548
|
-
return /* @__PURE__ */ (0,
|
|
1695
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1549
1696
|
"div",
|
|
1550
1697
|
__spreadValues({
|
|
1551
1698
|
"data-slot": "empty",
|
|
1552
|
-
className: (0,
|
|
1699
|
+
className: (0, import_cn13.cn)(
|
|
1553
1700
|
"flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 rounded-xl border-dashed p-6 text-center text-balance",
|
|
1554
1701
|
className
|
|
1555
1702
|
)
|
|
@@ -1558,15 +1705,15 @@ function Empty(_a) {
|
|
|
1558
1705
|
}
|
|
1559
1706
|
function EmptyHeader(_a) {
|
|
1560
1707
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1561
|
-
return /* @__PURE__ */ (0,
|
|
1708
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1562
1709
|
"div",
|
|
1563
1710
|
__spreadValues({
|
|
1564
1711
|
"data-slot": "empty-header",
|
|
1565
|
-
className: (0,
|
|
1712
|
+
className: (0, import_cn13.cn)("flex max-w-sm flex-col items-center gap-1", className)
|
|
1566
1713
|
}, props)
|
|
1567
1714
|
);
|
|
1568
1715
|
}
|
|
1569
|
-
var emptyMediaVariants = (0,
|
|
1716
|
+
var emptyMediaVariants = (0, import_class_variance_authority4.cva)(
|
|
1570
1717
|
"mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
1571
1718
|
{
|
|
1572
1719
|
variants: {
|
|
@@ -1588,22 +1735,22 @@ function EmptyMedia(_a) {
|
|
|
1588
1735
|
"className",
|
|
1589
1736
|
"variant"
|
|
1590
1737
|
]);
|
|
1591
|
-
return /* @__PURE__ */ (0,
|
|
1738
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1592
1739
|
"div",
|
|
1593
1740
|
__spreadValues({
|
|
1594
1741
|
"data-slot": "empty-icon",
|
|
1595
1742
|
"data-variant": variant,
|
|
1596
|
-
className: (0,
|
|
1743
|
+
className: (0, import_cn13.cn)(emptyMediaVariants({ variant, className }))
|
|
1597
1744
|
}, props)
|
|
1598
1745
|
);
|
|
1599
1746
|
}
|
|
1600
1747
|
function EmptyTitle(_a) {
|
|
1601
1748
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1602
|
-
return /* @__PURE__ */ (0,
|
|
1749
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1603
1750
|
"div",
|
|
1604
1751
|
__spreadValues({
|
|
1605
1752
|
"data-slot": "empty-title",
|
|
1606
|
-
className: (0,
|
|
1753
|
+
className: (0, import_cn13.cn)(
|
|
1607
1754
|
"font-heading text-sm font-medium tracking-tight",
|
|
1608
1755
|
className
|
|
1609
1756
|
)
|
|
@@ -1612,11 +1759,11 @@ function EmptyTitle(_a) {
|
|
|
1612
1759
|
}
|
|
1613
1760
|
function EmptyDescription(_a) {
|
|
1614
1761
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1615
|
-
return /* @__PURE__ */ (0,
|
|
1762
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1616
1763
|
"div",
|
|
1617
1764
|
__spreadValues({
|
|
1618
1765
|
"data-slot": "empty-description",
|
|
1619
|
-
className: (0,
|
|
1766
|
+
className: (0, import_cn13.cn)(
|
|
1620
1767
|
"text-xs/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",
|
|
1621
1768
|
className
|
|
1622
1769
|
)
|
|
@@ -1625,11 +1772,11 @@ function EmptyDescription(_a) {
|
|
|
1625
1772
|
}
|
|
1626
1773
|
function EmptyContent(_a) {
|
|
1627
1774
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1628
|
-
return /* @__PURE__ */ (0,
|
|
1775
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1629
1776
|
"div",
|
|
1630
1777
|
__spreadValues({
|
|
1631
1778
|
"data-slot": "empty-content",
|
|
1632
|
-
className: (0,
|
|
1779
|
+
className: (0, import_cn13.cn)(
|
|
1633
1780
|
"flex w-full max-w-sm min-w-0 flex-col items-center gap-2 text-xs/relaxed text-balance",
|
|
1634
1781
|
className
|
|
1635
1782
|
)
|
|
@@ -1638,18 +1785,18 @@ function EmptyContent(_a) {
|
|
|
1638
1785
|
}
|
|
1639
1786
|
|
|
1640
1787
|
// src/lib/utils.ts
|
|
1641
|
-
var
|
|
1788
|
+
var import_cn14 = require("cn");
|
|
1642
1789
|
|
|
1643
1790
|
// src/components/composed/state-empty.tsx
|
|
1644
|
-
var
|
|
1791
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1645
1792
|
function renderStateIcon(icon) {
|
|
1646
1793
|
if (typeof icon === "function" || typeof icon === "object" && icon !== null && "render" in icon) {
|
|
1647
1794
|
const IconComp = icon;
|
|
1648
|
-
return /* @__PURE__ */ (0,
|
|
1795
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(IconComp, {});
|
|
1649
1796
|
}
|
|
1650
1797
|
return icon;
|
|
1651
1798
|
}
|
|
1652
|
-
var StateEmpty = (0,
|
|
1799
|
+
var StateEmpty = (0, import_react8.memo)(function StateEmpty2({
|
|
1653
1800
|
icon,
|
|
1654
1801
|
title,
|
|
1655
1802
|
description,
|
|
@@ -1662,17 +1809,17 @@ var StateEmpty = (0, import_react2.memo)(function StateEmpty2({
|
|
|
1662
1809
|
const actionHandler = isFunctionAction ? render : onClick;
|
|
1663
1810
|
const buttonRender = isFunctionAction ? void 0 : render;
|
|
1664
1811
|
const hasAction = Boolean(buttonText || render || onClick);
|
|
1665
|
-
return /* @__PURE__ */ (0,
|
|
1812
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
1666
1813
|
Empty,
|
|
1667
1814
|
{
|
|
1668
|
-
className: (0,
|
|
1815
|
+
className: (0, import_cn14.cn)("w-full", state === "outline" && "border border-dashed"),
|
|
1669
1816
|
children: [
|
|
1670
|
-
/* @__PURE__ */ (0,
|
|
1671
|
-
/* @__PURE__ */ (0,
|
|
1672
|
-
/* @__PURE__ */ (0,
|
|
1673
|
-
/* @__PURE__ */ (0,
|
|
1817
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(EmptyHeader, { children: [
|
|
1818
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(EmptyMedia, { variant: "icon", children: renderStateIcon(icon) }),
|
|
1819
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(EmptyTitle, { children: title }),
|
|
1820
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(EmptyDescription, { children: description })
|
|
1674
1821
|
] }),
|
|
1675
|
-
hasAction && /* @__PURE__ */ (0,
|
|
1822
|
+
hasAction && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(EmptyContent, { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1676
1823
|
Button,
|
|
1677
1824
|
{
|
|
1678
1825
|
variant: "outline",
|
|
@@ -1689,20 +1836,20 @@ var StateEmpty = (0, import_react2.memo)(function StateEmpty2({
|
|
|
1689
1836
|
});
|
|
1690
1837
|
|
|
1691
1838
|
// src/components/ui/table.tsx
|
|
1692
|
-
var
|
|
1693
|
-
var
|
|
1839
|
+
var import_cn15 = require("cn");
|
|
1840
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1694
1841
|
function Table(_a) {
|
|
1695
1842
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1696
|
-
return /* @__PURE__ */ (0,
|
|
1843
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1697
1844
|
"div",
|
|
1698
1845
|
{
|
|
1699
1846
|
"data-slot": "table-container",
|
|
1700
1847
|
className: "relative w-full overflow-x-auto",
|
|
1701
|
-
children: /* @__PURE__ */ (0,
|
|
1848
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1702
1849
|
"table",
|
|
1703
1850
|
__spreadValues({
|
|
1704
1851
|
"data-slot": "table",
|
|
1705
|
-
className: (0,
|
|
1852
|
+
className: (0, import_cn15.cn)("w-full caption-bottom text-xs", className)
|
|
1706
1853
|
}, props)
|
|
1707
1854
|
)
|
|
1708
1855
|
}
|
|
@@ -1710,31 +1857,31 @@ function Table(_a) {
|
|
|
1710
1857
|
}
|
|
1711
1858
|
function TableHeader(_a) {
|
|
1712
1859
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1713
|
-
return /* @__PURE__ */ (0,
|
|
1860
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1714
1861
|
"thead",
|
|
1715
1862
|
__spreadValues({
|
|
1716
1863
|
"data-slot": "table-header",
|
|
1717
|
-
className: (0,
|
|
1864
|
+
className: (0, import_cn15.cn)("[&_tr]:border-b", className)
|
|
1718
1865
|
}, props)
|
|
1719
1866
|
);
|
|
1720
1867
|
}
|
|
1721
1868
|
function TableBody(_a) {
|
|
1722
1869
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1723
|
-
return /* @__PURE__ */ (0,
|
|
1870
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1724
1871
|
"tbody",
|
|
1725
1872
|
__spreadValues({
|
|
1726
1873
|
"data-slot": "table-body",
|
|
1727
|
-
className: (0,
|
|
1874
|
+
className: (0, import_cn15.cn)("[&_tr:last-child]:border-0", className)
|
|
1728
1875
|
}, props)
|
|
1729
1876
|
);
|
|
1730
1877
|
}
|
|
1731
1878
|
function TableRow(_a) {
|
|
1732
1879
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1733
|
-
return /* @__PURE__ */ (0,
|
|
1880
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1734
1881
|
"tr",
|
|
1735
1882
|
__spreadValues({
|
|
1736
1883
|
"data-slot": "table-row",
|
|
1737
|
-
className: (0,
|
|
1884
|
+
className: (0, import_cn15.cn)(
|
|
1738
1885
|
"border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted",
|
|
1739
1886
|
className
|
|
1740
1887
|
)
|
|
@@ -1743,11 +1890,11 @@ function TableRow(_a) {
|
|
|
1743
1890
|
}
|
|
1744
1891
|
function TableHead(_a) {
|
|
1745
1892
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1746
|
-
return /* @__PURE__ */ (0,
|
|
1893
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1747
1894
|
"th",
|
|
1748
1895
|
__spreadValues({
|
|
1749
1896
|
"data-slot": "table-head",
|
|
1750
|
-
className: (0,
|
|
1897
|
+
className: (0, import_cn15.cn)(
|
|
1751
1898
|
"h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0",
|
|
1752
1899
|
className
|
|
1753
1900
|
)
|
|
@@ -1756,11 +1903,11 @@ function TableHead(_a) {
|
|
|
1756
1903
|
}
|
|
1757
1904
|
function TableCell(_a) {
|
|
1758
1905
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1759
|
-
return /* @__PURE__ */ (0,
|
|
1906
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1760
1907
|
"td",
|
|
1761
1908
|
__spreadValues({
|
|
1762
1909
|
"data-slot": "table-cell",
|
|
1763
|
-
className: (0,
|
|
1910
|
+
className: (0, import_cn15.cn)(
|
|
1764
1911
|
"p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0",
|
|
1765
1912
|
className
|
|
1766
1913
|
)
|
|
@@ -1796,20 +1943,20 @@ var features = (0, import_react_table.tableFeatures)({
|
|
|
1796
1943
|
|
|
1797
1944
|
// src/components/composed/data-table/table-content-body.tsx
|
|
1798
1945
|
var import_react_table2 = require("@tanstack/react-table");
|
|
1799
|
-
var
|
|
1800
|
-
var
|
|
1946
|
+
var import_lucide_react9 = require("lucide-react");
|
|
1947
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1801
1948
|
function DataTableContentBody({
|
|
1802
1949
|
table,
|
|
1803
1950
|
columns
|
|
1804
1951
|
}) {
|
|
1805
1952
|
const rows = table.getRowModel().rows;
|
|
1806
1953
|
if (rows == null ? void 0 : rows.length) {
|
|
1807
|
-
return /* @__PURE__ */ (0,
|
|
1954
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TableBody, { children: rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TableRow, { children: row.getVisibleCells().map((cell) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TableCell, { children: (0, import_react_table2.flexRender)(cell.column.columnDef.cell, cell.getContext()) }, cell.id)) }, row.id)) });
|
|
1808
1955
|
}
|
|
1809
|
-
return /* @__PURE__ */ (0,
|
|
1956
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TableBody, { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TableCell, { colSpan: columns.length, className: "h-48 text-center", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1810
1957
|
StateEmpty,
|
|
1811
1958
|
{
|
|
1812
|
-
icon: /* @__PURE__ */ (0,
|
|
1959
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react9.SearchXIcon, {}),
|
|
1813
1960
|
title: "No matching results",
|
|
1814
1961
|
description: "No records matched your search query or filter criteria.",
|
|
1815
1962
|
buttonText: "Clear search & filters",
|
|
@@ -1823,18 +1970,18 @@ function DataTableContentBody({
|
|
|
1823
1970
|
|
|
1824
1971
|
// src/components/composed/data-table/table-content-header.tsx
|
|
1825
1972
|
var import_react_table3 = require("@tanstack/react-table");
|
|
1826
|
-
var
|
|
1973
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1827
1974
|
function DataTableContentHeader({
|
|
1828
1975
|
table
|
|
1829
1976
|
}) {
|
|
1830
|
-
return /* @__PURE__ */ (0,
|
|
1977
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(TableHeader, { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(TableRow, { children: headerGroup.headers.map((header) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(TableHead, { children: header.isPlaceholder ? null : (0, import_react_table3.flexRender)(
|
|
1831
1978
|
header.column.columnDef.header,
|
|
1832
1979
|
header.getContext()
|
|
1833
1980
|
) }, header.id)) }, headerGroup.id)) });
|
|
1834
1981
|
}
|
|
1835
1982
|
|
|
1836
1983
|
// src/components/composed/data-table/table-footer-entries.tsx
|
|
1837
|
-
var
|
|
1984
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
1838
1985
|
function DataTableFooterEntries({
|
|
1839
1986
|
table
|
|
1840
1987
|
}) {
|
|
@@ -1845,131 +1992,131 @@ function DataTableFooterEntries({
|
|
|
1845
1992
|
const totalRows = table.getFilteredRowModel().rows.length;
|
|
1846
1993
|
const startRow = totalRows === 0 ? 0 : pageIndex * pageSize + 1;
|
|
1847
1994
|
const endRow = Math.min((pageIndex + 1) * pageSize, totalRows);
|
|
1848
|
-
return /* @__PURE__ */ (0,
|
|
1995
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex-1 text-xs text-muted-foreground", children: [
|
|
1849
1996
|
"Showing",
|
|
1850
1997
|
" ",
|
|
1851
|
-
/* @__PURE__ */ (0,
|
|
1998
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { className: "font-medium text-foreground", children: [
|
|
1852
1999
|
startRow,
|
|
1853
2000
|
"-",
|
|
1854
2001
|
endRow
|
|
1855
2002
|
] }),
|
|
1856
2003
|
" ",
|
|
1857
2004
|
"of ",
|
|
1858
|
-
/* @__PURE__ */ (0,
|
|
2005
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "font-medium text-foreground", children: totalRows }),
|
|
1859
2006
|
" ",
|
|
1860
2007
|
"entries."
|
|
1861
2008
|
] });
|
|
1862
2009
|
}
|
|
1863
2010
|
|
|
1864
2011
|
// src/components/composed/data-table/table-footer-pagination.tsx
|
|
1865
|
-
var
|
|
1866
|
-
var
|
|
2012
|
+
var import_lucide_react10 = require("lucide-react");
|
|
2013
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
1867
2014
|
function DataTableFooterPagination({
|
|
1868
2015
|
table
|
|
1869
2016
|
}) {
|
|
1870
|
-
return /* @__PURE__ */ (0,
|
|
1871
|
-
/* @__PURE__ */ (0,
|
|
1872
|
-
/* @__PURE__ */ (0,
|
|
2017
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
2018
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Tooltip, { children: [
|
|
2019
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1873
2020
|
TooltipTrigger,
|
|
1874
2021
|
{
|
|
1875
|
-
render: /* @__PURE__ */ (0,
|
|
2022
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1876
2023
|
Button,
|
|
1877
2024
|
{
|
|
1878
2025
|
variant: "outline",
|
|
1879
2026
|
size: "icon-xs",
|
|
1880
2027
|
onClick: () => table.firstPage(),
|
|
1881
2028
|
disabled: !table.getCanPreviousPage(),
|
|
1882
|
-
children: /* @__PURE__ */ (0,
|
|
2029
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react10.ChevronsLeftIcon, {})
|
|
1883
2030
|
}
|
|
1884
2031
|
)
|
|
1885
2032
|
}
|
|
1886
2033
|
),
|
|
1887
|
-
/* @__PURE__ */ (0,
|
|
2034
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TooltipContent, { children: "Go to first page" })
|
|
1888
2035
|
] }),
|
|
1889
|
-
/* @__PURE__ */ (0,
|
|
1890
|
-
/* @__PURE__ */ (0,
|
|
2036
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Tooltip, { children: [
|
|
2037
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1891
2038
|
TooltipTrigger,
|
|
1892
2039
|
{
|
|
1893
|
-
render: /* @__PURE__ */ (0,
|
|
2040
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1894
2041
|
Button,
|
|
1895
2042
|
{
|
|
1896
2043
|
variant: "outline",
|
|
1897
2044
|
size: "icon-xs",
|
|
1898
2045
|
onClick: () => table.previousPage(),
|
|
1899
2046
|
disabled: !table.getCanPreviousPage(),
|
|
1900
|
-
children: /* @__PURE__ */ (0,
|
|
2047
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react10.ChevronLeftIcon, {})
|
|
1901
2048
|
}
|
|
1902
2049
|
)
|
|
1903
2050
|
}
|
|
1904
2051
|
),
|
|
1905
|
-
/* @__PURE__ */ (0,
|
|
2052
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TooltipContent, { children: "Go to previous page" })
|
|
1906
2053
|
] }),
|
|
1907
|
-
/* @__PURE__ */ (0,
|
|
1908
|
-
/* @__PURE__ */ (0,
|
|
2054
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Tooltip, { children: [
|
|
2055
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1909
2056
|
TooltipTrigger,
|
|
1910
2057
|
{
|
|
1911
|
-
render: /* @__PURE__ */ (0,
|
|
2058
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1912
2059
|
Button,
|
|
1913
2060
|
{
|
|
1914
2061
|
variant: "outline",
|
|
1915
2062
|
size: "icon-xs",
|
|
1916
2063
|
onClick: () => table.nextPage(),
|
|
1917
2064
|
disabled: !table.getCanNextPage(),
|
|
1918
|
-
children: /* @__PURE__ */ (0,
|
|
2065
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react10.ChevronRightIcon, {})
|
|
1919
2066
|
}
|
|
1920
2067
|
)
|
|
1921
2068
|
}
|
|
1922
2069
|
),
|
|
1923
|
-
/* @__PURE__ */ (0,
|
|
2070
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TooltipContent, { children: "Go to next page" })
|
|
1924
2071
|
] }),
|
|
1925
|
-
/* @__PURE__ */ (0,
|
|
1926
|
-
/* @__PURE__ */ (0,
|
|
2072
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Tooltip, { children: [
|
|
2073
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1927
2074
|
TooltipTrigger,
|
|
1928
2075
|
{
|
|
1929
|
-
render: /* @__PURE__ */ (0,
|
|
2076
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1930
2077
|
Button,
|
|
1931
2078
|
{
|
|
1932
2079
|
variant: "outline",
|
|
1933
2080
|
size: "icon-xs",
|
|
1934
2081
|
onClick: () => table.lastPage(),
|
|
1935
2082
|
disabled: !table.getCanNextPage(),
|
|
1936
|
-
children: /* @__PURE__ */ (0,
|
|
2083
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react10.ChevronsRightIcon, {})
|
|
1937
2084
|
}
|
|
1938
2085
|
)
|
|
1939
2086
|
}
|
|
1940
2087
|
),
|
|
1941
|
-
/* @__PURE__ */ (0,
|
|
2088
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TooltipContent, { children: "Go to last page" })
|
|
1942
2089
|
] })
|
|
1943
2090
|
] });
|
|
1944
2091
|
}
|
|
1945
2092
|
|
|
1946
2093
|
// src/components/composed/data-table/table-header-add.tsx
|
|
1947
|
-
var
|
|
1948
|
-
var
|
|
2094
|
+
var import_lucide_react11 = require("lucide-react");
|
|
2095
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1949
2096
|
function DataTableHeaderAdd({
|
|
1950
2097
|
onAdd,
|
|
1951
2098
|
addLabel
|
|
1952
2099
|
}) {
|
|
1953
|
-
return /* @__PURE__ */ (0,
|
|
1954
|
-
/* @__PURE__ */ (0,
|
|
1955
|
-
/* @__PURE__ */ (0,
|
|
2100
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
|
|
2101
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Tooltip, { children: [
|
|
2102
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1956
2103
|
TooltipTrigger,
|
|
1957
2104
|
{
|
|
1958
2105
|
className: "flex sm:hidden",
|
|
1959
|
-
render: /* @__PURE__ */ (0,
|
|
2106
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Button, { variant: "default", size: "icon", onClick: onAdd, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react11.PlusIcon, {}) })
|
|
1960
2107
|
}
|
|
1961
2108
|
),
|
|
1962
|
-
/* @__PURE__ */ (0,
|
|
2109
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TooltipContent, { children: addLabel != null ? addLabel : "Add" })
|
|
1963
2110
|
] }),
|
|
1964
|
-
/* @__PURE__ */ (0,
|
|
1965
|
-
/* @__PURE__ */ (0,
|
|
2111
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Button, { variant: "default", onClick: onAdd, className: "hidden sm:flex", children: [
|
|
2112
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react11.PlusIcon, {}),
|
|
1966
2113
|
addLabel != null ? addLabel : "Add"
|
|
1967
2114
|
] })
|
|
1968
2115
|
] });
|
|
1969
2116
|
}
|
|
1970
2117
|
|
|
1971
2118
|
// src/components/composed/data-table/table-header-download.tsx
|
|
1972
|
-
var
|
|
2119
|
+
var import_lucide_react12 = require("lucide-react");
|
|
1973
2120
|
|
|
1974
2121
|
// src/components/composed/data-table/export.ts
|
|
1975
2122
|
var XLSX = __toESM(require("xlsx"));
|
|
@@ -2109,7 +2256,7 @@ function printTable(headers, rows, title = "Data Export") {
|
|
|
2109
2256
|
}
|
|
2110
2257
|
|
|
2111
2258
|
// src/components/composed/data-table/table-header-download.tsx
|
|
2112
|
-
var
|
|
2259
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
2113
2260
|
function getTableExportData(table) {
|
|
2114
2261
|
const columns = table.getAllColumns().filter(
|
|
2115
2262
|
(col) => typeof col.accessorFn !== "undefined" && col.getIsVisible()
|
|
@@ -2152,25 +2299,25 @@ function DataTableHeaderDownload({
|
|
|
2152
2299
|
exportFilename,
|
|
2153
2300
|
onDownload
|
|
2154
2301
|
}) {
|
|
2155
|
-
return /* @__PURE__ */ (0,
|
|
2156
|
-
/* @__PURE__ */ (0,
|
|
2157
|
-
/* @__PURE__ */ (0,
|
|
2302
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(DropdownMenu, { children: [
|
|
2303
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Tooltip, { children: [
|
|
2304
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2158
2305
|
DropdownMenuTrigger,
|
|
2159
2306
|
{
|
|
2160
|
-
render: /* @__PURE__ */ (0,
|
|
2307
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2161
2308
|
TooltipTrigger,
|
|
2162
2309
|
{
|
|
2163
|
-
render: /* @__PURE__ */ (0,
|
|
2310
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Button, { variant: "outline", size: "icon", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react12.DownloadIcon, {}) })
|
|
2164
2311
|
}
|
|
2165
2312
|
)
|
|
2166
2313
|
}
|
|
2167
2314
|
),
|
|
2168
|
-
/* @__PURE__ */ (0,
|
|
2315
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(TooltipContent, { children: "Download options" })
|
|
2169
2316
|
] }),
|
|
2170
|
-
/* @__PURE__ */ (0,
|
|
2171
|
-
/* @__PURE__ */ (0,
|
|
2172
|
-
/* @__PURE__ */ (0,
|
|
2173
|
-
/* @__PURE__ */ (0,
|
|
2317
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(DropdownMenuContent, { align: "end", className: "w-48", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(DropdownMenuGroup, { children: [
|
|
2318
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(DropdownMenuLabel, { children: "Download data" }),
|
|
2319
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(DropdownMenuSeparator, {}),
|
|
2320
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
2174
2321
|
DropdownMenuItem,
|
|
2175
2322
|
{
|
|
2176
2323
|
className: "hover:cursor-pointer",
|
|
@@ -2180,12 +2327,12 @@ function DataTableHeaderDownload({
|
|
|
2180
2327
|
onDownload == null ? void 0 : onDownload();
|
|
2181
2328
|
},
|
|
2182
2329
|
children: [
|
|
2183
|
-
/* @__PURE__ */ (0,
|
|
2330
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react12.FileTextIcon, {}),
|
|
2184
2331
|
"Download PDF"
|
|
2185
2332
|
]
|
|
2186
2333
|
}
|
|
2187
2334
|
),
|
|
2188
|
-
/* @__PURE__ */ (0,
|
|
2335
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
2189
2336
|
DropdownMenuItem,
|
|
2190
2337
|
{
|
|
2191
2338
|
className: "hover:cursor-pointer",
|
|
@@ -2195,12 +2342,12 @@ function DataTableHeaderDownload({
|
|
|
2195
2342
|
onDownload == null ? void 0 : onDownload();
|
|
2196
2343
|
},
|
|
2197
2344
|
children: [
|
|
2198
|
-
/* @__PURE__ */ (0,
|
|
2345
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react12.FileSpreadsheetIcon, {}),
|
|
2199
2346
|
"Download Excel"
|
|
2200
2347
|
]
|
|
2201
2348
|
}
|
|
2202
2349
|
),
|
|
2203
|
-
/* @__PURE__ */ (0,
|
|
2350
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
2204
2351
|
DropdownMenuItem,
|
|
2205
2352
|
{
|
|
2206
2353
|
className: "hover:cursor-pointer",
|
|
@@ -2210,13 +2357,13 @@ function DataTableHeaderDownload({
|
|
|
2210
2357
|
onDownload == null ? void 0 : onDownload();
|
|
2211
2358
|
},
|
|
2212
2359
|
children: [
|
|
2213
|
-
/* @__PURE__ */ (0,
|
|
2360
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react12.FileCodeIcon, {}),
|
|
2214
2361
|
"Download CSV"
|
|
2215
2362
|
]
|
|
2216
2363
|
}
|
|
2217
2364
|
),
|
|
2218
|
-
/* @__PURE__ */ (0,
|
|
2219
|
-
/* @__PURE__ */ (0,
|
|
2365
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(DropdownMenuSeparator, {}),
|
|
2366
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
2220
2367
|
DropdownMenuItem,
|
|
2221
2368
|
{
|
|
2222
2369
|
className: "hover:cursor-pointer",
|
|
@@ -2225,7 +2372,7 @@ function DataTableHeaderDownload({
|
|
|
2225
2372
|
printTable(headers, rows, exportFilename);
|
|
2226
2373
|
},
|
|
2227
2374
|
children: [
|
|
2228
|
-
/* @__PURE__ */ (0,
|
|
2375
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react12.PrinterIcon, {}),
|
|
2229
2376
|
"Print Table"
|
|
2230
2377
|
]
|
|
2231
2378
|
}
|
|
@@ -2236,15 +2383,15 @@ function DataTableHeaderDownload({
|
|
|
2236
2383
|
|
|
2237
2384
|
// src/components/composed/data-table/table-header-filter.tsx
|
|
2238
2385
|
var import_date_fns = require("date-fns");
|
|
2239
|
-
var
|
|
2240
|
-
var
|
|
2386
|
+
var import_lucide_react15 = require("lucide-react");
|
|
2387
|
+
var import_react9 = require("react");
|
|
2241
2388
|
|
|
2242
2389
|
// src/components/ui/calendar.tsx
|
|
2243
|
-
var
|
|
2244
|
-
var
|
|
2390
|
+
var import_cn16 = require("cn");
|
|
2391
|
+
var import_lucide_react13 = require("lucide-react");
|
|
2245
2392
|
var React3 = __toESM(require("react"));
|
|
2246
2393
|
var import_react_day_picker = require("react-day-picker");
|
|
2247
|
-
var
|
|
2394
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
2248
2395
|
function Calendar(_a) {
|
|
2249
2396
|
var _b = _a, {
|
|
2250
2397
|
className,
|
|
@@ -2266,11 +2413,11 @@ function Calendar(_a) {
|
|
|
2266
2413
|
"components"
|
|
2267
2414
|
]);
|
|
2268
2415
|
const defaultClassNames = (0, import_react_day_picker.getDefaultClassNames)();
|
|
2269
|
-
return /* @__PURE__ */ (0,
|
|
2416
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2270
2417
|
import_react_day_picker.DayPicker,
|
|
2271
2418
|
__spreadValues({
|
|
2272
2419
|
showOutsideDays,
|
|
2273
|
-
className: (0,
|
|
2420
|
+
className: (0, import_cn16.cn)(
|
|
2274
2421
|
"group/calendar bg-background p-3 [--cell-radius:var(--radius-md)] [--cell-size:--spacing(6)] in-data-[slot=card-content]:bg-transparent in-data-[slot=popover-content]:bg-transparent",
|
|
2275
2422
|
String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
|
|
2276
2423
|
String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
|
|
@@ -2282,124 +2429,124 @@ function Calendar(_a) {
|
|
|
2282
2429
|
formatMonthDropdown: (date) => date.toLocaleString(locale == null ? void 0 : locale.code, { month: "short" })
|
|
2283
2430
|
}, formatters),
|
|
2284
2431
|
classNames: __spreadValues({
|
|
2285
|
-
root: (0,
|
|
2286
|
-
months: (0,
|
|
2432
|
+
root: (0, import_cn16.cn)("w-fit", defaultClassNames.root),
|
|
2433
|
+
months: (0, import_cn16.cn)(
|
|
2287
2434
|
"relative flex flex-col gap-4 md:flex-row",
|
|
2288
2435
|
defaultClassNames.months
|
|
2289
2436
|
),
|
|
2290
|
-
month: (0,
|
|
2291
|
-
nav: (0,
|
|
2437
|
+
month: (0, import_cn16.cn)("flex w-full flex-col gap-4", defaultClassNames.month),
|
|
2438
|
+
nav: (0, import_cn16.cn)(
|
|
2292
2439
|
"absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",
|
|
2293
2440
|
defaultClassNames.nav
|
|
2294
2441
|
),
|
|
2295
|
-
button_previous: (0,
|
|
2442
|
+
button_previous: (0, import_cn16.cn)(
|
|
2296
2443
|
buttonVariants({ variant: buttonVariant }),
|
|
2297
2444
|
"size-(--cell-size) p-0 select-none aria-disabled:opacity-50",
|
|
2298
2445
|
defaultClassNames.button_previous
|
|
2299
2446
|
),
|
|
2300
|
-
button_next: (0,
|
|
2447
|
+
button_next: (0, import_cn16.cn)(
|
|
2301
2448
|
buttonVariants({ variant: buttonVariant }),
|
|
2302
2449
|
"size-(--cell-size) p-0 select-none aria-disabled:opacity-50",
|
|
2303
2450
|
defaultClassNames.button_next
|
|
2304
2451
|
),
|
|
2305
|
-
month_caption: (0,
|
|
2452
|
+
month_caption: (0, import_cn16.cn)(
|
|
2306
2453
|
"flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)",
|
|
2307
2454
|
defaultClassNames.month_caption
|
|
2308
2455
|
),
|
|
2309
|
-
dropdowns: (0,
|
|
2456
|
+
dropdowns: (0, import_cn16.cn)(
|
|
2310
2457
|
"flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium",
|
|
2311
2458
|
defaultClassNames.dropdowns
|
|
2312
2459
|
),
|
|
2313
|
-
dropdown_root: (0,
|
|
2460
|
+
dropdown_root: (0, import_cn16.cn)(
|
|
2314
2461
|
"relative rounded-(--cell-radius)",
|
|
2315
2462
|
defaultClassNames.dropdown_root
|
|
2316
2463
|
),
|
|
2317
|
-
dropdown: (0,
|
|
2464
|
+
dropdown: (0, import_cn16.cn)(
|
|
2318
2465
|
"absolute inset-0 bg-popover opacity-0",
|
|
2319
2466
|
defaultClassNames.dropdown
|
|
2320
2467
|
),
|
|
2321
|
-
caption_label: (0,
|
|
2468
|
+
caption_label: (0, import_cn16.cn)(
|
|
2322
2469
|
"font-medium select-none",
|
|
2323
2470
|
captionLayout === "label" ? "text-sm" : "flex items-center gap-1 rounded-(--cell-radius) text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground",
|
|
2324
2471
|
defaultClassNames.caption_label
|
|
2325
2472
|
),
|
|
2326
|
-
month_grid: (0,
|
|
2327
|
-
weekdays: (0,
|
|
2328
|
-
weekday: (0,
|
|
2473
|
+
month_grid: (0, import_cn16.cn)("w-full border-collapse", defaultClassNames.month_grid),
|
|
2474
|
+
weekdays: (0, import_cn16.cn)("flex", defaultClassNames.weekdays),
|
|
2475
|
+
weekday: (0, import_cn16.cn)(
|
|
2329
2476
|
"flex-1 rounded-(--cell-radius) text-[0.8rem] font-normal text-muted-foreground select-none",
|
|
2330
2477
|
defaultClassNames.weekday
|
|
2331
2478
|
),
|
|
2332
|
-
week: (0,
|
|
2333
|
-
week_number_header: (0,
|
|
2479
|
+
week: (0, import_cn16.cn)("mt-2 flex w-full", defaultClassNames.week),
|
|
2480
|
+
week_number_header: (0, import_cn16.cn)(
|
|
2334
2481
|
"w-(--cell-size) select-none",
|
|
2335
2482
|
defaultClassNames.week_number_header
|
|
2336
2483
|
),
|
|
2337
|
-
week_number: (0,
|
|
2484
|
+
week_number: (0, import_cn16.cn)(
|
|
2338
2485
|
"text-[0.8rem] text-muted-foreground select-none",
|
|
2339
2486
|
defaultClassNames.week_number
|
|
2340
2487
|
),
|
|
2341
|
-
day: (0,
|
|
2488
|
+
day: (0, import_cn16.cn)(
|
|
2342
2489
|
"group/day relative aspect-square h-full w-full rounded-(--cell-radius) p-0 text-center select-none [&:last-child[data-selected=true]_button]:rounded-r-(--cell-radius)",
|
|
2343
2490
|
props.showWeekNumber ? "[&:nth-child(2)[data-selected=true]_button]:rounded-l-(--cell-radius)" : "[&:first-child[data-selected=true]_button]:rounded-l-(--cell-radius)",
|
|
2344
2491
|
defaultClassNames.day
|
|
2345
2492
|
),
|
|
2346
|
-
range_start: (0,
|
|
2493
|
+
range_start: (0, import_cn16.cn)(
|
|
2347
2494
|
"relative isolate z-0 rounded-l-(--cell-radius) bg-muted after:absolute after:inset-y-0 after:right-0 after:w-4 after:bg-muted",
|
|
2348
2495
|
defaultClassNames.range_start
|
|
2349
2496
|
),
|
|
2350
|
-
range_middle: (0,
|
|
2351
|
-
range_end: (0,
|
|
2497
|
+
range_middle: (0, import_cn16.cn)("rounded-none", defaultClassNames.range_middle),
|
|
2498
|
+
range_end: (0, import_cn16.cn)(
|
|
2352
2499
|
"relative isolate z-0 rounded-r-(--cell-radius) bg-muted after:absolute after:inset-y-0 after:left-0 after:w-4 after:bg-muted",
|
|
2353
2500
|
defaultClassNames.range_end
|
|
2354
2501
|
),
|
|
2355
|
-
today: (0,
|
|
2502
|
+
today: (0, import_cn16.cn)(
|
|
2356
2503
|
"rounded-(--cell-radius) bg-muted text-foreground data-[selected=true]:rounded-none",
|
|
2357
2504
|
defaultClassNames.today
|
|
2358
2505
|
),
|
|
2359
|
-
outside: (0,
|
|
2506
|
+
outside: (0, import_cn16.cn)(
|
|
2360
2507
|
"text-muted-foreground aria-selected:text-muted-foreground",
|
|
2361
2508
|
defaultClassNames.outside
|
|
2362
2509
|
),
|
|
2363
|
-
disabled: (0,
|
|
2510
|
+
disabled: (0, import_cn16.cn)(
|
|
2364
2511
|
"text-muted-foreground opacity-50",
|
|
2365
2512
|
defaultClassNames.disabled
|
|
2366
2513
|
),
|
|
2367
|
-
hidden: (0,
|
|
2514
|
+
hidden: (0, import_cn16.cn)("invisible", defaultClassNames.hidden)
|
|
2368
2515
|
}, classNames),
|
|
2369
2516
|
components: __spreadValues({
|
|
2370
2517
|
Root: (_a2) => {
|
|
2371
2518
|
var _b2 = _a2, { className: className2, rootRef } = _b2, props2 = __objRest(_b2, ["className", "rootRef"]);
|
|
2372
|
-
return /* @__PURE__ */ (0,
|
|
2519
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2373
2520
|
"div",
|
|
2374
2521
|
__spreadValues({
|
|
2375
2522
|
"data-slot": "calendar",
|
|
2376
2523
|
ref: rootRef,
|
|
2377
|
-
className: (0,
|
|
2524
|
+
className: (0, import_cn16.cn)(className2)
|
|
2378
2525
|
}, props2)
|
|
2379
2526
|
);
|
|
2380
2527
|
},
|
|
2381
2528
|
Chevron: (_c) => {
|
|
2382
2529
|
var _d = _c, { className: className2, orientation } = _d, props2 = __objRest(_d, ["className", "orientation"]);
|
|
2383
2530
|
if (orientation === "left") {
|
|
2384
|
-
return /* @__PURE__ */ (0,
|
|
2531
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react13.ChevronLeftIcon, __spreadValues({ className: (0, import_cn16.cn)("size-4", className2) }, props2));
|
|
2385
2532
|
}
|
|
2386
2533
|
if (orientation === "right") {
|
|
2387
|
-
return /* @__PURE__ */ (0,
|
|
2388
|
-
|
|
2534
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2535
|
+
import_lucide_react13.ChevronRightIcon,
|
|
2389
2536
|
__spreadValues({
|
|
2390
|
-
className: (0,
|
|
2537
|
+
className: (0, import_cn16.cn)("size-4", className2)
|
|
2391
2538
|
}, props2)
|
|
2392
2539
|
);
|
|
2393
2540
|
}
|
|
2394
|
-
return /* @__PURE__ */ (0,
|
|
2541
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react13.ChevronDownIcon, __spreadValues({ className: (0, import_cn16.cn)("size-4", className2) }, props2));
|
|
2395
2542
|
},
|
|
2396
2543
|
DayButton: (_e) => {
|
|
2397
2544
|
var props2 = __objRest(_e, []);
|
|
2398
|
-
return /* @__PURE__ */ (0,
|
|
2545
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(CalendarDayButton, __spreadValues({ locale }, props2));
|
|
2399
2546
|
},
|
|
2400
2547
|
WeekNumber: (_f) => {
|
|
2401
2548
|
var _g = _f, { children } = _g, props2 = __objRest(_g, ["children"]);
|
|
2402
|
-
return /* @__PURE__ */ (0,
|
|
2549
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("td", __spreadProps(__spreadValues({}, props2), { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "flex size-(--cell-size) items-center justify-center text-center", children }) }));
|
|
2403
2550
|
}
|
|
2404
2551
|
}, components)
|
|
2405
2552
|
}, props)
|
|
@@ -2423,7 +2570,7 @@ function CalendarDayButton(_a) {
|
|
|
2423
2570
|
var _a2;
|
|
2424
2571
|
if (modifiers.focused) (_a2 = ref.current) == null ? void 0 : _a2.focus();
|
|
2425
2572
|
}, [modifiers.focused]);
|
|
2426
|
-
return /* @__PURE__ */ (0,
|
|
2573
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2427
2574
|
Button,
|
|
2428
2575
|
__spreadValues({
|
|
2429
2576
|
variant: "ghost",
|
|
@@ -2433,7 +2580,7 @@ function CalendarDayButton(_a) {
|
|
|
2433
2580
|
"data-range-start": modifiers.range_start,
|
|
2434
2581
|
"data-range-end": modifiers.range_end,
|
|
2435
2582
|
"data-range-middle": modifiers.range_middle,
|
|
2436
|
-
className: (0,
|
|
2583
|
+
className: (0, import_cn16.cn)(
|
|
2437
2584
|
"relative isolate z-10 flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 border-0 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-[3px] group-data-[focused=true]/day:ring-ring/50 data-[range-end=true]:rounded-(--cell-radius) data-[range-end=true]:rounded-r-(--cell-radius) data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-muted data-[range-middle=true]:text-foreground data-[range-start=true]:rounded-(--cell-radius) data-[range-start=true]:rounded-l-(--cell-radius) data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground dark:hover:text-foreground [&>span]:text-xs [&>span]:opacity-70",
|
|
2438
2585
|
defaultClassNames.day,
|
|
2439
2586
|
className
|
|
@@ -2444,15 +2591,15 @@ function CalendarDayButton(_a) {
|
|
|
2444
2591
|
|
|
2445
2592
|
// src/components/ui/popover.tsx
|
|
2446
2593
|
var import_popover = require("@base-ui/react/popover");
|
|
2447
|
-
var
|
|
2448
|
-
var
|
|
2594
|
+
var import_cn17 = require("cn");
|
|
2595
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
2449
2596
|
function Popover(_a) {
|
|
2450
2597
|
var props = __objRest(_a, []);
|
|
2451
|
-
return /* @__PURE__ */ (0,
|
|
2598
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_popover.Popover.Root, __spreadValues({ "data-slot": "popover" }, props));
|
|
2452
2599
|
}
|
|
2453
2600
|
function PopoverTrigger(_a) {
|
|
2454
2601
|
var props = __objRest(_a, []);
|
|
2455
|
-
return /* @__PURE__ */ (0,
|
|
2602
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_popover.Popover.Trigger, __spreadValues({ "data-slot": "popover-trigger" }, props));
|
|
2456
2603
|
}
|
|
2457
2604
|
function PopoverContent(_a) {
|
|
2458
2605
|
var _b = _a, {
|
|
@@ -2468,7 +2615,7 @@ function PopoverContent(_a) {
|
|
|
2468
2615
|
"side",
|
|
2469
2616
|
"sideOffset"
|
|
2470
2617
|
]);
|
|
2471
|
-
return /* @__PURE__ */ (0,
|
|
2618
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_popover.Popover.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2472
2619
|
import_popover.Popover.Positioner,
|
|
2473
2620
|
{
|
|
2474
2621
|
align,
|
|
@@ -2476,11 +2623,11 @@ function PopoverContent(_a) {
|
|
|
2476
2623
|
side,
|
|
2477
2624
|
sideOffset,
|
|
2478
2625
|
className: "isolate z-50",
|
|
2479
|
-
children: /* @__PURE__ */ (0,
|
|
2626
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2480
2627
|
import_popover.Popover.Popup,
|
|
2481
2628
|
__spreadValues({
|
|
2482
2629
|
"data-slot": "popover-content",
|
|
2483
|
-
className: (0,
|
|
2630
|
+
className: (0, import_cn17.cn)(
|
|
2484
2631
|
"z-50 flex w-72 origin-(--transform-origin) flex-col gap-4 rounded-lg bg-popover p-2.5 text-xs text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
2485
2632
|
className
|
|
2486
2633
|
)
|
|
@@ -2492,17 +2639,17 @@ function PopoverContent(_a) {
|
|
|
2492
2639
|
|
|
2493
2640
|
// src/components/ui/select.tsx
|
|
2494
2641
|
var import_select = require("@base-ui/react/select");
|
|
2495
|
-
var
|
|
2496
|
-
var
|
|
2497
|
-
var
|
|
2642
|
+
var import_cn18 = require("cn");
|
|
2643
|
+
var import_lucide_react14 = require("lucide-react");
|
|
2644
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
2498
2645
|
var Select = import_select.Select.Root;
|
|
2499
2646
|
function SelectValue(_a) {
|
|
2500
2647
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
2501
|
-
return /* @__PURE__ */ (0,
|
|
2648
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2502
2649
|
import_select.Select.Value,
|
|
2503
2650
|
__spreadValues({
|
|
2504
2651
|
"data-slot": "select-value",
|
|
2505
|
-
className: (0,
|
|
2652
|
+
className: (0, import_cn18.cn)("flex flex-1 text-left", className)
|
|
2506
2653
|
}, props)
|
|
2507
2654
|
);
|
|
2508
2655
|
}
|
|
@@ -2516,22 +2663,22 @@ function SelectTrigger(_a) {
|
|
|
2516
2663
|
"size",
|
|
2517
2664
|
"children"
|
|
2518
2665
|
]);
|
|
2519
|
-
return /* @__PURE__ */ (0,
|
|
2666
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
2520
2667
|
import_select.Select.Trigger,
|
|
2521
2668
|
__spreadProps(__spreadValues({
|
|
2522
2669
|
"data-slot": "select-trigger",
|
|
2523
2670
|
"data-size": size,
|
|
2524
|
-
className: (0,
|
|
2671
|
+
className: (0, import_cn18.cn)(
|
|
2525
2672
|
"flex w-fit items-center justify-between gap-1.5 rounded-md border border-input bg-input/20 px-2 py-1.5 text-xs/relaxed whitespace-nowrap transition-colors outline-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-7 data-[size=sm]:h-6 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5",
|
|
2526
2673
|
className
|
|
2527
2674
|
)
|
|
2528
2675
|
}, props), {
|
|
2529
2676
|
children: [
|
|
2530
2677
|
children,
|
|
2531
|
-
/* @__PURE__ */ (0,
|
|
2678
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2532
2679
|
import_select.Select.Icon,
|
|
2533
2680
|
{
|
|
2534
|
-
render: /* @__PURE__ */ (0,
|
|
2681
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react14.ChevronDownIcon, { className: "pointer-events-none size-3.5 text-muted-foreground" })
|
|
2535
2682
|
}
|
|
2536
2683
|
)
|
|
2537
2684
|
]
|
|
@@ -2556,7 +2703,7 @@ function SelectContent(_a) {
|
|
|
2556
2703
|
"alignOffset",
|
|
2557
2704
|
"alignItemWithTrigger"
|
|
2558
2705
|
]);
|
|
2559
|
-
return /* @__PURE__ */ (0,
|
|
2706
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_select.Select.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2560
2707
|
import_select.Select.Positioner,
|
|
2561
2708
|
{
|
|
2562
2709
|
side,
|
|
@@ -2565,20 +2712,20 @@ function SelectContent(_a) {
|
|
|
2565
2712
|
alignOffset,
|
|
2566
2713
|
alignItemWithTrigger,
|
|
2567
2714
|
className: "isolate z-50",
|
|
2568
|
-
children: /* @__PURE__ */ (0,
|
|
2715
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
2569
2716
|
import_select.Select.Popup,
|
|
2570
2717
|
__spreadProps(__spreadValues({
|
|
2571
2718
|
"data-slot": "select-content",
|
|
2572
2719
|
"data-align-trigger": alignItemWithTrigger,
|
|
2573
|
-
className: (0,
|
|
2720
|
+
className: (0, import_cn18.cn)(
|
|
2574
2721
|
"relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
2575
2722
|
className
|
|
2576
2723
|
)
|
|
2577
2724
|
}, props), {
|
|
2578
2725
|
children: [
|
|
2579
|
-
/* @__PURE__ */ (0,
|
|
2580
|
-
/* @__PURE__ */ (0,
|
|
2581
|
-
/* @__PURE__ */ (0,
|
|
2726
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(SelectScrollUpButton, {}),
|
|
2727
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_select.Select.List, { children }),
|
|
2728
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(SelectScrollDownButton, {})
|
|
2582
2729
|
]
|
|
2583
2730
|
})
|
|
2584
2731
|
)
|
|
@@ -2593,22 +2740,22 @@ function SelectItem(_a) {
|
|
|
2593
2740
|
"className",
|
|
2594
2741
|
"children"
|
|
2595
2742
|
]);
|
|
2596
|
-
return /* @__PURE__ */ (0,
|
|
2743
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
2597
2744
|
import_select.Select.Item,
|
|
2598
2745
|
__spreadProps(__spreadValues({
|
|
2599
2746
|
"data-slot": "select-item",
|
|
2600
|
-
className: (0,
|
|
2747
|
+
className: (0, import_cn18.cn)(
|
|
2601
2748
|
"relative flex min-h-7 w-full cursor-default items-center gap-2 rounded-md px-2 py-1 text-xs/relaxed outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
|
|
2602
2749
|
className
|
|
2603
2750
|
)
|
|
2604
2751
|
}, props), {
|
|
2605
2752
|
children: [
|
|
2606
|
-
/* @__PURE__ */ (0,
|
|
2607
|
-
/* @__PURE__ */ (0,
|
|
2753
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_select.Select.ItemText, { className: "flex flex-1 shrink-0 gap-2 whitespace-nowrap", children }),
|
|
2754
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2608
2755
|
import_select.Select.ItemIndicator,
|
|
2609
2756
|
{
|
|
2610
|
-
render: /* @__PURE__ */ (0,
|
|
2611
|
-
children: /* @__PURE__ */ (0,
|
|
2757
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "pointer-events-none absolute right-2 flex items-center justify-center" }),
|
|
2758
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react14.CheckIcon, { className: "pointer-events-none" })
|
|
2612
2759
|
}
|
|
2613
2760
|
)
|
|
2614
2761
|
]
|
|
@@ -2621,16 +2768,16 @@ function SelectScrollUpButton(_a) {
|
|
|
2621
2768
|
} = _b, props = __objRest(_b, [
|
|
2622
2769
|
"className"
|
|
2623
2770
|
]);
|
|
2624
|
-
return /* @__PURE__ */ (0,
|
|
2771
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2625
2772
|
import_select.Select.ScrollUpArrow,
|
|
2626
2773
|
__spreadProps(__spreadValues({
|
|
2627
2774
|
"data-slot": "select-scroll-up-button",
|
|
2628
|
-
className: (0,
|
|
2775
|
+
className: (0, import_cn18.cn)(
|
|
2629
2776
|
"top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-3.5",
|
|
2630
2777
|
className
|
|
2631
2778
|
)
|
|
2632
2779
|
}, props), {
|
|
2633
|
-
children: /* @__PURE__ */ (0,
|
|
2780
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react14.ChevronUpIcon, {})
|
|
2634
2781
|
})
|
|
2635
2782
|
);
|
|
2636
2783
|
}
|
|
@@ -2640,22 +2787,22 @@ function SelectScrollDownButton(_a) {
|
|
|
2640
2787
|
} = _b, props = __objRest(_b, [
|
|
2641
2788
|
"className"
|
|
2642
2789
|
]);
|
|
2643
|
-
return /* @__PURE__ */ (0,
|
|
2790
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2644
2791
|
import_select.Select.ScrollDownArrow,
|
|
2645
2792
|
__spreadProps(__spreadValues({
|
|
2646
2793
|
"data-slot": "select-scroll-down-button",
|
|
2647
|
-
className: (0,
|
|
2794
|
+
className: (0, import_cn18.cn)(
|
|
2648
2795
|
"bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-3.5",
|
|
2649
2796
|
className
|
|
2650
2797
|
)
|
|
2651
2798
|
}, props), {
|
|
2652
|
-
children: /* @__PURE__ */ (0,
|
|
2799
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react14.ChevronDownIcon, {})
|
|
2653
2800
|
})
|
|
2654
2801
|
);
|
|
2655
2802
|
}
|
|
2656
2803
|
|
|
2657
2804
|
// src/components/composed/data-table/table-header-filter.tsx
|
|
2658
|
-
var
|
|
2805
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
2659
2806
|
function smartFilterFn(row, columnId, filterValue) {
|
|
2660
2807
|
var _a, _b, _c;
|
|
2661
2808
|
if (filterValue === void 0 || filterValue === null || filterValue === "" || filterValue === "all") {
|
|
@@ -2796,13 +2943,13 @@ function ColumnFilterInput({
|
|
|
2796
2943
|
table,
|
|
2797
2944
|
headerText
|
|
2798
2945
|
}) {
|
|
2799
|
-
const [calendarOpen, setCalendarOpen] = (0,
|
|
2946
|
+
const [calendarOpen, setCalendarOpen] = (0, import_react9.useState)(false);
|
|
2800
2947
|
const filterValue = column.getFilterValue();
|
|
2801
|
-
const variant = (0,
|
|
2948
|
+
const variant = (0, import_react9.useMemo)(
|
|
2802
2949
|
() => getFilterVariant(column, table),
|
|
2803
2950
|
[column, table]
|
|
2804
2951
|
);
|
|
2805
|
-
const options = (0,
|
|
2952
|
+
const options = (0, import_react9.useMemo)(() => {
|
|
2806
2953
|
if (variant === "boolean") {
|
|
2807
2954
|
return [
|
|
2808
2955
|
{ label: "True / Yes", value: "true" },
|
|
@@ -2816,7 +2963,7 @@ function ColumnFilterInput({
|
|
|
2816
2963
|
}, [column, table, variant]);
|
|
2817
2964
|
if (variant === "boolean" || variant === "select") {
|
|
2818
2965
|
const currentValue = filterValue === void 0 || filterValue === null || filterValue === "" ? "all" : String(filterValue);
|
|
2819
|
-
return /* @__PURE__ */ (0,
|
|
2966
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "relative flex items-center w-full", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
2820
2967
|
Select,
|
|
2821
2968
|
{
|
|
2822
2969
|
value: currentValue,
|
|
@@ -2828,13 +2975,13 @@ function ColumnFilterInput({
|
|
|
2828
2975
|
}
|
|
2829
2976
|
},
|
|
2830
2977
|
children: [
|
|
2831
|
-
/* @__PURE__ */ (0,
|
|
2978
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2832
2979
|
SelectTrigger,
|
|
2833
2980
|
{
|
|
2834
2981
|
className: "w-full",
|
|
2835
2982
|
onKeyDown: (e) => e.stopPropagation(),
|
|
2836
2983
|
onPointerDown: (e) => e.stopPropagation(),
|
|
2837
|
-
children: /* @__PURE__ */ (0,
|
|
2984
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2838
2985
|
SelectValue,
|
|
2839
2986
|
{
|
|
2840
2987
|
placeholder: `Select ${headerText.toLowerCase()}...`,
|
|
@@ -2843,9 +2990,9 @@ function ColumnFilterInput({
|
|
|
2843
2990
|
)
|
|
2844
2991
|
}
|
|
2845
2992
|
),
|
|
2846
|
-
/* @__PURE__ */ (0,
|
|
2847
|
-
/* @__PURE__ */ (0,
|
|
2848
|
-
options.map((opt) => /* @__PURE__ */ (0,
|
|
2993
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(SelectContent, { align: "start", children: [
|
|
2994
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(SelectItem, { value: "all", children: "All" }),
|
|
2995
|
+
options.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2849
2996
|
SelectItem,
|
|
2850
2997
|
{
|
|
2851
2998
|
value: opt.value,
|
|
@@ -2872,36 +3019,36 @@ function ColumnFilterInput({
|
|
|
2872
3019
|
}
|
|
2873
3020
|
}
|
|
2874
3021
|
const formattedDateLabel = dateObj ? (0, import_date_fns.format)(dateObj, "yyyy-MM-dd") : "";
|
|
2875
|
-
return /* @__PURE__ */ (0,
|
|
2876
|
-
/* @__PURE__ */ (0,
|
|
3022
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "relative flex items-center w-full", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Popover, { open: calendarOpen, onOpenChange: setCalendarOpen, children: [
|
|
3023
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2877
3024
|
PopoverTrigger,
|
|
2878
3025
|
{
|
|
2879
|
-
render: /* @__PURE__ */ (0,
|
|
3026
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
2880
3027
|
Button,
|
|
2881
3028
|
{
|
|
2882
3029
|
variant: "outline",
|
|
2883
|
-
className: (0,
|
|
3030
|
+
className: (0, import_cn14.cn)(
|
|
2884
3031
|
"w-full justify-start",
|
|
2885
3032
|
!formattedDateLabel && "text-muted-foreground"
|
|
2886
3033
|
),
|
|
2887
3034
|
onKeyDown: (e) => e.stopPropagation(),
|
|
2888
3035
|
onPointerDown: (e) => e.stopPropagation(),
|
|
2889
3036
|
children: [
|
|
2890
|
-
/* @__PURE__ */ (0,
|
|
2891
|
-
/* @__PURE__ */ (0,
|
|
3037
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react15.CalendarIcon, { className: "mr-1 size-3 shrink-0" }),
|
|
3038
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "truncate", children: formattedDateLabel || `Pick ${headerText.toLowerCase()}...` })
|
|
2892
3039
|
]
|
|
2893
3040
|
}
|
|
2894
3041
|
)
|
|
2895
3042
|
}
|
|
2896
3043
|
),
|
|
2897
|
-
/* @__PURE__ */ (0,
|
|
3044
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2898
3045
|
PopoverContent,
|
|
2899
3046
|
{
|
|
2900
3047
|
className: "w-auto p-0",
|
|
2901
3048
|
align: "start",
|
|
2902
3049
|
onPointerDown: (e) => e.stopPropagation(),
|
|
2903
3050
|
onKeyDown: (e) => e.stopPropagation(),
|
|
2904
|
-
children: /* @__PURE__ */ (0,
|
|
3051
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2905
3052
|
Calendar,
|
|
2906
3053
|
{
|
|
2907
3054
|
mode: "single",
|
|
@@ -2920,7 +3067,7 @@ function ColumnFilterInput({
|
|
|
2920
3067
|
)
|
|
2921
3068
|
] }) });
|
|
2922
3069
|
}
|
|
2923
|
-
return /* @__PURE__ */ (0,
|
|
3070
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "relative flex items-center w-full", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2924
3071
|
Input,
|
|
2925
3072
|
{
|
|
2926
3073
|
id: `filter-${column.id}`,
|
|
@@ -2937,46 +3084,46 @@ function DataTableHeaderFilter({
|
|
|
2937
3084
|
table,
|
|
2938
3085
|
columnFilters
|
|
2939
3086
|
}) {
|
|
2940
|
-
const filterableColumns = (0,
|
|
3087
|
+
const filterableColumns = (0, import_react9.useMemo)(
|
|
2941
3088
|
() => table.getAllColumns().filter(
|
|
2942
3089
|
(column) => typeof column.accessorFn !== "undefined" && column.getCanFilter()
|
|
2943
3090
|
),
|
|
2944
3091
|
[table]
|
|
2945
3092
|
);
|
|
2946
3093
|
if (filterableColumns.length === 0) return null;
|
|
2947
|
-
return /* @__PURE__ */ (0,
|
|
2948
|
-
/* @__PURE__ */ (0,
|
|
2949
|
-
/* @__PURE__ */ (0,
|
|
3094
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(DropdownMenu, { children: [
|
|
3095
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Tooltip, { children: [
|
|
3096
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2950
3097
|
DropdownMenuTrigger,
|
|
2951
3098
|
{
|
|
2952
|
-
render: /* @__PURE__ */ (0,
|
|
3099
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2953
3100
|
TooltipTrigger,
|
|
2954
3101
|
{
|
|
2955
|
-
render: /* @__PURE__ */ (0,
|
|
3102
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2956
3103
|
Button,
|
|
2957
3104
|
{
|
|
2958
3105
|
variant: columnFilters.length > 0 ? "secondary" : "outline",
|
|
2959
3106
|
size: "icon",
|
|
2960
|
-
children: /* @__PURE__ */ (0,
|
|
3107
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react15.ListFilterIcon, {})
|
|
2961
3108
|
}
|
|
2962
3109
|
)
|
|
2963
3110
|
}
|
|
2964
3111
|
)
|
|
2965
3112
|
}
|
|
2966
3113
|
),
|
|
2967
|
-
/* @__PURE__ */ (0,
|
|
3114
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(TooltipContent, { children: "Filter options" })
|
|
2968
3115
|
] }),
|
|
2969
|
-
/* @__PURE__ */ (0,
|
|
2970
|
-
/* @__PURE__ */ (0,
|
|
2971
|
-
/* @__PURE__ */ (0,
|
|
2972
|
-
/* @__PURE__ */ (0,
|
|
3116
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(DropdownMenuContent, { align: "end", className: "w-80", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(DropdownMenuGroup, { children: [
|
|
3117
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(DropdownMenuLabel, { children: "Filter by column" }),
|
|
3118
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(DropdownMenuSeparator, {}),
|
|
3119
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "max-h-64 overflow-y-auto space-y-2.5 p-1", children: filterableColumns.map((column) => {
|
|
2973
3120
|
const headerText = typeof column.columnDef.header === "string" ? column.columnDef.header : column.id;
|
|
2974
|
-
return /* @__PURE__ */ (0,
|
|
3121
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
2975
3122
|
"div",
|
|
2976
3123
|
{
|
|
2977
3124
|
className: "flex items-center justify-between px-1",
|
|
2978
3125
|
children: [
|
|
2979
|
-
/* @__PURE__ */ (0,
|
|
3126
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2980
3127
|
"label",
|
|
2981
3128
|
{
|
|
2982
3129
|
htmlFor: `filter-${column.id}`,
|
|
@@ -2984,7 +3131,7 @@ function DataTableHeaderFilter({
|
|
|
2984
3131
|
children: headerText
|
|
2985
3132
|
}
|
|
2986
3133
|
),
|
|
2987
|
-
/* @__PURE__ */ (0,
|
|
3134
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2988
3135
|
ColumnFilterInput,
|
|
2989
3136
|
{
|
|
2990
3137
|
column,
|
|
@@ -2997,9 +3144,9 @@ function DataTableHeaderFilter({
|
|
|
2997
3144
|
column.id
|
|
2998
3145
|
);
|
|
2999
3146
|
}) }),
|
|
3000
|
-
columnFilters.length > 0 && /* @__PURE__ */ (0,
|
|
3001
|
-
/* @__PURE__ */ (0,
|
|
3002
|
-
/* @__PURE__ */ (0,
|
|
3147
|
+
columnFilters.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
|
|
3148
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(DropdownMenuSeparator, {}),
|
|
3149
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3003
3150
|
DropdownMenuItem,
|
|
3004
3151
|
{
|
|
3005
3152
|
className: "hover:cursor-pointer text-destructive focus:text-destructive",
|
|
@@ -3013,13 +3160,13 @@ function DataTableHeaderFilter({
|
|
|
3013
3160
|
}
|
|
3014
3161
|
|
|
3015
3162
|
// src/components/composed/data-table/table-header-refresh.tsx
|
|
3016
|
-
var
|
|
3163
|
+
var import_lucide_react16 = require("lucide-react");
|
|
3017
3164
|
var import_navigation2 = require("next/navigation");
|
|
3018
|
-
var
|
|
3019
|
-
var
|
|
3165
|
+
var import_react10 = require("react");
|
|
3166
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
3020
3167
|
function DataTableHeaderRefresh() {
|
|
3021
3168
|
const router = (0, import_navigation2.useRouter)();
|
|
3022
|
-
const [isRefreshing, setIsRefreshing] = (0,
|
|
3169
|
+
const [isRefreshing, setIsRefreshing] = (0, import_react10.useState)(false);
|
|
3023
3170
|
const handleRefresh = () => {
|
|
3024
3171
|
setIsRefreshing(true);
|
|
3025
3172
|
router.refresh();
|
|
@@ -3027,21 +3174,21 @@ function DataTableHeaderRefresh() {
|
|
|
3027
3174
|
setIsRefreshing(false);
|
|
3028
3175
|
}, 750);
|
|
3029
3176
|
};
|
|
3030
|
-
return /* @__PURE__ */ (0,
|
|
3031
|
-
/* @__PURE__ */ (0,
|
|
3177
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Tooltip, { children: [
|
|
3178
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3032
3179
|
TooltipTrigger,
|
|
3033
3180
|
{
|
|
3034
|
-
render: /* @__PURE__ */ (0,
|
|
3181
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3035
3182
|
Button,
|
|
3036
3183
|
{
|
|
3037
3184
|
variant: "outline",
|
|
3038
3185
|
size: "icon",
|
|
3039
3186
|
onClick: handleRefresh,
|
|
3040
3187
|
disabled: isRefreshing,
|
|
3041
|
-
children: /* @__PURE__ */ (0,
|
|
3042
|
-
|
|
3188
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3189
|
+
import_lucide_react16.RotateCwIcon,
|
|
3043
3190
|
{
|
|
3044
|
-
className: (0,
|
|
3191
|
+
className: (0, import_cn14.cn)(
|
|
3045
3192
|
"transition-transform duration-750",
|
|
3046
3193
|
isRefreshing && "animate-spin"
|
|
3047
3194
|
)
|
|
@@ -3051,19 +3198,19 @@ function DataTableHeaderRefresh() {
|
|
|
3051
3198
|
)
|
|
3052
3199
|
}
|
|
3053
3200
|
),
|
|
3054
|
-
/* @__PURE__ */ (0,
|
|
3201
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(TooltipContent, { children: "Refresh data" })
|
|
3055
3202
|
] });
|
|
3056
3203
|
}
|
|
3057
3204
|
|
|
3058
3205
|
// src/components/composed/data-table/table-header-search.tsx
|
|
3059
|
-
var
|
|
3060
|
-
var
|
|
3206
|
+
var import_lucide_react17 = require("lucide-react");
|
|
3207
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
3061
3208
|
function DataTableHeaderSearch({
|
|
3062
3209
|
value = "",
|
|
3063
3210
|
onChange
|
|
3064
3211
|
}) {
|
|
3065
|
-
return /* @__PURE__ */ (0,
|
|
3066
|
-
/* @__PURE__ */ (0,
|
|
3212
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "relative flex items-center max-w-sm w-full", children: [
|
|
3213
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
3067
3214
|
Input,
|
|
3068
3215
|
{
|
|
3069
3216
|
placeholder: "Search...",
|
|
@@ -3072,56 +3219,56 @@ function DataTableHeaderSearch({
|
|
|
3072
3219
|
className: "pr-7"
|
|
3073
3220
|
}
|
|
3074
3221
|
),
|
|
3075
|
-
Boolean(value) && /* @__PURE__ */ (0,
|
|
3222
|
+
Boolean(value) && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
3076
3223
|
"button",
|
|
3077
3224
|
{
|
|
3078
3225
|
type: "button",
|
|
3079
3226
|
onClick: () => onChange(""),
|
|
3080
3227
|
className: "absolute right-2 text-muted-foreground hover:text-foreground p-0.5 rounded cursor-pointer",
|
|
3081
3228
|
"aria-label": "Clear search text",
|
|
3082
|
-
children: /* @__PURE__ */ (0,
|
|
3229
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react17.XIcon, { className: "size-3.5" })
|
|
3083
3230
|
}
|
|
3084
3231
|
)
|
|
3085
3232
|
] });
|
|
3086
3233
|
}
|
|
3087
3234
|
|
|
3088
3235
|
// src/components/composed/data-table/table-header-sort.tsx
|
|
3089
|
-
var
|
|
3090
|
-
var
|
|
3236
|
+
var import_lucide_react18 = require("lucide-react");
|
|
3237
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
3091
3238
|
function DataTableHeaderSort({
|
|
3092
3239
|
table,
|
|
3093
3240
|
sorting
|
|
3094
3241
|
}) {
|
|
3095
3242
|
const sortableColumns = table.getAllColumns().filter((column) => column.getCanSort());
|
|
3096
|
-
return /* @__PURE__ */ (0,
|
|
3097
|
-
/* @__PURE__ */ (0,
|
|
3098
|
-
/* @__PURE__ */ (0,
|
|
3243
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(DropdownMenu, { children: [
|
|
3244
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Tooltip, { children: [
|
|
3245
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
3099
3246
|
DropdownMenuTrigger,
|
|
3100
3247
|
{
|
|
3101
|
-
render: /* @__PURE__ */ (0,
|
|
3248
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
3102
3249
|
TooltipTrigger,
|
|
3103
3250
|
{
|
|
3104
|
-
render: /* @__PURE__ */ (0,
|
|
3251
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
3105
3252
|
Button,
|
|
3106
3253
|
{
|
|
3107
3254
|
variant: sorting.length > 0 ? "secondary" : "outline",
|
|
3108
3255
|
size: "icon",
|
|
3109
|
-
children: /* @__PURE__ */ (0,
|
|
3256
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react18.ArrowUpDownIcon, {})
|
|
3110
3257
|
}
|
|
3111
3258
|
)
|
|
3112
3259
|
}
|
|
3113
3260
|
)
|
|
3114
3261
|
}
|
|
3115
3262
|
),
|
|
3116
|
-
/* @__PURE__ */ (0,
|
|
3263
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(TooltipContent, { children: "Sort options" })
|
|
3117
3264
|
] }),
|
|
3118
|
-
/* @__PURE__ */ (0,
|
|
3119
|
-
/* @__PURE__ */ (0,
|
|
3120
|
-
/* @__PURE__ */ (0,
|
|
3265
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(DropdownMenuContent, { align: "end", className: "w-48", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(DropdownMenuGroup, { children: [
|
|
3266
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(DropdownMenuLabel, { children: "Sort by column" }),
|
|
3267
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(DropdownMenuSeparator, {}),
|
|
3121
3268
|
sortableColumns.map((column) => {
|
|
3122
3269
|
const isSorted = column.getIsSorted();
|
|
3123
3270
|
const headerText = typeof column.columnDef.header === "string" ? column.columnDef.header : column.id;
|
|
3124
|
-
return /* @__PURE__ */ (0,
|
|
3271
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
3125
3272
|
DropdownMenuItem,
|
|
3126
3273
|
{
|
|
3127
3274
|
className: "flex items-center justify-between hover:cursor-pointer capitalize",
|
|
@@ -3136,16 +3283,16 @@ function DataTableHeaderSort({
|
|
|
3136
3283
|
},
|
|
3137
3284
|
children: [
|
|
3138
3285
|
headerText,
|
|
3139
|
-
isSorted === "asc" && /* @__PURE__ */ (0,
|
|
3140
|
-
isSorted === "desc" && /* @__PURE__ */ (0,
|
|
3286
|
+
isSorted === "asc" && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react18.ArrowUpIcon, { className: "size-3.5" }),
|
|
3287
|
+
isSorted === "desc" && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react18.ArrowDownIcon, { className: "size-3.5" })
|
|
3141
3288
|
]
|
|
3142
3289
|
},
|
|
3143
3290
|
column.id
|
|
3144
3291
|
);
|
|
3145
3292
|
}),
|
|
3146
|
-
sorting.length > 0 && /* @__PURE__ */ (0,
|
|
3147
|
-
/* @__PURE__ */ (0,
|
|
3148
|
-
/* @__PURE__ */ (0,
|
|
3293
|
+
sorting.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
|
|
3294
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(DropdownMenuSeparator, {}),
|
|
3295
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
3149
3296
|
DropdownMenuItem,
|
|
3150
3297
|
{
|
|
3151
3298
|
className: "hover:cursor-pointer text-destructive focus:text-destructive",
|
|
@@ -3159,34 +3306,34 @@ function DataTableHeaderSort({
|
|
|
3159
3306
|
}
|
|
3160
3307
|
|
|
3161
3308
|
// src/components/composed/data-table/table-header-toggle.tsx
|
|
3162
|
-
var
|
|
3163
|
-
var
|
|
3309
|
+
var import_lucide_react19 = require("lucide-react");
|
|
3310
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
3164
3311
|
function DataTableHeaderToggle({
|
|
3165
3312
|
table
|
|
3166
3313
|
}) {
|
|
3167
|
-
return /* @__PURE__ */ (0,
|
|
3168
|
-
/* @__PURE__ */ (0,
|
|
3169
|
-
/* @__PURE__ */ (0,
|
|
3314
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(DropdownMenu, { children: [
|
|
3315
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(Tooltip, { children: [
|
|
3316
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3170
3317
|
DropdownMenuTrigger,
|
|
3171
3318
|
{
|
|
3172
|
-
render: /* @__PURE__ */ (0,
|
|
3319
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3173
3320
|
TooltipTrigger,
|
|
3174
3321
|
{
|
|
3175
|
-
render: /* @__PURE__ */ (0,
|
|
3322
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Button, { variant: "outline", size: "icon", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_lucide_react19.Columns3CogIcon, {}) })
|
|
3176
3323
|
}
|
|
3177
3324
|
)
|
|
3178
3325
|
}
|
|
3179
3326
|
),
|
|
3180
|
-
/* @__PURE__ */ (0,
|
|
3327
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(TooltipContent, { children: "Toggle columns" })
|
|
3181
3328
|
] }),
|
|
3182
|
-
/* @__PURE__ */ (0,
|
|
3183
|
-
/* @__PURE__ */ (0,
|
|
3184
|
-
/* @__PURE__ */ (0,
|
|
3329
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(DropdownMenuContent, { align: "end", className: "w-48", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(DropdownMenuGroup, { children: [
|
|
3330
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(DropdownMenuLabel, { children: "Toggle columns" }),
|
|
3331
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(DropdownMenuSeparator, {}),
|
|
3185
3332
|
table.getAllColumns().filter(
|
|
3186
3333
|
(column) => typeof column.accessorFn !== "undefined" && column.getCanHide()
|
|
3187
3334
|
).map((column) => {
|
|
3188
3335
|
const headerText = typeof column.columnDef.header === "string" ? column.columnDef.header : column.id;
|
|
3189
|
-
return /* @__PURE__ */ (0,
|
|
3336
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3190
3337
|
DropdownMenuCheckboxItem,
|
|
3191
3338
|
{
|
|
3192
3339
|
className: "capitalize hover:cursor-pointer",
|
|
@@ -3202,9 +3349,9 @@ function DataTableHeaderToggle({
|
|
|
3202
3349
|
}
|
|
3203
3350
|
|
|
3204
3351
|
// src/components/composed/data-table/data-row-actions.tsx
|
|
3205
|
-
var
|
|
3206
|
-
var
|
|
3207
|
-
var
|
|
3352
|
+
var import_lucide_react20 = require("lucide-react");
|
|
3353
|
+
var import_react11 = require("react");
|
|
3354
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
3208
3355
|
function RowActions({
|
|
3209
3356
|
label = "Actions",
|
|
3210
3357
|
items = [],
|
|
@@ -3218,50 +3365,50 @@ function RowActions({
|
|
|
3218
3365
|
if (visibleItems.length === 0) {
|
|
3219
3366
|
return null;
|
|
3220
3367
|
}
|
|
3221
|
-
return /* @__PURE__ */ (0,
|
|
3368
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3222
3369
|
"div",
|
|
3223
3370
|
{
|
|
3224
|
-
className: (0,
|
|
3225
|
-
children: /* @__PURE__ */ (0,
|
|
3226
|
-
/* @__PURE__ */ (0,
|
|
3371
|
+
className: (0, import_cn14.cn)("flex items-center justify-end w-full", containerClassName),
|
|
3372
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(DropdownMenu, { children: [
|
|
3373
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3227
3374
|
DropdownMenuTrigger,
|
|
3228
3375
|
{
|
|
3229
|
-
render: /* @__PURE__ */ (0,
|
|
3376
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Button, { variant: "ghost", size: "icon-xs", "aria-label": triggerLabel, children: triggerIcon != null ? triggerIcon : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_lucide_react20.MoreHorizontal, { className: "size-4" }) })
|
|
3230
3377
|
}
|
|
3231
3378
|
),
|
|
3232
|
-
/* @__PURE__ */ (0,
|
|
3379
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3233
3380
|
DropdownMenuContent,
|
|
3234
3381
|
{
|
|
3235
3382
|
align,
|
|
3236
|
-
className: (0,
|
|
3237
|
-
children: /* @__PURE__ */ (0,
|
|
3238
|
-
label && /* @__PURE__ */ (0,
|
|
3239
|
-
/* @__PURE__ */ (0,
|
|
3240
|
-
/* @__PURE__ */ (0,
|
|
3383
|
+
className: (0, import_cn14.cn)("w-40", contentClassName),
|
|
3384
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(DropdownMenuGroup, { children: [
|
|
3385
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
|
|
3386
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(DropdownMenuLabel, { children: label }),
|
|
3387
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(DropdownMenuSeparator, {})
|
|
3241
3388
|
] }),
|
|
3242
3389
|
visibleItems.map((item, index) => {
|
|
3243
3390
|
var _a;
|
|
3244
3391
|
const itemKey = (_a = item.id) != null ? _a : `${item.label}-${index}`;
|
|
3245
3392
|
const isDestructive = item.variant === "destructive";
|
|
3246
|
-
return /* @__PURE__ */ (0,
|
|
3247
|
-
item.separatorBefore && /* @__PURE__ */ (0,
|
|
3248
|
-
/* @__PURE__ */ (0,
|
|
3393
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_react11.Fragment, { children: [
|
|
3394
|
+
item.separatorBefore && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(DropdownMenuSeparator, {}),
|
|
3395
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
3249
3396
|
DropdownMenuItem,
|
|
3250
3397
|
{
|
|
3251
3398
|
onClick: item.onClick,
|
|
3252
3399
|
disabled: item.disabled,
|
|
3253
|
-
className: (0,
|
|
3400
|
+
className: (0, import_cn14.cn)(
|
|
3254
3401
|
"hover:cursor-pointer flex items-center gap-2",
|
|
3255
3402
|
isDestructive && "text-destructive focus:text-destructive",
|
|
3256
3403
|
item.className
|
|
3257
3404
|
),
|
|
3258
3405
|
children: [
|
|
3259
|
-
item.icon && /* @__PURE__ */ (0,
|
|
3260
|
-
/* @__PURE__ */ (0,
|
|
3406
|
+
item.icon && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "size-4 shrink-0 flex items-center justify-center", children: item.icon }),
|
|
3407
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { children: item.label })
|
|
3261
3408
|
]
|
|
3262
3409
|
}
|
|
3263
3410
|
),
|
|
3264
|
-
item.separatorAfter && /* @__PURE__ */ (0,
|
|
3411
|
+
item.separatorAfter && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(DropdownMenuSeparator, {})
|
|
3265
3412
|
] }, itemKey);
|
|
3266
3413
|
})
|
|
3267
3414
|
] })
|
|
@@ -3273,7 +3420,7 @@ function RowActions({
|
|
|
3273
3420
|
}
|
|
3274
3421
|
|
|
3275
3422
|
// src/components/composed/data-table/data-table.tsx
|
|
3276
|
-
var
|
|
3423
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
3277
3424
|
function DataTable({
|
|
3278
3425
|
columns,
|
|
3279
3426
|
data,
|
|
@@ -3291,12 +3438,12 @@ function DataTable({
|
|
|
3291
3438
|
showAddButton = true
|
|
3292
3439
|
}) {
|
|
3293
3440
|
const router = (0, import_navigation3.useRouter)();
|
|
3294
|
-
const [createOpen, setCreateOpen] = (0,
|
|
3295
|
-
const [sorting, setSorting] = (0,
|
|
3296
|
-
const [columnFilters, setColumnFilters] = (0,
|
|
3297
|
-
const [columnVisibility, setColumnVisibility] = (0,
|
|
3298
|
-
const [globalFilter, setGlobalFilter] = (0,
|
|
3299
|
-
const columnsWithSmartFilters = (0,
|
|
3441
|
+
const [createOpen, setCreateOpen] = (0, import_react12.useState)(false);
|
|
3442
|
+
const [sorting, setSorting] = (0, import_react12.useState)([]);
|
|
3443
|
+
const [columnFilters, setColumnFilters] = (0, import_react12.useState)([]);
|
|
3444
|
+
const [columnVisibility, setColumnVisibility] = (0, import_react12.useState)(initialColumnVisibility != null ? initialColumnVisibility : {});
|
|
3445
|
+
const [globalFilter, setGlobalFilter] = (0, import_react12.useState)("");
|
|
3446
|
+
const columnsWithSmartFilters = (0, import_react12.useMemo)(() => {
|
|
3300
3447
|
return columns.map((col) => __spreadValues({
|
|
3301
3448
|
filterFn: smartFilterFn
|
|
3302
3449
|
}, col));
|
|
@@ -3326,12 +3473,12 @@ function DataTable({
|
|
|
3326
3473
|
});
|
|
3327
3474
|
if (data.length === 0) {
|
|
3328
3475
|
const hasCreateAction = Boolean(renderCreateDialog);
|
|
3329
|
-
return /* @__PURE__ */ (0,
|
|
3330
|
-
/* @__PURE__ */ (0,
|
|
3476
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "space-y-2", children: [
|
|
3477
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3331
3478
|
StateEmpty,
|
|
3332
3479
|
{
|
|
3333
3480
|
state: "outline",
|
|
3334
|
-
icon: /* @__PURE__ */ (0,
|
|
3481
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react21.FolderOpenIcon, { className: "size-6 text-muted-foreground" }),
|
|
3335
3482
|
title: "No Data Available",
|
|
3336
3483
|
description: "There are currently no records to display. Create a new record to get started.",
|
|
3337
3484
|
buttonText: hasCreateAction ? addLabel != null ? addLabel : "Add Record" : "Refresh",
|
|
@@ -3341,26 +3488,26 @@ function DataTable({
|
|
|
3341
3488
|
renderCreateDialog == null ? void 0 : renderCreateDialog(createOpen, setCreateOpen)
|
|
3342
3489
|
] });
|
|
3343
3490
|
}
|
|
3344
|
-
return /* @__PURE__ */ (0,
|
|
3345
|
-
/* @__PURE__ */ (0,
|
|
3346
|
-
showSearchInput ? /* @__PURE__ */ (0,
|
|
3491
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "space-y-2", children: [
|
|
3492
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "flex flex-row items-center justify-between gap-1", children: [
|
|
3493
|
+
showSearchInput ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3347
3494
|
DataTableHeaderSearch,
|
|
3348
3495
|
{
|
|
3349
3496
|
value: globalFilter,
|
|
3350
3497
|
onChange: setGlobalFilter
|
|
3351
3498
|
}
|
|
3352
|
-
) : /* @__PURE__ */ (0,
|
|
3353
|
-
/* @__PURE__ */ (0,
|
|
3354
|
-
showRefreshButton && /* @__PURE__ */ (0,
|
|
3355
|
-
showSortButton && /* @__PURE__ */ (0,
|
|
3356
|
-
showFilterButton && /* @__PURE__ */ (0,
|
|
3499
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", {}),
|
|
3500
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "flex flex-row items-center gap-1", children: [
|
|
3501
|
+
showRefreshButton && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DataTableHeaderRefresh, {}),
|
|
3502
|
+
showSortButton && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DataTableHeaderSort, { table, sorting }),
|
|
3503
|
+
showFilterButton && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3357
3504
|
DataTableHeaderFilter,
|
|
3358
3505
|
{
|
|
3359
3506
|
table,
|
|
3360
3507
|
columnFilters
|
|
3361
3508
|
}
|
|
3362
3509
|
),
|
|
3363
|
-
showDownloadButton && /* @__PURE__ */ (0,
|
|
3510
|
+
showDownloadButton && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3364
3511
|
DataTableHeaderDownload,
|
|
3365
3512
|
{
|
|
3366
3513
|
table,
|
|
@@ -3368,8 +3515,8 @@ function DataTable({
|
|
|
3368
3515
|
onDownload
|
|
3369
3516
|
}
|
|
3370
3517
|
),
|
|
3371
|
-
showColumnToggleButton && /* @__PURE__ */ (0,
|
|
3372
|
-
showAddButton && renderCreateDialog && /* @__PURE__ */ (0,
|
|
3518
|
+
showColumnToggleButton && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DataTableHeaderToggle, { table }),
|
|
3519
|
+
showAddButton && renderCreateDialog && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3373
3520
|
DataTableHeaderAdd,
|
|
3374
3521
|
{
|
|
3375
3522
|
onAdd: () => setCreateOpen(true),
|
|
@@ -3379,13 +3526,13 @@ function DataTable({
|
|
|
3379
3526
|
] })
|
|
3380
3527
|
] }),
|
|
3381
3528
|
renderCreateDialog == null ? void 0 : renderCreateDialog(createOpen, setCreateOpen),
|
|
3382
|
-
/* @__PURE__ */ (0,
|
|
3383
|
-
/* @__PURE__ */ (0,
|
|
3384
|
-
/* @__PURE__ */ (0,
|
|
3529
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "overflow-hidden rounded-md border [&_[data-slot=table-container]]:no-scrollbar", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Table, { children: [
|
|
3530
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DataTableContentHeader, { table }),
|
|
3531
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DataTableContentBody, { table, columns })
|
|
3385
3532
|
] }) }),
|
|
3386
|
-
/* @__PURE__ */ (0,
|
|
3387
|
-
/* @__PURE__ */ (0,
|
|
3388
|
-
/* @__PURE__ */ (0,
|
|
3533
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "flex items-center justify-between px-2", children: [
|
|
3534
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DataTableFooterEntries, { table }),
|
|
3535
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DataTableFooterPagination, { table })
|
|
3389
3536
|
] })
|
|
3390
3537
|
] });
|
|
3391
3538
|
}
|
|
@@ -3393,13 +3540,13 @@ function DataTable({
|
|
|
3393
3540
|
// src/components/composed/header-tabs.tsx
|
|
3394
3541
|
var import_link2 = __toESM(require("next/link"));
|
|
3395
3542
|
var import_navigation4 = require("next/navigation");
|
|
3396
|
-
var
|
|
3543
|
+
var import_react13 = require("react");
|
|
3397
3544
|
|
|
3398
3545
|
// src/components/ui/tabs.tsx
|
|
3399
3546
|
var import_tabs = require("@base-ui/react/tabs");
|
|
3400
|
-
var
|
|
3401
|
-
var
|
|
3402
|
-
var
|
|
3547
|
+
var import_class_variance_authority5 = require("class-variance-authority");
|
|
3548
|
+
var import_cn19 = require("cn");
|
|
3549
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
3403
3550
|
function Tabs(_a) {
|
|
3404
3551
|
var _b = _a, {
|
|
3405
3552
|
className,
|
|
@@ -3408,19 +3555,19 @@ function Tabs(_a) {
|
|
|
3408
3555
|
"className",
|
|
3409
3556
|
"orientation"
|
|
3410
3557
|
]);
|
|
3411
|
-
return /* @__PURE__ */ (0,
|
|
3558
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3412
3559
|
import_tabs.Tabs.Root,
|
|
3413
3560
|
__spreadValues({
|
|
3414
3561
|
"data-slot": "tabs",
|
|
3415
3562
|
"data-orientation": orientation,
|
|
3416
|
-
className: (0,
|
|
3563
|
+
className: (0, import_cn19.cn)(
|
|
3417
3564
|
"group/tabs flex gap-2 data-horizontal:flex-col",
|
|
3418
3565
|
className
|
|
3419
3566
|
)
|
|
3420
3567
|
}, props)
|
|
3421
3568
|
);
|
|
3422
3569
|
}
|
|
3423
|
-
var tabsListVariants = (0,
|
|
3570
|
+
var tabsListVariants = (0, import_class_variance_authority5.cva)(
|
|
3424
3571
|
"group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none",
|
|
3425
3572
|
{
|
|
3426
3573
|
variants: {
|
|
@@ -3442,22 +3589,22 @@ function TabsList(_a) {
|
|
|
3442
3589
|
"className",
|
|
3443
3590
|
"variant"
|
|
3444
3591
|
]);
|
|
3445
|
-
return /* @__PURE__ */ (0,
|
|
3592
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3446
3593
|
import_tabs.Tabs.List,
|
|
3447
3594
|
__spreadValues({
|
|
3448
3595
|
"data-slot": "tabs-list",
|
|
3449
3596
|
"data-variant": variant,
|
|
3450
|
-
className: (0,
|
|
3597
|
+
className: (0, import_cn19.cn)(tabsListVariants({ variant }), className)
|
|
3451
3598
|
}, props)
|
|
3452
3599
|
);
|
|
3453
3600
|
}
|
|
3454
3601
|
function TabsTrigger(_a) {
|
|
3455
3602
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
3456
|
-
return /* @__PURE__ */ (0,
|
|
3603
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3457
3604
|
import_tabs.Tabs.Tab,
|
|
3458
3605
|
__spreadValues({
|
|
3459
3606
|
"data-slot": "tabs-trigger",
|
|
3460
|
-
className: (0,
|
|
3607
|
+
className: (0, import_cn19.cn)(
|
|
3461
3608
|
"relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-xs font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start group-data-vertical/tabs:py-[calc(--spacing(1.25))] hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 aria-disabled:pointer-events-none aria-disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5",
|
|
3462
3609
|
"group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent",
|
|
3463
3610
|
"data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground",
|
|
@@ -3469,16 +3616,16 @@ function TabsTrigger(_a) {
|
|
|
3469
3616
|
}
|
|
3470
3617
|
|
|
3471
3618
|
// src/components/composed/header-tabs.tsx
|
|
3472
|
-
var
|
|
3619
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
3473
3620
|
function renderTabIcon(icon) {
|
|
3474
3621
|
if (!icon) return null;
|
|
3475
3622
|
if (typeof icon === "function" || typeof icon === "object" && icon !== null && "render" in icon) {
|
|
3476
3623
|
const IconComp = icon;
|
|
3477
|
-
return /* @__PURE__ */ (0,
|
|
3624
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(IconComp, {});
|
|
3478
3625
|
}
|
|
3479
3626
|
return icon;
|
|
3480
3627
|
}
|
|
3481
|
-
var HeaderTabs = (0,
|
|
3628
|
+
var HeaderTabs = (0, import_react13.memo)(function HeaderTabs2({
|
|
3482
3629
|
items,
|
|
3483
3630
|
value,
|
|
3484
3631
|
onValueChange,
|
|
@@ -3490,12 +3637,12 @@ var HeaderTabs = (0, import_react7.memo)(function HeaderTabs2({
|
|
|
3490
3637
|
(item) => item.url === pathname || pathname.endsWith(item.url) || pathname.split("/").includes(item.value)
|
|
3491
3638
|
) : void 0;
|
|
3492
3639
|
const activeTab = (_b = value != null ? value : matchedItem == null ? void 0 : matchedItem.value) != null ? _b : (_a = items[0]) == null ? void 0 : _a.value;
|
|
3493
|
-
return /* @__PURE__ */ (0,
|
|
3494
|
-
/* @__PURE__ */ (0,
|
|
3640
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Tabs, { value: activeTab, onValueChange, className: "space-y-4", children: [
|
|
3641
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "w-full overflow-x-auto overflow-y-hidden border-b no-scrollbar", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TabsList, { variant: "line", className: "inline-flex w-max justify-start", children: items.map(({ title, value: tabValue, url, icon }) => /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
3495
3642
|
TabsTrigger,
|
|
3496
3643
|
{
|
|
3497
3644
|
nativeButton: false,
|
|
3498
|
-
render: /* @__PURE__ */ (0,
|
|
3645
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_link2.default, { href: url }),
|
|
3499
3646
|
value: tabValue,
|
|
3500
3647
|
children: [
|
|
3501
3648
|
renderTabIcon(icon),
|
|
@@ -3509,17 +3656,17 @@ var HeaderTabs = (0, import_react7.memo)(function HeaderTabs2({
|
|
|
3509
3656
|
});
|
|
3510
3657
|
|
|
3511
3658
|
// src/components/composed/header-title.tsx
|
|
3512
|
-
var
|
|
3513
|
-
var
|
|
3514
|
-
var HeaderTitle = (0,
|
|
3659
|
+
var import_react14 = require("react");
|
|
3660
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
3661
|
+
var HeaderTitle = (0, import_react14.memo)(function HeaderTitle2({
|
|
3515
3662
|
title,
|
|
3516
3663
|
subtitle,
|
|
3517
3664
|
children
|
|
3518
3665
|
}) {
|
|
3519
|
-
return /* @__PURE__ */ (0,
|
|
3520
|
-
/* @__PURE__ */ (0,
|
|
3521
|
-
/* @__PURE__ */ (0,
|
|
3522
|
-
/* @__PURE__ */ (0,
|
|
3666
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "w-full space-y-4", children: [
|
|
3667
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { children: [
|
|
3668
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("h1", { className: "font-semibold", children: title }),
|
|
3669
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: "text-xs text-muted-foreground", children: subtitle })
|
|
3523
3670
|
] }),
|
|
3524
3671
|
children
|
|
3525
3672
|
] });
|
|
@@ -3527,6 +3674,7 @@ var HeaderTitle = (0, import_react8.memo)(function HeaderTitle2({
|
|
|
3527
3674
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3528
3675
|
0 && (module.exports = {
|
|
3529
3676
|
AppSidebar,
|
|
3677
|
+
AvatarUser,
|
|
3530
3678
|
DataTable,
|
|
3531
3679
|
DataTableContentBody,
|
|
3532
3680
|
DataTableContentHeader,
|
|
@@ -3539,10 +3687,15 @@ var HeaderTitle = (0, import_react8.memo)(function HeaderTitle2({
|
|
|
3539
3687
|
DataTableHeaderSearch,
|
|
3540
3688
|
DataTableHeaderSort,
|
|
3541
3689
|
DataTableHeaderToggle,
|
|
3690
|
+
EmailLabel,
|
|
3691
|
+
EmailVerified,
|
|
3542
3692
|
HeaderTabs,
|
|
3543
3693
|
HeaderTitle,
|
|
3694
|
+
JoinedLabel,
|
|
3544
3695
|
RowActions,
|
|
3545
3696
|
StateEmpty,
|
|
3697
|
+
UserRole,
|
|
3698
|
+
UserStatus,
|
|
3546
3699
|
exportToCSV,
|
|
3547
3700
|
exportToPDF,
|
|
3548
3701
|
exportToXLSX,
|