/**
 * DevExtreme (esm/renovation/ui/grids/data_grid_next/utils.js)
 * Version: 22.1.3 (build 22180-0310)
 * Build date: Wed Jun 29 2022
 *
 * Copyright (c) 2012 - 2022 Developer Express Inc. ALL RIGHTS RESERVED
 * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
 */
import errors from "../../../../ui/widget/ui.errors";
import {
    isString,
    isNumeric
} from "../../../../core/utils/type";
import {
    getElementStyle
} from "../../pager/utils/get_element_width";
export var createGetKey = featureName => (rowData, keyExpr) => {
    if (void 0 === keyExpr) {
        return
    }
    if (null === keyExpr) {
        throw errors.Error("E1042", featureName)
    }
    if (!(keyExpr in rowData)) {
        throw errors.Error("E1046", keyExpr)
    }
    return rowData[keyExpr]
};
export var getReactRowKey = (row, index) => {
    if (!row.key || !(isNumeric(row.key) || isString(row.key))) {
        return "".concat(index)
    }
    return "".concat(row.rowType, "_").concat(row.key)
};
export var getElementHeight = element => getElementStyle("height", element);
