src/js/extensions/table/tableRangeHandler.js
function _findUnmergedRange(tableData, $start, $end) {
  const cellIndexData = tableDataHandler.createCellIndexData(tableData);
  const startCellIndex = tableDataHandler.findCellIndex(cellIndexData, $start);
  const endCellIndex = tableDataHandler.findCellIndex(cellIndexData, $end);
  let startRowIndex, endRowIndex, startColIndex, endColIndex;

  if (startCellIndex.rowIndex > endCellIndex.rowIndex) {
    startRowIndex = endCellIndex.rowIndex;
    endRowIndex = startCellIndex.rowIndex;
  } else {
    startRowIndex = startCellIndex.rowIndex;
    endRowIndex = endCellIndex.rowIndex;
  }

  if (startCellIndex.colIndex > endCellIndex.colIndex) {
    startColIndex = endCellIndex.colIndex;
    endColIndex = startCellIndex.colIndex;
  } else {
    startColIndex = startCellIndex.colIndex;
    endColIndex = endCellIndex.colIndex;
  }

  return {
    start: {
      rowIndex: startRowIndex,
      colIndex: startColIndex
    },
    end: {
      rowIndex: endRowIndex,
      colIndex: endColIndex
    }
  };
}
function _findUnmergedRange(tableData, $start, $end) {
  const cellIndexData = tableDataHandler.createCellIndexData(tableData);
  const startCellIndex = tableDataHandler.findCellIndex(cellIndexData, $start);
  const endCellIndex = tableDataHandler.findCellIndex(cellIndexData, $end);
  let startRowIndex, endRowIndex, startColIndex, endColIndex;

  if (startCellIndex.rowIndex > endCellIndex.rowIndex) {
    startRowIndex = endCellIndex.rowIndex;
    endRowIndex = startCellIndex.rowIndex;
  } else {
    startRowIndex = startCellIndex.rowIndex;
    endRowIndex = endCellIndex.rowIndex;
  }

  if (startCellIndex.colIndex > endCellIndex.colIndex) {
    startColIndex = endCellIndex.colIndex;
    endColIndex = startCellIndex.colIndex;
  } else {
    startColIndex = startCellIndex.colIndex;
    endColIndex = endCellIndex.colIndex;
  }

  return {
    start: {
      rowIndex: startRowIndex,
      colIndex: startColIndex
    },
    end: {
      rowIndex: endRowIndex,
      colIndex: endColIndex
    }
  };
}
function _findUnmergedRange ( tableData , $start , $end ) { const cellIndexData = tableDataHandler . createCellIndexData ( tableData ) ; const startCellIndex = tableDataHandler . findCellIndex ( cellIndexData , $start ) ; const endCellIndex = tableDataHandler . findCellIndex ( cellIndexData , $end ) ; let startRowIndex , endRowIndex , startColIndex , endColIndex ; if ( startCellIndex . rowIndex > endCellIndex . rowIndex ) { startRowIndex = endCellIndex . rowIndex ; endRowIndex = startCellIndex . rowIndex ; } else { startRowIndex = startCellIndex . rowIndex ; endRowIndex = endCellIndex . rowIndex ; } if ( startCellIndex . colIndex > endCellIndex . colIndex ) { startColIndex = endCellIndex . colIndex ; endColIndex = startCellIndex . colIndex ; } else { startColIndex = startCellIndex . colIndex ; endColIndex = endCellIndex . colIndex ; } return { start : { rowIndex : startRowIndex , colIndex : startColIndex } , end : { rowIndex : endRowIndex , colIndex : endColIndex } } ; }
Find unmerged table range.
@param {Array.<Array.<object>>} tableData - table data
@param {jQuery} $start - start talbe cell jQuery element
@param {jQuery} $end - end table cell jQuery element
@returns {{
start: {rowIndex: number, colIndex: number},
end: {rowIndex: number, colIndex: number}
}}
@private
Find unmerged table range .