Range Copy Preview
computeRangeCopyPreviewData
Section titled “computeRangeCopyPreviewData”Computes the exact range-copy values for a temporary drag target.
@param options Source range, target range, row/column types, and providers.
*
@returns Preview matrix and row/prop lookup, or null when no copy preview can be computed.
export function computeRangeCopyPreviewData(;mapRangeCopyMatrixToData
Section titled “mapRangeCopyMatrixToData”Maps a copied source matrix onto a target range using RevoGrid range-copy semantics.
@param matrix Source values ordered row-major. * @param source Source range to exclude from target writes. * @param target Target range to preview. * @param providers Plugin providers used to resolve target columns. * @param colType Column dimension type. * @returns Row/prop lookup for preview rendering.
export function mapRangeCopyMatrixToData( matrix: unknown[][], source: RangeArea, target: RangeArea, providers: Pick<PluginProviders, 'column'>, colType: DimensionCols,): Record<number, DataType>;isInRange
Section titled “isInRange”export function isInRange(row: number, col: number, range: RangeArea);RangeCopyPreviewComputedData
Section titled “RangeCopyPreviewComputedData”export type RangeCopyPreviewComputedData = { matrix: unknown[][]; data: Record<number, DataType>;};RangeCopyPreviewComputeOptions (Extended from index.ts)
Section titled “RangeCopyPreviewComputeOptions (Extended from index.ts)”export type RangeCopyPreviewComputeOptions = Pick<ChangedRange, 'oldRange' | 'newRange'> & { type: DimensionRows; colType: DimensionCols; providers: PluginProviders;};RangeCopyPreviewPlugin
Section titled “RangeCopyPreviewPlugin”The RangeCopyPreviewPlugin renders ghost values for the exact range copy
that RevoGrid will apply when the user drops an autofill/range-copy drag.
Features:
- Shows copied source values while dragging the fill handle.
- Uses copy semantics only; it does not infer AutoFill sequences.
- Keeps preview view-only and never writes to the data store.
- Clears preview on drop, cancel, source changes, and plugin destruction.
Example
Section titled “Example”import { RangeCopyPreviewPlugin } from '@revolist/revogrid-pro';
grid.plugins = [RangeCopyPreviewPlugin];class RangeCopyPreviewPlugin { destroy();}