@gravity-ui/react-data-table 1.0.3 → 1.1.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.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.1.0](https://github.com/gravity-ui/react-data-table/compare/v1.0.3...v1.1.0) (2023-05-05)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add event in cell click handler ([#26](https://github.com/gravity-ui/react-data-table/issues/26)) ([11e7a00](https://github.com/gravity-ui/react-data-table/commit/11e7a0067d980f6e3a215468d86df9b6a691428f))
|
|
9
|
+
|
|
3
10
|
## [1.0.3](https://github.com/gravity-ui/react-data-table/compare/v1.0.2...v1.0.3) (2023-02-02)
|
|
4
11
|
|
|
5
12
|
|
|
@@ -354,7 +354,7 @@ declare class DataTableView<T> extends React.Component<DataTableProps<T>, DataTa
|
|
|
354
354
|
index: number;
|
|
355
355
|
footer?: boolean;
|
|
356
356
|
headerData?: boolean;
|
|
357
|
-
}) => () => void) | (() => undefined);
|
|
357
|
+
}) => (event: React.MouseEvent<HTMLTableCellElement>) => void) | (() => undefined);
|
|
358
358
|
customStyle: ((props: import("./types").CustomStyleParams<T>) => React.CSSProperties) | (() => undefined);
|
|
359
359
|
group: boolean | undefined;
|
|
360
360
|
autogroup: boolean;
|
|
@@ -380,7 +380,7 @@ declare class DataTableView<T> extends React.Component<DataTableProps<T>, DataTa
|
|
|
380
380
|
index: number;
|
|
381
381
|
footer?: boolean | undefined;
|
|
382
382
|
headerData?: boolean | undefined;
|
|
383
|
-
}, column: Column<T>) => void) | undefined;
|
|
383
|
+
}, column: Column<T>, event: React.MouseEvent<HTMLTableCellElement, MouseEvent>) => void) | undefined;
|
|
384
384
|
defaultOrder: OrderType;
|
|
385
385
|
sortAccessor?: string | ((row: T) => any) | undefined;
|
|
386
386
|
sortAscending?: import("./types").Comparator<T> | undefined;
|
|
@@ -573,7 +573,7 @@ class DataTableView extends React.Component {
|
|
|
573
573
|
: ({ value }) => value;
|
|
574
574
|
const customStyle = typeof column.customStyle === 'function' ? column.customStyle : () => undefined;
|
|
575
575
|
const _getOnClick = typeof onClick === 'function'
|
|
576
|
-
? (data) => () => onClick(data, column)
|
|
576
|
+
? (data) => (event) => onClick(data, column, event)
|
|
577
577
|
: () => undefined;
|
|
578
578
|
return Object.assign(Object.assign({ index: columnIndex - indexAdjustment, columnIndex, dataColumn: true, defaultOrder }, column), { sortable: sortable && isSortEnabled, _className,
|
|
579
579
|
_getValue,
|
package/build/esm/lib/types.d.ts
CHANGED
|
@@ -49,7 +49,7 @@ export interface Column<T> {
|
|
|
49
49
|
index: number;
|
|
50
50
|
footer?: boolean;
|
|
51
51
|
headerData?: boolean;
|
|
52
|
-
}, column: Column<T>) => void;
|
|
52
|
+
}, column: Column<T>, event: React.MouseEvent<HTMLTableCellElement>) => void;
|
|
53
53
|
sortable?: boolean;
|
|
54
54
|
defaultOrder?: OrderType;
|
|
55
55
|
sortAccessor?: string | ((row: T) => any);
|