ExtensionBaseView.js 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. 'use strict';
  2. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  4. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  5. /**
  6. * Licensed Materials - Property of IBM
  7. * IBM Cognos Products: Dashboard
  8. * (C) Copyright IBM Corp. 2019
  9. * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  10. */
  11. define(['react', 'react-dom', 'ca-ui-toolkit', 'jquery', '../lib/@waca/core-client/js/core-client/ui/core/View'], function (React, ReactDOM, toolkit, $, BaseView) {
  12. var ProgressIndicator = toolkit.ProgressIndicator;
  13. var ExtensionBaseView = function (_BaseView) {
  14. _inherits(ExtensionBaseView, _BaseView);
  15. function ExtensionBaseView(options) {
  16. _classCallCheck(this, ExtensionBaseView);
  17. return _possibleConstructorReturn(this, _BaseView.call(this, options));
  18. }
  19. ExtensionBaseView.prototype.init = function init(options) {
  20. _BaseView.prototype.init.call(this, options);
  21. this.containerNode = options.containerNode;
  22. };
  23. ExtensionBaseView.prototype._setLoading = function _setLoading() {
  24. ReactDOM.render(React.createElement(ProgressIndicator, { variant: 'bar' }), this.containerNode);
  25. };
  26. ExtensionBaseView.prototype._removeLoading = function _removeLoading() {
  27. ReactDOM.unmountComponentAtNode(this.containerNode);
  28. };
  29. ExtensionBaseView.prototype.remove = function remove() {
  30. _BaseView.prototype.remove.call(this);
  31. };
  32. /**
  33. * Clear DOM node
  34. *
  35. * */
  36. ExtensionBaseView.clearContainer = function clearContainer(container) {
  37. ReactDOM.unmountComponentAtNode(container);
  38. $(container).empty();
  39. };
  40. return ExtensionBaseView;
  41. }(BaseView);
  42. ExtensionBaseView.CELL = {
  43. style: {
  44. left: {
  45. padding: '0px 8px',
  46. textAlign: 'left',
  47. width: '100%'
  48. },
  49. right: {
  50. padding: '0px 8px',
  51. textAlign: 'right',
  52. width: '100%'
  53. },
  54. center: {
  55. padding: '0px 8px',
  56. textAlign: 'center',
  57. width: '100%'
  58. }
  59. }
  60. };
  61. return ExtensionBaseView;
  62. });
  63. //# sourceMappingURL=ExtensionBaseView.js.map