подстветка ячеек

This commit is contained in:
2025-07-22 05:35:04 +03:00
parent 555505e09e
commit faad68cdc0
8 changed files with 394 additions and 46 deletions

View File

@@ -14,6 +14,7 @@ export const Spreadsheet = ({
activeSheet,
isEditing,
editingValue,
highlightedCells,
handleCellClick,
handleCellDoubleClick,
handleCellChange,
@@ -41,6 +42,7 @@ export const Spreadsheet = ({
editingValue,
cachedData,
mergedCells,
highlightedCells,
handleCellClick,
handleCellDoubleClick,
handleCellChange,
@@ -78,7 +80,9 @@ export const Spreadsheet = ({
onClick={() => setActiveSheet(sheetType)}
>
<div
ref={el => (containerRefs.current[sheetType] = el)}
ref={el => {
containerRefs.current[sheetType] = el
}}
className="flex h-full flex-col overflow-hidden border bg-card shadow-sm"
onKeyDown={handleKeyDown}
tabIndex={0}
@@ -102,7 +106,9 @@ export const Spreadsheet = ({
</div>
</div>
<div
ref={el => (rowHeaderRefs.current[sheetType] = el)}
ref={el => {
rowHeaderRefs.current[sheetType] = el
}}
className="overflow-y-hidden"
style={{ height: gridSize.height }}
>
@@ -126,7 +132,9 @@ export const Spreadsheet = ({
<div className="flex-1 overflow-hidden">
{/* Column Headers */}
<div
ref={el => (headerRefs.current[sheetType] = el)}
ref={el => {
headerRefs.current[sheetType] = el
}}
className="column-headers overflow-x-hidden"
>
<div className="flex">
@@ -171,9 +179,9 @@ export const Spreadsheet = ({
{/* Grid */}
<div className="min-h-0 flex-1">
<VariableSizeGrid
ref={(el: VariableSizeGrid | null) =>
(gridRefs.current[sheetType] = el)
}
ref={(el: VariableSizeGrid | null) => {
gridRefs.current[sheetType] = el
}}
columnCount={COL_COUNT}
rowCount={ROW_COUNT}
columnWidth={(index: number) => widths[index]}