@algorithm-shift/design-system 1.2.61 → 1.2.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +78 -18
- package/dist/index.css.map +1 -1
- package/dist/index.js +301 -165
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +334 -195
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -27958,6 +27958,10 @@ function DatePicker({ className, style, ...props }) {
|
|
|
27958
27958
|
const handleChange = (e) => {
|
|
27959
27959
|
props.onChange?.(e);
|
|
27960
27960
|
};
|
|
27961
|
+
const toDateInputValue = (value) => {
|
|
27962
|
+
if (!value) return "";
|
|
27963
|
+
return new Date(value).toISOString().split("T")[0];
|
|
27964
|
+
};
|
|
27961
27965
|
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_jsx_runtime41.Fragment, { children: [
|
|
27962
27966
|
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex justify-start items-center relative", children: [
|
|
27963
27967
|
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Calendar, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-[#BDBDBD]" }),
|
|
@@ -27970,7 +27974,7 @@ function DatePicker({ className, style, ...props }) {
|
|
|
27970
27974
|
onChange: handleChange,
|
|
27971
27975
|
disabled: isDisabled || !isEditable,
|
|
27972
27976
|
name: props.name,
|
|
27973
|
-
value: props.value
|
|
27977
|
+
value: toDateInputValue(props.value),
|
|
27974
27978
|
className: cn(
|
|
27975
27979
|
className,
|
|
27976
27980
|
props.errorMessage ? "border-red-500" : "",
|
|
@@ -28327,10 +28331,10 @@ var TextInputGroup = ({ className, style, prepend, append, ...props }) => {
|
|
|
28327
28331
|
};
|
|
28328
28332
|
var TextInputGroup_default = TextInputGroup;
|
|
28329
28333
|
|
|
28330
|
-
// src/components/DataDisplay/Table/Table.tsx
|
|
28331
|
-
var import_react26 = require("react");
|
|
28332
|
-
|
|
28333
28334
|
// src/components/ui/data-table.tsx
|
|
28335
|
+
var React6 = __toESM(require("react"));
|
|
28336
|
+
var import_free_solid_svg_icons = require("@fortawesome/free-solid-svg-icons");
|
|
28337
|
+
var import_react_fontawesome2 = require("@fortawesome/react-fontawesome");
|
|
28334
28338
|
var import_react_table = require("@tanstack/react-table");
|
|
28335
28339
|
|
|
28336
28340
|
// src/components/ui/table.tsx
|
|
@@ -28422,72 +28426,277 @@ function TableCell({ className, ...props }) {
|
|
|
28422
28426
|
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
28423
28427
|
function DataTable({
|
|
28424
28428
|
columns,
|
|
28425
|
-
rowActions,
|
|
28426
28429
|
data,
|
|
28427
28430
|
loading,
|
|
28428
|
-
|
|
28429
|
-
|
|
28430
|
-
|
|
28431
|
+
pagination = false,
|
|
28432
|
+
controlledPageIndex,
|
|
28433
|
+
onPageChange,
|
|
28434
|
+
pageSize = 10,
|
|
28435
|
+
paginationMode = "client",
|
|
28436
|
+
totalRecords = 0
|
|
28431
28437
|
}) {
|
|
28438
|
+
const [sorting, setSorting] = React6.useState([]);
|
|
28439
|
+
const [columnFilters, setColumnFilters] = React6.useState([]);
|
|
28440
|
+
const [columnVisibility, setColumnVisibility] = React6.useState({});
|
|
28432
28441
|
const table = (0, import_react_table.useReactTable)({
|
|
28433
28442
|
data,
|
|
28434
28443
|
columns,
|
|
28435
|
-
|
|
28436
|
-
|
|
28437
|
-
|
|
28438
|
-
|
|
28439
|
-
|
|
28440
|
-
|
|
28444
|
+
state: {
|
|
28445
|
+
sorting,
|
|
28446
|
+
columnFilters,
|
|
28447
|
+
columnVisibility,
|
|
28448
|
+
pagination: {
|
|
28449
|
+
pageIndex: controlledPageIndex ?? 0,
|
|
28450
|
+
pageSize
|
|
28451
|
+
}
|
|
28452
|
+
},
|
|
28453
|
+
onSortingChange: setSorting,
|
|
28454
|
+
onColumnFiltersChange: setColumnFilters,
|
|
28455
|
+
onColumnVisibilityChange: setColumnVisibility,
|
|
28456
|
+
getCoreRowModel: (0, import_react_table.getCoreRowModel)(),
|
|
28457
|
+
getSortedRowModel: (0, import_react_table.getSortedRowModel)(),
|
|
28458
|
+
getFilteredRowModel: (0, import_react_table.getFilteredRowModel)(),
|
|
28459
|
+
getPaginationRowModel: pagination && paginationMode === "client" ? (0, import_react_table.getPaginationRowModel)() : void 0,
|
|
28460
|
+
manualPagination: paginationMode === "server",
|
|
28461
|
+
pageCount: paginationMode === "server" ? Math.ceil(totalRecords / pageSize) : void 0,
|
|
28462
|
+
onPaginationChange: (updater) => {
|
|
28463
|
+
const prev = table.getState().pagination;
|
|
28464
|
+
const next = typeof updater === "function" ? updater(prev) : updater;
|
|
28465
|
+
onPageChange?.(next.pageIndex, next.pageSize);
|
|
28466
|
+
}
|
|
28441
28467
|
});
|
|
28442
|
-
const
|
|
28443
|
-
if (
|
|
28444
|
-
|
|
28468
|
+
const getPageNumbers = (currentPage, totalPages, maxVisiblePages = 5) => {
|
|
28469
|
+
if (totalPages <= maxVisiblePages) {
|
|
28470
|
+
return Array.from({ length: totalPages }, (_, i) => i + 1);
|
|
28445
28471
|
}
|
|
28472
|
+
const leftSiblingIndex = Math.max(currentPage - 1, 1);
|
|
28473
|
+
const rightSiblingIndex = Math.min(currentPage + 1, totalPages);
|
|
28474
|
+
const shouldShowLeftDots = leftSiblingIndex > 2;
|
|
28475
|
+
const shouldShowRightDots = rightSiblingIndex < totalPages - 1;
|
|
28476
|
+
if (!shouldShowLeftDots && shouldShowRightDots) {
|
|
28477
|
+
return [1, 2, 3, "...", totalPages];
|
|
28478
|
+
}
|
|
28479
|
+
if (shouldShowLeftDots && !shouldShowRightDots) {
|
|
28480
|
+
return [1, "...", totalPages - 2, totalPages - 1, totalPages];
|
|
28481
|
+
}
|
|
28482
|
+
if (shouldShowLeftDots && shouldShowRightDots) {
|
|
28483
|
+
return [1, "...", currentPage - 1, currentPage, currentPage + 1, "...", totalPages];
|
|
28484
|
+
}
|
|
28485
|
+
return [];
|
|
28446
28486
|
};
|
|
28447
|
-
return /* @__PURE__ */ (0, import_jsx_runtime47.
|
|
28448
|
-
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
28449
|
-
|
|
28450
|
-
|
|
28451
|
-
|
|
28452
|
-
|
|
28453
|
-
|
|
28454
|
-
|
|
28455
|
-
|
|
28456
|
-
|
|
28457
|
-
|
|
28458
|
-
|
|
28459
|
-
children:
|
|
28460
|
-
|
|
28461
|
-
|
|
28462
|
-
|
|
28463
|
-
|
|
28464
|
-
|
|
28465
|
-
|
|
28487
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "overflow-hidden rounded-md border w-full", children: [
|
|
28488
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "flex justify-end p-2", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(Popover, { children: [
|
|
28489
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
28490
|
+
Button,
|
|
28491
|
+
{
|
|
28492
|
+
variant: "outline",
|
|
28493
|
+
size: "sm",
|
|
28494
|
+
className: "px-3 py-1 text-xs cursor-pointer",
|
|
28495
|
+
children: "Manage Columns"
|
|
28496
|
+
}
|
|
28497
|
+
) }),
|
|
28498
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(PopoverContent, { align: "end", className: "w-48 p-3 space-y-2", children: [
|
|
28499
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "text-sm font-medium mb-2", children: "Show / Hide Columns" }),
|
|
28500
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("label", { className: "flex items-center gap-2 text-sm font-semibold border-b pb-2 mb-2", children: [
|
|
28501
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
28502
|
+
"input",
|
|
28503
|
+
{
|
|
28504
|
+
type: "checkbox",
|
|
28505
|
+
checked: table.getAllLeafColumns().every((col) => col.getIsVisible()),
|
|
28506
|
+
ref: (input) => {
|
|
28507
|
+
if (input) {
|
|
28508
|
+
input.indeterminate = table.getAllLeafColumns().some((col) => col.getIsVisible()) && !table.getAllLeafColumns().every((col) => col.getIsVisible());
|
|
28509
|
+
}
|
|
28510
|
+
},
|
|
28511
|
+
onChange: (e) => {
|
|
28512
|
+
table.getAllLeafColumns().forEach(
|
|
28513
|
+
(col) => col.toggleVisibility(e.target.checked)
|
|
28514
|
+
);
|
|
28515
|
+
}
|
|
28516
|
+
}
|
|
28517
|
+
),
|
|
28518
|
+
"Toggle All"
|
|
28519
|
+
] }),
|
|
28520
|
+
table.getAllLeafColumns().map((column) => /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("label", { className: "flex items-center gap-2 text-sm", children: [
|
|
28521
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
28522
|
+
"input",
|
|
28523
|
+
{
|
|
28524
|
+
type: "checkbox",
|
|
28525
|
+
checked: column.getIsVisible(),
|
|
28526
|
+
onChange: (e) => column.toggleVisibility(e.target.checked)
|
|
28527
|
+
}
|
|
28528
|
+
),
|
|
28529
|
+
column.columnDef.header?.toString() ?? column.id
|
|
28530
|
+
] }, column.id))
|
|
28531
|
+
] })
|
|
28532
|
+
] }) }),
|
|
28533
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(Table3, { children: [
|
|
28534
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TableHeader, { children: table.getHeaderGroups().map((hg) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TableRow, { children: hg.headers.map((header) => {
|
|
28535
|
+
const canSort = header.column.getCanSort();
|
|
28536
|
+
const canFilter = header.column.getCanFilter();
|
|
28537
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TableHead, { className: "relative select-none", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
28538
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
28539
|
+
"span",
|
|
28540
|
+
{
|
|
28541
|
+
className: `flex items-center gap-1 ${canSort ? "cursor-pointer" : ""}`,
|
|
28542
|
+
onClick: canSort ? header.column.getToggleSortingHandler() : void 0,
|
|
28543
|
+
children: [
|
|
28544
|
+
(0, import_react_table.flexRender)(header.column.columnDef.header, header.getContext()),
|
|
28545
|
+
canSort && /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_jsx_runtime47.Fragment, { children: [
|
|
28546
|
+
header.column.getIsSorted() === "asc" && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(ArrowUp, { size: 14, className: "text-gray-500" }),
|
|
28547
|
+
header.column.getIsSorted() === "desc" && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(ArrowDown, { size: 14, className: "text-gray-500" }),
|
|
28548
|
+
!header.column.getIsSorted() && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(ArrowUpDown, { size: 14, className: "text-gray-400" })
|
|
28549
|
+
] })
|
|
28550
|
+
]
|
|
28551
|
+
}
|
|
28552
|
+
),
|
|
28553
|
+
canFilter && /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(Popover, { children: [
|
|
28554
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
28555
|
+
"span",
|
|
28556
|
+
{
|
|
28557
|
+
role: "presentation",
|
|
28558
|
+
className: "pl-5 cursor-pointer",
|
|
28559
|
+
onClick: (e) => e.stopPropagation(),
|
|
28560
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_react_fontawesome2.FontAwesomeIcon, { icon: import_free_solid_svg_icons.faEllipsisH, className: "w-5 h-5 text-gray-500" })
|
|
28561
|
+
}
|
|
28562
|
+
) }),
|
|
28563
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
28564
|
+
PopoverContent,
|
|
28466
28565
|
{
|
|
28467
|
-
|
|
28468
|
-
|
|
28469
|
-
|
|
28470
|
-
|
|
28471
|
-
|
|
28566
|
+
align: "start",
|
|
28567
|
+
sideOffset: 4,
|
|
28568
|
+
className: "w-50 p-3 z-[200] border-gray-300",
|
|
28569
|
+
avoidCollisions: true,
|
|
28570
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
28571
|
+
"form",
|
|
28572
|
+
{
|
|
28573
|
+
onSubmit: (e) => {
|
|
28574
|
+
e.preventDefault();
|
|
28575
|
+
const formData = new FormData(e.currentTarget);
|
|
28576
|
+
const value = formData.get("filter");
|
|
28577
|
+
header.column.setFilterValue(value || void 0);
|
|
28578
|
+
},
|
|
28579
|
+
className: "space-y-2",
|
|
28580
|
+
children: [
|
|
28581
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("label", { htmlFor: "filter", className: "text-xs text-gray-500 font-normal", children: "Filter by value:" }),
|
|
28582
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
28583
|
+
"input",
|
|
28584
|
+
{
|
|
28585
|
+
name: "filter",
|
|
28586
|
+
placeholder: "Search",
|
|
28587
|
+
defaultValue: header.column.getFilterValue() ?? "",
|
|
28588
|
+
className: "border-gray-300 border-1 block p-3 rounded-md text-xs w-full h-9 focus:ring-0 focus:border-gray-300 focus-visible:ring-0 focus-visible:border-gray-300 focus-visible:outline-none mt-2 font-normal",
|
|
28589
|
+
autoComplete: "off"
|
|
28590
|
+
}
|
|
28591
|
+
),
|
|
28592
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "justify-end flex", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
28593
|
+
Button,
|
|
28594
|
+
{
|
|
28595
|
+
type: "submit",
|
|
28596
|
+
className: "py-2 px-3 bg-[#12715B] text-white text-xs h-auto cursor-pointer",
|
|
28597
|
+
children: "Apply"
|
|
28598
|
+
}
|
|
28599
|
+
) })
|
|
28600
|
+
]
|
|
28472
28601
|
}
|
|
28473
|
-
|
|
28474
|
-
|
|
28475
|
-
|
|
28476
|
-
|
|
28477
|
-
|
|
28478
|
-
|
|
28479
|
-
|
|
28480
|
-
|
|
28481
|
-
|
|
28482
|
-
|
|
28483
|
-
|
|
28484
|
-
|
|
28602
|
+
)
|
|
28603
|
+
}
|
|
28604
|
+
)
|
|
28605
|
+
] })
|
|
28606
|
+
] }) }, header.id);
|
|
28607
|
+
}) }, hg.id)) }),
|
|
28608
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TableBody, { children: loading ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TableCell, { colSpan: columns.length, className: "h-24 text-center", children: "Loading..." }) }) : table.getRowModel().rows.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TableRow, { children: row.getVisibleCells().map((cell) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TableCell, { children: (0, import_react_table.flexRender)(cell.column.columnDef.cell, cell.getContext()) }, cell.id)) }, row.id)) : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TableCell, { colSpan: columns.length, className: "h-24 text-center", children: "No results." }) }) })
|
|
28609
|
+
] }),
|
|
28610
|
+
pagination && /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "flex items-center justify-between py-3 px-2 text-sm w-full", children: [
|
|
28611
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { children: [
|
|
28612
|
+
"Page ",
|
|
28613
|
+
table.getState().pagination.pageIndex + 1,
|
|
28614
|
+
" of ",
|
|
28615
|
+
table.getPageCount()
|
|
28616
|
+
] }),
|
|
28617
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
28618
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
28619
|
+
"button",
|
|
28620
|
+
{
|
|
28621
|
+
onClick: () => table.previousPage(),
|
|
28622
|
+
disabled: !table.getCanPreviousPage?.(),
|
|
28623
|
+
className: "px-2 py-1 border rounded disabled:opacity-50 cursor-pointer",
|
|
28624
|
+
children: "Prev"
|
|
28625
|
+
}
|
|
28626
|
+
),
|
|
28627
|
+
getPageNumbers(
|
|
28628
|
+
table.getState().pagination.pageIndex + 1,
|
|
28629
|
+
table.getPageCount(),
|
|
28630
|
+
5
|
|
28631
|
+
).map((pageNum, index) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
28632
|
+
"button",
|
|
28633
|
+
{
|
|
28634
|
+
disabled: pageNum === "...",
|
|
28635
|
+
onClick: () => typeof pageNum === "number" && table.setPageIndex(pageNum - 1),
|
|
28636
|
+
className: `px-2 py-1 border rounded ${table.getState().pagination.pageIndex + 1 === pageNum ? "bg-[#12715B] text-white" : "bg-white"} ${pageNum === "..." ? "cursor-default" : "cursor-pointer"}`,
|
|
28637
|
+
children: pageNum
|
|
28638
|
+
},
|
|
28639
|
+
index
|
|
28640
|
+
)),
|
|
28641
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
28642
|
+
"button",
|
|
28643
|
+
{
|
|
28644
|
+
onClick: () => table.nextPage(),
|
|
28645
|
+
disabled: !table.getCanNextPage?.(),
|
|
28646
|
+
className: "px-2 py-1 border rounded disabled:opacity-50 cursor-pointer",
|
|
28647
|
+
children: "Next"
|
|
28648
|
+
}
|
|
28649
|
+
)
|
|
28650
|
+
] })
|
|
28651
|
+
] })
|
|
28652
|
+
] });
|
|
28485
28653
|
}
|
|
28486
28654
|
|
|
28487
|
-
// src/components/
|
|
28655
|
+
// src/components/DataDisplay/Table/Table.tsx
|
|
28488
28656
|
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
28657
|
+
var Table4 = ({
|
|
28658
|
+
columns,
|
|
28659
|
+
data,
|
|
28660
|
+
rowActions,
|
|
28661
|
+
className,
|
|
28662
|
+
style,
|
|
28663
|
+
pagination = false,
|
|
28664
|
+
paginationMode = "client",
|
|
28665
|
+
itemsPerPage = 10,
|
|
28666
|
+
onPageChange,
|
|
28667
|
+
page,
|
|
28668
|
+
loading = false,
|
|
28669
|
+
totalRecords = 0,
|
|
28670
|
+
...props
|
|
28671
|
+
}) => {
|
|
28672
|
+
const rawColumns = Array.isArray(columns) ? columns : [];
|
|
28673
|
+
const rawData = Array.isArray(data) ? data : [];
|
|
28674
|
+
const isControlled = typeof page === "number";
|
|
28675
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: `${className || ""} space-y-3`, style, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
28676
|
+
DataTable,
|
|
28677
|
+
{
|
|
28678
|
+
...props,
|
|
28679
|
+
columns: rawColumns,
|
|
28680
|
+
data: rawData,
|
|
28681
|
+
rowActions,
|
|
28682
|
+
loading,
|
|
28683
|
+
pagination,
|
|
28684
|
+
pageSize: itemsPerPage,
|
|
28685
|
+
controlledPageIndex: isControlled ? page - 1 : void 0,
|
|
28686
|
+
onPageChange: (pageIndex, pageSize) => {
|
|
28687
|
+
onPageChange?.({ page: pageIndex + 1, itemsPerPage: pageSize });
|
|
28688
|
+
},
|
|
28689
|
+
paginationMode,
|
|
28690
|
+
totalRecords
|
|
28691
|
+
}
|
|
28692
|
+
) });
|
|
28693
|
+
};
|
|
28694
|
+
var Table_default = Table4;
|
|
28695
|
+
|
|
28696
|
+
// src/components/ui/pagination.tsx
|
|
28697
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
28489
28698
|
function Pagination({ className, ...props }) {
|
|
28490
|
-
return /* @__PURE__ */ (0,
|
|
28699
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
28491
28700
|
"nav",
|
|
28492
28701
|
{
|
|
28493
28702
|
role: "navigation",
|
|
@@ -28502,7 +28711,7 @@ function PaginationContent({
|
|
|
28502
28711
|
className,
|
|
28503
28712
|
...props
|
|
28504
28713
|
}) {
|
|
28505
|
-
return /* @__PURE__ */ (0,
|
|
28714
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
28506
28715
|
"ul",
|
|
28507
28716
|
{
|
|
28508
28717
|
"data-slot": "pagination-content",
|
|
@@ -28512,7 +28721,7 @@ function PaginationContent({
|
|
|
28512
28721
|
);
|
|
28513
28722
|
}
|
|
28514
28723
|
function PaginationItem({ ...props }) {
|
|
28515
|
-
return /* @__PURE__ */ (0,
|
|
28724
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("li", { "data-slot": "pagination-item", ...props });
|
|
28516
28725
|
}
|
|
28517
28726
|
function PaginationLink({
|
|
28518
28727
|
className,
|
|
@@ -28520,7 +28729,7 @@ function PaginationLink({
|
|
|
28520
28729
|
size = "icon",
|
|
28521
28730
|
...props
|
|
28522
28731
|
}) {
|
|
28523
|
-
return /* @__PURE__ */ (0,
|
|
28732
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
28524
28733
|
"a",
|
|
28525
28734
|
{
|
|
28526
28735
|
"aria-current": isActive ? "page" : void 0,
|
|
@@ -28541,7 +28750,7 @@ function PaginationPrevious({
|
|
|
28541
28750
|
className,
|
|
28542
28751
|
...props
|
|
28543
28752
|
}) {
|
|
28544
|
-
return /* @__PURE__ */ (0,
|
|
28753
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
28545
28754
|
PaginationLink,
|
|
28546
28755
|
{
|
|
28547
28756
|
"aria-label": "Go to previous page",
|
|
@@ -28549,8 +28758,8 @@ function PaginationPrevious({
|
|
|
28549
28758
|
className: cn("gap-1 px-2.5 sm:pl-2.5", className),
|
|
28550
28759
|
...props,
|
|
28551
28760
|
children: [
|
|
28552
|
-
/* @__PURE__ */ (0,
|
|
28553
|
-
/* @__PURE__ */ (0,
|
|
28761
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(ChevronLeft, {}),
|
|
28762
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "hidden sm:block", children: "Previous" })
|
|
28554
28763
|
]
|
|
28555
28764
|
}
|
|
28556
28765
|
);
|
|
@@ -28559,7 +28768,7 @@ function PaginationNext({
|
|
|
28559
28768
|
className,
|
|
28560
28769
|
...props
|
|
28561
28770
|
}) {
|
|
28562
|
-
return /* @__PURE__ */ (0,
|
|
28771
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
28563
28772
|
PaginationLink,
|
|
28564
28773
|
{
|
|
28565
28774
|
"aria-label": "Go to next page",
|
|
@@ -28567,8 +28776,8 @@ function PaginationNext({
|
|
|
28567
28776
|
className: cn("gap-1 px-2.5 sm:pr-2.5", className),
|
|
28568
28777
|
...props,
|
|
28569
28778
|
children: [
|
|
28570
|
-
/* @__PURE__ */ (0,
|
|
28571
|
-
/* @__PURE__ */ (0,
|
|
28779
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "hidden sm:block", children: "Next" }),
|
|
28780
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(ChevronRight, {})
|
|
28572
28781
|
]
|
|
28573
28782
|
}
|
|
28574
28783
|
);
|
|
@@ -28577,7 +28786,7 @@ function PaginationEllipsis({
|
|
|
28577
28786
|
className,
|
|
28578
28787
|
...props
|
|
28579
28788
|
}) {
|
|
28580
|
-
return /* @__PURE__ */ (0,
|
|
28789
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
28581
28790
|
"span",
|
|
28582
28791
|
{
|
|
28583
28792
|
"aria-hidden": true,
|
|
@@ -28585,15 +28794,15 @@ function PaginationEllipsis({
|
|
|
28585
28794
|
className: cn("flex size-9 items-center justify-center", className),
|
|
28586
28795
|
...props,
|
|
28587
28796
|
children: [
|
|
28588
|
-
/* @__PURE__ */ (0,
|
|
28589
|
-
/* @__PURE__ */ (0,
|
|
28797
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Ellipsis, { className: "size-4" }),
|
|
28798
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "sr-only", children: "More pages" })
|
|
28590
28799
|
]
|
|
28591
28800
|
}
|
|
28592
28801
|
);
|
|
28593
28802
|
}
|
|
28594
28803
|
|
|
28595
28804
|
// src/components/DataDisplay/Pagination/Pagination.tsx
|
|
28596
|
-
var
|
|
28805
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
28597
28806
|
var CustomPagination = ({
|
|
28598
28807
|
totalPages,
|
|
28599
28808
|
currentPage,
|
|
@@ -28639,10 +28848,10 @@ var CustomPagination = ({
|
|
|
28639
28848
|
}
|
|
28640
28849
|
};
|
|
28641
28850
|
const pageNumbers = getPageNumbers();
|
|
28642
|
-
return /* @__PURE__ */ (0,
|
|
28643
|
-
/* @__PURE__ */ (0,
|
|
28644
|
-
/* @__PURE__ */ (0,
|
|
28645
|
-
/* @__PURE__ */ (0,
|
|
28851
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex flex-row gap-1 w-full items-center justify-between", children: [
|
|
28852
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
28853
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("p", { className: "text-sm text-muted-foreground whitespace-nowrap", children: "Items per page:" }),
|
|
28854
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
28646
28855
|
Select,
|
|
28647
28856
|
{
|
|
28648
28857
|
defaultValue: String(perPage),
|
|
@@ -28650,26 +28859,26 @@ var CustomPagination = ({
|
|
|
28650
28859
|
onPageChange({ page: 1, itemsPerPage: Number(value) });
|
|
28651
28860
|
},
|
|
28652
28861
|
children: [
|
|
28653
|
-
/* @__PURE__ */ (0,
|
|
28654
|
-
/* @__PURE__ */ (0,
|
|
28655
|
-
/* @__PURE__ */ (0,
|
|
28656
|
-
/* @__PURE__ */ (0,
|
|
28657
|
-
/* @__PURE__ */ (0,
|
|
28658
|
-
/* @__PURE__ */ (0,
|
|
28862
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(SelectTrigger, { className: "w-[100px]", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(SelectValue, { placeholder: "Select" }) }),
|
|
28863
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(SelectContent, { children: [
|
|
28864
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(SelectItem, { value: "5", children: "5" }),
|
|
28865
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(SelectItem, { value: "10", children: "10" }),
|
|
28866
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(SelectItem, { value: "20", children: "20" }),
|
|
28867
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(SelectItem, { value: "50", children: "50" })
|
|
28659
28868
|
] })
|
|
28660
28869
|
]
|
|
28661
28870
|
}
|
|
28662
28871
|
)
|
|
28663
28872
|
] }),
|
|
28664
|
-
/* @__PURE__ */ (0,
|
|
28665
|
-
/* @__PURE__ */ (0,
|
|
28873
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Pagination, { className: "justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(PaginationContent, { children: [
|
|
28874
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(PaginationItem, { children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
28666
28875
|
PaginationPrevious,
|
|
28667
28876
|
{
|
|
28668
28877
|
onClick: () => handlePageChange(currentPage - 1),
|
|
28669
28878
|
className: currentPage === 1 ? "pointer-events-none opacity-50" : "cursor-pointer"
|
|
28670
28879
|
}
|
|
28671
28880
|
) }),
|
|
28672
|
-
pageNumbers.map((pageNumber, index) => /* @__PURE__ */ (0,
|
|
28881
|
+
pageNumbers.map((pageNumber, index) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(PaginationItem, { children: pageNumber === "..." ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(PaginationEllipsis, {}) : /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
28673
28882
|
PaginationLink,
|
|
28674
28883
|
{
|
|
28675
28884
|
onClick: () => handlePageChange(pageNumber),
|
|
@@ -28678,7 +28887,7 @@ var CustomPagination = ({
|
|
|
28678
28887
|
children: pageNumber
|
|
28679
28888
|
}
|
|
28680
28889
|
) }, index)),
|
|
28681
|
-
/* @__PURE__ */ (0,
|
|
28890
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(PaginationItem, { children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
28682
28891
|
PaginationNext,
|
|
28683
28892
|
{
|
|
28684
28893
|
onClick: () => handlePageChange(currentPage + 1),
|
|
@@ -28690,78 +28899,6 @@ var CustomPagination = ({
|
|
|
28690
28899
|
};
|
|
28691
28900
|
var Pagination_default = CustomPagination;
|
|
28692
28901
|
|
|
28693
|
-
// src/components/DataDisplay/Table/Table.tsx
|
|
28694
|
-
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
28695
|
-
var Table4 = ({
|
|
28696
|
-
columns,
|
|
28697
|
-
data,
|
|
28698
|
-
rowActions,
|
|
28699
|
-
className,
|
|
28700
|
-
style,
|
|
28701
|
-
pagination = false,
|
|
28702
|
-
paginationMode = "client",
|
|
28703
|
-
itemsPerPage = 10,
|
|
28704
|
-
onPageChange,
|
|
28705
|
-
page,
|
|
28706
|
-
loading = false,
|
|
28707
|
-
totalRecords = 0,
|
|
28708
|
-
...props
|
|
28709
|
-
}) => {
|
|
28710
|
-
const rawColumns = Array.isArray(columns) ? columns : [];
|
|
28711
|
-
const rawData = Array.isArray(data) ? data : [];
|
|
28712
|
-
const rawRowActions = Array.isArray(rowActions) ? rowActions : [];
|
|
28713
|
-
const isControlled = typeof page === "number";
|
|
28714
|
-
const [internalPage, setInternalPage] = (0, import_react26.useState)(1);
|
|
28715
|
-
const currentPage = isControlled ? page : internalPage;
|
|
28716
|
-
(0, import_react26.useEffect)(() => {
|
|
28717
|
-
if (isControlled) return;
|
|
28718
|
-
if (currentPage > 1 && !pagination) setInternalPage(1);
|
|
28719
|
-
}, [pagination, isControlled]);
|
|
28720
|
-
const enablePagination = pagination && (paginationMode === "server" ? totalRecords > itemsPerPage : rawData.length > itemsPerPage);
|
|
28721
|
-
const handlePageChange = (options) => {
|
|
28722
|
-
if (!isControlled) setInternalPage(options.page);
|
|
28723
|
-
onPageChange?.(options);
|
|
28724
|
-
};
|
|
28725
|
-
const paginatedData = !enablePagination ? rawData : paginationMode === "server" ? rawData : rawData.slice(
|
|
28726
|
-
(currentPage - 1) * itemsPerPage,
|
|
28727
|
-
currentPage * itemsPerPage
|
|
28728
|
-
);
|
|
28729
|
-
const totalPages = enablePagination ? Math.max(
|
|
28730
|
-
1,
|
|
28731
|
-
Math.ceil(
|
|
28732
|
-
(paginationMode === "server" ? totalRecords : rawData.length) / itemsPerPage
|
|
28733
|
-
)
|
|
28734
|
-
) : 1;
|
|
28735
|
-
const isCellClickEnabled = (row, id) => {
|
|
28736
|
-
const selectedColumn = (columns || [])?.find((col) => col.accessorKey === id);
|
|
28737
|
-
if (!selectedColumn) return false;
|
|
28738
|
-
return selectedColumn.isClickable ?? false;
|
|
28739
|
-
};
|
|
28740
|
-
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: `${className || ""} space-y-3`, style, children: [
|
|
28741
|
-
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
28742
|
-
DataTable,
|
|
28743
|
-
{
|
|
28744
|
-
...props,
|
|
28745
|
-
columns: rawColumns,
|
|
28746
|
-
data: paginatedData,
|
|
28747
|
-
rowActions: rawRowActions,
|
|
28748
|
-
loading,
|
|
28749
|
-
cellClickEnabled: isCellClickEnabled
|
|
28750
|
-
}
|
|
28751
|
-
),
|
|
28752
|
-
enablePagination && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
28753
|
-
Pagination_default,
|
|
28754
|
-
{
|
|
28755
|
-
perPage: itemsPerPage,
|
|
28756
|
-
totalPages,
|
|
28757
|
-
currentPage,
|
|
28758
|
-
onPageChange: handlePageChange
|
|
28759
|
-
}
|
|
28760
|
-
)
|
|
28761
|
-
] });
|
|
28762
|
-
};
|
|
28763
|
-
var Table_default = Table4;
|
|
28764
|
-
|
|
28765
28902
|
// src/components/Navigation/Tabs/Tabs.tsx
|
|
28766
28903
|
var import_link5 = __toESM(require("next/link"));
|
|
28767
28904
|
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
@@ -28843,23 +28980,22 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode }) => {
|
|
|
28843
28980
|
}
|
|
28844
28981
|
)
|
|
28845
28982
|
] });
|
|
28846
|
-
const forceMobile = canvasMode === "mobile" || canvasMode === "tablet";
|
|
28847
|
-
const forceDesktop = canvasMode === "desktop";
|
|
28983
|
+
const forceMobile = canvasMode ? canvasMode === "mobile" || canvasMode === "tablet" : void 0;
|
|
28984
|
+
const forceDesktop = canvasMode ? canvasMode === "desktop" : void 0;
|
|
28848
28985
|
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className, style, children: [
|
|
28849
|
-
forceDesktop && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "hidden md:flex", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: `flex gap-2 ${verticalMenu ? "flex-col items-start" : "flex-row"}`, children: rawTabs.map(renderDesktopTab) }) }),
|
|
28850
|
-
forceMobile && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { children: renderMobileMenu() }),
|
|
28851
|
-
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "md:hidden", children: renderMobileMenu() })
|
|
28986
|
+
forceDesktop !== void 0 ? forceDesktop && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "hidden md:flex", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: `flex gap-2 ${verticalMenu ? "flex-col items-start" : "flex-row"}`, children: rawTabs.map(renderDesktopTab) }) }) : /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "hidden md:flex", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: `flex gap-2 ${verticalMenu ? "flex-col items-start" : "flex-row"}`, children: rawTabs.map(renderDesktopTab) }) }),
|
|
28987
|
+
forceMobile !== void 0 ? forceMobile && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { children: renderMobileMenu() }) : /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "flex md:hidden", children: renderMobileMenu() })
|
|
28852
28988
|
] });
|
|
28853
28989
|
};
|
|
28854
28990
|
var Tabs_default = Tabs;
|
|
28855
28991
|
|
|
28856
28992
|
// src/components/Navigation/Stages/Stages.tsx
|
|
28857
|
-
var
|
|
28993
|
+
var import_react26 = __toESM(require("react"));
|
|
28858
28994
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
28859
28995
|
var StagesComponent = ({ stages, isShowBtn, buttonText, className, style }) => {
|
|
28860
28996
|
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className, style, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "flex items-center justify-between bg-red p-2 rounded-lg border border-gray-200 w-full", children: [
|
|
28861
28997
|
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("button", { className: "p-2 hover:bg-gray-100 rounded", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("svg", { className: "w-4 h-4 text-gray-600", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" }) }) }) }),
|
|
28862
|
-
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "flex items-center flex-1 px-2 flex-wrap gap-2", children: stages?.length > 0 && stages?.map((stage, index) => /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
28998
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "flex items-center flex-1 px-2 flex-wrap gap-2", children: stages?.length > 0 && stages?.map((stage, index) => /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_react26.default.Fragment, { children: [
|
|
28863
28999
|
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
28864
29000
|
"button",
|
|
28865
29001
|
{
|
|
@@ -28891,10 +29027,10 @@ var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
|
28891
29027
|
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
28892
29028
|
|
|
28893
29029
|
// src/components/ui/avatar.tsx
|
|
28894
|
-
var
|
|
29030
|
+
var React8 = __toESM(require("react"));
|
|
28895
29031
|
var AvatarPrimitive = __toESM(require("@radix-ui/react-avatar"));
|
|
28896
29032
|
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
28897
|
-
var Avatar =
|
|
29033
|
+
var Avatar = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
28898
29034
|
AvatarPrimitive.Root,
|
|
28899
29035
|
{
|
|
28900
29036
|
ref,
|
|
@@ -28906,7 +29042,7 @@ var Avatar = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
28906
29042
|
}
|
|
28907
29043
|
));
|
|
28908
29044
|
Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|
28909
|
-
var AvatarImage =
|
|
29045
|
+
var AvatarImage = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
28910
29046
|
AvatarPrimitive.Image,
|
|
28911
29047
|
{
|
|
28912
29048
|
ref,
|
|
@@ -28915,7 +29051,7 @@ var AvatarImage = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
28915
29051
|
}
|
|
28916
29052
|
));
|
|
28917
29053
|
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
28918
|
-
var AvatarFallback =
|
|
29054
|
+
var AvatarFallback = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
28919
29055
|
AvatarPrimitive.Fallback,
|
|
28920
29056
|
{
|
|
28921
29057
|
ref,
|