ab-ui-library 1.55.2 → 1.55.3
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.
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { TTableProps } from './types';
|
|
2
2
|
import 'react-loading-skeleton/dist/skeleton.css';
|
|
3
|
-
export declare function Table<TData>({ data, columns, isLoading, hasError, isActionsVisible, totalCount, emptyTitle, emptySubTitle, emptyIllustration, withSelect, withBorder, defaultPageIndex, defaultPageSize, defaultHiddenColumns, collapsibleRows, renderExpandedContent, renderHeader, renderFooter, onSortChange, onRowClick, tableSettings, onRowSelection, onColumnSizing, onPaginationChange, rowEventsProps, activeRowId, getRowId, resetExpandedOnPageChange }: TTableProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare function Table<TData>({ data, columns, isLoading, hasError, isActionsVisible, totalCount, emptyTitle, emptySubTitle, emptyIllustration, withSelect, withBorder, defaultPageIndex, defaultPageSize, defaultHiddenColumns, collapsibleRows, renderExpandedContent, renderHeader, renderFooter, onSortChange, onRowClick, tableSettings, onRowSelection, onColumnSizing, onPaginationChange, rowEventsProps, activeRowId, getRowId, resetExpandedOnPageChange, rowClassName, }: TTableProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -111,7 +111,8 @@ function Table(_ref2) {
|
|
|
111
111
|
activeRowId = _ref2.activeRowId,
|
|
112
112
|
getRowId = _ref2.getRowId,
|
|
113
113
|
_ref2$resetExpandedOn = _ref2.resetExpandedOnPageChange,
|
|
114
|
-
resetExpandedOnPageChange = _ref2$resetExpandedOn === void 0 ? true : _ref2$resetExpandedOn
|
|
114
|
+
resetExpandedOnPageChange = _ref2$resetExpandedOn === void 0 ? true : _ref2$resetExpandedOn,
|
|
115
|
+
rowClassName = _ref2.rowClassName;
|
|
115
116
|
var _useState = useState(new Set()),
|
|
116
117
|
_useState2 = _slicedToArray(_useState, 2),
|
|
117
118
|
expandedRows = _useState2[0],
|
|
@@ -268,7 +269,7 @@ function Table(_ref2) {
|
|
|
268
269
|
return /*#__PURE__*/React.createElement(React.Fragment, {
|
|
269
270
|
key: row.id
|
|
270
271
|
}, /*#__PURE__*/React.createElement("tr", _extends({}, rowEventsProps, {
|
|
271
|
-
className: classNames({
|
|
272
|
+
className: classNames(rowClassName === null || rowClassName === void 0 ? void 0 : rowClassName(row), {
|
|
272
273
|
selected: row.getIsSelected(),
|
|
273
274
|
active: row.id == activeRowId
|
|
274
275
|
})
|
|
@@ -43,6 +43,7 @@ export type TTableProps<TData> = {
|
|
|
43
43
|
onPaginationChange?: (state: TPaginationState) => void;
|
|
44
44
|
getRowId?: (row: TData) => string;
|
|
45
45
|
resetExpandedOnPageChange?: boolean;
|
|
46
|
+
rowClassName?: (row: Row<TData>) => string | undefined;
|
|
46
47
|
};
|
|
47
48
|
export type Column<TData> = ColumnDef<TData> & {
|
|
48
49
|
enableColumnDragging?: boolean;
|