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