@onesaz/ui 0.3.10 → 0.3.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -0
- package/dist/index.js +19 -11
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -795,6 +795,8 @@ interface GridColDef<TData = any> {
|
|
|
795
795
|
valueFormatter?: (params: GridValueFormatterParams) => string;
|
|
796
796
|
type?: 'string' | 'number' | 'date' | 'dateTime' | 'boolean';
|
|
797
797
|
wrapText?: boolean;
|
|
798
|
+
scrollable?: boolean;
|
|
799
|
+
maxCellHeight?: number;
|
|
798
800
|
cellClassName?: string;
|
|
799
801
|
export?: boolean;
|
|
800
802
|
hideExport?: boolean;
|
package/dist/index.js
CHANGED
|
@@ -1935,17 +1935,17 @@ var DialogContent = React22.forwardRef(({ className, children, hideCloseButton =
|
|
|
1935
1935
|
{
|
|
1936
1936
|
ref,
|
|
1937
1937
|
className: cn(
|
|
1938
|
-
"fixed
|
|
1938
|
+
"fixed z-50 grid w-full gap-4 p-6 shadow-lg",
|
|
1939
1939
|
"bg-popover border border-border text-popover-foreground",
|
|
1940
1940
|
"rounded-lg",
|
|
1941
1941
|
"data-[state=open]:animate-zoom-in data-[state=closed]:animate-zoom-out",
|
|
1942
1942
|
"duration-200",
|
|
1943
|
-
size === "sm" && "max-w-sm",
|
|
1944
|
-
size === "md" && "max-w-md",
|
|
1945
|
-
size === "lg" && "max-w-lg",
|
|
1946
|
-
size === "xl" && "max-w-xl",
|
|
1947
|
-
size === "2xl" && "max-w-2xl",
|
|
1948
|
-
size === "full" && "max-w-full",
|
|
1943
|
+
size === "sm" && "left-1/2 top-1/2 max-w-sm -translate-x-1/2 -translate-y-1/2",
|
|
1944
|
+
size === "md" && "left-1/2 top-1/2 max-w-md -translate-x-1/2 -translate-y-1/2",
|
|
1945
|
+
size === "lg" && "left-1/2 top-1/2 max-w-lg -translate-x-1/2 -translate-y-1/2",
|
|
1946
|
+
size === "xl" && "left-1/2 top-1/2 max-w-xl -translate-x-1/2 -translate-y-1/2",
|
|
1947
|
+
size === "2xl" && "left-1/2 top-1/2 max-w-2xl -translate-x-1/2 -translate-y-1/2",
|
|
1948
|
+
size === "full" && "inset-0 h-full w-full max-w-full rounded-none",
|
|
1949
1949
|
className
|
|
1950
1950
|
),
|
|
1951
1951
|
...props,
|
|
@@ -3900,6 +3900,8 @@ function convertColumns(columns, checkboxSelection) {
|
|
|
3900
3900
|
flex: col.flex,
|
|
3901
3901
|
headerName: col.headerName || col.field,
|
|
3902
3902
|
wrapText: col.wrapText,
|
|
3903
|
+
scrollable: col.scrollable,
|
|
3904
|
+
maxCellHeight: col.maxCellHeight,
|
|
3903
3905
|
cellClassName: col.cellClassName
|
|
3904
3906
|
}
|
|
3905
3907
|
};
|
|
@@ -4421,6 +4423,8 @@ var RowRenderer = ({
|
|
|
4421
4423
|
const meta = cell.column.columnDef.meta;
|
|
4422
4424
|
const align = meta?.align || "left";
|
|
4423
4425
|
const wrapText = meta?.wrapText !== void 0 ? meta.wrapText : globalWrapText;
|
|
4426
|
+
const scrollable = meta?.scrollable || false;
|
|
4427
|
+
const maxCellHeight = meta?.maxCellHeight || 100;
|
|
4424
4428
|
const cellClassName = meta?.cellClassName;
|
|
4425
4429
|
const colWidth = columnWidths.get(cell.column.id);
|
|
4426
4430
|
const width = colWidth?.width || cell.column.getSize();
|
|
@@ -4432,7 +4436,7 @@ var RowRenderer = ({
|
|
|
4432
4436
|
showCellVerticalBorder && "border-r last:border-r-0 border-border"
|
|
4433
4437
|
),
|
|
4434
4438
|
style: {
|
|
4435
|
-
height: wrapText ? "auto" : rowHeight,
|
|
4439
|
+
height: wrapText || scrollable ? "auto" : rowHeight,
|
|
4436
4440
|
minHeight: rowHeight,
|
|
4437
4441
|
textAlign: align,
|
|
4438
4442
|
width,
|
|
@@ -4443,12 +4447,16 @@ var RowRenderer = ({
|
|
|
4443
4447
|
"div",
|
|
4444
4448
|
{
|
|
4445
4449
|
className: cn(
|
|
4446
|
-
wrapText ? "whitespace-normal break-words" : "truncate",
|
|
4450
|
+
wrapText ? "whitespace-normal break-words" : scrollable ? "overflow-auto" : "truncate",
|
|
4451
|
+
scrollable && "max-h-[100px]",
|
|
4447
4452
|
cellClassName
|
|
4448
4453
|
),
|
|
4454
|
+
style: {
|
|
4455
|
+
maxHeight: scrollable ? `${maxCellHeight}px` : void 0
|
|
4456
|
+
},
|
|
4449
4457
|
title: (
|
|
4450
|
-
// Show tooltip for truncated simple text values
|
|
4451
|
-
!wrapText && (typeof cell.getValue() === "string" || typeof cell.getValue() === "number") ? String(cell.getValue()) : void 0
|
|
4458
|
+
// Show tooltip for truncated simple text values (not for scrollable or wrapped content)
|
|
4459
|
+
!wrapText && !scrollable && (typeof cell.getValue() === "string" || typeof cell.getValue() === "number") ? String(cell.getValue()) : void 0
|
|
4452
4460
|
),
|
|
4453
4461
|
children: flexRender(cell.column.columnDef.cell, cell.getContext())
|
|
4454
4462
|
}
|