@bigbinary/neeto-atoms 1.0.24 → 1.0.25

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.
@@ -3375,7 +3375,6 @@ const useTableSelection = ({ enableRowSelection, selectedRowKeys, onRowSelect, d
3375
3375
  ariaLabel: "Select row",
3376
3376
  }),
3377
3377
  size: 40,
3378
- maxSize: 40,
3379
3378
  enableSorting: false,
3380
3379
  enableResizing: false,
3381
3380
  };
@@ -3714,43 +3713,53 @@ const DataTable = ({ columns, data, getRowId: getRowIdProp, sorting: sortingProp
3714
3713
  onSortingChange([{ id: columnId, desc }]);
3715
3714
  }
3716
3715
  };
3717
- return (jsxRuntime.jsxs("div", { className: utils.cn("relative flex min-h-0 w-full flex-col", className), children: [loading && jsxRuntime.jsx(LoadingOverlay, {}), bulkSelectAllRowsProps && (jsxRuntime.jsx(BulkSelectCallout, { bulkSelectAllRowsProps: bulkSelectAllRowsProps, isAllPageRowsSelected: table.getIsAllPageRowsSelected(), isBulkAllSelected: isBulkAllSelected })), jsxRuntime.jsx("div", { className: utils.cn("min-h-0 flex-1 overflow-auto", bordered && "rounded-lg border"), children: jsxRuntime.jsxs(primitives_Table.Table, { children: [jsxRuntime.jsx(primitives_Table.TableHeader, { className: "sticky top-0 z-20 bg-muted", children: table.getHeaderGroups().map(headerGroup => (jsxRuntime.jsx(primitives_Table.TableRow, { className: "hover:bg-muted", children: headerGroup.headers.map((header, headerIndex) => {
3718
- const isPinned = header.column.getIsPinned();
3719
- const isSelectionCol = header.column.id === "_selection";
3720
- const visibleHeaders = headerGroup.headers.filter(h => h.column.id !== "_selection");
3721
- const columnIndexInData = visibleHeaders.findIndex(h => h.id === header.id);
3722
- return (jsxRuntime.jsxs(primitives_Table.TableHead, { className: utils.cn("group/head relative", header.column.getCanSort() &&
3723
- "cursor-pointer select-none", isPinned && "sticky z-10 bg-muted"), style: {
3724
- width: header.getSize(),
3725
- minWidth: enableColumnResize
3726
- ? header.getSize()
3727
- : undefined,
3728
- maxWidth: header.column.columnDef.maxSize,
3729
- ...(isPinned === "left"
3730
- ? {
3731
- left: header.column.getStart("left"),
3732
- }
3733
- : {}),
3734
- ...(isPinned === "right"
3735
- ? {
3736
- right: header.column.getAfter("right"),
3737
- }
3738
- : {}),
3739
- }, onClick: header.column.getCanSort()
3740
- ? header.column.getToggleSortingHandler()
3741
- : undefined, children: [header.isPlaceholder ? null : (jsxRuntime.jsxs("div", { className: "flex items-center", children: [jsxRuntime.jsx("div", { className: "flex-1 truncate", children: flexRender(header.column.columnDef.header, header.getContext()) }), jsxRuntime.jsx(SortIndicator, { column: header.column }), showHeaderMenu && !isSelectionCol && (jsxRuntime.jsx(HeaderCellMenu, { column: header.column, columnIndex: columnIndexInData, enableAddColumn: enableAddColumn, enableColumnFreeze: enableColumnFreeze, isColumnPinned: isColumnPinned(header.column.id), canMoveLeft: headerIndex > (selectionColumn ? 1 : 0), canMoveRight: headerIndex < headerGroup.headers.length - 1, onSort: handleSort, onHideColumn: onColumnHideProp ? hideColumn : undefined, onTogglePin: toggleColumnPin, onAddColumn: onColumnAdd, onDeleteColumn: onColumnDelete, onMoveColumn: onColumnUpdate
3742
- ? (colId, dir) => moveColumn(colId, dir)
3743
- : undefined, onMoreActionClick: onMoreActionClick }))] })), enableColumnResize && jsxRuntime.jsx(ResizeHandle, { header: header })] }, header.id));
3744
- }) }, headerGroup.id))) }), jsxRuntime.jsx(primitives_Table.TableBody, { className: loading ? "opacity-50" : undefined, children: table.getRowModel().rows.length > 0 ? (table.getRowModel().rows.map(row => (jsxRuntime.jsx(primitives_Table.TableRow, { "data-state": row.getIsSelected() ? "selected" : undefined, className: utils.cn(allowRowClick && onRowClick && "cursor-pointer"), onClick: allowRowClick && onRowClick
3716
+ return (jsxRuntime.jsxs("div", { className: utils.cn("relative flex min-h-0 w-full flex-col", className), children: [loading && jsxRuntime.jsx(LoadingOverlay, {}), bulkSelectAllRowsProps &&
3717
+ (data.length !== totalCount || isBulkAllSelected) && (jsxRuntime.jsx(BulkSelectCallout, { bulkSelectAllRowsProps: bulkSelectAllRowsProps, isAllPageRowsSelected: table.getIsAllPageRowsSelected(), isBulkAllSelected: isBulkAllSelected })), jsxRuntime.jsx("div", { className: utils.cn("min-h-0 flex-1 overflow-auto", bordered && "rounded-lg border"), children: jsxRuntime.jsxs(primitives_Table.Table, { children: [jsxRuntime.jsx(primitives_Table.TableHeader, { className: "sticky top-0 z-20 bg-muted", children: table.getHeaderGroups().map(headerGroup => {
3718
+ const dataHeaders = headerGroup.headers.filter(h => h.column.id !== "_selection");
3719
+ const totalDataSize = dataHeaders.reduce((sum, h) => sum + h.getSize(), 0);
3720
+ return (jsxRuntime.jsx(primitives_Table.TableRow, { className: "hover:bg-muted", children: headerGroup.headers.map((header, headerIndex) => {
3721
+ const isPinned = header.column.getIsPinned();
3722
+ const isSelectionCol = header.column.id === "_selection";
3723
+ const columnIndexInData = dataHeaders.findIndex(h => h.id === header.id);
3724
+ return (jsxRuntime.jsxs(primitives_Table.TableHead, { className: utils.cn("group/head relative", header.column.getCanSort() &&
3725
+ "cursor-pointer select-none", isPinned && "sticky z-10 bg-muted"), style: {
3726
+ width: selectionColumn && isSelectionCol
3727
+ ? 0
3728
+ : selectionColumn
3729
+ ? `${(header.getSize() / totalDataSize) * 100}%`
3730
+ : header.getSize(),
3731
+ minWidth: enableColumnResize
3732
+ ? header.getSize()
3733
+ : undefined,
3734
+ ...(isPinned === "left"
3735
+ ? {
3736
+ left: header.column.getStart("left"),
3737
+ }
3738
+ : {}),
3739
+ ...(isPinned === "right"
3740
+ ? {
3741
+ right: header.column.getAfter("right"),
3742
+ }
3743
+ : {}),
3744
+ }, onClick: header.column.getCanSort()
3745
+ ? header.column.getToggleSortingHandler()
3746
+ : undefined, children: [header.isPlaceholder ? null : (jsxRuntime.jsxs("div", { className: "flex items-center", children: [jsxRuntime.jsx("div", { className: "flex-1 truncate", children: flexRender(header.column.columnDef.header, header.getContext()) }), jsxRuntime.jsx(SortIndicator, { column: header.column }), showHeaderMenu && !isSelectionCol && (jsxRuntime.jsx(HeaderCellMenu, { column: header.column, columnIndex: columnIndexInData, enableAddColumn: enableAddColumn, enableColumnFreeze: enableColumnFreeze, isColumnPinned: isColumnPinned(header.column.id), canMoveLeft: headerIndex > (selectionColumn ? 1 : 0), canMoveRight: headerIndex < headerGroup.headers.length - 1, onSort: handleSort, onHideColumn: onColumnHideProp ? hideColumn : undefined, onTogglePin: toggleColumnPin, onAddColumn: onColumnAdd, onDeleteColumn: onColumnDelete, onMoveColumn: onColumnUpdate
3747
+ ? (colId, dir) => moveColumn(colId, dir)
3748
+ : undefined, onMoreActionClick: onMoreActionClick }))] })), enableColumnResize && jsxRuntime.jsx(ResizeHandle, { header: header })] }, header.id));
3749
+ }) }, headerGroup.id));
3750
+ }) }), jsxRuntime.jsx(primitives_Table.TableBody, { className: loading ? "opacity-50" : undefined, children: table.getRowModel().rows.length > 0 ? (table.getRowModel().rows.map(row => (jsxRuntime.jsx(primitives_Table.TableRow, { "data-state": row.getIsSelected() ? "selected" : undefined, className: utils.cn("group", allowRowClick && onRowClick && "cursor-pointer"), onClick: allowRowClick && onRowClick
3745
3751
  ? event => onRowClick(event, row.original, row.index)
3746
3752
  : undefined, children: row.getVisibleCells().map(cell => {
3747
3753
  const isPinned = cell.column.getIsPinned();
3748
- return (jsxRuntime.jsx(primitives_Table.TableCell, { className: utils.cn(isPinned && "sticky z-10 bg-background"), style: {
3749
- width: cell.column.getSize(),
3754
+ const isSelCell = cell.column.id === "_selection";
3755
+ return (jsxRuntime.jsx(primitives_Table.TableCell, { className: utils.cn(isPinned &&
3756
+ "sticky z-10 bg-background group-data-[state=selected]:bg-muted"), style: {
3757
+ width: selectionColumn && isSelCell
3758
+ ? 0
3759
+ : cell.column.getSize(),
3750
3760
  minWidth: enableColumnResize
3751
3761
  ? cell.column.getSize()
3752
3762
  : undefined,
3753
- maxWidth: cell.column.columnDef.maxSize,
3754
3763
  ...(isPinned === "left"
3755
3764
  ? {
3756
3765
  left: cell.column.getStart("left"),
@@ -3772,4 +3781,4 @@ exports.useColumnVisibility = useColumnVisibility;
3772
3781
  exports.useTablePagination = useTablePagination;
3773
3782
  exports.useTableSelection = useTableSelection;
3774
3783
  exports.useTableSort = useTableSort;
3775
- //# sourceMappingURL=DataTable-BOeCq0s4.js.map
3784
+ //# sourceMappingURL=DataTable-Cw0ly-hT.js.map