@visactor/vtable
Version:
canvas table width high performance
37 lines (33 loc) • 1.25 kB
JavaScript
import { isValid } from "@visactor/vutils";
export function getProp(name, cellStyle, col, row, _table) {
const prop = cellStyle && isValid(cellStyle[name]) ? cellStyle[name] : void 0;
if ("function" == typeof prop) {
return prop({
col: col,
row: row,
table: _table,
value: _table.getCellValue(col, row),
dataValue: _table.getCellOriginValue(col, row),
cellHeaderPaths: _table.getCellHeaderPaths(col, row)
});
}
return prop;
}
export function getRawProp(name, cellStyle, col, row, _table) {
const prop = cellStyle && isValid(cellStyle[name]) ? cellStyle[name] : void 0;
if ("function" != typeof prop) return prop;
}
export function getFunctionalProp(name, cellStyle, col, row, _table) {
const prop = cellStyle && isValid(cellStyle[name]) ? cellStyle[name] : void 0;
if ("function" == typeof prop) {
return prop({
col: col,
row: row,
table: _table,
value: _table.getCellValue(col, row),
dataValue: _table.getCellOriginValue(col, row),
cellHeaderPaths: _table.getCellHeaderPaths(col, row)
});
}
}
//# sourceMappingURL=get-prop.js.map