@caido-utils/components 0.3.0 → 0.3.1

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.
@@ -11,6 +11,7 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<__VLS_With
11
11
  selection?: Record<string, unknown>[] | null;
12
12
  activeRow?: Record<string, unknown> | null;
13
13
  scrollKey?: string;
14
+ dataKey?: string;
14
15
  }>, {
15
16
  rowHeight: number;
16
17
  selectable: boolean;
@@ -29,6 +30,7 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<__VLS_With
29
30
  selection?: Record<string, unknown>[] | null;
30
31
  activeRow?: Record<string, unknown> | null;
31
32
  scrollKey?: string;
33
+ dataKey?: string;
32
34
  }>, {
33
35
  rowHeight: number;
34
36
  selectable: boolean;
@@ -33,6 +33,7 @@ const props = withDefaults(
33
33
  selection?: Record<string, unknown>[] | null;
34
34
  activeRow?: Record<string, unknown> | null;
35
35
  scrollKey?: string;
36
+ dataKey?: string;
36
37
  }>(),
37
38
  {
38
39
  rowHeight: ROW_HEIGHT,
@@ -120,10 +121,10 @@ onBeforeUnmount(() => {
120
121
  const isMultiple = props.selectable === "multiple";
121
122
 
122
123
  const attrs = useAttrs();
123
- const dataKeyAttr = (attrs["dataKey"] as string) ?? "id";
124
+ const dataKeyAttr = computed(() => props.dataKey ?? "id");
124
125
 
125
126
  function getRowKey(row: Record<string, unknown>): unknown {
126
- return row[dataKeyAttr];
127
+ return row[dataKeyAttr.value];
127
128
  }
128
129
 
129
130
  // --- Selection logic ---
@@ -11,6 +11,7 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<__VLS_With
11
11
  selection?: Record<string, unknown>[] | null;
12
12
  activeRow?: Record<string, unknown> | null;
13
13
  scrollKey?: string;
14
+ dataKey?: string;
14
15
  }>, {
15
16
  rowHeight: number;
16
17
  selectable: boolean;
@@ -29,6 +30,7 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<__VLS_With
29
30
  selection?: Record<string, unknown>[] | null;
30
31
  activeRow?: Record<string, unknown> | null;
31
32
  scrollKey?: string;
33
+ dataKey?: string;
32
34
  }>, {
33
35
  rowHeight: number;
34
36
  selectable: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@caido-utils/components",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"