react-konva-grid
Advanced tools
Comparing version 2.6.4 to 2.6.5
@@ -6,2 +6,3 @@ import React from "react"; | ||
initialSelections?: SelectionArea[]; | ||
initialActiveCell: CellInterface | null; | ||
columnCount?: number; | ||
@@ -8,0 +9,0 @@ rowCount?: number; |
@@ -5,6 +5,2 @@ "use strict"; | ||
const types_1 = require("./../types"); | ||
const initialActiveCell = { | ||
rowIndex: 3, | ||
columnIndex: 3, | ||
}; | ||
/** | ||
@@ -15,3 +11,3 @@ * useSelection hook to enable selection in datagrid | ||
const useSelection = (options) => { | ||
const { gridRef, initialSelections = [], columnCount = 0, rowCount = 0 } = options || {}; | ||
const { gridRef, initialActiveCell = null, initialSelections = [], columnCount = 0, rowCount = 0, } = options || {}; | ||
const [activeCell, setActiveCell] = react_1.useState(initialActiveCell); | ||
@@ -18,0 +14,0 @@ const [selections, setSelections] = react_1.useState(initialSelections); |
{ | ||
"name": "react-konva-grid", | ||
"description": "Declarative React Canvas Grid primitive for Data table, Pivot table, Excel Worksheets", | ||
"version": "2.6.4", | ||
"version": "2.6.5", | ||
"main": "dist/index.js", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
@@ -8,2 +8,3 @@ import React, { useState, useCallback, useRef } from "react"; | ||
initialSelections?: SelectionArea[]; | ||
initialActiveCell: CellInterface | null; | ||
columnCount?: number; | ||
@@ -24,7 +25,2 @@ rowCount?: number; | ||
const initialActiveCell = { | ||
rowIndex: 3, | ||
columnIndex: 3, | ||
}; | ||
/** | ||
@@ -35,4 +31,9 @@ * useSelection hook to enable selection in datagrid | ||
const useSelection = (options?: UseSelectionOptions): SelectionResults => { | ||
const { gridRef, initialSelections = [], columnCount = 0, rowCount = 0 } = | ||
options || {}; | ||
const { | ||
gridRef, | ||
initialActiveCell = null, | ||
initialSelections = [], | ||
columnCount = 0, | ||
rowCount = 0, | ||
} = options || {}; | ||
const [activeCell, setActiveCell] = useState<CellInterface | null>( | ||
@@ -39,0 +40,0 @@ initialActiveCell |
Sorry, the diff of this file is not supported yet
14782584
21154