VisDnDUtilsAPI.js 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. "use strict";
  2. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3. /**
  4. * Licensed Materials - Property of IBM
  5. * IBM Business Analytics (C) Copyright IBM Corp. 2020
  6. * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. */
  8. /**
  9. * @class VisDnDUtilsAPI
  10. * @hideconstructor
  11. *
  12. * @classdesc Utility API for drag and drop of metadata onto a visualization content
  13. */
  14. define([], function () {
  15. var VisDnDUtilsAPI = function () {
  16. function VisDnDUtilsAPI() {
  17. _classCallCheck(this, VisDnDUtilsAPI);
  18. }
  19. /**
  20. * @public
  21. * @function VisDnDUtilsAPI#mapColumns
  22. * @description Map the given metadata drag and drop payload to a specific slot
  23. * @param {String} slotId Identifier of the slot to map to
  24. * @param {Object} payload the metadata drag and drop payload
  25. * @param {Object} options the options to process the accept
  26. * @param {TransactionToken} transactionToken the transaction token
  27. * @returns {Boolean}
  28. */
  29. VisDnDUtilsAPI.prototype.mapColumns = function mapColumns() {};
  30. /**
  31. * @public
  32. * @function VisDnDUtilsAPI#acceptsOlapV2
  33. * @description process the on drop action of drag and drop by applying special rules for OLAP (eg: can't drop levels of a hierarchy in the wrong order)
  34. * @param {Array} targetMetadataColumns - metadata columns in target slot
  35. * @param {Array} sourceMetadataColumns - metadata columns to be added into target slot
  36. * @param {Number} indexInTargetSlot - index in target slot to add
  37. * @param {Number} indexInSourceSlot - slot item index in source slot, it is undefined if dnd from metadata tree
  38. * @param {Boolean} isReplace - if it is to replace the column in the position
  39. * @param {Boolean} IsSameSlot - if it is drag and drop in the same slot
  40. * @return {Boolean} return True if the two lists of columns can be in the same slot
  41. */
  42. VisDnDUtilsAPI.prototype.acceptsOlapV2 = function acceptsOlapV2() {};
  43. /**
  44. * @public
  45. * @function VisDnDUtilsAPI#addMembersAsLocalFilters
  46. * @description Add members as local filters to visualization or Slot
  47. * @param {object} [options]
  48. * @param {object[]} [options.columns] - metadata columns may be added into target slot or visualization as local filters
  49. * @param {object} [options.slotAPI] - target slot if members to be added into target slot as local filter
  50. * @param {Boolean} [options.doUpdateFilters] - if true, local filter get updated.
  51. * @param {Boolean} [options.bReplace] - if true, replace the slot local filters by local filter created based on members.
  52. * @param {TransactionToken} transactionToken the transaction token
  53. */
  54. VisDnDUtilsAPI.prototype.addMembersAsLocalFilters = function addMembersAsLocalFilters() {};
  55. /**
  56. * @public
  57. * @function VisDnDUtilsAPI#accepts
  58. * @param {Object} payload the drag and drop payload
  59. * @param {Object} options the options to process the accept
  60. * @description called by the DnD manager to check whether to accept the dragged object or not
  61. * @returns {Boolean}
  62. */
  63. VisDnDUtilsAPI.prototype.accepts = function accepts() {};
  64. /**
  65. * @public
  66. * @function VisDnDUtilsAPI#onDrop
  67. * @param {Object} payload the drag and drop payload
  68. * @description process the on drop action of drag and drop
  69. */
  70. VisDnDUtilsAPI.prototype.onDrop = function onDrop() {};
  71. return VisDnDUtilsAPI;
  72. }();
  73. return VisDnDUtilsAPI;
  74. });
  75. //# sourceMappingURL=VisDnDUtilsAPI.js.map