src/js/extensions/table/tableRangeHandler.js
function _expandMergedRange(tableData, tableRange) {
  let rangeStr = '';

  while (rangeStr !== JSON.stringify(tableRange)) {
    rangeStr = JSON.stringify(tableRange);

    _expandRowMergedRange(tableData, tableRange, 'start');
    _expandRowMergedRange(tableData, tableRange, 'end');

    util.range(tableRange.start.rowIndex, tableRange.end.rowIndex + 1).forEach(rowIndex => {
      _expandColMergedRange(tableData, tableRange, rowIndex, tableRange.start.colIndex);
      _expandColMergedRange(tableData, tableRange, rowIndex, tableRange.end.colIndex);
    });
  }

  return tableRange;
}
function _expandMergedRange(tableData, tableRange) {
  let rangeStr = '';

  while (rangeStr !== JSON.stringify(tableRange)) {
    rangeStr = JSON.stringify(tableRange);

    _expandRowMergedRange(tableData, tableRange, 'start');
    _expandRowMergedRange(tableData, tableRange, 'end');

    util.range(tableRange.start.rowIndex, tableRange.end.rowIndex + 1).forEach(rowIndex => {
      _expandColMergedRange(tableData, tableRange, rowIndex, tableRange.start.colIndex);
      _expandColMergedRange(tableData, tableRange, rowIndex, tableRange.end.colIndex);
    });
  }

  return tableRange;
}
function _expandMergedRange ( tableData , tableRange ) { let rangeStr = '' ; while ( rangeStr !== JSON . stringify ( tableRange ) ) { rangeStr = JSON . stringify ( tableRange ) ; _expandRowMergedRange ( tableData , tableRange , 'start' ) ; _expandRowMergedRange ( tableData , tableRange , 'end' ) ; util . range ( tableRange . start . rowIndex , tableRange . end . rowIndex + 1 ) . forEach ( rowIndex => { _expandColMergedRange ( tableData , tableRange , rowIndex , tableRange . start . colIndex ) ; _expandColMergedRange ( tableData , tableRange , rowIndex , tableRange . end . colIndex ) ; } ) ; } return tableRange ; }
Expand table range by merge properties like colspan, rowspan.
@param {Array.<Array.<object>>} tableData - table data
@param {{
start: {rowIndex: number, colIndex: number},
end: {rowIndex: number, colIndex: number}
}} tableRange - table range
@returns {{
start: {rowIndex: number, colIndex: number},
end: {rowIndex: number, colIndex: number}
}}
@private
Expand table range by merge properties like colspan rowspan .