UNPKG

handsontable

Version:

Handsontable is a JavaScript Data Grid available for React, Angular and Vue.

21 lines 899 B
import "core-js/modules/esnext.iterator.constructor.js"; import "core-js/modules/esnext.iterator.some.js"; export const command = { name: 'moveCellSelectionInlineStart', callback(hot, event) { const { selection } = hot; const settings = hot.getSettings(); const selectedRanges = hot.getSelectedRange(); const selectedRange = hot.getSelectedRangeActive(); const tabMoves = typeof settings.tabMoves === 'function' ? settings.tabMoves(event) : settings.tabMoves; selection.markSource('keyboard'); if ((selectedRanges.some(range => selection.isMultiple(range)) || selectedRanges.length > 1) && !selectedRange.isHeader() && hot.countRenderedCols() > 0 && hot.countRenderedRows() > 0) { selection.transformFocus(tabMoves.row, tabMoves.col); } else { selection.transformStart(tabMoves.row, tabMoves.col); } selection.markEndSource(); } };