lecom-ui 4.7.8 → 4.7.9
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.
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { cn } from '../../lib/utils.js';
|
|
2
3
|
import { useReactTable, getSortedRowModel, getCoreRowModel, flexRender } from '@tanstack/react-table';
|
|
3
4
|
import { Pagination } from '../Pagination/Pagination.js';
|
|
4
5
|
import { ScrollArea, ScrollBar } from '../ScrollArea/ScrollArea.js';
|
|
@@ -13,6 +14,7 @@ function DataTable({
|
|
|
13
14
|
pagination,
|
|
14
15
|
vwDiff,
|
|
15
16
|
vhDiff,
|
|
17
|
+
className,
|
|
16
18
|
onIsSelected
|
|
17
19
|
}) {
|
|
18
20
|
const [sorting, setSorting] = React.useState([]);
|
|
@@ -108,7 +110,10 @@ function DataTable({
|
|
|
108
110
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
109
111
|
"div",
|
|
110
112
|
{
|
|
111
|
-
className:
|
|
113
|
+
className: cn(
|
|
114
|
+
"bg-white rounded-[8px] p-2 transition-all duration-500",
|
|
115
|
+
className
|
|
116
|
+
),
|
|
112
117
|
style: { width: styleDataTableContainer().width }
|
|
113
118
|
},
|
|
114
119
|
/* @__PURE__ */ React.createElement(ScrollArea, { type: "always", className: "p-2" }, /* @__PURE__ */ React.createElement(
|
|
@@ -127,7 +132,7 @@ function DataTable({
|
|
|
127
132
|
"th",
|
|
128
133
|
{
|
|
129
134
|
key: header.id,
|
|
130
|
-
className: "h-12 px-4 [&:has([role=checkbox])]:pr-0
|
|
135
|
+
className: "h-12 px-4 [&:has([role=checkbox])]:pr-0 shadow-[0_-1.5px_0px_0px_#c9c9c9_inset] text-left",
|
|
131
136
|
"data-header": header.id,
|
|
132
137
|
"data-fixed": getFixed(
|
|
133
138
|
header.column.columnDef.meta
|
|
@@ -152,7 +157,7 @@ function DataTable({
|
|
|
152
157
|
"td",
|
|
153
158
|
{
|
|
154
159
|
key: cell.id,
|
|
155
|
-
className: "p-4 py-0 h-10 [&:has([role=checkbox])]:pr-0 transition-colors
|
|
160
|
+
className: "p-4 py-0 h-10 [&:has([role=checkbox])]:pr-0 transition-colors shadow-[0_-0.5px_0px_0px_#c9c9c9_inset] text-left",
|
|
156
161
|
"data-column": cell.column.id,
|
|
157
162
|
"data-fixed": getFixed(
|
|
158
163
|
cell.column.columnDef.meta
|
|
@@ -171,7 +176,7 @@ function DataTable({
|
|
|
171
176
|
"td",
|
|
172
177
|
{
|
|
173
178
|
colSpan: columns.length,
|
|
174
|
-
className: "p-4 py-0 h-10 align-middle [&:has([role=checkbox])]:pr-0 transition-colors
|
|
179
|
+
className: "p-4 py-0 h-10 align-middle [&:has([role=checkbox])]:pr-0 transition-colors"
|
|
175
180
|
},
|
|
176
181
|
noResults ?? /* @__PURE__ */ React.createElement("div", { className: "text-center" }, "-")
|
|
177
182
|
))))
|
|
@@ -59,7 +59,15 @@ function buildColumns({
|
|
|
59
59
|
),
|
|
60
60
|
onClick: () => externalColumn.onSort?.({ table, column })
|
|
61
61
|
},
|
|
62
|
-
typeof externalColumn.title === "string" ? /* @__PURE__ */ React.createElement(
|
|
62
|
+
typeof externalColumn.title === "string" ? /* @__PURE__ */ React.createElement(
|
|
63
|
+
Typography,
|
|
64
|
+
{
|
|
65
|
+
variant: "body-large-500",
|
|
66
|
+
textColor: "text-grey-950",
|
|
67
|
+
className: "truncate"
|
|
68
|
+
},
|
|
69
|
+
externalColumn.title
|
|
70
|
+
) : title,
|
|
63
71
|
hasSort && /* @__PURE__ */ React.createElement(
|
|
64
72
|
ArrowUpDown,
|
|
65
73
|
{
|
package/dist/index.d.ts
CHANGED
|
@@ -369,6 +369,7 @@ interface DataTableProps<TData, TValue> {
|
|
|
369
369
|
pagination?: PaginationProps;
|
|
370
370
|
vwDiff?: number;
|
|
371
371
|
vhDiff?: number;
|
|
372
|
+
className?: string;
|
|
372
373
|
onIsSelected?: (row: Row$1<TData>) => boolean;
|
|
373
374
|
}
|
|
374
375
|
interface Row<TData> {
|
|
@@ -394,7 +395,7 @@ interface BuildCellSelect<TData, TValue> {
|
|
|
394
395
|
}
|
|
395
396
|
type Meta = Record<string, string | number>;
|
|
396
397
|
|
|
397
|
-
declare function DataTable<TData, TValue>({ isLoading, columns, data, noResults, pagination, vwDiff, vhDiff, onIsSelected, }: DataTableProps<TData, TValue>): React$1.JSX.Element;
|
|
398
|
+
declare function DataTable<TData, TValue>({ isLoading, columns, data, noResults, pagination, vwDiff, vhDiff, className, onIsSelected, }: DataTableProps<TData, TValue>): React$1.JSX.Element;
|
|
398
399
|
declare namespace DataTable {
|
|
399
400
|
var displayName: string;
|
|
400
401
|
}
|
|
@@ -713,7 +714,7 @@ declare const TooltipTrigger: React$1.ForwardRefExoticComponent<TooltipPrimitive
|
|
|
713
714
|
declare const TooltipArrow: React$1.ForwardRefExoticComponent<TooltipPrimitive.TooltipArrowProps & React$1.RefAttributes<SVGSVGElement>>;
|
|
714
715
|
declare const TooltipPortal: React$1.FC<TooltipPrimitive.TooltipPortalProps>;
|
|
715
716
|
declare const tooltipContentVariants: (props?: ({
|
|
716
|
-
color?: "
|
|
717
|
+
color?: "black" | "white" | null | undefined;
|
|
717
718
|
arrow?: boolean | null | undefined;
|
|
718
719
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
719
720
|
interface TooltipContentProps extends React$1.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>, VariantProps<typeof tooltipContentVariants> {
|