'use strict'; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** * Licensed Materials - Property of IBM * IBM Business Analytics (C) Copyright IBM Corp. 2019, 2020 * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. */ define(['./VIPRDecoratable', '../../../widgets/livewidget/nls/StringResources', '../../../apiHelpers/SlotAPIHelper'], function (VIPRDecoratable, StringResources, SlotAPIHelper) { // implements IItemClass var VIPRItemClass = function (_VIPRDecoratable) { _inherits(VIPRItemClass, _VIPRDecoratable); function VIPRItemClass(dataItem, context) { _classCallCheck(this, VIPRItemClass); var _this = _possibleConstructorReturn(this, _VIPRDecoratable.apply(this, arguments)); _this.dataItem = dataItem; _this.context = context; return _this; } VIPRItemClass.prototype.getUniqueName = function getUniqueName() { return this.dataItem.getColumnId(); }; VIPRItemClass.prototype.getCaption = function getCaption() { var summaryStr = void 0; if (!this.context.hideAggTypeInAxisLabels) { var aggregate = this.dataItem.getAggregation() || 'none'; summaryStr = aggregate !== 'none' ? ' (' + StringResources.get(aggregate) + ')' : null; } var caption = this.dataItem.getLabel(); if (this.getUniqueName() === SlotAPIHelper.MULTI_MEASURES_SERIES) { caption = StringResources.get('MeasuresCaption'); } return summaryStr ? caption + summaryStr : caption; }; return VIPRItemClass; }(VIPRDecoratable); return VIPRItemClass; }); //# sourceMappingURL=VIPRItemClass.js.map