'use strict'; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } /** * Licensed Materials - Property of IBM * IBM Business Analytics (C) Copyright IBM Corp. 2019 * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. */ /** * @class KpiPropertyCallbacks * @hideconstructor * @classdesc This class provides APIs for dashboard avtivity state */ define([], function () { /** * this class is used in VisPropertyProvider. */ var SummaryPropertyCallbacks = function () { function SummaryPropertyCallbacks(options) { _classCallCheck(this, SummaryPropertyCallbacks); this.dashboardApi = options.features['API']; } SummaryPropertyCallbacks.prototype.getAPI = function getAPI() { // we have to return implementation here. return this; }; SummaryPropertyCallbacks.prototype.preRenderAlignmentProperty = function preRenderAlignmentProperty(_content) { // [livewidget-cleanup] todo: once we have the infografic property, we can remove the dependence on view var curVis = _content.getFeature('livewidget.internal').getVisView(); if (curVis.isInfographic()) { return { removeProperty: true //if we remove 'removeProperty' here, we should reimplement onChangeValueSizeProperty() }; } else { return {}; } }; SummaryPropertyCallbacks.prototype.preRenderValueSizeProperty = function preRenderValueSizeProperty(_content, property) { // [livewidget-cleanup] todo: once we have the infografic property, we can remove the dependence on view var curVis = _content.getFeature('livewidget.internal').getVisView(); var kpiPropertyCallbacks = this.dashboardApi.getFeature('KpiPropertyCallbacks'); if (curVis.isInfographic()) { return { removeProperty: true //if we remove 'removeProperty' here, we should reimplement onChangeValueSizeProperty() }; } else { return kpiPropertyCallbacks.preRenderValueSizeProperty(_content, property); } }; SummaryPropertyCallbacks.prototype.preRenderBaseLabelProperty = function preRenderBaseLabelProperty(_content) { var kpiPropertyCallbacks = this.dashboardApi.getFeature('KpiPropertyCallbacks'); return kpiPropertyCallbacks.preRenderBaseLabelProperty(_content); }; SummaryPropertyCallbacks.prototype.preRenderFillDirectionProperty = function preRenderFillDirectionProperty(_content) { var curVis = _content.getFeature('livewidget.internal').getVisView(); if (curVis.isInfographic()) { return {}; } else { return { removeProperty: true //if we remove 'removeProperty' here, we should reimplement onChangeValueSizeProperty() }; } }; SummaryPropertyCallbacks.prototype.onChangeValueSizeProperty = function onChangeValueSizeProperty(_content, propertyName, propertyValue) { void propertyValue; void propertyName; /** * The property is not using now since we set "removeProperty:true". * [todo] if we want to re-enable the property, we should directly use widgetModel.properties... * There is an example in VisPropertyPropvider. */ /* const transactionId = _.uniqueId('kpi_font_size'); const ownerWidget = _content.getFeature('livewidget.internal').getWidget(); ownerWidget.onPropertyUpdate({ 'category': propertyName, 'item': propertyValue, 'transactionId': transactionId }); */ }; return SummaryPropertyCallbacks; }(); return SummaryPropertyCallbacks; }); //# sourceMappingURL=SummaryPropertyCallbacks.js.map