kelt-ui-kit-react 0.7.9 → 0.8.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.
@@ -8,7 +8,7 @@ export type DataTableProps<T> = {
8
8
  element?: JSX.Element;
9
9
  data: T[];
10
10
  actions?: dataTableActionsInterface[];
11
- columns: dataTableColumnsInterface[];
11
+ columns: dataTableColumnsInterface<T>[];
12
12
  loading?: boolean;
13
13
  onRowClick?: (row: any) => void;
14
14
  onColumnClick?: (column: any) => void;
@@ -1,6 +1,6 @@
1
1
  import { HTMLInputTypeAttribute } from 'react';
2
2
 
3
- export interface dataTableColumnsInterface {
3
+ export interface dataTableColumnsInterface<T> {
4
4
  id: string;
5
5
  label: string;
6
6
  minWidth?: number;
@@ -10,7 +10,7 @@ export interface dataTableColumnsInterface {
10
10
  filterable?: boolean;
11
11
  filterValue?: string;
12
12
  editable?: boolean;
13
- onEdit?: (value: any) => void;
13
+ onEdit?: (value: any, row: T) => void;
14
14
  type: HTMLInputTypeAttribute;
15
15
  }
16
16
  export interface dataTableActionsInterface {
package/dist/index.js CHANGED
@@ -2301,7 +2301,7 @@ function lo(e) {
2301
2301
  value: y,
2302
2302
  step: "0.01",
2303
2303
  onChange: (w) => {
2304
- f.onEdit && f.onEdit(w.target.value);
2304
+ f.onEdit && f.onEdit(w.target.value, h);
2305
2305
  }
2306
2306
  }
2307
2307
  ) : f.format ? f.format(y) : y
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "kelt-ui-kit-react",
3
3
  "type": "module",
4
- "version": "0.7.9",
4
+ "version": "0.8.0",
5
5
  "private": false,
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -14,7 +14,7 @@ export type DataTableProps<T> = {
14
14
  element?: JSX.Element;
15
15
  data: T[];
16
16
  actions?: dataTableActionsInterface[];
17
- columns: dataTableColumnsInterface[];
17
+ columns: dataTableColumnsInterface<T>[];
18
18
  loading?: boolean;
19
19
  onRowClick?: (row: any) => void;
20
20
  onColumnClick?: (column: any) => void;
@@ -79,7 +79,7 @@ export function DataTable<T>(props: DataTableProps<T>) {
79
79
  step="0.01"
80
80
  onChange={(e) => {
81
81
  if (column.onEdit) {
82
- column.onEdit(e.target.value);
82
+ column.onEdit(e.target.value, row);
83
83
  }
84
84
  }}
85
85
  />
@@ -1,6 +1,6 @@
1
1
  import { HTMLInputTypeAttribute } from "react";
2
2
 
3
- export interface dataTableColumnsInterface {
3
+ export interface dataTableColumnsInterface<T> {
4
4
  id: string;
5
5
  label: string;
6
6
  minWidth?: number;
@@ -10,7 +10,7 @@ export interface dataTableColumnsInterface {
10
10
  filterable?: boolean;
11
11
  filterValue?: string;
12
12
  editable?: boolean;
13
- onEdit?: (value: any) => void;
13
+ onEdit?: (value: any, row: T) => void;
14
14
  type: HTMLInputTypeAttribute;
15
15
  }
16
16
  export interface dataTableActionsInterface {