DashboardCore.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. define(['../../lib/@waca/dashboard-common/dist/core/APIFactory', '../DashboardCoreAPI'], function (APIFactory, DashboardCoreAPI) {
  9. /**
  10. * @implements DashboardCoreAPI
  11. * @hideconstructor
  12. */
  13. var DashboardCore = function () {
  14. function DashboardCore(_ref) {
  15. var dashboardAPI = _ref.dashboardAPI,
  16. internalDashboardAPI = _ref.internalDashboardAPI;
  17. _classCallCheck(this, DashboardCore);
  18. this._dashboardAPI = dashboardAPI;
  19. this._internalDashboardAPI = internalDashboardAPI;
  20. this._api = APIFactory.createAPI(this, [DashboardCoreAPI]);
  21. }
  22. DashboardCore.prototype.getAPI = function getAPI() {
  23. return this._api;
  24. };
  25. DashboardCore.prototype.getFeature = function getFeature(name) {
  26. return this._dashboardAPI.getFeature(name);
  27. };
  28. DashboardCore.prototype.destroy = function destroy() {
  29. var legacyViewControllers = this.getFeature('LegacyViewControllers');
  30. if (legacyViewControllers) {
  31. legacyViewControllers.destroy();
  32. }
  33. this._internalDashboardAPI.destroy();
  34. };
  35. return DashboardCore;
  36. }();
  37. return DashboardCore;
  38. });
  39. //# sourceMappingURL=DashboardCore.js.map