UNPKG

@gooddata/react-components

Version:

GoodData.UI - A powerful JavaScript library for building analytical applications

32 lines 1.31 kB
"use strict"; var __assign = (this && this.__assign) || function () { __assign = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; Object.defineProperty(exports, "__esModule", { value: true }); function fixEmptyHeaderItems(executionResult, emptyHeaderString) { if (!executionResult.headerItems) { return executionResult; } var headerItems = executionResult.headerItems.map(function (dim) { return dim.map(function (attr) { return attr.map(function (headerItemWrapper) { var type = Object.keys(headerItemWrapper)[0]; if (["attributeHeaderItem", "measureHeaderItem", "totalHeaderItem"].indexOf(type) >= 0) { headerItemWrapper[type].name = headerItemWrapper[type].name || emptyHeaderString; } return headerItemWrapper; }); }); }); return __assign({}, executionResult, { headerItems: headerItems }); } exports.fixEmptyHeaderItems = fixEmptyHeaderItems; //# sourceMappingURL=fixEmptyHeaderItems.js.map