ffr-components
Version:
Fiori styled UI components
10 lines • 688 B
JavaScript
import oType from '../utils';
export var calculateRowKey = function calculateRowKey(dataKey, rowData, index) {
return oType.isFunction(dataKey) ? dataKey(rowData) : oType.isString(dataKey) ? String(rowData[dataKey]) : index + '';
};
export var isDefaultFocusAble = function isDefaultFocusAble(tableContext, fixed, index) {
return fixed === 'left' && tableContext.hasLeftFixedContentTable() && index === 1 || !tableContext.hasLeftFixedContentTable() && !fixed && index === 0;
};
export var generateTableIndex = function generateTableIndex(type, fixed, rowIndex, colIndex) {
return "".concat(type, "-").concat(!fixed ? 'center' : fixed, "-").concat(rowIndex, "-").concat(colIndex);
};