123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163 |
- '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 Cognos Products: BI Cloud (C) Copyright IBM Corp. 2018, 2020
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- /**
- * Create a public API to a decorator for the n-th vipr dataset
- *
- * @class DecoratorAPI
- * @hideconstructor
- * @classdesc
- */
- define([], function () {
- var APISpec = function () {
- function APISpec() {
- _classCallCheck(this, APISpec);
- }
- APISpec.prototype.getAPISpec = function getAPISpec() {
- var _this = this;
- if (!this.apiSpec) {
- var drillGetUndoActions = function drillGetUndoActions() {
- var actionName = void 0;
- var params = void 0;
- var drillDown = _this.getDrillDownValue();
- var drillUp = _this.getDrillUpValue();
- if (!drillDown && !drillUp) {
- actionName = 'clearDrill';
- params = [];
- } else if (drillDown) {
- actionName = 'drillDown';
- params = [drillDown];
- } else if (drillUp) {
- actionName = 'drillUp';
- params = [drillUp];
- }
- return [{
- name: actionName,
- params: params
- }];
- };
- this.apiSpec = {
- name: 'dataitem API',
- features: {
- 'Dashboard.Transaction': this.transaction
- },
- events: {
- serializeActions: {
- children: [{
- getObject: function getObject() {
- return _this.unionImpl;
- },
- callStack: [{
- name: 'getUnion',
- params: []
- }]
- }]
- },
- propagationInfo: {
- namespace: this.isRootDataItem() ? 'dataitem' : null,
- info: {
- dataItemId: this.getId()
- },
- callStack: {
- name: 'getDataItem',
- params: [this.getId()]
- }
- },
- actions: {
- // This action is currently not exposed as a dataItem API . Will only be exposed when needed
- // setLabel: {
- // eventName:'label',
- // info:{
- // refresh: { render: true }
- // },
- // getUndoActions: () => [{ params:[this.dataItemModel.itemLabel] }]
- // },
- setAggregation: {
- eventName: 'aggregation',
- getUndoActions: function getUndoActions() {
- return [{ params: [_this.hasDefaultAggregation() ? undefined : _this.getAggregation()] }];
- },
- autoCreateTransaction: true,
- transactionParamIndex: 1,
- transactionAPI: this.transaction
- },
- setFormat: {
- eventName: 'format',
- info: {
- refresh: { data: true /* TODO: livewidget_cleanup - should not refresh data, but for some reason the data format change is not rendered properly without data refresh*/
- } },
- getUndoActions: function getUndoActions() {
- return [{ params: [_this.hasDefaultFormat() ? undefined : _this.getFormat()] }];
- }
- },
- setSort: {
- eventName: 'sort',
- transactionParamIndex: 1,
- getUndoActions: function getUndoActions() {
- return [{ params: [_this.hasDefaultSort() ? undefined : _this.getSort()] }];
- }
- },
- setTopBottom: {
- eventName: 'topbottom',
- getUndoActions: function getUndoActions() {
- return [{ params: [_this.getTopBottom()] }];
- },
- autoCreateTransaction: true,
- transactionParamIndex: 1,
- transactionAPI: this.transaction
- },
- setBinning: {
- eventName: 'binning',
- getUndoActions: function getUndoActions() {
- return [{ params: [_this.getBinning()] }];
- },
- autoCreateTransaction: true,
- transactionParamIndex: 1,
- transactionAPI: this.transaction
- },
- drillUp: {
- eventName: 'drillUp',
- getUndoActions: drillGetUndoActions,
- autoCreateTransaction: true,
- transactionParamIndex: 1,
- transactionAPI: this.transaction
- },
- drillDown: {
- eventName: 'drillDown',
- getUndoActions: drillGetUndoActions,
- autoCreateTransaction: true,
- transactionParamIndex: 1,
- transactionAPI: this.transaction
- },
- clearDrill: {
- eventName: 'clearDrill',
- getUndoActions: drillGetUndoActions,
- autoCreateTransaction: true,
- transactionParamIndex: 0,
- transactionAPI: this.transaction
- }
- }
- }
- };
- }
- return this.apiSpec;
- };
- return APISpec;
- }();
- return APISpec;
- });
- //# sourceMappingURL=DataItemAPISpec.js.map
|