@aurelia-mdc-web/tree-view
Version:
Wrapper for Material Components Web Tree View
50 lines • 1.64 kB
JavaScript
import { __decorate, __metadata } from "tslib";
import { inject, bindable, noView, ViewSlot, customElement, ViewFactory, Container } from 'aurelia-framework';
var TreeNode = /** @class */ (function () {
function TreeNode(element, container) {
this.element = element;
this.container = container;
this.viewSlot = new ViewSlot(this.element, true);
}
TreeNode.prototype.bind = function (bindingContext) {
this.build();
this.viewSlot.bind(bindingContext, this.rootBindingContext);
};
TreeNode.prototype.attached = function () {
this.viewSlot.attached();
};
TreeNode.prototype.detached = function () {
this.viewSlot.detached();
};
TreeNode.prototype.unbind = function () {
this.viewSlot.unbind();
};
TreeNode.prototype.build = function () {
if (this.built) {
return;
}
this.built = true;
if (!this.factory) {
return;
}
this.view = this.factory.create(this.container);
this.viewSlot.add(this.view);
};
__decorate([
bindable,
__metadata("design:type", ViewFactory)
], TreeNode.prototype, "factory", void 0);
__decorate([
bindable,
__metadata("design:type", Object)
], TreeNode.prototype, "rootBindingContext", void 0);
TreeNode = __decorate([
inject(Element, Container),
customElement('mdc-tree-node'),
noView(),
__metadata("design:paramtypes", [Element, Container])
], TreeNode);
return TreeNode;
}());
export { TreeNode };
//# sourceMappingURL=mdc-tree-node.js.map