DataPointSelectionsAPISpec.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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 Cognos Products: BI Cloud (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. * API specification of DataPointSelectionsAPI
  10. *
  11. * @class DataPointSelectionsAPISpec
  12. * @private
  13. * @hideconstructor
  14. * @classdesc
  15. */
  16. define([], function () {
  17. var APISpec = function () {
  18. function APISpec() {
  19. _classCallCheck(this, APISpec);
  20. }
  21. APISpec.prototype.getAPISpec = function getAPISpec() {
  22. var _this = this;
  23. if (!this.apiSpec) {
  24. this.apiSpec = {
  25. name: 'dataPointSelections API',
  26. events: {
  27. propagationInfo: {
  28. namespace: 'selections',
  29. info: {
  30. name: 'DataPointSelections'
  31. },
  32. callStack: {
  33. name: 'getFeature',
  34. params: ['DataPointSelections']
  35. }
  36. },
  37. actions: {
  38. /**
  39. * @event DataPointSelectionsAPI#CanvasAPI change:content:selections:select
  40. */
  41. /**
  42. * @event DataPointSelectionsAPI#ContentAPI change:selections:select
  43. */
  44. 'select': {
  45. eventName: 'select',
  46. getUndoActions: function getUndoActions(args) {
  47. return [{
  48. name: 'deselect',
  49. params: [args[0]]
  50. }];
  51. }
  52. },
  53. /**
  54. * @event DataPointSelectionsAPI#CanvasAPI change:content:selections:deselect
  55. */
  56. /**
  57. * @event DataPointSelectionsAPI#ContentAPI change:selections:deselect
  58. */
  59. 'deselect': {
  60. eventName: 'deselect',
  61. getUndoActions: function getUndoActions(args) {
  62. return [{
  63. name: 'select',
  64. params: [args[0]]
  65. }];
  66. }
  67. },
  68. /**
  69. * @event DataPointSelectionsAPI#CanvasAPI change:content:selections:clearAll
  70. */
  71. /**
  72. * @event DataPointSelectionsAPI#ContentAPI change:selections:clearAll
  73. */
  74. 'clearAll': {
  75. eventName: 'clearAll',
  76. getUndoActions: function getUndoActions() {
  77. return [{
  78. name: 'select',
  79. params: [_this.getSelections()]
  80. }];
  81. }
  82. }
  83. }
  84. }
  85. };
  86. }
  87. return this.apiSpec;
  88. };
  89. return APISpec;
  90. }();
  91. return APISpec;
  92. });
  93. //# sourceMappingURL=DataPointSelectionsAPISpec.js.map