@antv/s2
Version:
effective spreadsheet render core lib
20 lines • 1.09 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.whetherLeafByLevel = void 0;
const lodash_1 = require("lodash");
const common_1 = require("../../common");
const whetherLeafByLevel = (params) => {
var _a, _b, _c, _d;
const { spreadsheet, level, fields } = params;
const { options, dataSet } = spreadsheet;
const moreThanOneValue = dataSet.moreThanOneValue();
const isValueInCols = (_b = (_a = spreadsheet.dataCfg.fields) === null || _a === void 0 ? void 0 : _a.valueInCols) !== null && _b !== void 0 ? _b : true;
const isHideMeasure = ((_d = (_c = options === null || options === void 0 ? void 0 : options.style) === null || _c === void 0 ? void 0 : _c.colCell) === null || _d === void 0 ? void 0 : _d.hideValue) &&
isValueInCols &&
!moreThanOneValue &&
(0, lodash_1.includes)(fields, common_1.EXTRA_FIELD);
const extraSize = isHideMeasure ? 2 : 1;
return level === fields.length - extraSize;
};
exports.whetherLeafByLevel = whetherLeafByLevel;
//# sourceMappingURL=whether-leaf-by-level.js.map