@invopop/popui 0.1.4-beta.44 → 0.1.4-beta.45
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.
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
let { table, filters, frozenColumns, onFreezeColumn, disabled = false }: { table: Table<TData>; filters?: Snippet; frozenColumns: Set<string>; onFreezeColumn: (columnId: string) => void; disabled?: boolean } = $props()
|
|
8
8
|
</script>
|
|
9
9
|
|
|
10
|
-
<div class={clsx('flex items-center justify-between px-4 py-
|
|
10
|
+
<div class={clsx('flex items-center justify-between px-4 py-2.5', {
|
|
11
11
|
'pointer-events-none opacity-30': disabled
|
|
12
12
|
})}>
|
|
13
13
|
{#if filters}
|
|
@@ -393,7 +393,7 @@
|
|
|
393
393
|
})}
|
|
394
394
|
<div
|
|
395
395
|
class={cn(
|
|
396
|
-
'absolute inset-0 flex items-center bg-background group-hover/row:bg-background-default-secondary group-data-[state=selected]/row:bg-background-selected group-data-[state=selected]/row:group-hover/row:bg-background-selected group-data-[state=error]/row:bg-background-critical group-data-[state=error]/row:group-hover/row:bg-background-critical group-data-[state=success]/row:bg-background-selected group-data-[state=success]/row:group-hover/row:bg-background-selected group-data-[focused=true]/row:bg-background-default-secondary px-3',
|
|
396
|
+
'absolute inset-0 flex items-center bg-background group-hover/row:bg-background-default-secondary group-data-[state=selected]/row:bg-background-selected group-data-[state=selected]/row:group-hover/row:bg-background-selected group-data-[state=error]/row:bg-background-critical group-data-[state=error]/row:group-hover/row:bg-background-critical group-data-[state=success]/row:bg-background-selected group-data-[state=success]/row:group-hover/row:bg-background-selected group-data-[focused=true]/row:bg-background-default-secondary px-3 shadow-[inset_0_-1px_0_0_var(--color-border)]',
|
|
397
397
|
align === 'right' ? 'justify-end' : '',
|
|
398
398
|
{ 'pl-4': isFirst, 'pr-4': isLast, 'border-r border-border': isFrozen && isLastFrozen }
|
|
399
399
|
)}
|
|
@@ -600,13 +600,14 @@
|
|
|
600
600
|
data-state={dataState}
|
|
601
601
|
data-row-index={rowIndex}
|
|
602
602
|
data-focused={focusedRowIndex === rowIndex ? 'true' : undefined}
|
|
603
|
-
class={cn(clsx('
|
|
603
|
+
class={cn(clsx('shadow-[inset_0_-1px_0_0_var(--color-border)]', {
|
|
604
604
|
'cursor-pointer': onRowClick
|
|
605
605
|
}), getRowClassName?.(row.original as TData))}
|
|
606
606
|
onclick={() => onRowClick?.(row.original as TData)}
|
|
607
607
|
>
|
|
608
608
|
{#each row.getVisibleCells() as cell, index (cell.id)}
|
|
609
609
|
{@const visibleCells = row.getVisibleCells()}
|
|
610
|
+
{@const allCells = row.getAllCells()}
|
|
610
611
|
{@const isLastScrollable = index === visibleCells.length - 2}
|
|
611
612
|
{@const firstDataColumnIndex = visibleCells.findIndex(
|
|
612
613
|
(c) => c.column.id !== 'select' && c.column.id !== 'actions'
|
|
@@ -615,9 +616,9 @@
|
|
|
615
616
|
{@const isFirstCell = index === 0}
|
|
616
617
|
{@const isLastCell = index === visibleCells.length - 1}
|
|
617
618
|
{@const isFrozen = frozenColumns.has(cell.column.id)}
|
|
618
|
-
{@const lastFrozenColumnId =
|
|
619
|
+
{@const lastFrozenColumnId = allCells.map(c => c.column).reverse().find(col => frozenColumns.has(col.id))?.id}
|
|
619
620
|
{@const isLastFrozen = isFrozen && cell.column.id === lastFrozenColumnId}
|
|
620
|
-
{@const frozenOffset = isFrozen ? calculateFrozenOffset(cell.column.id,
|
|
621
|
+
{@const frozenOffset = isFrozen ? calculateFrozenOffset(cell.column.id, allCells.map(c => c.column)) : 0}
|
|
621
622
|
<Table.Cell
|
|
622
623
|
style={getCellStyle(cell, isLastScrollable, isFrozen, frozenOffset)}
|
|
623
624
|
class={getCellClasses(
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
bind:this={ref}
|
|
14
14
|
data-slot="table-head"
|
|
15
15
|
class={cn(
|
|
16
|
-
'text-foreground-default-secondary text-base font-normal text-left align-middle [&:has([role=checkbox])]:p-0 [&:has(button)]:p-0 px-3 bg-background',
|
|
16
|
+
'text-foreground-default-secondary text-base font-normal text-left align-middle [&:has([role=checkbox])]:p-0 [&:has(button)]:p-0 px-3 bg-background shadow-[inset_0_-1px_0_0_var(--color-border)]',
|
|
17
17
|
className
|
|
18
18
|
)}
|
|
19
19
|
{...restProps}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
<thead
|
|
16
16
|
bind:this={ref}
|
|
17
17
|
data-slot="table-header"
|
|
18
|
-
class={cn('sticky top-0 z-20
|
|
18
|
+
class={cn('sticky top-0 z-20 bg-background', className)}
|
|
19
19
|
onclick={bubble('click')}
|
|
20
20
|
onkeydown={bubble('keydown')}
|
|
21
21
|
>
|