Source: Component.js

Source: Component.js

"use strict";

var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };

var _prototypeProperties = function (child, staticProps, instanceProps) { if (staticProps) Object.defineProperties(child, staticProps); if (instanceProps) Object.defineProperties(child.prototype, instanceProps); };

var _inherits = function (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) subClass.__proto__ = superClass; };

var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } };

var CommonViewComponent = _interopRequire(require("./CommonViewComponent"));

var Component = (function (CommonViewComponent) {
  function Component(helper, $container) {
    var _this = this;
    _classCallCheck(this, Component);

    this.$container = $container || $.create("div");
    this.$container.on("dispose", function () {
      _this.destroy();
    });
    this.helper = helper;
    this.elements = [];
  }

  _inherits(Component, CommonViewComponent);

  _prototypeProperties(Component, null, {
    firstRender: {

      /**
       * Invoked on both server and browser (except the first time for the browser)
       */
      value: function firstRender(data) {},
      writable: true,
      configurable: true
    },
    prepare: {

      /**
       * Invoked once on the browser
       *
       * Register events here
       */
      value: function prepare() {},
      writable: true,
      configurable: true
    },
    destroy: {

      /**
       * Invoked once on the browser
       */
      value: function destroy() {},
      writable: true,
      configurable: true
    }
  });

  return Component;
})(CommonViewComponent);

module.exports = Component;
//# sourceMappingURL=Component.js.map