compote-ui 0.38.2 → 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.
@@ -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
@@ -7,6 +7,10 @@ declare function $$render<T extends RowData>(): {
7
7
  isRowSelectionEnabled: boolean;
8
8
  table: DataTableInstance<T>;
9
9
  emptyMessage: string;
10
+ onRowDoubleClick?: (details: {
11
+ row: T;
12
+ event: MouseEvent;
13
+ }) => void;
10
14
  };
11
15
  exports: {};
12
16
  bindings: "";
@@ -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>
@@ -8,6 +8,10 @@ declare function $$render<T extends RowData>(): {
8
8
  caption?: string;
9
9
  emptyMessage?: string;
10
10
  class?: ClassValue;
11
+ onRowDoubleClick?: (details: {
12
+ row: T;
13
+ event: MouseEvent;
14
+ }) => void;
11
15
  };
12
16
  exports: {};
13
17
  bindings: "";
@@ -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
@@ -8,6 +8,10 @@ declare function $$render<T extends RowData>(): {
8
8
  caption?: string;
9
9
  emptyMessage?: string;
10
10
  class?: ClassValue;
11
+ onRowDoubleClick?: (details: {
12
+ row: T;
13
+ event: MouseEvent;
14
+ }) => void;
11
15
  };
12
16
  exports: {};
13
17
  bindings: "";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "compote-ui",
3
- "version": "0.38.2",
3
+ "version": "0.39.0",
4
4
  "license": "MIT",
5
5
  "scripts": {
6
6
  "dev": "vite dev --open",