@invopop/popui 0.1.4-beta.32 → 0.1.4-beta.34
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.
|
@@ -79,6 +79,7 @@ export interface DataTableProps<TData> {
|
|
|
79
79
|
onSortingChange?: (columnId: string, direction: 'asc' | 'desc') => void;
|
|
80
80
|
onFilterChange?: (columnId: string) => void;
|
|
81
81
|
onFreezeChange?: (columnId: string) => void;
|
|
82
|
+
onColumnResize?: (columnSizes: Record<string, number>) => void;
|
|
82
83
|
getRowClassName?: (row: TData) => string;
|
|
83
84
|
}
|
|
84
85
|
export interface DataTablePaginationProps<T> {
|
|
@@ -62,6 +62,7 @@
|
|
|
62
62
|
onSortingChange,
|
|
63
63
|
onFilterChange,
|
|
64
64
|
onFreezeChange,
|
|
65
|
+
onColumnResize,
|
|
65
66
|
getRowClassName,
|
|
66
67
|
children
|
|
67
68
|
}: DataTableProps<TData> = $props()
|
|
@@ -156,7 +157,12 @@
|
|
|
156
157
|
setColumnVisibility: (value) => (columnVisibility = value),
|
|
157
158
|
setSorting: (value) => (sorting = value),
|
|
158
159
|
setPagination: (value) => (pagination = value),
|
|
159
|
-
setColumnSizing: (value) =>
|
|
160
|
+
setColumnSizing: (value) => {
|
|
161
|
+
columnSizing = value
|
|
162
|
+
if (onColumnResize && Object.keys(value).length > 0) {
|
|
163
|
+
onColumnResize(value)
|
|
164
|
+
}
|
|
165
|
+
},
|
|
160
166
|
setColumnSizingInfo: (value) => (columnSizingInfo = value),
|
|
161
167
|
setColumnOrder: (value) => (columnOrder = value)
|
|
162
168
|
})
|
|
@@ -345,7 +351,7 @@
|
|
|
345
351
|
{ 'pl-4': isFirst, 'pr-4': isLast, 'border-r border-border': isFrozen && isLastFrozen }
|
|
346
352
|
)}
|
|
347
353
|
>
|
|
348
|
-
<div class="relative z-10 flex items-center">
|
|
354
|
+
<div class="relative z-10 flex items-center w-full">
|
|
349
355
|
{@render children()}
|
|
350
356
|
</div>
|
|
351
357
|
</div>
|
|
@@ -594,7 +600,7 @@
|
|
|
594
600
|
</Table.Root>
|
|
595
601
|
{/if}
|
|
596
602
|
</div>
|
|
597
|
-
{#if enablePagination}
|
|
603
|
+
{#if enablePagination && data.length > 0}
|
|
598
604
|
<DataTablePagination
|
|
599
605
|
{table}
|
|
600
606
|
{data}
|