DashboardStateAPI.js 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  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. 2019, 2020
  6. * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. */
  8. /**
  9. * @class DashboardStateAPI
  10. * @hideconstructor
  11. * @classdesc API class that is used to control a dashboard state
  12. */
  13. define([], function () {
  14. var DashboardStateAPI = function () {
  15. function DashboardStateAPI() {
  16. _classCallCheck(this, DashboardStateAPI);
  17. }
  18. /**
  19. * @function DashboardStateAPI#onUiStateChange
  20. * @description register a callback which will be called when the ui state is changed
  21. * The UI State object is the payload passed to the callback.
  22. * The structure of the object is:
  23. * {
  24. * authoring: boolean,
  25. * eventGroups: boolean
  26. * }
  27. * @param {function} callback The callback to register
  28. */
  29. DashboardStateAPI.prototype.onUiStateChange = function onUiStateChange() {};
  30. /**
  31. * @function DashboardStateAPI#offUiStateChange
  32. * @description de-register the callback that was registered with onUiStateChange
  33. */
  34. DashboardStateAPI.prototype.offUiStateChange = function offUiStateChange() {};
  35. /**
  36. * @function DashboardStateAPI#getUiState
  37. * @description get the full UI state object with all its properties
  38. * @returns {Object} the DashboardState's ui state object
  39. */
  40. DashboardStateAPI.prototype.getUiState = function getUiState() {};
  41. /**
  42. * @function DashboardStateAPI#setDirty
  43. * @description set a dashboard to dirty or not dirty.
  44. * @param {boolean} dirty true means a dashboard will be set to dirty. Otherwise, false
  45. */
  46. DashboardStateAPI.prototype.setDirty = function setDirty() {};
  47. /**
  48. * @function DashboardStateAPI#setAuthoring
  49. * @desc enable or disable the dashboard authoring state
  50. * @param {Boolean} flag The boolean value to set the authoring state to
  51. */
  52. DashboardStateAPI.prototype.setAuthoring = function setAuthoring() {};
  53. /**
  54. * @function DashboardStateAPI#setSelectionProperties
  55. * @desc enable or disable the dashboard properties state
  56. * @param {Boolean} flag the boolean value to set the properties state to
  57. */
  58. DashboardStateAPI.prototype.setSelectionProperties = function setSelectionProperties() {};
  59. /**
  60. * @function DashboardStateAPI#setSidePanelOpen
  61. * @desc enable or disable the dashboard in app slideout state
  62. * @param {Boolean} state - the boolean value to set the in app slideout state to
  63. */
  64. DashboardStateAPI.prototype.setSidePanelOpen = function setSidePanelOpen() {};
  65. /**
  66. * @function DashboardStateAPI#setSidePanelCurrentView
  67. * @desc set the current in app slideout view
  68. * @param {String | null} view - the current view to set; When passing null as current view, the current view is cleared
  69. */
  70. DashboardStateAPI.prototype.setSidePanelCurrentView = function setSidePanelCurrentView() {};
  71. /**
  72. * @function DashboardStateAPI#setEventGroups
  73. * @desc enable or disable the dashboard event groups state
  74. * @param {Boolean} flag The boolean value to set the event groups state to
  75. */
  76. DashboardStateAPI.prototype.setEventGroups = function setEventGroups() {};
  77. /**
  78. * @function DashboardStateAPI#setFullScreen
  79. * @desc enable or disable full screen
  80. * @param {Boolean} flag The boolean value to set the full screen
  81. */
  82. DashboardStateAPI.prototype.setFullScreen = function setFullScreen() {};
  83. /**
  84. * @function DashboardStateAPI#setActivive
  85. * @description set a dashboard activity and call corresponding callbacks.
  86. * A payload passed to a callback is in this struture:
  87. * {
  88. * name: "change:active",
  89. * info: {
  90. * actionName: 'setActive',
  91. * value: boolean
  92. * }
  93. * }
  94. * @param {Boolean} isActive set the activity of a dashboard to isActive
  95. */
  96. DashboardStateAPI.prototype.setActive = function setActive() {};
  97. /**
  98. * @function DashboardAPI#isActive
  99. * @description get a dashboard activity
  100. * @param
  101. * @returns {Boolean} true if a dashboard is active and false otherwise
  102. */
  103. DashboardStateAPI.prototype.isActive = function isActive() {};
  104. /**
  105. * @function DashboardStateAPI#onChangeActive
  106. * @description register a callback which will be called when a dashboard is
  107. * changed to active or deactive
  108. * @param {function} callback the callback will be called
  109. */
  110. DashboardStateAPI.prototype.onChangeActive = function onChangeActive() {};
  111. /**
  112. * @function DashboardStateAPI#updateUiState
  113. * @description update some dashboard UI state
  114. * @param {object} options.stateChange Its keys are state names and its values are new state values
  115. */
  116. DashboardStateAPI.prototype.updateUiState = function updateUiState() {};
  117. return DashboardStateAPI;
  118. }();
  119. return DashboardStateAPI;
  120. });
  121. //# sourceMappingURL=DashboardStateAPI.js.map