@kayord/ui 0.4.0 → 0.4.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.
@@ -10,6 +10,7 @@ export let isLoading = false;
10
10
  export let hideHeader = false;
11
11
  export let noDataMessage = "No Data";
12
12
  export let serverItemCount = void 0;
13
+ export let rowAction = void 0;
13
14
  const { headerRows, pageRows, tableAttrs, tableBodyAttrs, pluginStates, rows, flatColumns } = tableViewModel;
14
15
  const isSortEnabled = pluginStates.sort != void 0;
15
16
  const sortKeys = isSortEnabled ? pluginStates.sort.sortKeys : void 0;
@@ -95,7 +96,12 @@ const selectedDataIds = isSelectEnabled ? pluginStates.select.selectedDataIds :
95
96
  {/if}
96
97
  {#each $pageRows as row (row.id)}
97
98
  <Subscribe rowAttrs={row.attrs()} let:rowAttrs>
98
- <Table.Row {...rowAttrs} data-state={!isSelectEnabled ? false : $selectedDataIds[row.id] && "selected"}>
99
+ <Table.Row
100
+ {...rowAttrs}
101
+ data-state={!isSelectEnabled ? false : $selectedDataIds[row.id] && "selected"}
102
+ class={rowAction == undefined ? "" : "hover:cursor-pointer"}
103
+ on:click={rowAction}
104
+ >
99
105
  {#each row.cells as cell (cell.id)}
100
106
  <Subscribe attrs={cell.attrs()} let:attrs>
101
107
  <Table.Cell {...attrs}>
@@ -9,6 +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
13
  };
13
14
  events(): {} & {
14
15
  [evt: string]: CustomEvent<any>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kayord/ui",
3
3
  "private": false,
4
- "version": "0.4.0",
4
+ "version": "0.4.1",
5
5
  "exports": {
6
6
  ".": {
7
7
  "types": "./dist/index.d.ts",