@kayord/ui 0.4.1 → 0.4.2
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.
|
@@ -19,6 +19,10 @@ const pageIndex = isPagingEnabled ? pluginStates.page.pageIndex : void 0;
|
|
|
19
19
|
const pageSize = isPagingEnabled ? pluginStates.page.pageSize : void 0;
|
|
20
20
|
const isSelectEnabled = pluginStates.select != void 0;
|
|
21
21
|
const selectedDataIds = isSelectEnabled ? pluginStates.select.selectedDataIds : void 0;
|
|
22
|
+
const getOriginalData = (id) => {
|
|
23
|
+
const data = $pageRows[id];
|
|
24
|
+
return data.original;
|
|
25
|
+
};
|
|
22
26
|
</script>
|
|
23
27
|
|
|
24
28
|
<div class="w-full">
|
|
@@ -100,7 +104,7 @@ const selectedDataIds = isSelectEnabled ? pluginStates.select.selectedDataIds :
|
|
|
100
104
|
{...rowAttrs}
|
|
101
105
|
data-state={!isSelectEnabled ? false : $selectedDataIds[row.id] && "selected"}
|
|
102
106
|
class={rowAction == undefined ? "" : "hover:cursor-pointer"}
|
|
103
|
-
on:click={rowAction}
|
|
107
|
+
on:click={() => (rowAction != undefined ? rowAction(getOriginalData(row.id)) : undefined)}
|
|
104
108
|
>
|
|
105
109
|
{#each row.cells as cell (cell.id)}
|
|
106
110
|
<Subscribe attrs={cell.attrs()} let:attrs>
|
|
@@ -9,7 +9,7 @@ declare class __sveltets_Render<T extends RowData> {
|
|
|
9
9
|
hideHeader?: boolean | undefined;
|
|
10
10
|
noDataMessage?: string | undefined;
|
|
11
11
|
serverItemCount?: number | undefined;
|
|
12
|
-
rowAction?: (() => void) | undefined;
|
|
12
|
+
rowAction?: ((row: T | undefined) => void) | undefined;
|
|
13
13
|
};
|
|
14
14
|
events(): {} & {
|
|
15
15
|
[evt: string]: CustomEvent<any>;
|