"use strict";
var _prototypeProperties = function (child, staticProps, instanceProps) { if (staticProps) Object.defineProperties(child, staticProps); if (instanceProps) Object.defineProperties(child.prototype, instanceProps); };
var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } };
var CommonViewComponent = (function () {
function CommonViewComponent() {
_classCallCheck(this, CommonViewComponent);
}
_prototypeProperties(CommonViewComponent, null, {
_initElements: {
/**
* Invoked on both server and browser (except the first time for the browser)
*/
value: function _initElements() {
var _this = this;
if (this.elements.length) {
this.elements.forEach(function (elementName) {
if (!_this["$" + elementName]) {
_this["$" + elementName] = $.create("div");
}
_this["$" + elementName].setAttribute("data-role", elementName);
});
}
},
writable: true,
configurable: true
},
_loadElements: {
/**
* Invoked only on browser just the first time
*/
value: function _loadElements() {
var _this = this;
if (this.elements.length) {
this.elements.forEach(function (elementName) {
_this["$" + elementName] = _this.$container.findFirst("[data-role=\"" + elementName + "\"]");
});
console.log(this.elements, this);
}
},
writable: true,
configurable: true
},
init: {
/**
* Invoked on both server and browser (even the first time for the browser)
*/
value: function init(properties) {},
writable: true,
configurable: true
},
load: {
/**
* Invoked only on browser just the first time
*/
value: function load() {},
writable: true,
configurable: true
},
render: {
/**
* Invoked on both server and browser (except the first time for the browser)
*/
value: function render(data) {},
writable: true,
configurable: true
},
toHtmlString: {
value: function toHtmlString() {
return this.$container.outerHTML;
},
writable: true,
configurable: true
}
});
return CommonViewComponent;
})();
module.exports = CommonViewComponent;
//# sourceMappingURL=CommonViewComponent.js.map