Comparing version 8.5.1 to 8.6.0
@@ -46,4 +46,4 @@ "use strict"; | ||
var CellText = function (props) { | ||
var childComponents = props.childComponents, column = props.column, format = props.format, dispatch = props.dispatch, editingMode = props.editingMode, rowKeyValue = props.rowKeyValue, value = props.value; | ||
var formattedValue = (format && format({ column: column, value: value })) | ||
var childComponents = props.childComponents, column = props.column, format = props.format, dispatch = props.dispatch, editingMode = props.editingMode, rowKeyValue = props.rowKeyValue, rowData = props.rowData, value = props.value; | ||
var formattedValue = (format && format({ column: column, value: value, rowData: rowData })) | ||
|| (value === null || value === void 0 ? void 0 : value.toString()); | ||
@@ -50,0 +50,0 @@ var _a = (0, ComponentUtils_1.getElementCustomization)({ |
@@ -49,3 +49,3 @@ "use strict"; | ||
var value = (0, DataUtils_1.getValueByColumn)(item, column); | ||
var formattedValue = (format && format({ column: column, value: value })) | ||
var formattedValue = (format && format({ column: column, value: value, rowData: item })) | ||
|| (value === null || value === void 0 ? void 0 : value.toString()); | ||
@@ -52,0 +52,0 @@ return formattedValue; |
@@ -61,3 +61,3 @@ "use strict"; | ||
var column = group_1 && groupedColumns.find(function (c) { return c.key === group_1.columnKey; }); | ||
return (react_1.default.createElement(GroupRow_1.default, { childComponents: childComponents, column: column, contentColSpan: columns.length - groupIndex + groups.length, dispatch: dispatch, groupIndex: groupIndex, groupKey: d.key, groupItems: d.groupItems, columns: columns, groupedColumns: groupedColumns, isExpanded: groupsExpanded.some(function (ge) { return JSON.stringify(ge) === JSON.stringify(d.key); }), text: (0, GroupUtils_1.getGroupText)(d.value, column, format), key: JSON.stringify(d.key) })); | ||
return (react_1.default.createElement(GroupRow_1.default, { childComponents: childComponents, column: column, contentColSpan: columns.length - groupIndex + groups.length, dispatch: dispatch, groupIndex: groupIndex, groupKey: d.key, groupItems: d.groupItems, columns: columns, groupedColumns: groupedColumns, isExpanded: groupsExpanded.some(function (ge) { return JSON.stringify(ge) === JSON.stringify(d.key); }), text: (0, GroupUtils_1.getGroupText)(d.value, column, format, d.groupItems), key: JSON.stringify(d.key) })); | ||
} | ||
@@ -64,0 +64,0 @@ else if (d.groupSummaryMark === GroupUtils_1.groupSummaryMark) { |
{ | ||
"name": "ka-table", | ||
"version": "8.5.1", | ||
"version": "8.6.0", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "repository": "github:komarovalexander/ka-table", |
@@ -23,2 +23,3 @@ /// <reference types="react" /> | ||
column: Column; | ||
rowData?: any; | ||
}) => any; | ||
@@ -25,0 +26,0 @@ export type FilterFunc = (props: { |
@@ -146,3 +146,3 @@ "use strict"; | ||
var value = (0, DataUtils_1.getValueByColumn)(item, column); | ||
var fieldValue = (format && format({ column: column, value: value })) | ||
var fieldValue = (format && format({ column: column, value: value, rowData: item })) | ||
|| (value === null || value === void 0 ? void 0 : value.toString()); | ||
@@ -149,0 +149,0 @@ return (_a = column.headerFilterValues) === null || _a === void 0 ? void 0 : _a.includes(fieldValue); |
@@ -14,3 +14,3 @@ import { Column } from '../models'; | ||
export declare const getGroupMark: () => {}; | ||
export declare const getGroupText: (value: any, column: Column, format?: FormatFunc) => any; | ||
export declare const getGroupText: (value: any, column: Column, format?: FormatFunc, groupItems?: any[]) => any; | ||
export declare const isMaxDeep: (groupPanel: GroupPanelSettings, columns: Column[], groups?: Group[]) => boolean; |
@@ -111,4 +111,4 @@ "use strict"; | ||
exports.getGroupMark = getGroupMark; | ||
var getGroupText = function (value, column, format) { | ||
return format ? format({ column: column, value: value }) : "".concat((column && column.title ? column.title + ': ' : '')).concat(value); | ||
var getGroupText = function (value, column, format, groupItems) { | ||
return format ? format({ column: column, value: value, rowData: groupItems === null || groupItems === void 0 ? void 0 : groupItems[0] }) : "".concat((column && column.title ? column.title + ': ' : '')).concat(value); | ||
}; | ||
@@ -115,0 +115,0 @@ exports.getGroupText = getGroupText; |
387474
7950