compote-ui 0.38.1 → 0.39.0
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/components/data-table/data-table-head.svelte +0 -1
- package/dist/components/data-table/data-table-virtual-rows.svelte +3 -1
- package/dist/components/data-table/data-table-virtual-rows.svelte.d.ts +4 -0
- package/dist/components/data-table/data-table-virtualized.svelte +3 -0
- package/dist/components/data-table/data-table-virtualized.svelte.d.ts +4 -0
- package/dist/components/data-table/data-table.svelte +3 -0
- package/dist/components/data-table/data-table.svelte.d.ts +4 -0
- package/dist/components/menu/menu-content.svelte +17 -12
- package/dist/components/menu/menu-content.svelte.d.ts +2 -1
- package/package.json +1 -1
|
@@ -27,9 +27,10 @@
|
|
|
27
27
|
isRowSelectionEnabled: boolean;
|
|
28
28
|
table: DataTableInstance<T>;
|
|
29
29
|
emptyMessage: string;
|
|
30
|
+
onRowDoubleClick?: (details: { row: T; event: MouseEvent }) => void;
|
|
30
31
|
};
|
|
31
32
|
|
|
32
|
-
let { rows, scrollContainer, isRowSelectionEnabled, table, emptyMessage }: Props = $props();
|
|
33
|
+
let { rows, scrollContainer, isRowSelectionEnabled, table, emptyMessage, onRowDoubleClick }: Props = $props();
|
|
33
34
|
|
|
34
35
|
const rowVirtualizer = createVirtualizer<HTMLDivElement, HTMLTableRowElement>({
|
|
35
36
|
get count() {
|
|
@@ -75,6 +76,7 @@
|
|
|
75
76
|
'bg-well/60 [--row-bg:color-mix(in_srgb,var(--compote-well)_60%,var(--compote-surface-1))]'
|
|
76
77
|
)}
|
|
77
78
|
style="display: flex; position: absolute; transform: translateY({virtualRow.start}px); width: 100%"
|
|
79
|
+
ondblclick={(event) => onRowDoubleClick?.({ row: row.original, event })}
|
|
78
80
|
>
|
|
79
81
|
{#if isRowSelectionEnabled}
|
|
80
82
|
<td
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
caption?: string;
|
|
17
17
|
emptyMessage?: string;
|
|
18
18
|
class?: ClassValue;
|
|
19
|
+
onRowDoubleClick?: (details: { row: T; event: MouseEvent }) => void;
|
|
19
20
|
};
|
|
20
21
|
|
|
21
22
|
let {
|
|
@@ -23,6 +24,7 @@
|
|
|
23
24
|
caption,
|
|
24
25
|
emptyMessage = 'No rows found',
|
|
25
26
|
class: className,
|
|
27
|
+
onRowDoubleClick,
|
|
26
28
|
...rest
|
|
27
29
|
}: Props = $props();
|
|
28
30
|
|
|
@@ -86,6 +88,7 @@
|
|
|
86
88
|
{isRowSelectionEnabled}
|
|
87
89
|
{table}
|
|
88
90
|
{emptyMessage}
|
|
91
|
+
{onRowDoubleClick}
|
|
89
92
|
/>
|
|
90
93
|
{/if}
|
|
91
94
|
</table>
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
caption?: string;
|
|
29
29
|
emptyMessage?: string;
|
|
30
30
|
class?: ClassValue;
|
|
31
|
+
onRowDoubleClick?: (details: { row: T; event: MouseEvent }) => void;
|
|
31
32
|
};
|
|
32
33
|
|
|
33
34
|
let {
|
|
@@ -35,6 +36,7 @@
|
|
|
35
36
|
caption,
|
|
36
37
|
emptyMessage = 'No rows found',
|
|
37
38
|
class: className,
|
|
39
|
+
onRowDoubleClick,
|
|
38
40
|
...rest
|
|
39
41
|
}: Props = $props();
|
|
40
42
|
|
|
@@ -115,6 +117,7 @@
|
|
|
115
117
|
rowSelected &&
|
|
116
118
|
'bg-well/60 [--row-bg:color-mix(in_srgb,var(--compote-well)_60%,var(--compote-surface-1))]'
|
|
117
119
|
)}
|
|
120
|
+
ondblclick={(event) => onRowDoubleClick?.({ row: row.original, event })}
|
|
118
121
|
>
|
|
119
122
|
{#if isRowSelectionEnabled}
|
|
120
123
|
<td
|
|
@@ -1,23 +1,28 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { Menu } from '@ark-ui/svelte/menu';
|
|
3
|
+
import { Portal } from '@ark-ui/svelte/portal';
|
|
4
|
+
import type { MenuContentBaseProps } from '@ark-ui/svelte/menu';
|
|
3
5
|
import type { Snippet } from 'svelte';
|
|
4
6
|
import { cn } from 'tailwind-variants';
|
|
5
7
|
|
|
6
|
-
type Props = {
|
|
8
|
+
type Props = MenuContentBaseProps & {
|
|
7
9
|
class?: string;
|
|
8
10
|
children: Snippet;
|
|
9
11
|
};
|
|
10
12
|
|
|
11
|
-
const { class: className, children }: Props = $props();
|
|
13
|
+
const { class: className, children, ...restProps }: Props = $props();
|
|
12
14
|
</script>
|
|
13
15
|
|
|
14
|
-
<
|
|
15
|
-
<Menu.
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
16
|
+
<Portal>
|
|
17
|
+
<Menu.Positioner>
|
|
18
|
+
<Menu.Content
|
|
19
|
+
{...restProps}
|
|
20
|
+
class={cn(
|
|
21
|
+
'z-50 min-w-32 overflow-hidden rounded-md border bg-surface-1 p-1 text-ink shadow-md outline-none',
|
|
22
|
+
className
|
|
23
|
+
)}
|
|
24
|
+
>
|
|
25
|
+
{@render children()}
|
|
26
|
+
</Menu.Content>
|
|
27
|
+
</Menu.Positioner>
|
|
28
|
+
</Portal>
|