Class: AutofillCalculations

AutofillCalculations

Class responsible for all of the Autofill-related operations on merged cells.

Members

mergedCellsCollectionMergedCellsCollection

Reference to the MergedCellsCollection class instance.

pluginMergeCells

Reference to the Merge Cells plugin.

Methods

correctSelectionAreaSize(selectionArea)

Correct the provided selection area, so it's not selecting only a part of a merged cell.

Parameters:
Name Type Description
selectionArea Array

dragAreaOverlapsCollections(baseArea, fullArea, direction){Boolean}

Check if the drag area contains any merged cells.

Parameters:
Name Type Description
baseArea Array

The base selection area.

fullArea Array

The base area extended by the drag area.

direction String

Drag direction.

Returns: {Boolean}

getDirection(selectionArea, finalArea){String}

Get the direction of the autofill process.

Parameters:
Name Type Description
selectionArea Array

The selection area.

finalArea Array

The final area (base + drag).

Returns: {String} up, down, left or right.

recreateAfterDataPopulation(changes)

Recreate the merged cells after the autofill process.

Parameters:
Name Type Description
changes Array

Changes made.

snapDragArea(baseArea, dragArea, dragDirection, foundMergedCells){Array}

Snap the drag area to the farthest merged cell, so it won't clip any of the merged cells.

Parameters:
Name Type Description
baseArea Array

The base selected area.

dragArea Array

The drag area.

dragDirection String

The autofill drag direction.

foundMergedCells Array

MergeCellCoords found in the base selection area.

Returns: {Array} The new drag area