@cryptlex/web-components 1.6.0 → 1.6.1
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/components/data-table/table-content.es.js +18 -18
- package/dist/components/data-table/table-content.es.js.map +1 -1
- package/dist/components/static-data-table/data-table.es.js +12 -12
- package/dist/components/static-data-table/data-table.es.js.map +1 -1
- package/dist/components/ui/table.es.js +25 -25
- package/dist/components/ui/table.es.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import { jsxs as r, jsx as e, Fragment as
|
|
2
|
-
import { ACTIONS_COLUMN_ID as
|
|
1
|
+
import { jsxs as r, jsx as e, Fragment as c } from "react/jsx-runtime";
|
|
2
|
+
import { ACTIONS_COLUMN_ID as m } from "./data-table.es.js";
|
|
3
3
|
import { Button as u } from "../ui/button.es.js";
|
|
4
|
-
import { Table as f, TableHeader as h, TableRow as a,
|
|
4
|
+
import { Table as f, TableHeader as h, TableRow as a, TableHead as x, TableBody as N, TableCell as d, TableFooter as b } from "../ui/table.es.js";
|
|
5
5
|
import { flexRender as g } from "@tanstack/react-table";
|
|
6
|
-
import { Info as
|
|
7
|
-
function
|
|
6
|
+
import { Info as w } from "lucide-react";
|
|
7
|
+
function j({
|
|
8
8
|
table: s,
|
|
9
9
|
columns: p,
|
|
10
10
|
dataQuery: o
|
|
11
11
|
}) {
|
|
12
|
-
var
|
|
12
|
+
var i;
|
|
13
13
|
return /* @__PURE__ */ r(f, { className: "size-full", children: [
|
|
14
14
|
/* @__PURE__ */ e(h, { className: "sticky top-0 z-10", children: s.getHeaderGroups().map((n, l) => /* @__PURE__ */ e(a, { children: n.headers.map((t) => /* @__PURE__ */ e(
|
|
15
|
-
|
|
15
|
+
x,
|
|
16
16
|
{
|
|
17
|
-
className: `px-4 py-2 text-left text-sm font-medium bg-card whitespace-nowrap ${t.id ===
|
|
17
|
+
className: `px-4 py-2 text-left text-sm font-medium bg-card whitespace-nowrap ${t.id === m ? "sticky right-0 z-50 text-center" : ""}`,
|
|
18
18
|
children: /* @__PURE__ */ r("span", { className: "inline-flex items-center gap-1", children: [
|
|
19
|
+
/* @__PURE__ */ e("span", { children: t.isPlaceholder ? null : g(t.column.columnDef.header, t.getContext()) }),
|
|
19
20
|
t.column.getCanSort() && /* @__PURE__ */ e(u, { size: "xs", variant: "outline", className: "font-mono", onClick: t.column.getToggleSortingHandler(), children: {
|
|
20
21
|
asc: "↑",
|
|
21
22
|
desc: "↓"
|
|
22
|
-
}[t.column.getIsSorted()] ?? "
|
|
23
|
-
/* @__PURE__ */ e("span", { children: t.isPlaceholder ? null : g(t.column.columnDef.header, t.getContext()) })
|
|
23
|
+
}[t.column.getIsSorted()] ?? "." })
|
|
24
24
|
] })
|
|
25
25
|
},
|
|
26
26
|
t.id
|
|
27
27
|
)) }, l)) }),
|
|
28
|
-
/* @__PURE__ */ e(
|
|
28
|
+
/* @__PURE__ */ e(N, { className: "flex-1 overflow-y-auto", children: s.getRowModel().rows.length ? (
|
|
29
29
|
// Render table data
|
|
30
30
|
s.getRowModel().rows.map((n) => /* @__PURE__ */ e(a, { className: "transition-colors data-[state=selected]:bg-muted-foreground/30 hover:bg-muted-foreground/20", "data-state": n.getIsSelected() && "selected", children: n.getVisibleCells().map((l) => /* @__PURE__ */ e(
|
|
31
|
-
|
|
31
|
+
d,
|
|
32
32
|
{
|
|
33
33
|
className: `
|
|
34
34
|
px-4 py-2 text-left text-sm whitespace-nowrap
|
|
35
|
-
${l.column.id ===
|
|
35
|
+
${l.column.id === m ? "sticky right-0 w-20 bg-card" : ""}
|
|
36
36
|
`,
|
|
37
37
|
children: g(l.column.columnDef.cell, l.getContext())
|
|
38
38
|
},
|
|
@@ -40,15 +40,15 @@ function I({
|
|
|
40
40
|
)) }, n.id))
|
|
41
41
|
) : (
|
|
42
42
|
// Empty table
|
|
43
|
-
/* @__PURE__ */ e(a, { className: "cursor-not-allowed", children: /* @__PURE__ */ e(
|
|
44
|
-
/* @__PURE__ */ e(
|
|
43
|
+
/* @__PURE__ */ e(a, { className: "cursor-not-allowed", children: /* @__PURE__ */ e(d, { colSpan: p.length, className: "border-none", children: /* @__PURE__ */ e("span", { className: "flex gap-3 justify-center items-center", children: !o.isFetching && (o.isError ? /* @__PURE__ */ r(c, { children: [
|
|
44
|
+
/* @__PURE__ */ e(w, {}),
|
|
45
45
|
" You don't have the required permissions. Please contact your admin."
|
|
46
|
-
] }) : (
|
|
46
|
+
] }) : (i = o.data) != null && i.data ? null : /* @__PURE__ */ e(c, { children: "No result found." })) }) }) })
|
|
47
47
|
) }),
|
|
48
|
-
o.isFetching && /* @__PURE__ */ e(
|
|
48
|
+
o.isFetching && /* @__PURE__ */ e(b, { className: "absolute inset-0 z-20 flex justify-center items-center bg-card/80" })
|
|
49
49
|
] });
|
|
50
50
|
}
|
|
51
51
|
export {
|
|
52
|
-
|
|
52
|
+
j as TableContent
|
|
53
53
|
};
|
|
54
54
|
//# sourceMappingURL=table-content.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-content.es.js","sources":["../../../lib/components/data-table/table-content.tsx"],"sourcesContent":["import { ACTIONS_COLUMN_ID } from '@/components/data-table/data-table';\nimport { Button } from '@/components/ui/button';\nimport {\n TableBody,\n TableCell,\n Table as TableComponent,\n TableFooter,\n TableHeader,\n TableRow,\n} from '@/components/ui/table';\nimport type { UseQueryResult } from '@tanstack/react-query';\nimport { ColumnDef, Table, flexRender } from '@tanstack/react-table';\nimport { Info } from 'lucide-react';\n\nexport function TableContent<TData, TValue>({\n table,\n columns,\n dataQuery,\n}: {\n table: Table<TData>;\n columns: ColumnDef<TData, TValue>[];\n dataQuery: UseQueryResult<any, unknown>;\n}) {\n return (\n <TableComponent className=\"size-full\">\n <TableHeader className=\"sticky top-0 z-10\">\n {table.getHeaderGroups().map((headerGroup, index) => (\n <TableRow key={index}>\n {headerGroup.headers.map((header) => (\n <
|
|
1
|
+
{"version":3,"file":"table-content.es.js","sources":["../../../lib/components/data-table/table-content.tsx"],"sourcesContent":["import { ACTIONS_COLUMN_ID } from '@/components/data-table/data-table';\nimport { Button } from '@/components/ui/button';\nimport {\n TableBody,\n TableCell,\n Table as TableComponent,\n TableFooter,\n TableHead,\n TableHeader,\n TableRow,\n} from '@/components/ui/table';\nimport type { UseQueryResult } from '@tanstack/react-query';\nimport { ColumnDef, Table, flexRender } from '@tanstack/react-table';\nimport { Info } from 'lucide-react';\n\nexport function TableContent<TData, TValue>({\n table,\n columns,\n dataQuery,\n}: {\n table: Table<TData>;\n columns: ColumnDef<TData, TValue>[];\n dataQuery: UseQueryResult<any, unknown>;\n}) {\n return (\n <TableComponent className=\"size-full\">\n <TableHeader className=\"sticky top-0 z-10\">\n {table.getHeaderGroups().map((headerGroup, index) => (\n <TableRow key={index}>\n {headerGroup.headers.map((header) => (\n <TableHead\n key={header.id}\n className={`px-4 py-2 text-left text-sm font-medium bg-card whitespace-nowrap ${header.id === ACTIONS_COLUMN_ID ? 'sticky right-0 z-50 text-center' : ''}`}\n >\n <span className='inline-flex items-center gap-1'>\n {/* Header text */}\n <span>\n {header.isPlaceholder\n ? null\n : flexRender(header.column.columnDef.header, header.getContext())}\n </span>\n {/* Sorting button / Indicator */}\n {header.column.getCanSort() &&\n <Button size=\"xs\" variant='outline' className='font-mono' onClick={header.column.getToggleSortingHandler()}>{{\n asc: '↑',\n desc: '↓',\n }[header.column.getIsSorted() as string] ?? \".\"}</Button>\n }\n </span>\n </TableHead>\n ))}\n </TableRow>\n ))}\n </TableHeader>\n <TableBody className=\"flex-1 overflow-y-auto\">\n {table.getRowModel().rows.length ?\n // Render table data\n (\n table.getRowModel().rows.map((row) => (\n <TableRow className='transition-colors data-[state=selected]:bg-muted-foreground/30 hover:bg-muted-foreground/20' key={row.id} data-state={row.getIsSelected() && 'selected'}>\n {row.getVisibleCells().map((cell) => (\n <TableCell\n key={cell.id}\n className={`\n px-4 py-2 text-left text-sm whitespace-nowrap\n ${cell.column.id === ACTIONS_COLUMN_ID\n ? 'sticky right-0 w-20 bg-card'\n : ''\n }\n `}\n >\n {flexRender(cell.column.columnDef.cell, cell.getContext())}\n </TableCell>\n ))}\n </TableRow>\n ))\n )\n :\n // Empty table\n (\n <TableRow className=\"cursor-not-allowed\">\n <TableCell colSpan={columns.length} className=\"border-none\">\n <span className=\"flex gap-3 justify-center items-center\">\n {!dataQuery.isFetching && (\n dataQuery.isError ? (\n <>\n <Info /> You don't have the required permissions. Please contact your admin.\n </>\n ) : !dataQuery.data?.data ? (\n <>No result found.</>\n ) : null\n )}\n </span>\n </TableCell>\n </TableRow>\n )}\n </TableBody>\n {/* Loader positioned to cover entire table viewport */}\n {dataQuery.isFetching && (\n <TableFooter className=\"absolute inset-0 z-20 flex justify-center items-center bg-card/80\" />\n )}\n </TableComponent>\n );\n}\n"],"names":["TableContent","table","columns","dataQuery","jsxs","TableComponent","jsx","TableHeader","headerGroup","index","TableRow","header","TableHead","ACTIONS_COLUMN_ID","flexRender","Button","TableBody","row","cell","TableCell","Fragment","Info","_a","TableFooter"],"mappings":";;;;;;AAeO,SAASA,EAA4B;AAAA,EAC1C,OAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC;AACF,GAIG;;AAEC,SAAA,gBAAAC,EAACC,GAAe,EAAA,WAAU,aACxB,UAAA;AAAA,IAAA,gBAAAC,EAACC,KAAY,WAAU,qBACpB,UAAMN,EAAA,kBAAkB,IAAI,CAACO,GAAaC,wBACxCC,GACE,EAAA,UAAAF,EAAY,QAAQ,IAAI,CAACG,MACxB,gBAAAL;AAAA,MAACM;AAAA,MAAA;AAAA,QAEC,WAAW,qEAAqED,EAAO,OAAOE,IAAoB,oCAAoC,EAAE;AAAA,QAExJ,UAAA,gBAAAT,EAAC,QAAK,EAAA,WAAU,kCAEd,UAAA;AAAA,UAAA,gBAAAE,EAAC,QACE,EAAA,UAAAK,EAAO,gBACJ,OACAG,EAAWH,EAAO,OAAO,UAAU,QAAQA,EAAO,WAAY,CAAA,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;AAAA,IAECnB,EAAU,cACR,gBAAAG,EAAAiB,GAAA,EAAY,WAAU,oEAAoE,CAAA;AAAA,EAAA,GAE/F;AAEJ;"}
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { Badge as h } from "../ui/badge.es.js";
|
|
3
|
-
import { Table as g, TableHeader as x, TableRow as c, TableCell as
|
|
4
|
-
import { getResourceDisplayName as
|
|
5
|
-
function
|
|
3
|
+
import { Table as g, TableHeader as x, TableRow as c, TableHead as f, TableCell as t, TableBody as u } from "../ui/table.es.js";
|
|
4
|
+
import { getResourceDisplayName as y, getValueFromData as N } from "../data-table/table-utils/constants.es.js";
|
|
5
|
+
function A({ accessors: d, data: o, affectedData: n }) {
|
|
6
6
|
return /* @__PURE__ */ i(g, { children: [
|
|
7
7
|
/* @__PURE__ */ e(x, { className: "text-left align-middle sticky top-0 z-10 bg-card", children: /* @__PURE__ */ i(c, { children: [
|
|
8
8
|
d.map((r) => /* @__PURE__ */ e(
|
|
9
|
-
|
|
9
|
+
f,
|
|
10
10
|
{
|
|
11
11
|
className: "px-4 py-2 text-left text-sm font-medium cursor-pointer whitespace-nowrap bg-card",
|
|
12
|
-
children:
|
|
12
|
+
children: y(String(r), "admin-portal")
|
|
13
13
|
},
|
|
14
14
|
String(r)
|
|
15
15
|
)),
|
|
16
|
-
n && /* @__PURE__ */ e(
|
|
16
|
+
n && /* @__PURE__ */ e(t, { className: "px-4 py-2 text-left text-sm font-medium cursor-pointer whitespace-nowrap bg-card", children: "Affected" })
|
|
17
17
|
] }) }),
|
|
18
|
-
/* @__PURE__ */ e(
|
|
19
|
-
d.map((
|
|
20
|
-
const p = r[
|
|
21
|
-
return Array.isArray(p) ? /* @__PURE__ */ e(
|
|
18
|
+
/* @__PURE__ */ e(u, { children: o.map((r, m) => /* @__PURE__ */ i(c, { children: [
|
|
19
|
+
d.map((a) => {
|
|
20
|
+
const p = r[a];
|
|
21
|
+
return Array.isArray(p) ? /* @__PURE__ */ e(t, { className: "flex gap-4", children: p.map((l, s) => /* @__PURE__ */ e(h, { children: (l == null ? void 0 : l.name) || l }, s)) }, String(a)) : /* @__PURE__ */ e(t, { children: N(r, a) }, String(a));
|
|
22
22
|
}),
|
|
23
|
-
n && /* @__PURE__ */ e(
|
|
23
|
+
n && /* @__PURE__ */ e(t, { children: n.includes(r) ? /* @__PURE__ */ e("span", { className: "text-success-foreground", children: "✔" }) : /* @__PURE__ */ e("span", { className: "text-destructive-foreground", children: "✖" }) })
|
|
24
24
|
] }, m)) })
|
|
25
25
|
] });
|
|
26
26
|
}
|
|
27
27
|
export {
|
|
28
|
-
|
|
28
|
+
A as StaticDataTable
|
|
29
29
|
};
|
|
30
30
|
//# sourceMappingURL=data-table.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-table.es.js","sources":["../../../lib/components/static-data-table/data-table.tsx"],"sourcesContent":["import { getResourceDisplayName, getValueFromData } from '@/components/data-table';\nimport { Badge } from '@/components/ui/badge';\nimport { Table, TableBody, TableCell, TableHeader, TableRow } from '@/components/ui/table';\n\n\nexport interface StaticDataTableProps<T> {\n accessors: (keyof T)[];\n data: T[];\n affectedData?: T[];\n}\n\nexport function StaticDataTable<T>({ accessors, data, affectedData }: StaticDataTableProps<T>) {\n return (\n <Table>\n <TableHeader className=\"text-left align-middle sticky top-0 z-10 bg-card\">\n <TableRow>\n {accessors.map((accessor) => (\n <
|
|
1
|
+
{"version":3,"file":"data-table.es.js","sources":["../../../lib/components/static-data-table/data-table.tsx"],"sourcesContent":["import { getResourceDisplayName, getValueFromData } from '@/components/data-table';\nimport { Badge } from '@/components/ui/badge';\nimport { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@/components/ui/table';\n\n\nexport interface StaticDataTableProps<T> {\n accessors: (keyof T)[];\n data: T[];\n affectedData?: T[];\n}\n\nexport function StaticDataTable<T>({ accessors, data, affectedData }: StaticDataTableProps<T>) {\n return (\n <Table>\n <TableHeader className=\"text-left align-middle sticky top-0 z-10 bg-card\">\n <TableRow>\n {accessors.map((accessor) => (\n <TableHead\n key={String(accessor)}\n className=\"px-4 py-2 text-left text-sm font-medium cursor-pointer whitespace-nowrap bg-card\"\n >\n {getResourceDisplayName(String(accessor), 'admin-portal')}\n </TableHead>\n ))}\n {affectedData && (\n <TableCell className=\"px-4 py-2 text-left text-sm font-medium cursor-pointer whitespace-nowrap bg-card\">\n Affected\n </TableCell>\n )}\n </TableRow>\n </TableHeader>\n <TableBody>\n {data.map((item, index) => (\n <TableRow key={index}>\n {accessors.map((accessor) => {\n const value = item[accessor];\n // Handle arrays (e.g., userGroups) with badges\n if (Array.isArray(value)) {\n return (\n <TableCell key={String(accessor)} className=\"flex gap-4\">\n {value.map((subItem, subIndex) => (\n <Badge key={subIndex}>{subItem?.name || subItem}</Badge>\n ))}\n </TableCell>\n );\n }\n // Handle other data types\n return (\n <TableCell key={String(accessor)}>{getValueFromData(item, accessor)}</TableCell>\n );\n })}\n {affectedData && (\n <TableCell>\n {affectedData.includes(item) ? (\n <span className=\"text-success-foreground\">✔</span>\n ) : (\n <span className=\"text-destructive-foreground\">✖</span>\n )}\n </TableCell>\n )}\n </TableRow>\n ))}\n </TableBody>\n </Table>\n );\n}\n"],"names":["StaticDataTable","accessors","data","affectedData","Table","jsx","TableHeader","jsxs","TableRow","accessor","TableHead","getResourceDisplayName","TableCell","TableBody","item","index","value","subItem","subIndex","Badge","getValueFromData"],"mappings":";;;;AAWO,SAASA,EAAmB,EAAE,WAAAC,GAAW,MAAAC,GAAM,cAAAC,KAAyC;AAC7F,2BACGC,GACC,EAAA,UAAA;AAAA,IAAA,gBAAAC,EAACC,GAAY,EAAA,WAAU,oDACrB,UAAA,gBAAAC,EAACC,GACE,EAAA,UAAA;AAAA,MAAUP,EAAA,IAAI,CAACQ,MACd,gBAAAJ;AAAA,QAACK;AAAA,QAAA;AAAA,UAEC,WAAU;AAAA,UAET,UAAuBC,EAAA,OAAOF,CAAQ,GAAG,cAAc;AAAA,QAAA;AAAA,QAHnD,OAAOA,CAAQ;AAAA,MAAA,CAKvB;AAAA,MACAN,KACC,gBAAAE,EAACO,GAAU,EAAA,WAAU,oFAAmF,UAExG,WAAA,CAAA;AAAA,IAAA,EAAA,CAEJ,EACF,CAAA;AAAA,IACA,gBAAAP,EAACQ,KACE,UAAKX,EAAA,IAAI,CAACY,GAAMC,wBACdP,GACE,EAAA,UAAA;AAAA,MAAUP,EAAA,IAAI,CAACQ,MAAa;AACrB,cAAAO,IAAQF,EAAKL,CAAQ;AAEvB,eAAA,MAAM,QAAQO,CAAK,sBAElBJ,GAAiC,EAAA,WAAU,cACzC,UAAMI,EAAA,IAAI,CAACC,GAASC,wBAClBC,GAAsB,EAAA,WAAAF,KAAA,gBAAAA,EAAS,SAAQA,EAA5B,GAAAC,CAAoC,CACjD,EAHa,GAAA,OAAOT,CAAQ,CAI/B,IAKF,gBAAAJ,EAACO,KAAkC,UAAiBQ,EAAAN,GAAML,CAAQ,EAAlD,GAAA,OAAOA,CAAQ,CAAqC;AAAA,MAAA,CAEvE;AAAA,MACAN,KACE,gBAAAE,EAAAO,GAAA,EACE,YAAa,SAASE,CAAI,IACxB,gBAAAT,EAAA,QAAA,EAAK,WAAU,2BAA0B,eAAC,IAE3C,gBAAAA,EAAC,UAAK,WAAU,+BAA8B,cAAC,CAAA,EAEnD,CAAA;AAAA,IAAA,EAzBW,GAAAU,CA2Bf,CACD,EACH,CAAA;AAAA,EAAA,GACF;AAEJ;"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import * as o from "react";
|
|
3
3
|
import { cn as l } from "../../utils/index.es.js";
|
|
4
|
-
const d =
|
|
5
|
-
({ className: e, ...a },
|
|
4
|
+
const d = o.forwardRef(
|
|
5
|
+
({ className: e, ...a }, r) => /* @__PURE__ */ t(
|
|
6
6
|
"table",
|
|
7
7
|
{
|
|
8
|
-
ref:
|
|
8
|
+
ref: r,
|
|
9
9
|
className: l(
|
|
10
|
-
"w-full caption-bottom text-sm [&_tr:last-child]:border-0 my-0
|
|
10
|
+
"w-full caption-bottom text-sm [&_tr:last-child]:border-0 my-0 whitespace-nowrap",
|
|
11
11
|
e
|
|
12
12
|
),
|
|
13
13
|
...a
|
|
@@ -15,19 +15,19 @@ const d = t.forwardRef(
|
|
|
15
15
|
)
|
|
16
16
|
);
|
|
17
17
|
d.displayName = "Table";
|
|
18
|
-
const s =
|
|
18
|
+
const s = o.forwardRef(({ className: e, ...a }, r) => /* @__PURE__ */ t(
|
|
19
19
|
"thead",
|
|
20
20
|
{
|
|
21
|
-
ref:
|
|
21
|
+
ref: r,
|
|
22
22
|
className: l("[&_tr]:border-b border-b", e),
|
|
23
23
|
...a
|
|
24
24
|
}
|
|
25
25
|
));
|
|
26
26
|
s.displayName = "TableHeader";
|
|
27
|
-
const b =
|
|
27
|
+
const b = o.forwardRef(({ className: e, ...a }, r) => /* @__PURE__ */ t(
|
|
28
28
|
"tbody",
|
|
29
29
|
{
|
|
30
|
-
ref:
|
|
30
|
+
ref: r,
|
|
31
31
|
className: l(
|
|
32
32
|
"[&_tr:last-child]:border-b-2 [&_tr:last-child]:border-dotted",
|
|
33
33
|
// Updated to 2px dotted border for the last row
|
|
@@ -37,20 +37,20 @@ const b = t.forwardRef(({ className: e, ...a }, o) => /* @__PURE__ */ r(
|
|
|
37
37
|
}
|
|
38
38
|
));
|
|
39
39
|
b.displayName = "TableBody";
|
|
40
|
-
const m =
|
|
40
|
+
const m = o.forwardRef(({ className: e, ...a }, r) => /* @__PURE__ */ t(
|
|
41
41
|
"tfoot",
|
|
42
42
|
{
|
|
43
|
-
ref:
|
|
44
|
-
className: l("border-t
|
|
43
|
+
ref: r,
|
|
44
|
+
className: l("border-t font-medium last:[&>tr]:border-b-0", e),
|
|
45
45
|
...a
|
|
46
46
|
}
|
|
47
47
|
));
|
|
48
48
|
m.displayName = "TableFooter";
|
|
49
|
-
const c =
|
|
50
|
-
({ className: e, ...a },
|
|
49
|
+
const c = o.forwardRef(
|
|
50
|
+
({ className: e, ...a }, r) => /* @__PURE__ */ t(
|
|
51
51
|
"tr",
|
|
52
52
|
{
|
|
53
|
-
ref:
|
|
53
|
+
ref: r,
|
|
54
54
|
className: l(
|
|
55
55
|
"border-b border-border",
|
|
56
56
|
e
|
|
@@ -60,36 +60,36 @@ const c = t.forwardRef(
|
|
|
60
60
|
)
|
|
61
61
|
);
|
|
62
62
|
c.displayName = "TableRow";
|
|
63
|
-
const f =
|
|
63
|
+
const f = o.forwardRef(({ className: e, ...a }, r) => /* @__PURE__ */ t(
|
|
64
64
|
"th",
|
|
65
65
|
{
|
|
66
|
-
ref:
|
|
66
|
+
ref: r,
|
|
67
67
|
className: l(
|
|
68
|
-
"
|
|
68
|
+
"text-left align-middle font-medium",
|
|
69
69
|
e
|
|
70
70
|
),
|
|
71
71
|
...a
|
|
72
72
|
}
|
|
73
73
|
));
|
|
74
74
|
f.displayName = "TableHead";
|
|
75
|
-
const i =
|
|
75
|
+
const i = o.forwardRef(({ className: e, ...a }, r) => /* @__PURE__ */ t(
|
|
76
76
|
"td",
|
|
77
77
|
{
|
|
78
|
-
ref:
|
|
78
|
+
ref: r,
|
|
79
79
|
className: l(
|
|
80
|
-
"[
|
|
80
|
+
"[&_tr:last-child]:border-dotted",
|
|
81
81
|
e
|
|
82
82
|
),
|
|
83
83
|
...a
|
|
84
84
|
}
|
|
85
85
|
));
|
|
86
86
|
i.displayName = "TableCell";
|
|
87
|
-
const
|
|
88
|
-
|
|
87
|
+
const n = o.forwardRef(({ className: e, ...a }, r) => /* @__PURE__ */ t("caption", { ref: r, className: l("mt-4 text-sm text-muted-foreground", e), ...a }));
|
|
88
|
+
n.displayName = "TableCaption";
|
|
89
89
|
export {
|
|
90
90
|
d as Table,
|
|
91
91
|
b as TableBody,
|
|
92
|
-
|
|
92
|
+
n as TableCaption,
|
|
93
93
|
i as TableCell,
|
|
94
94
|
m as TableFooter,
|
|
95
95
|
f as TableHead,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.es.js","sources":["../../../lib/components/ui/table.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { cn } from '@/utils';\n\nconst Table = React.forwardRef<HTMLTableElement, React.HTMLAttributes<HTMLTableElement>>(\n ({ className, ...props }, ref) => (\n <table\n ref={ref}\n className={cn(\n 'w-full caption-bottom text-sm [&_tr:last-child]:border-0 my-0
|
|
1
|
+
{"version":3,"file":"table.es.js","sources":["../../../lib/components/ui/table.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { cn } from '@/utils';\n\nconst Table = React.forwardRef<HTMLTableElement, React.HTMLAttributes<HTMLTableElement>>(\n ({ className, ...props }, ref) => (\n <table\n ref={ref}\n className={cn(\n 'w-full caption-bottom text-sm [&_tr:last-child]:border-0 my-0 whitespace-nowrap',\n className,\n )}\n {...props}\n />\n ),\n);\nTable.displayName = 'Table';\n\nconst TableHeader = React.forwardRef<\n HTMLTableSectionElement,\n React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n <thead\n ref={ref}\n className={cn('[&_tr]:border-b border-b', className)} // Added border-b to apply a bottom border\n {...props}\n />\n));\nTableHeader.displayName = 'TableHeader';\n\nconst TableBody = React.forwardRef<\n HTMLTableSectionElement,\n React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n <tbody\n ref={ref}\n className={cn(\n '[&_tr:last-child]:border-b-2 [&_tr:last-child]:border-dotted', // Updated to 2px dotted border for the last row\n className,\n )}\n {...props}\n />\n));\nTableBody.displayName = 'TableBody';\n\nconst TableFooter = React.forwardRef<\n HTMLTableSectionElement,\n React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n <tfoot\n ref={ref}\n className={cn('border-t font-medium last:[&>tr]:border-b-0', className)}\n {...props}\n />\n));\nTableFooter.displayName = 'TableFooter';\n\nconst TableRow = React.forwardRef<HTMLTableRowElement, React.HTMLAttributes<HTMLTableRowElement>>(\n ({ className, ...props }, ref) => (\n <tr\n ref={ref}\n className={cn(\n 'border-b border-border',\n className,\n )}\n {...props}\n />\n ),\n);\nTableRow.displayName = 'TableRow';\n\nconst TableHead = React.forwardRef<\n HTMLTableCellElement,\n React.ThHTMLAttributes<HTMLTableCellElement>\n>(({ className, ...props }, ref) => (\n <th\n ref={ref}\n className={cn(\n 'text-left align-middle font-medium',\n className,\n )}\n {...props}\n />\n));\nTableHead.displayName = 'TableHead';\n\nconst TableCell = React.forwardRef<\n HTMLTableCellElement,\n React.TdHTMLAttributes<HTMLTableCellElement>\n>(({ className, ...props }, ref) => (\n <td\n ref={ref}\n className={cn(\n '[&_tr:last-child]:border-dotted',\n className,\n )}\n {...props}\n />\n));\nTableCell.displayName = 'TableCell';\n\nconst TableCaption = React.forwardRef<\n HTMLTableCaptionElement,\n React.HTMLAttributes<HTMLTableCaptionElement>\n>(({ className, ...props }, ref) => (\n <caption ref={ref} className={cn('mt-4 text-sm text-muted-foreground', className)} {...props} />\n));\nTableCaption.displayName = 'TableCaption';\n\nexport { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow };\n"],"names":["Table","React","className","props","ref","jsx","cn","TableHeader","TableBody","TableFooter","TableRow","TableHead","TableCell","TableCaption"],"mappings":";;;AAIA,MAAMA,IAAQC,EAAM;AAAA,EAClB,CAAC,EAAE,WAAAC,GAAW,GAAGC,KAASC,MACxB,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAD;AAAA,MACA,WAAWE;AAAA,QACT;AAAA,QACAJ;AAAA,MACF;AAAA,MACC,GAAGC;AAAA,IAAA;AAAA,EAAA;AAGV;AACAH,EAAM,cAAc;AAEd,MAAAO,IAAcN,EAAM,WAGxB,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAM,GAAGC,MAC1B,gBAAAC;AAAA,EAAC;AAAA,E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