function onBeforePaste({
    event,
    cellSelectionRangeData,
    colgroups,
    allRowKeys,
}) {
    let pastedData;

    if (event.clipboardData) {
        pastedData = event.clipboardData.getData("text/plain");
    }
    // IE browser
    else if (window.clipboardData) {
        pastedData = window.clipboardData.getData("Text");
    }

    if (typeof pastedData !== "string") {
        return null;
    }

    let decodePasteData = decodeSpreadsheetStr(pastedData);

    const startColIndex = colgroups.findIndex(
        (x) => x.key === cellSelectionRangeData.leftColKey,
    );
    const endColIndex = Math.min(
        startColIndex + decodePasteData[0].length - 1,
        colgroups.length - 1,
    );
    const startRowIndex = allRowKeys.indexOf(cellSelectionRangeData.topRowKey);
    const endRowIndex = Math.min(
        startRowIndex + decodePasteData.length - 1,
        allRowKeys.length - 1,
    );

    let response = {
        selectionRangeIndexes: {
            startColIndex,
            endColIndex,
            startRowIndex,
            endRowIndex,
        },
        selectionRangeKeys: {
            startColKey: colgroups[startColIndex].key,
            endColKey: colgroups[endColIndex].key,
            startRowKey: allRowKeys[startRowIndex],
            endRowKey: allRowKeys[endRowIndex],
        },
        data: [],
    };

    const sourceFieldNames = colgroups
        .slice(startColIndex, endColIndex + 1)
        .map((x) => x.field);

    response.data = decodePasteData
        .slice(0, endRowIndex - startRowIndex + 1)
        .map((rowData) => {
            let newRow = {};

            rowData.forEach((cellData, cellIndex) => {
                if (cellIndex <= endColIndex - startColIndex) {
                    newRow[sourceFieldNames[cellIndex]] = cellData;
                }
            });
            return newRow;
        });

    return response;
}
@onBeforePaste
@desc on before paste
@param {Event} event
@return