react-datasheet-grid
Advanced tools
Comparing version 3.4.0 to 3.5.0
@@ -43,3 +43,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
// @ts-ignore | ||
data: deprecatedValue, value: data = deprecatedValue !== null && deprecatedValue !== void 0 ? deprecatedValue : DEFAULT_DATA, className, style, height: maxHeight = 400, onChange = DEFAULT_EMPTY_CALLBACK, columns: rawColumns = DEFAULT_COLUMNS, rowHeight = 40, headerRowHeight = rowHeight, gutterColumn, stickyRightColumn, addRowsComponent: AddRowsComponent = AddRows, createRow = DEFAULT_CREATE_ROW, autoAddRow = false, lockRows = false, disableExpandSelection = false, duplicateRow = DEFAULT_DUPLICATE_ROW, contextMenuComponent: ContextMenuComponent = ContextMenu, disableContextMenu: disableContextMenuRaw = false, onFocus = DEFAULT_EMPTY_CALLBACK, onBlur = DEFAULT_EMPTY_CALLBACK, onActiveCellChange = DEFAULT_EMPTY_CALLBACK, onSelectionChange = DEFAULT_EMPTY_CALLBACK, }, ref) => { | ||
data: deprecatedValue, value: data = deprecatedValue !== null && deprecatedValue !== void 0 ? deprecatedValue : DEFAULT_DATA, className, style, height: maxHeight = 400, onChange = DEFAULT_EMPTY_CALLBACK, columns: rawColumns = DEFAULT_COLUMNS, rowHeight = 40, headerRowHeight = rowHeight, gutterColumn, stickyRightColumn, addRowsComponent: AddRowsComponent = AddRows, createRow = DEFAULT_CREATE_ROW, autoAddRow = false, lockRows = false, disableExpandSelection = false, duplicateRow = DEFAULT_DUPLICATE_ROW, contextMenuComponent: ContextMenuComponent = ContextMenu, disableContextMenu: disableContextMenuRaw = false, onFocus = DEFAULT_EMPTY_CALLBACK, onBlur = DEFAULT_EMPTY_CALLBACK, onActiveCellChange = DEFAULT_EMPTY_CALLBACK, onSelectionChange = DEFAULT_EMPTY_CALLBACK, rowClassName, }, ref) => { | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k; | ||
@@ -1129,2 +1129,3 @@ // Display a warning message message when `data` is used instead of `value` | ||
getContextMenuItems, | ||
rowClassName, | ||
}); | ||
@@ -1131,0 +1132,0 @@ const itemSize = useCallback((index) => (index === 0 ? headerRowHeight : rowHeight), [headerRowHeight, rowHeight]); |
@@ -18,3 +18,3 @@ var __rest = (this && this.__rest) || function (s, e) { | ||
const nullfunc = () => null; | ||
const RowComponent = React.memo(({ index, style, data, isScrolling, columns, hasStickyRightColumn, active, activeColIndex, editing, setRowData, deleteRows, insertRowAfter, duplicateRows, stopEditing, getContextMenuItems, }) => { | ||
const RowComponent = React.memo(({ index, style, data, isScrolling, columns, hasStickyRightColumn, active, activeColIndex, editing, setRowData, deleteRows, insertRowAfter, duplicateRows, stopEditing, getContextMenuItems, rowClassName, }) => { | ||
const firstRender = useFirstRender(); | ||
@@ -35,3 +35,5 @@ // True when we should render the light version (when we are scrolling) | ||
}, [insertRowAfter, index]); | ||
return (React.createElement("div", { className: "dsg-row", style: style }, columns.map((column, i) => { | ||
return (React.createElement("div", { className: cx('dsg-row', typeof rowClassName === 'string' ? rowClassName : null, typeof rowClassName === 'function' | ||
? rowClassName({ rowData: data, rowIndex: index }) | ||
: null), style: style }, columns.map((column, i) => { | ||
const Component = column.component; | ||
@@ -66,4 +68,4 @@ const disabled = column.disabled === true || | ||
? data.stopEditing | ||
: undefined, getContextMenuItems: data.getContextMenuItems })); | ||
: undefined, getContextMenuItems: data.getContextMenuItems, rowClassName: data.rowClassName })); | ||
}; | ||
//# sourceMappingURL=Row.js.map |
@@ -16,3 +16,3 @@ var __rest = (this && this.__rest) || function (s, e) { | ||
export const StaticDataSheetGrid = React.forwardRef((_a, ref) => { | ||
var { columns, gutterColumn, stickyRightColumn, addRowsComponent, createRow, duplicateRow, style, onFocus, onBlur, onActiveCellChange, onSelectionChange } = _a, rest = __rest(_a, ["columns", "gutterColumn", "stickyRightColumn", "addRowsComponent", "createRow", "duplicateRow", "style", "onFocus", "onBlur", "onActiveCellChange", "onSelectionChange"]); | ||
var { columns, gutterColumn, stickyRightColumn, addRowsComponent, createRow, duplicateRow, style, onFocus, onBlur, onActiveCellChange, onSelectionChange, rowClassName } = _a, rest = __rest(_a, ["columns", "gutterColumn", "stickyRightColumn", "addRowsComponent", "createRow", "duplicateRow", "style", "onFocus", "onBlur", "onActiveCellChange", "onSelectionChange", "rowClassName"]); | ||
const [staticProps] = useState({ | ||
@@ -30,2 +30,3 @@ columns, | ||
onSelectionChange, | ||
rowClassName, | ||
}); | ||
@@ -32,0 +33,0 @@ return React.createElement(DataSheetGrid, Object.assign({}, staticProps, rest, { ref: ref })); |
@@ -84,2 +84,6 @@ import React from 'react'; | ||
getContextMenuItems: () => ContextMenuItem[]; | ||
rowClassName?: string | ((opt: { | ||
rowData: T; | ||
rowIndex: number; | ||
}) => string | undefined); | ||
}; | ||
@@ -134,2 +138,6 @@ export declare type HeaderContextType<T> = { | ||
getContextMenuItems: () => ContextMenuItem[]; | ||
rowClassName?: string | ((opt: { | ||
rowData: T; | ||
rowIndex: number; | ||
}) => string | undefined); | ||
}; | ||
@@ -164,2 +172,6 @@ export declare type SimpleColumn<T, C> = Partial<Pick<Column<T, C>, 'title' | 'maxWidth' | 'minWidth' | 'width' | 'component' | 'columnData'>>; | ||
className?: string; | ||
rowClassName?: string | ((opt: { | ||
rowData: T; | ||
rowIndex: number; | ||
}) => string | undefined); | ||
onChange?: (value: T[], operations: Operation[]) => void; | ||
@@ -166,0 +178,0 @@ columns?: Partial<Column<T, any>>[]; |
{ | ||
"name": "react-datasheet-grid", | ||
"version": "3.4.0", | ||
"version": "3.5.0", | ||
"description": "An Excel-like React component to create beautiful spreadsheets.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
252349
2944