123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204 |
- "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. 2018, 2021
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- /**
- * @interface SlotsAPI
- * @classdesc API class that is used to control slots.
- * @example visualization.getSlots()
- */
- define([], function () {
- var SlotsAPI = function () {
- function SlotsAPI() {
- _classCallCheck(this, SlotsAPI);
- }
- /**
- * @function SlotsAPI#createDataItems
- * @description Creates data items that are not mapped to any slot.
- * @public
- *
- * @param {object[]} dataitems Array of a dataItem spec. The spec contains a columnsId and an optional ID.
- * @param {Object} transactionToken
- */
- SlotsAPI.prototype.createDataItems = function createDataItems() {};
- /**
- * @function SlotsAPI#deleteDataItems
- * @description Deletes data items that correspond to the given dataItem IDs.
- * @public
- *
- * @param {String[]} idList List of data items IDs to delete. This will not remove slot mappings to the deleted dataItem IDs.
- * To delete and remove the mappings, use {@link SlotAPI#removeDataItems} instead.
- * @param {Object} transactionToken
- */
- SlotsAPI.prototype.deleteDataItems = function deleteDataItems() {};
- /**
- * @function SlotsAPI#setDataItems
- * @description Changes the data items assigned to an existing slot. Supports reordering and deletion of existing items.
- * @public
- *
- * @param {string[]} dataItemtIds - Ordered array of dataItem IDs to assign to this slot.
- * @param {string} slotId
- * @param {Object} transactionToken
- * @return {DataItemAPI[]} Array of removed data items
- */
- SlotsAPI.prototype.setDataItems = function setDataItems() {};
- /**
- * @function SlotsAPI#swapSlots
- * @description Swaps data items between the two slots that are identified by their IDs.
- * The operation should be performed as one transaction.
- * @public
- *
- * @param {string} sourceSlotId ID of the source slot
- * @param {string} targetSlotId ID of the target slot
- * @param {Object} transactionToken
- */
- SlotsAPI.prototype.swapSlots = function swapSlots() {};
- /**
- * @function SlotsAPI#getSlot
- * @description Gets the slot with the given ID
- * @public
- *
- * @param {string} slotId
- * @return {SlotAPI} Slot
- */
- SlotsAPI.prototype.getSlot = function getSlot() {};
- /**
- * @function SlotsAPI#getSlotList
- * @description Returns the list of all slots.
- * @public
- *
- * @return {SlotAPI[]}
- */
- SlotsAPI.prototype.getSlotList = function getSlotList() {};
- /**
- * @function SlotsAPI#getMappedSlotList
- * @description Returns the list of the mapped slots.
- * @public
- *
- * @return {SlotAPI[]}
- */
- SlotsAPI.prototype.getMappedSlotList = function getMappedSlotList() {};
- /**
- * @function SlotsAPI#getDataItem
- * @description Returns the data item with the given ID.
- * @public
- *
- * @param {String} dataItemId Unique dataItem ID
- *
- * @returns {dataItemAPI} Associated data item (or null)
- */
- SlotsAPI.prototype.getDataItem = function getDataItem() {};
- /**
- * @function SlotsAPI#getDataItemList
- * @description Returns a list of all dataItems in this visualization including ones which are not mapped to any slot.
- * @public
- *
- * @return {DataItem[]} dataItemList
- */
- SlotsAPI.prototype.getDataItemList = function getDataItemList() {};
- /**
- * @function SlotsAPI#getMappingInfo
- * @description Returns the data item location in the slots for the supplied dataItemUniqueId.
- * @public
- *
- * @param {string} dataItemId - dataItemUniqueId to find in the set of slots.
- * @return {MappingInfo} dataItem slot location information (dataItemAPI, slotAPI, indexInSlot).
- * Returns null if the data item is not mapped.
- */
- SlotsAPI.prototype.getMappingInfo = function getMappingInfo() /* dataItemId */{};
- /**
- * @function SlotsAPI#getMappingInfoList
- * @description Returns an array of all the data item mapping information for all the slots.
- * @public
- *
- * @return {MappingInfo[]} Array of data item mapping information
- */
- SlotsAPI.prototype.getMappingInfoList = function getMappingInfoList() {};
- /**
- * @function SlotsAPI#isMappingComplete
- * @description Returns true if all of the required slots for the specified layer are mapped and this visualization can be rendered.
- * If no layer is specified, then returns true if at least one layer has all required slots mapped.
- * @public
- *
- * @param {string} layerId (optional)
- * @return {boolean} isMappingComplete
- */
- SlotsAPI.prototype.isMappingComplete = function isMappingComplete() {};
- /**
- * @function SlotsAPI#clearAllSlots
- * @description Clears all slots content
- * @public
- *
- * @param {SetOptions} options
- */
- SlotsAPI.prototype.clearAllSlots = function clearAllSlots() /* options */{};
- /**
- * handlers can be registered for api's that support them (eg createDataItems, deleteDataItems)
- * @param {String} eventName - the name of the event eg change:dataitems:create
- * @param {function} handler - the handler
- */
- SlotsAPI.prototype.on = function on() {};
- /**
- * External code (eg navigate) can register a handler that will be called at the beginning of the deleteDataItemsAPI.
- * Similar to an event handler for delete but allows for 2 things
- * 1) It is called before items are deleted rather than after
- * 2) It can contribute to a transaction involving data item deletion.
- * @param {function} handler - the handler to call.
- */
- SlotsAPI.prototype.registerDeleteDataItemsHandler = function registerDeleteDataItemsHandler() {};
- return SlotsAPI;
- }();
- return SlotsAPI;
- });
- //# sourceMappingURL=SlotsAPI.js.map
|