react-data-grid-temp
Advanced tools
Comparing version 7.0.0-canary.18.0 to 7.0.0-canary.18.1
@@ -58,14 +58,24 @@ var __assign = (this && this.__assign) || function () { | ||
function getCellContent() { | ||
var render; | ||
if (selectedCellProps && selectedCellProps.mode === 'SELECT') { | ||
render = (React.createElement(React.Fragment, null, | ||
React.createElement(column.formatter, { column: column, rowIdx: rowIdx, row: row, isCellSelected: isSelected, isRowSelected: isRowSelected, onRowSelectionChange: onRowSelectionChange }), | ||
(selectedCellProps === null || selectedCellProps === void 0 ? void 0 : selectedCellProps.dragHandleProps) && (React.createElement("div", __assign({ className: "rdg-cell-drag-handle" }, selectedCellProps.dragHandleProps))))); | ||
} | ||
if (selectedCellProps && selectedCellProps.mode === 'EDIT') { | ||
var _a = selectedCellProps.editorContainerProps, editorPortalTarget = _a.editorPortalTarget, editorProps = __rest(_a, ["editorPortalTarget"]); | ||
var _b = document.scrollingElement || document.documentElement, docTop = _b.scrollTop, docLeft = _b.scrollLeft; | ||
var _c = cellRef.current.getBoundingClientRect(), left = _c.left, top_1 = _c.top; | ||
var gridLeft = left + docLeft; | ||
var gridTop = top_1 + docTop; | ||
return (React.createElement(EditorPortal, { target: editorPortalTarget }, | ||
React.createElement(EditorContainer, __assign({}, editorProps, { rowIdx: rowIdx, row: row, column: column, left: gridLeft, top: gridTop })))); | ||
if (cellRef.current) { | ||
var _c = cellRef.current.getBoundingClientRect(), left = _c.left, top_1 = _c.top; | ||
var gridLeft = left + docLeft; | ||
var gridTop = top_1 + docTop; | ||
render = (React.createElement(EditorPortal, { target: editorPortalTarget }, | ||
React.createElement(EditorContainer, __assign({}, editorProps, { rowIdx: rowIdx, row: row, column: column, left: gridLeft, top: gridTop })))); | ||
} | ||
else { | ||
// 未获得 cellRef.current 正常显示表格 | ||
render = (React.createElement(column.formatter, { column: column, rowIdx: rowIdx, row: row, isCellSelected: isSelected, isRowSelected: isRowSelected, onRowSelectionChange: onRowSelectionChange })); | ||
} | ||
} | ||
return (React.createElement(React.Fragment, null, | ||
React.createElement(column.formatter, { column: column, rowIdx: rowIdx, row: row, isCellSelected: isSelected, isRowSelected: isRowSelected, onRowSelectionChange: onRowSelectionChange }), | ||
(selectedCellProps === null || selectedCellProps === void 0 ? void 0 : selectedCellProps.dragHandleProps) && (React.createElement("div", __assign({ className: "rdg-cell-drag-handle" }, selectedCellProps.dragHandleProps))))); | ||
return render; | ||
} | ||
@@ -72,0 +82,0 @@ return (React.createElement("div", __assign({ role: "gridcell", "aria-colindex": column.idx + 1, "aria-selected": isSelected, ref: useCombinedRefs(cellRef, ref), className: className, style: { |
@@ -108,3 +108,3 @@ import { KeyboardEvent } from 'react'; | ||
} | ||
interface SelectedCellPropsSelect extends SelectedCellPropsBase { | ||
export interface SelectedCellPropsSelect extends SelectedCellPropsBase { | ||
mode: 'SELECT'; | ||
@@ -170,6 +170,2 @@ dragHandleProps?: Pick<React.HTMLAttributes<HTMLDivElement>, 'onMouseDown' | 'onDoubleClick'>; | ||
} | ||
export interface KeyDownEvent { | ||
event: React.KeyboardEvent<HTMLDivElement>; | ||
selectedPosition: Position; | ||
} | ||
export interface SortColumn { | ||
@@ -176,0 +172,0 @@ columnKey: string; |
{ | ||
"name": "react-data-grid-temp", | ||
"version": "7.0.0-canary.18.0", | ||
"version": "7.0.0-canary.18.1", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "description": "Excel-like grid component built with React, with editors, keyboard navigation, copy & paste, and the like", |
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
347567
3049